FreeBSD/usr.sbin/nandsim/nandsim_cfgparse.c
/* Convert logoutput strings literals into appropriate ints. */
Convert logoutput strings literals into appropriate ints.
Convert logoutput strings literals into appropriate ints .
static uint8_t
logoutputtoint(char *logoutput, int *output)
{
	int out;
	if (strcmp(logoutput, "file") == 0)
		out = NANDSIM_OUTPUT_FILE;
	else if (strcmp(logoutput, "console") == 0)
		out = NANDSIM_OUTPUT_CONSOLE;
	else if (strcmp(logoutput, "ram") == 0)
		out = NANDSIM_OUTPUT_RAM;
	else if (strcmp(logoutput, "none") == 0)
		out = NANDSIM_OUTPUT_NONE;
	else
		out = -1;
	*output = out;
	if (out == -1)
		return (EINVAL);
	else
		return (0);
}
static uint8_t logoutputtoint ( char * logoutput , int * output ) { int out ; if ( strcmp ( logoutput , " " ) == 0 ) out = NANDSIM_OUTPUT_FILE ; else if ( strcmp ( logoutput , " " ) == 0 ) out = NANDSIM_OUTPUT_CONSOLE ; else if ( strcmp ( logoutput , " " ) == 0 ) out = NANDSIM_OUTPUT_RAM ; else if ( strcmp ( logoutput , " " ) == 0 ) out = NANDSIM_OUTPUT_NONE ; else out = -1 ; * output = out ; if ( out == -1 ) return ( EINVAL ) ; else return ( 0 ) ; }
Convert logoutput strings literals into appropriate ints.
Convert logoutput strings literals into appropriate ints .