FreeBSD/usr.sbin/jail/config.c
/*
 * Return if a boolean parameter exists and is true.
 */
Return if a boolean parameter exists and is true.
Return if a boolean parameter exists and is true .
int
bool_param(const struct cfparam *p)
{
	const char *cs;
	if (p == NULL)
		return 0;
	cs = strrchr(p->name, '.');
	return !strncmp(cs ? cs + 1 : p->name, "no", 2) ^
	    (TAILQ_EMPTY(&p->val) ||
	     !strcasecmp(TAILQ_LAST(&p->val, cfstrings)->s, "true") ||
	     (strtol(TAILQ_LAST(&p->val, cfstrings)->s, NULL, 10)));
}
int bool_param ( const struct cfparam * p ) { const char * cs ; if ( p == NULL ) return 0 ; cs = strrchr ( p -> name , ' ' ) ; return ! strncmp ( cs ? cs + 1 : p -> name , " " , 2 ) ^ ( TAILQ_EMPTY ( & p -> val ) || ! strcasecmp ( TAILQ_LAST ( & p -> val , cfstrings ) -> s , " " ) || ( strtol ( TAILQ_LAST ( & p -> val , cfstrings ) -> s , NULL , 10 ) ) ) ; }
Return if a boolean parameter exists and is true.
Return if a boolean parameter exists and is true .