• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/cups-408/cups/cups/

Lines Matching defs:option

42 #define PPD_OPTION	2		/* Line contained an option name */
67 static ppd_choice_t *ppd_add_choice(ppd_option_t *option, const char *name);
77 static void ppd_free_option(ppd_option_t *option);
86 static int ppd_hash_option(ppd_option_t *option);
88 char *keyword, char *option, char *text,
107 ppd_coption_t *coption; /* Current custom option */
313 _("Illegal option keyword string"),
317 _("Missing option keyword"),
392 ppd_option_t *option; /* Current option */
590 option = NULL;
622 * create the corresponding option, as needed...
631 option = NULL;
679 if (option == NULL &&
690 * Create the option in the appropriate group...
705 option = ppd_get_option(group, keyword);
709 option = ppd_get_option(group, keyword);
711 if (option == NULL)
719 * Now fill in the initial information for the option...
723 option->section = PPD_ORDER_JCL;
725 option->section = PPD_ORDER_ANY;
727 option->order = 10.0f;
730 option->ui = PPD_UI_BOOLEAN;
732 option->ui = PPD_UI_PICKONE;
740 option->keyword, ppd->attrs[j]->value));
741 strlcpy(option->defchoice, ppd->attrs[j]->value,
742 sizeof(option->defchoice));
747 strlcpy(option->text, _("Media Size"), sizeof(option->text));
749 strlcpy(option->text, _("Media Type"), sizeof(option->text));
751 strlcpy(option->text, _("Media Source"), sizeof(option->text));
753 strlcpy(option->text, _("Output Mode"), sizeof(option->text));
755 strlcpy(option->text, _("Resolution"), sizeof(option->text));
757 strlcpy(option->text, keyword, sizeof(option->text));
912 ppd_coption_t *coption; /* Custom option */
921 * Get the custom option and parameter...
1031 else if (!strncmp(keyword, "Custom", 6) && !strcmp(name, "True") && !option)
1033 ppd_option_t *custom_option; /* Custom option */
1035 DEBUG_puts("2_ppdOpen: Processing Custom option...");
1038 * Get the option and custom option...
1048 if (option && !_cups_strcasecmp(option->keyword, keyword + 6))
1049 custom_option = option;
1056 * Add the "custom" option...
1092 if (option && !_cups_strcasecmp(option->keyword, "PageRegion"))
1093 custom_option = option;
1232 if (option && cg->ppd_conform == PPD_CONFORM_STRICT)
1240 * Add an option record to the current sub-group, group, or file...
1255 option = ppd_get_option(subgroup, name);
1263 option = ppd_get_option(group, name);
1267 option = ppd_get_option(group, name);
1269 if (option == NULL)
1277 * Now fill in the initial information for the option...
1281 option->ui = PPD_UI_PICKMANY;
1283 option->ui = PPD_UI_BOOLEAN;
1285 option->ui = PPD_UI_PICKONE;
1293 option->ui = PPD_UI_PICKONE;
1301 option->keyword, ppd->attrs[j]->value));
1302 strlcpy(option->defchoice, ppd->attrs[j]->value,
1303 sizeof(option->defchoice));
1308 cupsCharsetToUTF8((cups_utf8_t *)option->text, text,
1309 sizeof(option->text), encoding);
1313 strlcpy(option->text, _("Media Size"), sizeof(option->text));
1315 strlcpy(option->text, _("Media Type"), sizeof(option->text));
1317 strlcpy(option->text, _("Media Source"), sizeof(option->text));
1319 strlcpy(option->text, _("Output Mode"), sizeof(option->text));
1321 strlcpy(option->text, _("Resolution"), sizeof(option->text));
1323 strlcpy(option->text, name, sizeof(option->text));
1326 option->section = PPD_ORDER_ANY;
1332 * Add a custom option choice if we have already seen a CustomFoo
1343 if ((choice = ppdFindChoice(option, "Custom")) == NULL)
1344 if ((choice = ppd_add_choice(option, "Custom")) == NULL)
1365 if (option && cg->ppd_conform == PPD_CONFORM_STRICT)
1382 * Add an option record to the current JCLs...
1388 option = ppd_get_option(group, name);
1390 if (option == NULL)
1398 * Now fill in the initial information for the option...
1402 option->ui = PPD_UI_PICKMANY;
1404 option->ui = PPD_UI_BOOLEAN;
1406 option->ui = PPD_UI_PICKONE;
1420 option->keyword, ppd->attrs[j]->value));
1421 strlcpy(option->defchoice, ppd->attrs[j]->value,
1422 sizeof(option->defchoice));
1427 cupsCharsetToUTF8((cups_utf8_t *)option->text, text,
1428 sizeof(option->text), encoding);
1430 strlcpy(option->text, name, sizeof(option->text));
1432 option->section = PPD_ORDER_JCL;
1439 * Add a custom option choice if we have already seen a CustomFoo
1447 if ((choice = ppd_add_choice(option, "Custom")) == NULL)
1464 option = NULL;
1550 if (option == NULL)
1574 option->section = section;
1575 option->order = order;
1616 else if (option && !strcmp(keyword + 7, option->keyword))
1619 * Set the default as part of the current option...
1624 strlcpy(option->defchoice, string, sizeof(option->defchoice));
1626 DEBUG_printf(("2_ppdOpen: %s is now %s...", keyword, option->defchoice));
1631 * Lookup option and set if it has been defined...
1634 ppd_option_t *toption; /* Temporary option */
1870 else if (option != NULL &&
1873 !strcmp(keyword, option->keyword))
1888 * Add the option choice...
1891 if ((choice = ppd_add_choice(option, name)) == NULL)
1908 if (option->section == PPD_ORDER_JCL)
1971 * Create the sorted options array and set the option back-pointer for
1972 * each choice and custom option...
1983 for (j = group->num_options, option = group->options;
1985 j --, option ++)
1987 ppd_coption_t *coption; /* Custom option */
1990 cupsArrayAdd(ppd->options, option);
1992 for (k = 0; k < option->num_choices; k ++)
1993 option->choices[k].option = option;
1995 if ((coption = ppdFindCustomOption(ppd, option->keyword)) != NULL)
1996 coption->option = option;
2279 * 'ppd_add_choice()' - Add a choice to an option.
2283 ppd_add_choice(ppd_option_t *option, /* I - Option */
2289 if (option->num_choices == 0)
2292 choice = realloc(option->choices, sizeof(ppd_choice_t) * (size_t)(option->num_choices + 1));
2297 option->choices = choice;
2298 choice += option->num_choices;
2299 option->num_choices ++;
2358 return (strcmp(a->option->keyword, b->option->keyword));
2367 ppd_compare_coptions(ppd_coption_t *a, /* I - First option */
2368 ppd_coption_t *b) /* I - Second option */
2379 ppd_compare_options(ppd_option_t *a, /* I - First option */
2380 ppd_option_t *b) /* I - Second option */
2475 ppd_option_t *option; /* Current option */
2481 for (i = group->num_options, option = group->options;
2483 i --, option ++)
2484 ppd_free_option(option);
2502 * 'ppd_free_option()' - Free a single option.
2506 ppd_free_option(ppd_option_t *option) /* I - Option to free */
2512 if (option->num_choices > 0)
2514 for (i = option->num_choices, choice = option->choices;
2521 ppd_free(option->choices);
2527 * 'ppd_get_coption()' - Get a custom option record.
2530 static ppd_coption_t * /* O - Custom option... */
2532 const char *name) /* I - Name of option */
2534 ppd_coption_t *copt; /* New custom option */
2538 * See if the option already exists...
2545 * Not found, so create the custom option record...
2569 static ppd_cparam_t * /* O - Extended option... */
2669 * 'ppd_get_option()' - Find or create the named option as needed.
2672 static ppd_option_t * /* O - Named option */
2674 const char *name) /* I - Name of option */
2677 ppd_option_t *option; /* Option */
2683 for (i = group->num_options, option = group->options; i > 0; i --, option ++)
2684 if (!strcmp(option->keyword, name))
2690 option = malloc(sizeof(ppd_option_t));
2692 option = realloc(group->options, (size_t)(group->num_options + 1) * sizeof(ppd_option_t));
2694 if (option == NULL)
2697 group->options = option;
2698 option += group->num_options;
2701 memset(option, 0, sizeof(ppd_option_t));
2702 strlcpy(option->keyword, name, sizeof(option->keyword));
2705 return (option);
2710 * 'ppd_hash_option()' - Generate a hash of the option name...
2714 ppd_hash_option(ppd_option_t *option) /* I - Option */
2720 for (hash = option->keyword[0], k = option->keyword + 1; *k;)
2736 char *option, /* O - Option from line */
3037 option[0] = '\0';
3115 * Get an option name...
3121 optptr = option;
3127 (optptr - option) >= (PPD_MAX_NAME - 1))