FreeBSD/contrib/mdocml/roff.c
/*
 * Parse a roff node's type from the input buffer.  This must be in the
 * form of ".foo xxx" in the usual way.
 */
Parse a roff node's type from the input buffer.  This must be in the
form of ".foo xxx" in the usual way.
Parse a roff node ' s type from the input buffer . This must be in the form of " . foo xxx " in the usual way .
static enum rofft
roff_parse(struct roff *r, char *buf, int *pos, int ln, int ppos)
{
	char		*cp;
	const char	*mac;
	size_t		 maclen;
	enum rofft	 t;
	cp = buf + *pos;
	if ('\0' == *cp || '"' == *cp || '\t' == *cp || ' ' == *cp)
		return ROFF_MAX;
	mac = cp;
	maclen = roff_getname(r, &cp, ln, ppos);
	t = (r->current_string = roff_getstrn(r, mac, maclen))
	    ? ROFF_USERDEF : roffhash_find(mac, maclen);
	if (ROFF_MAX != t)
		*pos = cp - buf;
	return t;
}
static enum rofft roff_parse ( struct roff * r , char * buf , int * pos , int ln , int ppos ) { char * cp ; const char * mac ; size_t maclen ; enum rofft t ; cp = buf + * pos ; if ( ' \0 ' == * cp || ' ' == * cp || ' \t ' == * cp || ' ' == * cp ) return ROFF_MAX ; mac = cp ; maclen = roff_getname ( r , & cp , ln , ppos ) ; t = ( r -> current_string = roff_getstrn ( r , mac , maclen ) ) ? ROFF_USERDEF : roffhash_find ( mac , maclen ) ; if ( ROFF_MAX != t ) * pos = cp - buf ; return t ; }
Parse a roff node's type from the input buffer.
Parse a roff node ' s type from the input buffer .