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

Function _ppdOpen

cups/ppd.c:412–2161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410 */
411
412ppd_file_t * /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
413_ppdOpen(
414 cups_file_t *fp, /* I - File to read from */
415 _ppd_localization_t localization) /* I - Localization to load */
416{
417 int i, j, k; /* Looping vars */
418 _ppd_line_t line; /* Line buffer */
419 ppd_file_t *ppd; /* PPD file record */
420 ppd_group_t *group, /* Current group */
421 *subgroup; /* Current sub-group */
422 ppd_option_t *option; /* Current option */
423 ppd_choice_t *choice; /* Current choice */
424 ppd_const_t *constraint; /* Current constraint */
425 ppd_size_t *size; /* Current page size */
426 int mask; /* Line data mask */
427 char keyword[PPD_MAX_NAME],
428 /* Keyword from file */
429 name[PPD_MAX_NAME],
430 /* Option from file */
431 text[PPD_MAX_LINE],
432 /* Human-readable text from file */
433 *string, /* Code/text from file */
434 *sptr, /* Pointer into string */
435 *temp, /* Temporary string pointer */
436 **tempfonts; /* Temporary fonts pointer */
437 float order; /* Order dependency number */
438 ppd_section_t section; /* Order dependency section */
439 ppd_profile_t *profile; /* Pointer to color profile */
440 char **filter; /* Pointer to filter */
441 struct lconv *loc; /* Locale data */
442 int ui_keyword; /* Is this line a UI keyword? */
443 cups_lang_t *lang; /* Language data */
444 cups_encoding_t encoding; /* Encoding of PPD file */
445 _ppd_globals_t *pg = _ppdGlobals();
446 /* Global data */
447 char custom_name[PPD_MAX_NAME];
448 /* CustomFoo attribute name */
449 ppd_attr_t *custom_attr; /* CustomFoo attribute */
450 char ll[7], /* Base language + '.' */
451 ll_CC[7]; /* Language w/country + '.' */
452 size_t ll_len = 0, /* Base language length */
453 ll_CC_len = 0; /* Language w/country length */
454 static const char * const ui_keywords[] =
455 {
456#ifdef CUPS_USE_FULL_UI_KEYWORDS_LIST
457 /*
458 * Adobe defines some 41 keywords as "UI", meaning that they are
459 * user interface elements and that they should be treated as such
460 * even if the PPD creator doesn't use Open/CloseUI around them.
461 *
462 * Since this can cause previously invisible options to appear and
463 * confuse users, the default is to only treat the PageSize and
464 * PageRegion keywords this way.
465 */
466 /* Boolean keywords */
467 "BlackSubstitution",
468 "Booklet",
469 "Collate",

Callers 5

copy_modelFunction · 0.85
mainFunction · 0.85
ppdOpenFunction · 0.85
ppdOpen2Function · 0.85
_ppdOpenFileFunction · 0.85

Calls 15

_ppdGlobalsFunction · 0.85
cupsLangDefaultFunction · 0.85
ppd_readFunction · 0.85
cupsArrayNewFunction · 0.85
_cups_isalphaFunction · 0.85
_cups_strcasecmpFunction · 0.85
ppd_get_groupFunction · 0.85
ppd_get_optionFunction · 0.85
_ppdGetEncodingFunction · 0.85
cupsCharsetToUTF8Function · 0.85
ppd_decodeFunction · 0.85
_cupsStrScandFunction · 0.85

Tested by 1

mainFunction · 0.68