|
|
1.1 ! root 1: extern char *__modemcap; ! 2: ! 3: mgetflag (id) ! 4: register char *id; ! 5: { ! 6: register char *cp = __modemcap; ! 7: ! 8: if (__modemcap == (char *) 0) /* has mgetent() been called? ... */ ! 9: return (-1); /* ... no, can't find number*/ ! 10: ! 11: while (*cp != ':' && *cp != 0) /* find first entry in cap*/ ! 12: cp++; ! 13: ! 14: if (*cp == 0) /* empty entry??? */ ! 15: return (0); /* ... yes, bad modemcap entry*/ ! 16: else ! 17: cp++; /* point to first character in next */ ! 18: ! 19: while (*cp != 0) { /* until entry found or end of entry */ ! 20: if (cp[0] == id[0] && cp[1] == id[1]) { /* found entry!!!*/ ! 21: return (1); /* return true */ ! 22: } else { /* not entry, skip this entire entry */ ! 23: while (*cp != ':' && *cp != 0) ! 24: cp++; /* search for end of current entry */ ! 25: ! 26: if (*cp != 0) ! 27: cp++; /* skip terminating character*/ ! 28: } ! 29: } ! 30: return (0); ! 31: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.