FreeBSD/usr.bin/last/last.c
/*
 * want --
 *	see if want this entry
 */
want
see if want this entry
want see if want this entry
static int
want(struct utmpx *bp)
{
	ARG *step;
	if (snaptime)
		return (NO);
	if (!arglist)
		return (YES);
	for (step = arglist; step; step = step->next)
		switch(step->type) {
		case REBOOT_TYPE:
			if (bp->ut_type == BOOT_TIME ||
			    bp->ut_type == SHUTDOWN_TIME)
				return (YES);
			break;
		case HOST_TYPE:
			if (!strcasecmp(step->name, bp->ut_host))
				return (YES);
			break;
		case TTY_TYPE:
			if (!strcmp(step->name, bp->ut_line))
				return (YES);
			break;
		case USER_TYPE:
			if (!strcmp(step->name, bp->ut_user))
				return (YES);
			break;
		}
	return (NO);
}
static int want ( struct utmpx * bp ) { ARG * step ; if ( snaptime ) return ( NO ) ; if ( ! arglist ) return ( YES ) ; for ( step = arglist ; step ; step = step -> next ) switch ( step -> type ) { case REBOOT_TYPE : if ( bp -> ut_type == BOOT_TIME || bp -> ut_type == SHUTDOWN_TIME ) return ( YES ) ; break ; case HOST_TYPE : if ( ! strcasecmp ( step -> name , bp -> ut_host ) ) return ( YES ) ; break ; case TTY_TYPE : if ( ! strcmp ( step -> name , bp -> ut_line ) ) return ( YES ) ; break ; case USER_TYPE : if ( ! strcmp ( step -> name , bp -> ut_user ) ) return ( YES ) ; break ; } return ( NO ) ; }
want
      see if want this entry
want see if want this entry