| 2673 | */ |
| 2674 | |
| 2675 | static ppd_coption_t * /* O - Custom option... */ |
| 2676 | ppd_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 | /* |
no test coverage detected