Lines Matching refs:pc
56 _ppd_cache_t *pc, /* I - PPD cache info */ in _cupsConvertOptions() argument
89 …if (pc->password && (password = cupsGetOption("job-password", num_options, options)) != NULL && ip… in _cupsConvertOptions()
121 if (pc->account_id) in _cupsConvertOptions()
130 if (pc->accounting_user_id) in _cupsConvertOptions()
139 …(mandatory = (const char *)cupsArrayFirst(pc->mandatory); mandatory; mandatory = (const char *)cup… in _cupsConvertOptions()
202 media_source = _ppdCacheGetSource(pc, cupsGetOption("InputSlot", num_options, options)); in _cupsConvertOptions()
203 media_type = _ppdCacheGetType(pc, cupsGetOption("MediaType", num_options, options)); in _cupsConvertOptions()
204 size = _ppdCacheGetSize(pc, keyword); in _cupsConvertOptions()
247 keyword = _ppdCacheGetBin(pc, choice->choice); in _cupsConvertOptions()
291 else if (pc->sides_option && (choice = ppdFindMarkedChoice(ppd, pc->sides_option)) != NULL) in _cupsConvertOptions()
293 if (!_cups_strcasecmp(choice->choice, pc->sides_1sided)) in _cupsConvertOptions()
295 else if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_long)) in _cupsConvertOptions()
297 if (!_cups_strcasecmp(choice->choice, pc->sides_2sided_short)) in _cupsConvertOptions()
366 …num_finishings = _ppdCacheGetFinishingValues(pc, num_options, options, (int)(sizeof(finishings) / … in _cupsConvertOptions()
399 _ppd_cache_t *pc; /* PWG mapping data */ in _ppdCacheCreateWithFile() local
477 if ((pc = calloc(1, sizeof(_ppd_cache_t))) == NULL) in _ppdCacheCreateWithFile()
484 pc->max_copies = 9999; in _ppdCacheCreateWithFile()
510 if (!pc->filters) in _ppdCacheCreateWithFile()
511 pc->filters = cupsArrayNew3(NULL, NULL, NULL, 0, in _ppdCacheCreateWithFile()
515 cupsArrayAdd(pc->filters, value); in _ppdCacheCreateWithFile()
519 if (!pc->prefilters) in _ppdCacheCreateWithFile()
520 pc->prefilters = cupsArrayNew3(NULL, NULL, NULL, 0, in _ppdCacheCreateWithFile()
524 cupsArrayAdd(pc->prefilters, value); in _ppdCacheCreateWithFile()
528 pc->product = _cupsStrAlloc(value); in _ppdCacheCreateWithFile()
532 pc->single_file = !_cups_strcasecmp(value, "true"); in _ppdCacheCreateWithFile()
602 if ((pc->bins = calloc((size_t)num_bins, sizeof(pwg_map_t))) == NULL) in _ppdCacheCreateWithFile()
619 if (pc->num_bins >= num_bins) in _ppdCacheCreateWithFile()
627 map = pc->bins + pc->num_bins; in _ppdCacheCreateWithFile()
631 pc->num_bins ++; in _ppdCacheCreateWithFile()
652 if ((pc->sizes = calloc((size_t)num_sizes, sizeof(pwg_size_t))) == NULL) in _ppdCacheCreateWithFile()
663 if (pc->num_sizes >= num_sizes) in _ppdCacheCreateWithFile()
671 size = pc->sizes + pc->num_sizes; in _ppdCacheCreateWithFile()
686 pc->num_sizes ++; in _ppdCacheCreateWithFile()
690 if (pc->custom_max_width > 0) in _ppdCacheCreateWithFile()
698 if (sscanf(value, "%d%d%d%d%d%d%d%d", &(pc->custom_max_width), in _ppdCacheCreateWithFile()
699 &(pc->custom_max_length), &(pc->custom_min_width), in _ppdCacheCreateWithFile()
700 &(pc->custom_min_length), &(pc->custom_size.left), in _ppdCacheCreateWithFile()
701 &(pc->custom_size.bottom), &(pc->custom_size.right), in _ppdCacheCreateWithFile()
702 &(pc->custom_size.top)) != 8) in _ppdCacheCreateWithFile()
711 pc->custom_max_width, pc->custom_max_length, NULL); in _ppdCacheCreateWithFile()
712 pc->custom_max_keyword = _cupsStrAlloc(pwg_keyword); in _ppdCacheCreateWithFile()
715 pc->custom_min_width, pc->custom_min_length, NULL); in _ppdCacheCreateWithFile()
716 pc->custom_min_keyword = _cupsStrAlloc(pwg_keyword); in _ppdCacheCreateWithFile()
720 pc->source_option = _cupsStrAlloc(value); in _ppdCacheCreateWithFile()
740 if ((pc->sources = calloc((size_t)num_sources, sizeof(pwg_map_t))) == NULL) in _ppdCacheCreateWithFile()
758 if (pc->num_sources >= num_sources) in _ppdCacheCreateWithFile()
766 map = pc->sources + pc->num_sources; in _ppdCacheCreateWithFile()
770 pc->num_sources ++; in _ppdCacheCreateWithFile()
789 if ((pc->types = calloc((size_t)num_types, sizeof(pwg_map_t))) == NULL) in _ppdCacheCreateWithFile()
807 if (pc->num_types >= num_types) in _ppdCacheCreateWithFile()
815 map = pc->types + pc->num_types; in _ppdCacheCreateWithFile()
819 pc->num_types ++; in _ppdCacheCreateWithFile()
842 pc->num_presets[print_color_mode][print_quality] = in _ppdCacheCreateWithFile()
844 pc->presets[print_color_mode] + print_quality); in _ppdCacheCreateWithFile()
847 pc->sides_option = _cupsStrAlloc(value); in _ppdCacheCreateWithFile()
849 pc->sides_1sided = _cupsStrAlloc(value); in _ppdCacheCreateWithFile()
851 pc->sides_2sided_long = _cupsStrAlloc(value); in _ppdCacheCreateWithFile()
853 pc->sides_2sided_short = _cupsStrAlloc(value); in _ppdCacheCreateWithFile()
856 if (!pc->finishings) in _ppdCacheCreateWithFile()
857 pc->finishings = in _ppdCacheCreateWithFile()
869 cupsArrayAdd(pc->finishings, finishings); in _ppdCacheCreateWithFile()
872 pc->max_copies = atoi(value); in _ppdCacheCreateWithFile()
874 pc->charge_info_uri = _cupsStrAlloc(value); in _ppdCacheCreateWithFile()
876 pc->account_id = !_cups_strcasecmp(value, "true"); in _ppdCacheCreateWithFile()
878 pc->accounting_user_id = !_cups_strcasecmp(value, "true"); in _ppdCacheCreateWithFile()
880 pc->password = _cupsStrAlloc(value); in _ppdCacheCreateWithFile()
883 if (pc->mandatory) in _ppdCacheCreateWithFile()
884 _cupsArrayAddStrings(pc->mandatory, value, ' '); in _ppdCacheCreateWithFile()
886 pc->mandatory = _cupsArrayNewStrings(value, ' '); in _ppdCacheCreateWithFile()
890 if (!pc->support_files) in _ppdCacheCreateWithFile()
891 pc->support_files = cupsArrayNew3(NULL, NULL, NULL, 0, in _ppdCacheCreateWithFile()
895 cupsArrayAdd(pc->support_files, value); in _ppdCacheCreateWithFile()
904 if (pc->num_sizes < num_sizes) in _ppdCacheCreateWithFile()
907 pc->num_sizes, num_sizes)); in _ppdCacheCreateWithFile()
912 if (pc->num_sources < num_sources) in _ppdCacheCreateWithFile()
915 pc->num_sources, num_sources)); in _ppdCacheCreateWithFile()
920 if (pc->num_types < num_types) in _ppdCacheCreateWithFile()
923 pc->num_types, num_types)); in _ppdCacheCreateWithFile()
930 return (pc); in _ppdCacheCreateWithFile()
939 _ppdCacheDestroy(pc); in _ppdCacheCreateWithFile()
959 _ppd_cache_t *pc; /* PWG mapping data */ in _ppdCacheCreateWithPPD() local
1014 if ((pc = calloc(1, sizeof(_ppd_cache_t))) == NULL) in _ppdCacheCreateWithPPD()
1026 if ((pc->sizes = calloc((size_t)ppd->num_sizes, sizeof(pwg_size_t))) == NULL) in _ppdCacheCreateWithPPD()
1033 for (i = ppd->num_sizes, pwg_size = pc->sizes, ppd_size = ppd->sizes; in _ppdCacheCreateWithPPD()
1054 for (j = 0; j < pc->num_sizes; j ++) in _ppdCacheCreateWithPPD()
1055 if (!strcmp(pc->sizes[j].map.pwg, pwg_media->pwg)) in _ppdCacheCreateWithPPD()
1109 for (k = pc->num_sizes, similar = 0, old_size = pc->sizes, new_size = NULL; in _ppdCacheCreateWithPPD()
1146 pc->num_sizes ++; in _ppdCacheCreateWithPPD()
1176 pc->custom_max_keyword = _cupsStrAlloc(pwg_keyword); in _ppdCacheCreateWithPPD()
1177 pc->custom_max_width = PWG_FROM_POINTS(ppd->custom_max[0]); in _ppdCacheCreateWithPPD()
1178 pc->custom_max_length = PWG_FROM_POINTS(ppd->custom_max[1]); in _ppdCacheCreateWithPPD()
1183 pc->custom_min_keyword = _cupsStrAlloc(pwg_keyword); in _ppdCacheCreateWithPPD()
1184 pc->custom_min_width = PWG_FROM_POINTS(ppd->custom_min[0]); in _ppdCacheCreateWithPPD()
1185 pc->custom_min_length = PWG_FROM_POINTS(ppd->custom_min[1]); in _ppdCacheCreateWithPPD()
1187 pc->custom_size.left = PWG_FROM_POINTS(ppd->custom_margins[0]); in _ppdCacheCreateWithPPD()
1188 pc->custom_size.bottom = PWG_FROM_POINTS(ppd->custom_margins[1]); in _ppdCacheCreateWithPPD()
1189 pc->custom_size.right = PWG_FROM_POINTS(ppd->custom_margins[2]); in _ppdCacheCreateWithPPD()
1190 pc->custom_size.top = PWG_FROM_POINTS(ppd->custom_margins[3]); in _ppdCacheCreateWithPPD()
1202 pc->source_option = _cupsStrAlloc(input_slot->keyword); in _ppdCacheCreateWithPPD()
1204 if ((pc->sources = calloc((size_t)input_slot->num_choices, sizeof(pwg_map_t))) == NULL) in _ppdCacheCreateWithPPD()
1211 pc->num_sources = input_slot->num_choices; in _ppdCacheCreateWithPPD()
1214 map = pc->sources; in _ppdCacheCreateWithPPD()
1265 if ((pc->types = calloc((size_t)media_type->num_choices, sizeof(pwg_map_t))) == NULL) in _ppdCacheCreateWithPPD()
1272 pc->num_types = media_type->num_choices; in _ppdCacheCreateWithPPD()
1275 map = pc->types; in _ppdCacheCreateWithPPD()
1329 if ((pc->bins = calloc((size_t)output_bin->num_choices, sizeof(pwg_map_t))) == NULL) in _ppdCacheCreateWithPPD()
1336 pc->num_bins = output_bin->num_choices; in _ppdCacheCreateWithPPD()
1339 map = pc->bins; in _ppdCacheCreateWithPPD()
1436 if (!pc->num_presets[pwg_print_color_mode][pwg_print_quality]) in _ppdCacheCreateWithPPD()
1437 pc->num_presets[pwg_print_color_mode][pwg_print_quality] = in _ppdCacheCreateWithPPD()
1439 pc->presets[pwg_print_color_mode] + in _ppdCacheCreateWithPPD()
1448 if (!pc->num_presets[_PWG_PRINT_COLOR_MODE_MONOCHROME][_PWG_PRINT_QUALITY_DRAFT] && in _ppdCacheCreateWithPPD()
1449 !pc->num_presets[_PWG_PRINT_COLOR_MODE_MONOCHROME][_PWG_PRINT_QUALITY_NORMAL] && in _ppdCacheCreateWithPPD()
1450 !pc->num_presets[_PWG_PRINT_COLOR_MODE_MONOCHROME][_PWG_PRINT_QUALITY_HIGH]) in _ppdCacheCreateWithPPD()
1504 if (pc->num_presets[_PWG_PRINT_COLOR_MODE_COLOR][pwg_print_quality]) in _ppdCacheCreateWithPPD()
1510 num_options = pc->num_presets[_PWG_PRINT_COLOR_MODE_COLOR] in _ppdCacheCreateWithPPD()
1517 coption = pc->presets[_PWG_PRINT_COLOR_MODE_COLOR] in _ppdCacheCreateWithPPD()
1526 pc->num_presets[_PWG_PRINT_COLOR_MODE_MONOCHROME][pwg_print_quality] = in _ppdCacheCreateWithPPD()
1528 pc->presets[_PWG_PRINT_COLOR_MODE_MONOCHROME][pwg_print_quality] = in _ppdCacheCreateWithPPD()
1539 pc->num_presets[_PWG_PRINT_COLOR_MODE_MONOCHROME][pwg_print_quality] = in _ppdCacheCreateWithPPD()
1541 pc->num_presets[_PWG_PRINT_COLOR_MODE_MONOCHROME] in _ppdCacheCreateWithPPD()
1543 pc->presets[_PWG_PRINT_COLOR_MODE_MONOCHROME] + in _ppdCacheCreateWithPPD()
1561 pc->sides_option = _cupsStrAlloc(duplex->keyword); in _ppdCacheCreateWithPPD()
1568 !_cups_strcasecmp(choice->choice, "False")) && !pc->sides_1sided) in _ppdCacheCreateWithPPD()
1569 pc->sides_1sided = _cupsStrAlloc(choice->choice); in _ppdCacheCreateWithPPD()
1572 !_cups_strcasecmp(choice->choice, "Top")) && !pc->sides_2sided_long) in _ppdCacheCreateWithPPD()
1573 pc->sides_2sided_long = _cupsStrAlloc(choice->choice); in _ppdCacheCreateWithPPD()
1577 !pc->sides_2sided_short) in _ppdCacheCreateWithPPD()
1578 pc->sides_2sided_short = _cupsStrAlloc(choice->choice); in _ppdCacheCreateWithPPD()
1586 pc->filters = cupsArrayNew3(NULL, NULL, NULL, 0, in _ppdCacheCreateWithPPD()
1590 cupsArrayAdd(pc->filters, in _ppdCacheCreateWithPPD()
1597 cupsArrayAdd(pc->filters, ppd_attr->value); in _ppdCacheCreateWithPPD()
1604 cupsArrayAdd(pc->filters, ppd->filters[i]); in _ppdCacheCreateWithPPD()
1607 cupsArrayAdd(pc->filters, "application/vnd.cups-postscript 0 -"); in _ppdCacheCreateWithPPD()
1613 for (filter = (const char *)cupsArrayFirst(pc->filters); in _ppdCacheCreateWithPPD()
1615 filter = (const char *)cupsArrayNext(pc->filters)) in _ppdCacheCreateWithPPD()
1630 for (filter = (const char *)cupsArrayFirst(pc->filters); in _ppdCacheCreateWithPPD()
1632 filter = (const char *)cupsArrayNext(pc->filters)) in _ppdCacheCreateWithPPD()
1638 cupsArrayAdd(pc->filters, in _ppdCacheCreateWithPPD()
1645 pc->prefilters = cupsArrayNew3(NULL, NULL, NULL, 0, in _ppdCacheCreateWithPPD()
1651 cupsArrayAdd(pc->prefilters, ppd_attr->value); in _ppdCacheCreateWithPPD()
1657 pc->single_file = !_cups_strcasecmp(ppd_attr->value, "true"); in _ppdCacheCreateWithPPD()
1664 pc->product = _cupsStrAlloc(ppd->product); in _ppdCacheCreateWithPPD()
1676 pc->finishings = cupsArrayNew3((cups_array_func_t)pwg_compare_finishings, in _ppdCacheCreateWithPPD()
1690 cupsArrayAdd(pc->finishings, finishings); in _ppdCacheCreateWithPPD()
1703 …pc->finishings = cupsArrayNew3((cups_array_func_t)pwg_compare_finishings, NULL, NULL, 0, NULL, (cu… in _ppdCacheCreateWithPPD()
1712 …pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_TOP_LEFT, "StapleLocation", "SinglePortrai… in _ppdCacheCreateWithPPD()
1714 … pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_TOP_LEFT, "StapleLocation", "UpperLeft"); in _ppdCacheCreateWithPPD()
1716 …pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_TOP_RIGHT, "StapleLocation", "UpperRight"); in _ppdCacheCreateWithPPD()
1718 …pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_BOTTOM_LEFT, "StapleLocation", "SingleLand… in _ppdCacheCreateWithPPD()
1720 …pwg_add_finishing(pc->finishings, IPP_FINISHINGS_STAPLE_DUAL_LEFT, "StapleLocation", "DualLandscap… in _ppdCacheCreateWithPPD()
1730 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_DUAL_LEFT, "RIPunch", "Left2"); in _ppdCacheCreateWithPPD()
1732 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_TRIPLE_LEFT, "RIPunch", "Left3"); in _ppdCacheCreateWithPPD()
1734 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_QUAD_LEFT, "RIPunch", "Left4"); in _ppdCacheCreateWithPPD()
1736 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_DUAL_RIGHT, "RIPunch", "Right2"); in _ppdCacheCreateWithPPD()
1738 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT, "RIPunch", "Right3"); in _ppdCacheCreateWithPPD()
1740 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_QUAD_RIGHT, "RIPunch", "Right4"); in _ppdCacheCreateWithPPD()
1742 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_DUAL_TOP, "RIPunch", "Upper2"); in _ppdCacheCreateWithPPD()
1744 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_TRIPLE_TOP, "RIPunch", "Upper3"); in _ppdCacheCreateWithPPD()
1746 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_PUNCH_QUAD_TOP, "RIPunch", "Upper4"); in _ppdCacheCreateWithPPD()
1756 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_BIND_LEFT, "BindEdge", "Left"); in _ppdCacheCreateWithPPD()
1758 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_BIND_RIGHT, "BindEdge", "Right"); in _ppdCacheCreateWithPPD()
1760 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_BIND_TOP, "BindEdge", "Top"); in _ppdCacheCreateWithPPD()
1762 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_BIND_BOTTOM, "BindEdge", "Bottom"); in _ppdCacheCreateWithPPD()
1772 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_Z, "FoldType", "ZFold"); in _ppdCacheCreateWithPPD()
1774 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_HALF, "FoldType", "Saddle"); in _ppdCacheCreateWithPPD()
1776 … pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_DOUBLE_GATE, "FoldType", "DoubleGate"); in _ppdCacheCreateWithPPD()
1778 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_LEFT_GATE, "FoldType", "LeftGate"); in _ppdCacheCreateWithPPD()
1780 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_RIGHT_GATE, "FoldType", "RightGate"); in _ppdCacheCreateWithPPD()
1782 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_LETTER, "FoldType", "Letter"); in _ppdCacheCreateWithPPD()
1784 pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_POSTER, "FoldType", "XFold"); in _ppdCacheCreateWithPPD()
1794 … pwg_add_finishing(pc->finishings, IPP_FINISHINGS_FOLD_LETTER, "RIFoldType", "OutsideTwoFold"); in _ppdCacheCreateWithPPD()
1797 if (cupsArrayCount(pc->finishings) == 0) in _ppdCacheCreateWithPPD()
1799 cupsArrayDelete(pc->finishings); in _ppdCacheCreateWithPPD()
1800 pc->finishings = NULL; in _ppdCacheCreateWithPPD()
1809 pc->max_copies = atoi(ppd_attr->value); in _ppdCacheCreateWithPPD()
1811 pc->max_copies = 1; in _ppdCacheCreateWithPPD()
1813 pc->max_copies = 9999; in _ppdCacheCreateWithPPD()
1821 pc->charge_info_uri = _cupsStrAlloc(ppd_attr->value); in _ppdCacheCreateWithPPD()
1824 pc->account_id = !_cups_strcasecmp(ppd_attr->value, "true"); in _ppdCacheCreateWithPPD()
1827 pc->accounting_user_id = !_cups_strcasecmp(ppd_attr->value, "true"); in _ppdCacheCreateWithPPD()
1830 pc->password = _cupsStrAlloc(ppd_attr->value); in _ppdCacheCreateWithPPD()
1833 pc->mandatory = _cupsArrayNewStrings(ppd_attr->value, ' '); in _ppdCacheCreateWithPPD()
1839 pc->support_files = cupsArrayNew3(NULL, NULL, NULL, 0, in _ppdCacheCreateWithPPD()
1846 cupsArrayAdd(pc->support_files, ppd_attr->value); in _ppdCacheCreateWithPPD()
1849 cupsArrayAdd(pc->support_files, ppd_attr->value); in _ppdCacheCreateWithPPD()
1855 return (pc); in _ppdCacheCreateWithPPD()
1864 _ppdCacheDestroy(pc); in _ppdCacheCreateWithPPD()
1875 _ppdCacheDestroy(_ppd_cache_t *pc) /* I - PPD cache and mapping data */ in _ppdCacheDestroy() argument
1886 if (!pc) in _ppdCacheDestroy()
1893 if (pc->bins) in _ppdCacheDestroy()
1895 for (i = pc->num_bins, map = pc->bins; i > 0; i --, map ++) in _ppdCacheDestroy()
1901 free(pc->bins); in _ppdCacheDestroy()
1904 if (pc->sizes) in _ppdCacheDestroy()
1906 for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++) in _ppdCacheDestroy()
1912 free(pc->sizes); in _ppdCacheDestroy()
1915 if (pc->source_option) in _ppdCacheDestroy()
1916 _cupsStrFree(pc->source_option); in _ppdCacheDestroy()
1918 if (pc->sources) in _ppdCacheDestroy()
1920 for (i = pc->num_sources, map = pc->sources; i > 0; i --, map ++) in _ppdCacheDestroy()
1926 free(pc->sources); in _ppdCacheDestroy()
1929 if (pc->types) in _ppdCacheDestroy()
1931 for (i = pc->num_types, map = pc->types; i > 0; i --, map ++) in _ppdCacheDestroy()
1937 free(pc->types); in _ppdCacheDestroy()
1940 if (pc->custom_max_keyword) in _ppdCacheDestroy()
1941 _cupsStrFree(pc->custom_max_keyword); in _ppdCacheDestroy()
1943 if (pc->custom_min_keyword) in _ppdCacheDestroy()
1944 _cupsStrFree(pc->custom_min_keyword); in _ppdCacheDestroy()
1946 _cupsStrFree(pc->product); in _ppdCacheDestroy()
1947 cupsArrayDelete(pc->filters); in _ppdCacheDestroy()
1948 cupsArrayDelete(pc->prefilters); in _ppdCacheDestroy()
1949 cupsArrayDelete(pc->finishings); in _ppdCacheDestroy()
1951 _cupsStrFree(pc->charge_info_uri); in _ppdCacheDestroy()
1952 _cupsStrFree(pc->password); in _ppdCacheDestroy()
1954 cupsArrayDelete(pc->mandatory); in _ppdCacheDestroy()
1956 cupsArrayDelete(pc->support_files); in _ppdCacheDestroy()
1958 free(pc); in _ppdCacheDestroy()
1969 _ppd_cache_t *pc, /* I - PPD cache and mapping data */ in _ppdCacheGetBin() argument
1979 if (!pc || !output_bin) in _ppdCacheGetBin()
1987 for (i = 0; i < pc->num_bins; i ++) in _ppdCacheGetBin()
1988 if (!_cups_strcasecmp(output_bin, pc->bins[i].ppd)) in _ppdCacheGetBin()
1989 return (pc->bins[i].pwg); in _ppdCacheGetBin()
2002 _ppd_cache_t *pc, /* I - PPD cache and mapping data */ in _ppdCacheGetFinishingOptions() argument
2019 if (!pc || cupsArrayCount(pc->finishings) == 0 || !options || in _ppdCacheGetFinishingOptions()
2035 if ((f = cupsArrayFind(pc->finishings, &key)) != NULL) in _ppdCacheGetFinishingOptions()
2049 if ((f = cupsArrayFind(pc->finishings, &key)) != NULL) in _ppdCacheGetFinishingOptions()
2070 _ppd_cache_t *pc, /* I - PPD cache and mapping data */ in _ppdCacheGetFinishingValues() argument
2087 …shingValues(pc=%p, num_options=%d, options=%p, max_values=%d, values=%p)", pc, num_options, option… in _ppdCacheGetFinishingValues()
2089 if (!pc || max_values < 1 || !values) in _ppdCacheGetFinishingValues()
2094 else if (!pc->finishings) in _ppdCacheGetFinishingValues()
2104 for (f = (_pwg_finishings_t *)cupsArrayFirst(pc->finishings); in _ppdCacheGetFinishingValues()
2106 f = (_pwg_finishings_t *)cupsArrayNext(pc->finishings)) in _ppdCacheGetFinishingValues()
2157 _ppd_cache_t *pc, /* I - PPD cache and mapping data */ in _ppdCacheGetInputSlot() argument
2165 if (!pc || pc->num_sources == 0 || (!job && !keyword)) in _ppdCacheGetInputSlot()
2206 for (i = 0; i < pc->num_sources; i ++) in _ppdCacheGetInputSlot()
2207 if (!_cups_strcasecmp(keyword, pc->sources[i].pwg)) in _ppdCacheGetInputSlot()
2208 return (pc->sources[i].ppd); in _ppdCacheGetInputSlot()
2222 _ppd_cache_t *pc, /* I - PPD cache and mapping data */ in _ppdCacheGetMediaType() argument
2230 if (!pc || pc->num_types == 0 || (!job && !keyword)) in _ppdCacheGetMediaType()
2260 for (i = 0; i < pc->num_types; i ++) in _ppdCacheGetMediaType()
2261 if (!_cups_strcasecmp(keyword, pc->types[i].pwg)) in _ppdCacheGetMediaType()
2262 return (pc->types[i].ppd); in _ppdCacheGetMediaType()
2276 _ppd_cache_t *pc, /* I - PPD cache and mapping data */ in _ppdCacheGetOutputBin() argument
2286 if (!pc || !output_bin) in _ppdCacheGetOutputBin()
2294 for (i = 0; i < pc->num_bins; i ++) in _ppdCacheGetOutputBin()
2295 if (!_cups_strcasecmp(output_bin, pc->bins[i].pwg)) in _ppdCacheGetOutputBin()
2296 return (pc->bins[i].ppd); in _ppdCacheGetOutputBin()
2309 _ppd_cache_t *pc, /* I - PPD cache and mapping data */ in _ppdCacheGetPageSize() argument
2331 pc, job, keyword, exact)); in _ppdCacheGetPageSize()
2337 if (!pc || (!job && !keyword)) in _ppdCacheGetPageSize()
2378 for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++) in _ppdCacheGetPageSize()
2381 (int)(size - pc->sizes), size->map.pwg, size->map.ppd)); in _ppdCacheGetPageSize()
2436 for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++) in _ppdCacheGetPageSize()
2500 if (jobsize.width >= pc->custom_min_width && in _ppdCacheGetPageSize()
2501 jobsize.width <= pc->custom_max_width && in _ppdCacheGetPageSize()
2502 jobsize.length >= pc->custom_min_length && in _ppdCacheGetPageSize()
2503 jobsize.length <= pc->custom_max_length) in _ppdCacheGetPageSize()
2509 snprintf(pc->custom_ppd_size, sizeof(pc->custom_ppd_size), "Custom.%dx%d", in _ppdCacheGetPageSize()
2514 dleft = pc->custom_size.left - jobsize.left; in _ppdCacheGetPageSize()
2515 dright = pc->custom_size.right - jobsize.right; in _ppdCacheGetPageSize()
2516 dtop = pc->custom_size.top - jobsize.top; in _ppdCacheGetPageSize()
2517 dbottom = pc->custom_size.bottom - jobsize.bottom; in _ppdCacheGetPageSize()
2527 pc->custom_ppd_size)); in _ppdCacheGetPageSize()
2529 return (pc->custom_ppd_size); in _ppdCacheGetPageSize()
2548 _ppd_cache_t *pc, /* I - PPD cache and mapping data */ in _ppdCacheGetSize() argument
2560 if (!pc || !page_size) in _ppdCacheGetSize()
2620 pc->custom_size.width = (int)w; in _ppdCacheGetSize()
2621 pc->custom_size.length = (int)l; in _ppdCacheGetSize()
2623 return (&(pc->custom_size)); in _ppdCacheGetSize()
2630 for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++) in _ppdCacheGetSize()
2645 pc->custom_size.width = media->width; in _ppdCacheGetSize()
2646 pc->custom_size.length = media->length; in _ppdCacheGetSize()
2648 return (&(pc->custom_size)); in _ppdCacheGetSize()
2662 _ppd_cache_t *pc, /* I - PPD cache and mapping data */ in _ppdCacheGetSource() argument
2673 if (!pc || !input_slot) in _ppdCacheGetSource()
2676 for (i = pc->num_sources, source = pc->sources; i > 0; i --, source ++) in _ppdCacheGetSource()
2691 _ppd_cache_t *pc, /* I - PPD cache and mapping data */ in _ppdCacheGetType() argument
2702 if (!pc || !media_type) in _ppdCacheGetType()
2705 for (i = pc->num_types, type = pc->types; i > 0; i --, type ++) in _ppdCacheGetType()
2719 _ppd_cache_t *pc, /* I - PPD cache and mapping data */ in _ppdCacheWriteFile() argument
2737 if (!pc || !filename) in _ppdCacheWriteFile()
2764 if (pc->num_bins > 0) in _ppdCacheWriteFile()
2766 cupsFilePrintf(fp, "NumBins %d\n", pc->num_bins); in _ppdCacheWriteFile()
2767 for (i = pc->num_bins, map = pc->bins; i > 0; i --, map ++) in _ppdCacheWriteFile()
2775 cupsFilePrintf(fp, "NumSizes %d\n", pc->num_sizes); in _ppdCacheWriteFile()
2776 for (i = pc->num_sizes, size = pc->sizes; i > 0; i --, size ++) in _ppdCacheWriteFile()
2780 if (pc->custom_max_width > 0) in _ppdCacheWriteFile()
2782 pc->custom_max_width, pc->custom_max_length, in _ppdCacheWriteFile()
2783 pc->custom_min_width, pc->custom_min_length, in _ppdCacheWriteFile()
2784 pc->custom_size.left, pc->custom_size.bottom, in _ppdCacheWriteFile()
2785 pc->custom_size.right, pc->custom_size.top); in _ppdCacheWriteFile()
2791 if (pc->source_option) in _ppdCacheWriteFile()
2792 cupsFilePrintf(fp, "SourceOption %s\n", pc->source_option); in _ppdCacheWriteFile()
2794 if (pc->num_sources > 0) in _ppdCacheWriteFile()
2796 cupsFilePrintf(fp, "NumSources %d\n", pc->num_sources); in _ppdCacheWriteFile()
2797 for (i = pc->num_sources, map = pc->sources; i > 0; i --, map ++) in _ppdCacheWriteFile()
2805 if (pc->num_types > 0) in _ppdCacheWriteFile()
2807 cupsFilePrintf(fp, "NumTypes %d\n", pc->num_types); in _ppdCacheWriteFile()
2808 for (i = pc->num_types, map = pc->types; i > 0; i --, map ++) in _ppdCacheWriteFile()
2818 if (pc->num_presets[i][j]) in _ppdCacheWriteFile()
2821 for (k = pc->num_presets[i][j], option = pc->presets[i][j]; in _ppdCacheWriteFile()
2832 if (pc->sides_option) in _ppdCacheWriteFile()
2833 cupsFilePrintf(fp, "SidesOption %s\n", pc->sides_option); in _ppdCacheWriteFile()
2835 if (pc->sides_1sided) in _ppdCacheWriteFile()
2836 cupsFilePrintf(fp, "Sides1Sided %s\n", pc->sides_1sided); in _ppdCacheWriteFile()
2838 if (pc->sides_2sided_long) in _ppdCacheWriteFile()
2839 cupsFilePrintf(fp, "Sides2SidedLong %s\n", pc->sides_2sided_long); in _ppdCacheWriteFile()
2841 if (pc->sides_2sided_short) in _ppdCacheWriteFile()
2842 cupsFilePrintf(fp, "Sides2SidedShort %s\n", pc->sides_2sided_short); in _ppdCacheWriteFile()
2848 if (pc->product) in _ppdCacheWriteFile()
2849 cupsFilePutConf(fp, "Product", pc->product); in _ppdCacheWriteFile()
2851 for (value = (const char *)cupsArrayFirst(pc->filters); in _ppdCacheWriteFile()
2853 value = (const char *)cupsArrayNext(pc->filters)) in _ppdCacheWriteFile()
2856 for (value = (const char *)cupsArrayFirst(pc->prefilters); in _ppdCacheWriteFile()
2858 value = (const char *)cupsArrayNext(pc->prefilters)) in _ppdCacheWriteFile()
2861 cupsFilePrintf(fp, "SingleFile %s\n", pc->single_file ? "true" : "false"); in _ppdCacheWriteFile()
2867 for (f = (_pwg_finishings_t *)cupsArrayFirst(pc->finishings); in _ppdCacheWriteFile()
2869 f = (_pwg_finishings_t *)cupsArrayNext(pc->finishings)) in _ppdCacheWriteFile()
2881 cupsFilePrintf(fp, "MaxCopies %d\n", pc->max_copies); in _ppdCacheWriteFile()
2887 if (pc->charge_info_uri) in _ppdCacheWriteFile()
2888 cupsFilePutConf(fp, "ChargeInfoURI", pc->charge_info_uri); in _ppdCacheWriteFile()
2890 cupsFilePrintf(fp, "AccountId %s\n", pc->account_id ? "true" : "false"); in _ppdCacheWriteFile()
2892 pc->accounting_user_id ? "true" : "false"); in _ppdCacheWriteFile()
2894 if (pc->password) in _ppdCacheWriteFile()
2895 cupsFilePutConf(fp, "Password", pc->password); in _ppdCacheWriteFile()
2897 for (value = (char *)cupsArrayFirst(pc->mandatory); in _ppdCacheWriteFile()
2899 value = (char *)cupsArrayNext(pc->mandatory)) in _ppdCacheWriteFile()
2906 for (value = (char *)cupsArrayFirst(pc->support_files); in _ppdCacheWriteFile()
2908 value = (char *)cupsArrayNext(pc->support_files)) in _ppdCacheWriteFile()