usr.bin/last/want.c
static int
want(struct utmp *bp, int check)
{
	ARG *step;

	if (check) {
		/*
		 * when uucp and ftp log in over a network, the entry in
		 * the utmp file is the name plus their process id.  See
		 * etc/ftpd.c and usr.bin/uucp/uucpd.c for more information.
		 */
		if (!strncmp(bp->ut_line, "ftp", sizeof("ftp") - 1))
			bp->ut_line[3] = '\0';
		else if (!strncmp(bp->ut_line, "uucp", sizeof("uucp") - 1))
			bp->ut_line[4] = '\0';
	}
	if (!arglist)
		return (YES);

	for (step = arglist; step; step = step->next)
		switch(step->type) {
		case HOST_TYPE:
			if (!strncasecmp(step->name, bp->ut_host, HOSTSIZE))
				return (YES);
			break;
		case TTY_TYPE:
			if (!strncmp(step->name, bp->ut_line, LINESIZE))
				return (YES);
			break;
		case USER_TYPE:
			if (!strncmp(step->name, bp->ut_name, NAMESIZE))
				return (YES);
			break;
	}
	return (NO);
}
/*
 * want --
 *	see if want this entry
 */
want
see if want this entry
want see if want this entry
static int
want(struct utmp *bp, int check)
{
	ARG *step;
	if (check) {
		if (!strncmp(bp->ut_line, "ftp", sizeof("ftp") - 1))
			bp->ut_line[3] = '\0';
		else if (!strncmp(bp->ut_line, "uucp", sizeof("uucp") - 1))
			bp->ut_line[4] = '\0';
	}
	if (!arglist)
		return (YES);
	for (step = arglist; step; step = step->next)
		switch(step->type) {
		case HOST_TYPE:
			if (!strncasecmp(step->name, bp->ut_host, HOSTSIZE))
				return (YES);
			break;
		case TTY_TYPE:
			if (!strncmp(step->name, bp->ut_line, LINESIZE))
				return (YES);
			break;
		case USER_TYPE:
			if (!strncmp(step->name, bp->ut_name, NAMESIZE))
				return (YES);
			break;
	}
	return (NO);
}
static int want ( struct utmp * bp , int check ) { ARG * step ; if ( check ) { if ( ! strncmp ( bp -> ut_line , " " , sizeof ( " " ) - 1 ) ) bp -> ut_line [ 3 ] = ' \0 ' ; else if ( ! strncmp ( bp -> ut_line , " " , sizeof ( " " ) - 1 ) ) bp -> ut_line [ 4 ] = ' \0 ' ; } if ( ! arglist ) return ( YES ) ; for ( step = arglist ; step ; step = step -> next ) switch ( step -> type ) { case HOST_TYPE : if ( ! strncasecmp ( step -> name , bp -> ut_host , HOSTSIZE ) ) return ( YES ) ; break ; case TTY_TYPE : if ( ! strncmp ( step -> name , bp -> ut_line , LINESIZE ) ) return ( YES ) ; break ; case USER_TYPE : if ( ! strncmp ( step -> name , bp -> ut_name , NAMESIZE ) ) return ( YES ) ; break ; } return ( NO ) ; }
want
      see if want this entry
want see if want this entry
/*
		 * when uucp and ftp log in over a network, the entry in
		 * the utmp file is the name plus their process id.  See
		 * etc/ftpd.c and usr.bin/uucp/uucpd.c for more information.
		 */