File:  [MW Coherent from dump] / coherent / a / usr / bob / uusrc / modemcap / mgetflag.c
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:34 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

extern	char	*__modemcap;

mgetflag (id)
register char	*id;
{
	register char	*cp = __modemcap;

	if (__modemcap == (char *) 0)		/* has mgetent() been called? ...	*/
		return (-1);			/* ... no, can't find number*/

	while (*cp != ':' && *cp != 0)		/* find first entry in cap*/
		cp++;

	if (*cp == 0)				/* empty entry???	*/
		return (0);			/* ... yes, bad modemcap entry*/
	else
		cp++;				/* point to first character in next	*/

	while (*cp != 0) {			/* until entry found or end of entry	*/
		if (cp[0] == id[0] && cp[1] == id[1]) {	/* found entry!!!*/
			return (1);		/* return true		*/
		} else {			/* not entry, skip this entire entry	*/
			while (*cp != ':' && *cp != 0)
				cp++;		/* search for end of current entry	*/

			if (*cp != 0)
				cp++;		/* skip terminating character*/
		}
	}
	return (0);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.