• Home
  • Raw
  • Download

Lines Matching refs:ppd

74 static ppd_attr_t	*ppd_add_attr(ppd_file_t *ppd, const char *name,
78 static ppd_size_t *ppd_add_size(ppd_file_t *ppd, const char *name);
85 static void ppd_free_filters(ppd_file_t *ppd);
88 static ppd_coption_t *ppd_get_coption(ppd_file_t *ppd, const char *name);
92 static ppd_group_t *ppd_get_group(ppd_file_t *ppd, const char *name,
108 static int ppd_update_filters(ppd_file_t *ppd,
117 ppdClose(ppd_file_t *ppd) /* I - PPD file record */ in ppdClose() argument
132 if (!ppd) in ppdClose()
139 _cupsStrFree(ppd->lang_encoding); in ppdClose()
140 _cupsStrFree(ppd->nickname); in ppdClose()
141 if (ppd->patches) in ppdClose()
142 free(ppd->patches); in ppdClose()
143 _cupsStrFree(ppd->jcl_begin); in ppdClose()
144 _cupsStrFree(ppd->jcl_end); in ppdClose()
145 _cupsStrFree(ppd->jcl_ps); in ppdClose()
151 if (ppd->num_emulations > 0) in ppdClose()
153 for (i = ppd->num_emulations, emul = ppd->emulations; i > 0; i --, emul ++) in ppdClose()
159 ppd_free(ppd->emulations); in ppdClose()
166 if (ppd->num_groups > 0) in ppdClose()
168 for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++) in ppdClose()
171 ppd_free(ppd->groups); in ppdClose()
174 cupsArrayDelete(ppd->options); in ppdClose()
175 cupsArrayDelete(ppd->marked); in ppdClose()
181 if (ppd->num_sizes > 0) in ppdClose()
182 ppd_free(ppd->sizes); in ppdClose()
188 if (ppd->num_consts > 0) in ppdClose()
189 ppd_free(ppd->consts); in ppdClose()
195 ppd_free_filters(ppd); in ppdClose()
201 if (ppd->num_fonts > 0) in ppdClose()
203 for (i = ppd->num_fonts, font = ppd->fonts; i > 0; i --, font ++) in ppdClose()
206 ppd_free(ppd->fonts); in ppdClose()
213 if (ppd->num_profiles > 0) in ppdClose()
214 ppd_free(ppd->profiles); in ppdClose()
220 if (ppd->num_attrs > 0) in ppdClose()
222 for (i = ppd->num_attrs, attr = ppd->attrs; i > 0; i --, attr ++) in ppdClose()
228 ppd_free(ppd->attrs); in ppdClose()
231 cupsArrayDelete(ppd->sorted_attrs); in ppdClose()
237 for (coption = (ppd_coption_t *)cupsArrayFirst(ppd->coptions); in ppdClose()
239 coption = (ppd_coption_t *)cupsArrayNext(ppd->coptions)) in ppdClose()
265 cupsArrayDelete(ppd->coptions); in ppdClose()
271 if (ppd->cups_uiconstraints) in ppdClose()
276 for (consts = (_ppd_cups_uiconsts_t *)cupsArrayFirst(ppd->cups_uiconstraints); in ppdClose()
278 consts = (_ppd_cups_uiconsts_t *)cupsArrayNext(ppd->cups_uiconstraints)) in ppdClose()
284 cupsArrayDelete(ppd->cups_uiconstraints); in ppdClose()
291 if (ppd->cache) in ppdClose()
292 _ppdCacheDestroy(ppd->cache); in ppdClose()
298 ppd_free(ppd); in ppdClose()
448 ppd_file_t *ppd; /* PPD file record */ in _ppdOpen() local
652 if ((ppd = calloc(1, sizeof(ppd_file_t))) == NULL) in _ppdOpen()
662 ppd->language_level = 2; in _ppdOpen()
663 ppd->color_device = 0; in _ppdOpen()
664 ppd->colorspace = PPD_CS_N; in _ppdOpen()
665 ppd->landscape = -90; in _ppdOpen()
666 ppd->coptions = cupsArrayNew((cups_array_func_t)ppd_compare_coptions, in _ppdOpen()
785 if ((group = ppd_get_group(ppd, "General", _("General"), pg, in _ppdOpen()
819 for (j = 0; j < ppd->num_attrs; j ++) in _ppdOpen()
820 if (!strncmp(ppd->attrs[j]->name, "Default", 7) && in _ppdOpen()
821 !strcmp(ppd->attrs[j]->name + 7, keyword) && in _ppdOpen()
822 ppd->attrs[j]->value) in _ppdOpen()
825 option->keyword, ppd->attrs[j]->value)); in _ppdOpen()
826 strlcpy(option->defchoice, ppd->attrs[j]->value, in _ppdOpen()
847 ppd->language_level = atoi(string); in _ppdOpen()
854 ppd->lang_encoding = _cupsStrAlloc("UTF-8"); in _ppdOpen()
858 ppd->lang_version = string; in _ppdOpen()
860 ppd->manufacturer = string; in _ppdOpen()
862 ppd->modelname = string; in _ppdOpen()
864 ppd->protocols = string; in _ppdOpen()
866 ppd->pcfilename = string; in _ppdOpen()
875 ppd->nickname = _cupsStrAlloc((char *)utf8); in _ppdOpen()
878 ppd->nickname = _cupsStrAlloc(string); in _ppdOpen()
881 ppd->product = string; in _ppdOpen()
883 ppd->shortnickname = string; in _ppdOpen()
885 ppd->ttrasterizer = string; in _ppdOpen()
888 ppd->jcl_begin = _cupsStrAlloc(string); in _ppdOpen()
889 ppd_decode(ppd->jcl_begin); /* Decode quoted string */ in _ppdOpen()
893 ppd->jcl_end = _cupsStrAlloc(string); in _ppdOpen()
894 ppd_decode(ppd->jcl_end); /* Decode quoted string */ in _ppdOpen()
898 ppd->jcl_ps = _cupsStrAlloc(string); in _ppdOpen()
899 ppd_decode(ppd->jcl_ps); /* Decode quoted string */ in _ppdOpen()
902 ppd->accurate_screens = !strcmp(string, "True"); in _ppdOpen()
904 ppd->color_device = !strcmp(string, "True"); in _ppdOpen()
906 ppd->contone_only = !strcmp(string, "True"); in _ppdOpen()
908 ppd->flip_duplex = !strcmp(string, "True"); in _ppdOpen()
910 ppd->manual_copies = !strcmp(string, "True"); in _ppdOpen()
912 ppd->model_number = atoi(string); in _ppdOpen()
915 if (ppd->num_profiles == 0) in _ppdOpen()
918 profile = realloc(ppd->profiles, sizeof(ppd_profile_t) * (size_t)(ppd->num_profiles + 1)); in _ppdOpen()
927 ppd->profiles = profile; in _ppdOpen()
928 profile += ppd->num_profiles; in _ppdOpen()
929 ppd->num_profiles ++; in _ppdOpen()
949 if (ppd->num_filters == 0) in _ppdOpen()
952 filter = realloc(ppd->filters, sizeof(char *) * (size_t)(ppd->num_filters + 1)); in _ppdOpen()
961 ppd->filters = filter; in _ppdOpen()
962 filter += ppd->num_filters; in _ppdOpen()
963 ppd->num_filters ++; in _ppdOpen()
972 ppd->throughput = atoi(string); in _ppdOpen()
979 if (ppd->num_fonts == 0) in _ppdOpen()
982 tempfonts = (char **)realloc(ppd->fonts, sizeof(char *) * (size_t)(ppd->num_fonts + 1)); in _ppdOpen()
991 ppd->fonts = tempfonts; in _ppdOpen()
992 ppd->fonts[ppd->num_fonts] = _cupsStrAlloc(name); in _ppdOpen()
993 ppd->num_fonts ++; in _ppdOpen()
1009 if ((coption = ppd_get_coption(ppd, keyword + 11)) == NULL) in _ppdOpen()
1101 ppd->custom_min[0] = cparam->minimum.custom_points; in _ppdOpen()
1102 ppd->custom_max[0] = cparam->maximum.custom_points; in _ppdOpen()
1106 ppd->custom_min[1] = cparam->minimum.custom_points; in _ppdOpen()
1107 ppd->custom_max[1] = cparam->maximum.custom_points; in _ppdOpen()
1114 ppd->custom_margins[i] = (float)_cupsStrScand(sptr, &sptr, loc); in _ppdOpen()
1126 if (!ppd_get_coption(ppd, keyword + 6)) in _ppdOpen()
1136 custom_option = ppdFindOption(ppd, keyword + 6); in _ppdOpen()
1173 ppd->variable_sizes = 1; in _ppdOpen()
1175 ppd_add_size(ppd, "Custom"); in _ppdOpen()
1180 custom_option = ppdFindOption(ppd, "PageRegion"); in _ppdOpen()
1202 ppd->landscape = -90; in _ppdOpen()
1204 ppd->landscape = 90; in _ppdOpen()
1216 ppd->num_emulations = count; in _ppdOpen()
1217 if ((ppd->emulations = calloc((size_t)count, sizeof(ppd_emul_t))) == NULL) in _ppdOpen()
1226 for (nameptr = ppd->emulations[i].name; in _ppdOpen()
1229 if (nameptr < (ppd->emulations[i].name + sizeof(ppd->emulations[i].name) - 1)) in _ppdOpen()
1242 for (i = 0; i < ppd->num_emulations; i ++) in _ppdOpen()
1243 if (!strcmp(keyword + 14, ppd->emulations[i].name)) in _ppdOpen()
1245 ppd->emulations[i].start = string; in _ppdOpen()
1253 for (i = 0; i < ppd->num_emulations; i ++) in _ppdOpen()
1254 if (!strcmp(keyword + 13, ppd->emulations[i].name)) in _ppdOpen()
1256 ppd->emulations[i].stop = string; in _ppdOpen()
1293 if (ppd->patches == NULL) in _ppdOpen()
1294 ppd->patches = strdup(string); in _ppdOpen()
1297 temp = realloc(ppd->patches, strlen(ppd->patches) + in _ppdOpen()
1306 ppd->patches = temp; in _ppdOpen()
1308 memcpy(ppd->patches + strlen(ppd->patches), string, strlen(string) + 1); in _ppdOpen()
1343 if ((group = ppd_get_group(ppd, "General", _("General"), pg, in _ppdOpen()
1380 for (j = 0; j < ppd->num_attrs; j ++) in _ppdOpen()
1381 if (!strncmp(ppd->attrs[j]->name, "Default", 7) && in _ppdOpen()
1382 !strcmp(ppd->attrs[j]->name + 7, name) && in _ppdOpen()
1383 ppd->attrs[j]->value) in _ppdOpen()
1386 option->keyword, ppd->attrs[j]->value)); in _ppdOpen()
1387 strlcpy(option->defchoice, ppd->attrs[j]->value, in _ppdOpen()
1426 if ((custom_attr = ppdFindAttr(ppd, custom_name, "True")) != NULL) in _ppdOpen()
1461 group = ppd_get_group(ppd, "JCL", _("JCL"), pg, encoding); in _ppdOpen()
1499 for (j = 0; j < ppd->num_attrs; j ++) in _ppdOpen()
1500 if (!strncmp(ppd->attrs[j]->name, "Default", 7) && in _ppdOpen()
1501 !strcmp(ppd->attrs[j]->name + 7, name) && in _ppdOpen()
1502 ppd->attrs[j]->value) in _ppdOpen()
1505 option->keyword, ppd->attrs[j]->value)); in _ppdOpen()
1506 strlcpy(option->defchoice, ppd->attrs[j]->value, in _ppdOpen()
1530 if ((custom_attr = ppdFindAttr(ppd, custom_name, "True")) != NULL) in _ppdOpen()
1614 group = ppd_get_group(ppd, string, sptr, pg, encoding); in _ppdOpen()
1665 for (i = ppd->num_groups, gtemp = ppd->groups; i > 0; i --, gtemp ++) in _ppdOpen()
1710 ppd->colorspace = PPD_CS_CMY; in _ppdOpen()
1712 ppd->colorspace = PPD_CS_CMYK; in _ppdOpen()
1714 ppd->colorspace = PPD_CS_RGB; in _ppdOpen()
1716 ppd->colorspace = PPD_CS_RGBK; in _ppdOpen()
1718 ppd->colorspace = PPD_CS_N; in _ppdOpen()
1720 ppd->colorspace = PPD_CS_GRAY; in _ppdOpen()
1743 if ((toption = ppdFindOption(ppd, keyword + 7)) != NULL) in _ppdOpen()
1759 if (ppd->num_consts == 0) in _ppdOpen()
1762 constraint = realloc(ppd->consts, (size_t)(ppd->num_consts + 2) * sizeof(ppd_const_t)); in _ppdOpen()
1771 ppd->consts = constraint; in _ppdOpen()
1772 constraint += ppd->num_consts; in _ppdOpen()
1773 ppd->num_consts ++; in _ppdOpen()
1932 if ((size = ppdPageSize(ppd, name)) == NULL) in _ppdOpen()
1933 size = ppd_add_size(ppd, name); in _ppdOpen()
1954 if ((size = ppdPageSize(ppd, name)) == NULL) in _ppdOpen()
1955 size = ppd_add_size(ppd, name); in _ppdOpen()
1989 if (ppdPageSize(ppd, name) == NULL) in _ppdOpen()
1990 ppd_add_size(ppd, name); in _ppdOpen()
2027 ppd_add_attr(ppd, keyword, name, text, string); in _ppdOpen()
2070 ppdClose(ppd); in _ppdOpen()
2079 if (!ppd_update_filters(ppd, pg)) in _ppdOpen()
2081 ppdClose(ppd); in _ppdOpen()
2091 ppd->options = cupsArrayNew2((cups_array_func_t)ppd_compare_options, NULL, in _ppdOpen()
2095 for (i = ppd->num_groups, group = ppd->groups; in _ppdOpen()
2106 cupsArrayAdd(ppd->options, option); in _ppdOpen()
2111 if ((coption = ppdFindCustomOption(ppd, option->keyword)) != NULL) in _ppdOpen()
2120 ppd->marked = cupsArrayNew((cups_array_func_t)ppd_compare_choices, NULL); in _ppdOpen()
2126 return (ppd); in _ppdOpen()
2137 ppdClose(ppd); in _ppdOpen()
2150 ppd_file_t *ppd; /* PPD file record */ in ppdOpen() local
2165 ppd = _ppdOpen(cf, _PPD_LOCALIZATION_DEFAULT); in ppdOpen()
2173 return (ppd); in ppdOpen()
2198 ppd_file_t *ppd; /* PPD file record */ in ppdOpenFd() local
2226 ppd = ppdOpen2(fp); in ppdOpenFd()
2233 ppd = NULL; in ppdOpenFd()
2236 return (ppd); in ppdOpenFd()
2249 ppd_file_t *ppd; /* PPD file record */ in _ppdOpenFile() local
2277 ppd = _ppdOpen(fp, localization); in _ppdOpenFile()
2284 ppd = NULL; in _ppdOpenFile()
2287 return (ppd); in _ppdOpenFile()
2324 ppd_add_attr(ppd_file_t *ppd, /* I - PPD file data */ in ppd_add_attr() argument
2338 if (ppd == NULL || name == NULL || spec == NULL) in ppd_add_attr()
2345 if (!ppd->sorted_attrs) in ppd_add_attr()
2346 ppd->sorted_attrs = cupsArrayNew((cups_array_func_t)ppd_compare_attrs, in ppd_add_attr()
2353 if (ppd->num_attrs == 0) in ppd_add_attr()
2356 ptr = realloc(ppd->attrs, (size_t)(ppd->num_attrs + 1) * sizeof(ppd_attr_t *)); in ppd_add_attr()
2361 ppd->attrs = ptr; in ppd_add_attr()
2362 ptr += ppd->num_attrs; in ppd_add_attr()
2369 ppd->num_attrs ++; in ppd_add_attr()
2384 cupsArrayAdd(ppd->sorted_attrs, temp); in ppd_add_attr()
2429 ppd_add_size(ppd_file_t *ppd, /* I - PPD file */ in ppd_add_size() argument
2435 if (ppd->num_sizes == 0) in ppd_add_size()
2438 size = realloc(ppd->sizes, sizeof(ppd_size_t) * (size_t)(ppd->num_sizes + 1)); in ppd_add_size()
2443 ppd->sizes = size; in ppd_add_size()
2444 size += ppd->num_sizes; in ppd_add_size()
2445 ppd->num_sizes ++; in ppd_add_size()
2564 ppd_free_filters(ppd_file_t *ppd) /* I - PPD file */ in ppd_free_filters() argument
2570 if (ppd->num_filters > 0) in ppd_free_filters()
2572 for (i = ppd->num_filters, filter = ppd->filters; i > 0; i --, filter ++) in ppd_free_filters()
2575 ppd_free(ppd->filters); in ppd_free_filters()
2577 ppd->num_filters = 0; in ppd_free_filters()
2578 ppd->filters = NULL; in ppd_free_filters()
2647 ppd_get_coption(ppd_file_t *ppd, /* I - PPD file */ in ppd_get_coption() argument
2657 if ((copt = ppdFindCustomOption(ppd, name)) != NULL) in ppd_get_coption()
2671 cupsArrayAdd(ppd->coptions, copt); in ppd_get_coption()
2729 ppd_get_group(ppd_file_t *ppd, /* I - PPD file */ in ppd_get_group() argument
2740 ppd, name, text, pg)); in ppd_get_group()
2742 for (i = ppd->num_groups, group = ppd->groups; i > 0; i --, group ++) in ppd_get_group()
2757 if (ppd->num_groups == 0) in ppd_get_group()
2760 group = realloc(ppd->groups, (size_t)(ppd->num_groups + 1) * sizeof(ppd_group_t)); in ppd_get_group()
2769 ppd->groups = group; in ppd_get_group()
2770 group += ppd->num_groups; in ppd_get_group()
2771 ppd->num_groups ++; in ppd_get_group()
3395 ppd_update_filters(ppd_file_t *ppd, /* I - PPD file */ in ppd_update_filters() argument
3410 DEBUG_printf(("4ppd_update_filters(ppd=%p, cg=%p)", ppd, pg)); in ppd_update_filters()
3416 if ((attr = ppdFindAttr(ppd, "cupsFilter2", NULL)) == NULL) in ppd_update_filters()
3426 ppd_free_filters(ppd); in ppd_update_filters()
3479 if (ppd->num_filters == 0) in ppd_update_filters()
3482 filter = realloc(ppd->filters, sizeof(char *) * (size_t)(ppd->num_filters + 1)); in ppd_update_filters()
3492 ppd->filters = filter; in ppd_update_filters()
3493 filter += ppd->num_filters; in ppd_update_filters()
3494 ppd->num_filters ++; in ppd_update_filters()
3498 while ((attr = ppdFindNextAttr(ppd, "cupsFilter2", NULL)) != NULL); in ppd_update_filters()