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

Function ppdFindOption

cups/ppd-mark.c:413–457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411 */
412
413ppd_option_t * /* O - Pointer to option or @code NULL@ */
414ppdFindOption(ppd_file_t *ppd, /* I - PPD file data */
415 const char *option) /* I - Option/Keyword name */
416{
417 /*
418 * Range check input...
419 */
420
421 if (!ppd || !option)
422 return (NULL);
423
424 if (ppd->options)
425 {
426 /*
427 * Search in the array...
428 */
429
430 ppd_option_t key; /* Option search key */
431
432
433 strlcpy(key.keyword, option, sizeof(key.keyword));
434
435 return ((ppd_option_t *)cupsArrayFind(ppd->options, &key));
436 }
437 else
438 {
439 /*
440 * Search in each group...
441 */
442
443 int i, j; /* Looping vars */
444 ppd_group_t *group; /* Current group */
445 ppd_option_t *optptr; /* Current option */
446
447
448 for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++)
449 for (j = group->num_options, optptr = group->options;
450 j > 0;
451 j --, optptr ++)
452 if (!_cups_strcasecmp(optptr->keyword, option))
453 return (optptr);
454
455 return (NULL);
456 }
457}
458
459
460/*

Callers 15

apple_register_profilesFunction · 0.85
copy_modelFunction · 0.85
load_ppdFunction · 0.85
import_ppdMethod · 0.85
include_featureFunction · 0.85
set_pstops_optionsFunction · 0.85
write_optionsFunction · 0.85
mainFunction · 0.85
check_constraintsFunction · 0.85
check_defaultsFunction · 0.85
check_duplexFunction · 0.85
check_sizesFunction · 0.85

Calls 2

cupsArrayFindFunction · 0.85
_cups_strcasecmpFunction · 0.85

Tested by 7

mainFunction · 0.68
check_constraintsFunction · 0.68
check_defaultsFunction · 0.68
check_duplexFunction · 0.68
check_sizesFunction · 0.68
show_conflictsFunction · 0.68
show_ppdFunction · 0.68