int scan_debug_options(char *caller_name, debug_option *options, char *values) { char *cp; int rc = 0; if (NULL == values || NULL == options || NULL == caller_name) { return(0); } if ('~' == *values) { /* Ignore unknown options. */ values += 1; caller_name = NULL; } /* Pick apart a colon separated list of option=value. */ while (NULL != values && 0 != *values) { if (NULL != (cp = ss(values,':'))) { *cp = 0; } rc += set_debug_option(caller_name,options,values); if (NULL != cp) { *cp++ = ':'; } values = cp; } return(rc); }
/*ARGSUSED*/ static void rf_ConfigureDebug(RF_Config_t *cfgPtr) { char *val_p, *name_p, *white_p; long val; int i; rf_ResetDebugOptions(); for (i = 0; cfgPtr->debugVars[i][0] && i < RF_MAXDBGV; i++) { name_p = rf_find_non_white(&cfgPtr->debugVars[i][0]); white_p = rf_find_white(name_p); /* skip to start of 2nd * word */ val_p = rf_find_non_white(white_p); if (*val_p == '0' && *(val_p + 1) == 'x') val = rf_htoi(val_p + 2); else val = rf_atoi(val_p); *white_p = '\0'; set_debug_option(name_p, val); } }