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

Function ppd_get_coption

cups/ppd.c:2675–2707  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2673 */
2674
2675static ppd_coption_t * /* O - Custom option... */
2676ppd_get_coption(ppd_file_t *ppd, /* I - PPD file */
2677 const char *name) /* I - Name of option */
2678{
2679 ppd_coption_t *copt; /* New custom option */
2680
2681
2682 /*
2683 * See if the option already exists...
2684 */
2685
2686 if ((copt = ppdFindCustomOption(ppd, name)) != NULL)
2687 return (copt);
2688
2689 /*
2690 * Not found, so create the custom option record...
2691 */
2692
2693 if ((copt = calloc(1, sizeof(ppd_coption_t))) == NULL)
2694 return (NULL);
2695
2696 strlcpy(copt->keyword, name, sizeof(copt->keyword));
2697
2698 copt->params = cupsArrayNew((cups_array_func_t)NULL, NULL);
2699
2700 cupsArrayAdd(ppd->coptions, copt);
2701
2702 /*
2703 * Return the new record...
2704 */
2705
2706 return (copt);
2707}
2708
2709
2710/*

Callers 1

_ppdOpenFunction · 0.85

Calls 3

ppdFindCustomOptionFunction · 0.85
cupsArrayNewFunction · 0.85
cupsArrayAddFunction · 0.85

Tested by

no test coverage detected