FreeBSD/contrib/ntp/ntpq/ntpq-subs.c
/*
 * findlistvar - Look for the named variable in a varlist.  If found,
 *		 return a pointer to it.  Otherwise, if the list has
 *		 slots available, return the pointer to the first free
 *		 slot, or NULL if it's full.
 */
Look for the named variable in a varlist.  If found,
return a pointer to it.  Otherwise, if the list has
slots available, return the pointer to the first free
slot, or NULL if it's full.
Look for the named variable in a varlist . If found return a pointer to it . Otherwise if the list has slots available return the pointer to the first free slot or NULL if it ' s full .
static struct varlist *
findlistvar(
	struct varlist *list,
	char *name
	)
{
	struct varlist *vl;
	for (vl = list; vl < list + MAXLIST && vl->name != NULL; vl++)
		if (!strcmp(name, vl->name))
			return vl;
	if (vl < list + MAXLIST)
		return vl;
	return NULL;
}
static struct varlist * findlistvar ( struct varlist * list , char * name ) { struct varlist * vl ; for ( vl = list ; vl < list + MAXLIST && vl -> name != NULL ; vl ++ ) if ( ! strcmp ( name , vl -> name ) ) return vl ; if ( vl < list + MAXLIST ) return vl ; return NULL ; }
findlistvar - Look for the named variable in a varlist.
findlistvar - Look for the named variable in a varlist .