MCPcopy Create free account
hub / github.com/OpenPrinting/cups / parse_fatal_errors

Function parse_fatal_errors

scheduler/conf.c:2463–2536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2461 */
2462
2463static int /* O - FatalErrors bits */
2464parse_fatal_errors(const char *s) /* I - FatalErrors string */
2465{
2466 int fatal; /* FatalErrors bits */
2467 char value[1024], /* Value string */
2468 *valstart, /* Pointer into value */
2469 *valend; /* End of value */
2470
2471
2472 /*
2473 * Empty FatalErrors line yields NULL pointer...
2474 */
2475
2476 if (!s)
2477 return (CUPSD_FATAL_NONE);
2478
2479 /*
2480 * Loop through the value string,...
2481 */
2482
2483 strlcpy(value, s, sizeof(value));
2484
2485 fatal = CUPSD_FATAL_NONE;
2486
2487 for (valstart = value; *valstart;)
2488 {
2489 /*
2490 * Get the current space/comma-delimited kind name...
2491 */
2492
2493 for (valend = valstart; *valend; valend ++)
2494 if (_cups_isspace(*valend) || *valend == ',')
2495 break;
2496
2497 if (*valend)
2498 *valend++ = '\0';
2499
2500 /*
2501 * Add the error to the bitmask...
2502 */
2503
2504 if (!_cups_strcasecmp(valstart, "all"))
2505 fatal = CUPSD_FATAL_ALL;
2506 else if (!_cups_strcasecmp(valstart, "browse"))
2507 fatal |= CUPSD_FATAL_BROWSE;
2508 else if (!_cups_strcasecmp(valstart, "-browse"))
2509 fatal &= ~CUPSD_FATAL_BROWSE;
2510 else if (!_cups_strcasecmp(valstart, "config"))
2511 fatal |= CUPSD_FATAL_CONFIG;
2512 else if (!_cups_strcasecmp(valstart, "-config"))
2513 fatal &= ~CUPSD_FATAL_CONFIG;
2514 else if (!_cups_strcasecmp(valstart, "listen"))
2515 fatal |= CUPSD_FATAL_LISTEN;
2516 else if (!_cups_strcasecmp(valstart, "-listen"))
2517 fatal &= ~CUPSD_FATAL_LISTEN;
2518 else if (!_cups_strcasecmp(valstart, "log"))
2519 fatal |= CUPSD_FATAL_LOG;
2520 else if (!_cups_strcasecmp(valstart, "-log"))

Callers 2

cupsdReadConfigurationFunction · 0.85
read_cups_files_confFunction · 0.85

Calls 3

_cups_isspaceFunction · 0.85
_cups_strcasecmpFunction · 0.85
cupsdLogMessageFunction · 0.85

Tested by

no test coverage detected