• Home
  • Raw
  • Download

Lines Matching refs:ppd

176 			         ppd_info_t *ppd, cups_file_t *fp, off_t end);
242 ppd_info_t *ppd; /* PPD */ in add_ppd() local
250 if ((ppd = (ppd_info_t *)calloc(1, sizeof(ppd_info_t))) == NULL) in add_ppd()
262 ppd->found = 1; in add_ppd()
263 ppd->record.mtime = mtime; in add_ppd()
264 ppd->record.size = (off_t)size; in add_ppd()
265 ppd->record.model_number = model_number; in add_ppd()
266 ppd->record.type = type; in add_ppd()
268 strlcpy(ppd->record.filename, filename, sizeof(ppd->record.filename)); in add_ppd()
269 strlcpy(ppd->record.name, name, sizeof(ppd->record.name)); in add_ppd()
270 strlcpy(ppd->record.languages[0], language, in add_ppd()
271 sizeof(ppd->record.languages[0])); in add_ppd()
272 strlcpy(ppd->record.products[0], product, sizeof(ppd->record.products[0])); in add_ppd()
273 strlcpy(ppd->record.psversions[0], psversion, in add_ppd()
274 sizeof(ppd->record.psversions[0])); in add_ppd()
275 strlcpy(ppd->record.make, make, sizeof(ppd->record.make)); in add_ppd()
276 strlcpy(ppd->record.make_and_model, make_and_model, in add_ppd()
277 sizeof(ppd->record.make_and_model)); in add_ppd()
278 strlcpy(ppd->record.device_id, device_id, sizeof(ppd->record.device_id)); in add_ppd()
279 strlcpy(ppd->record.scheme, scheme, sizeof(ppd->record.scheme)); in add_ppd()
286 if ((recommended = strstr(ppd->record.make_and_model, in add_ppd()
294 cupsArrayAdd(PPDsByName, ppd); in add_ppd()
295 cupsArrayAdd(PPDsByMakeModel, ppd); in add_ppd()
301 return (ppd); in add_ppd()
781 ppd_info_t *ppd; /* Current PPD */ in dump_ppds_dat() local
797 for (ppd = (ppd_info_t *)cupsArrayFirst(PPDsByName); in dump_ppds_dat()
798 ppd; in dump_ppds_dat()
799 ppd = (ppd_info_t *)cupsArrayNext(PPDsByName)) in dump_ppds_dat()
802 (int)ppd->record.mtime, (long)ppd->record.size, in dump_ppds_dat()
803 ppd->record.model_number, ppd->record.type, ppd->record.filename, in dump_ppds_dat()
804 ppd->record.name, ppd->record.languages[0], ppd->record.products[0], in dump_ppds_dat()
805 ppd->record.psversions[0], ppd->record.make, in dump_ppds_dat()
806 ppd->record.make_and_model, ppd->record.device_id, in dump_ppds_dat()
807 ppd->record.scheme); in dump_ppds_dat()
1010 ppd_info_t *ppd; /* Current PPD file */ in list_ppds() local
1109 for (ppd = (ppd_info_t *)cupsArrayFirst(PPDsByName); in list_ppds()
1110 ppd; in list_ppds()
1111 ppd = (ppd_info_t *)cupsArrayNext(PPDsByName)) in list_ppds()
1112 if (!ppd->found) in list_ppds()
1118 cupsArrayRemove(PPDsByName, ppd); in list_ppds()
1119 cupsArrayRemove(PPDsByMakeModel, ppd); in list_ppds()
1120 free(ppd); in list_ppds()
1143 for (ppd = (ppd_info_t *)cupsArrayFirst(PPDsByName); in list_ppds()
1144 ppd; in list_ppds()
1145 ppd = (ppd_info_t *)cupsArrayNext(PPDsByName)) in list_ppds()
1146 cupsFileWrite(fp, (char *)&(ppd->record), sizeof(ppd_rec_t)); in list_ppds()
1301 for (ppd = (ppd_info_t *)cupsArrayFirst(PPDsByMakeModel); in list_ppds()
1302 ppd; in list_ppds()
1303 ppd = (ppd_info_t *)cupsArrayNext(PPDsByMakeModel)) in list_ppds()
1314 if (ppd->record.type < PPD_TYPE_POSTSCRIPT || in list_ppds()
1315 ppd->record.type >= PPD_TYPE_DRV) in list_ppds()
1318 if (cupsArrayFind(exclude, ppd->record.scheme) || in list_ppds()
1319 (include && !cupsArrayFind(include, ppd->record.scheme))) in list_ppds()
1322 ppd->matches = 0; in list_ppds()
1325 !regexec(device_id_re, ppd->record.device_id, in list_ppds()
1336 ppd->matches ++; in list_ppds()
1342 if (!ppd->record.languages[i][0]) in list_ppds()
1344 else if (!strcmp(ppd->record.languages[i], language)) in list_ppds()
1346 ppd->matches ++; in list_ppds()
1351 if (make && !_cups_strcasecmp(ppd->record.make, make)) in list_ppds()
1352 ppd->matches ++; in list_ppds()
1355 !regexec(make_and_model_re, ppd->record.make_and_model, in list_ppds()
1363 ppd->matches += 3; // Exact match in list_ppds()
1365 ppd->matches += 2; // Prefix match in list_ppds()
1368 ppd->matches ++; // Infix match in list_ppds()
1371 if (model_number_str && ppd->record.model_number == model_number) in list_ppds()
1372 ppd->matches ++; in list_ppds()
1377 if (!ppd->record.products[i][0]) in list_ppds()
1379 else if (!_cups_strcasecmp(ppd->record.products[i], product)) in list_ppds()
1381 ppd->matches += 3; in list_ppds()
1384 else if (!_cups_strncasecmp(ppd->record.products[i], product, in list_ppds()
1387 ppd->matches += 2; in list_ppds()
1395 if (!ppd->record.psversions[i][0]) in list_ppds()
1397 else if (!_cups_strcasecmp(ppd->record.psversions[i], psversion)) in list_ppds()
1399 ppd->matches ++; in list_ppds()
1404 if (type_str && ppd->record.type == type) in list_ppds()
1405 ppd->matches ++; in list_ppds()
1407 if (ppd->matches) in list_ppds()
1410 ppd->record.name, ppd->matches); in list_ppds()
1411 cupsArrayAdd(matches, ppd); in list_ppds()
1419 for (ppd = (ppd_info_t *)cupsArrayFirst(PPDsByMakeModel); in list_ppds()
1420 ppd; in list_ppds()
1421 ppd = (ppd_info_t *)cupsArrayNext(PPDsByMakeModel)) in list_ppds()
1427 if (ppd->record.type < PPD_TYPE_POSTSCRIPT || in list_ppds()
1428 ppd->record.type >= PPD_TYPE_DRV) in list_ppds()
1431 if (cupsArrayFind(exclude, ppd->record.scheme) || in list_ppds()
1432 (include && !cupsArrayFind(include, ppd->record.scheme))) in list_ppds()
1435 cupsArrayAdd(matches, ppd); in list_ppds()
1441 for (ppd = (ppd_info_t *)cupsArrayFirst(matches); in list_ppds()
1442 count > 0 && ppd; in list_ppds()
1443 ppd = (ppd_info_t *)cupsArrayNext(matches)) in list_ppds()
1449 if (ppd->record.type < PPD_TYPE_POSTSCRIPT || in list_ppds()
1450 ppd->record.type >= PPD_TYPE_DRV) in list_ppds()
1472 ppd->record.name, ppd->record.make_and_model); in list_ppds()
1481 cupsdSendIPPString(IPP_TAG_NAME, "ppd-name", ppd->record.name); in list_ppds()
1486 ppd->record.languages[0]); in list_ppds()
1488 for (i = 1; i < PPD_MAX_LANG && ppd->record.languages[i][0]; i ++) in list_ppds()
1489 cupsdSendIPPString(IPP_TAG_LANGUAGE, "", ppd->record.languages[i]); in list_ppds()
1493 cupsdSendIPPString(IPP_TAG_TEXT, "ppd-make", ppd->record.make); in list_ppds()
1497 ppd->record.make_and_model); in list_ppds()
1501 ppd->record.device_id); in list_ppds()
1506 ppd->record.products[0]); in list_ppds()
1508 for (i = 1; i < PPD_MAX_PROD && ppd->record.products[i][0]; i ++) in list_ppds()
1509 cupsdSendIPPString(IPP_TAG_TEXT, "", ppd->record.products[i]); in list_ppds()
1515 ppd->record.psversions[0]); in list_ppds()
1517 for (i = 1; i < PPD_MAX_VERS && ppd->record.psversions[i][0]; i ++) in list_ppds()
1518 cupsdSendIPPString(IPP_TAG_TEXT, "", ppd->record.psversions[i]); in list_ppds()
1523 if (ppd->record.type < PPD_TYPE_POSTSCRIPT || ppd->record.type > PPD_TYPE_ARCHIVE) in list_ppds()
1534 cupsdSendIPPString(IPP_TAG_KEYWORD, "ppd-type", PPDTypes[ppd->record.type]); in list_ppds()
1539 ppd->record.model_number); in list_ppds()
1542 printf("%s (%s)\n", ppd->record.name, ppd->record.make_and_model); in list_ppds()
1555 for (this_make = ppd->record.make, in list_ppds()
1556 ppd = (ppd_info_t *)cupsArrayNext(matches); in list_ppds()
1557 ppd; in list_ppds()
1558 ppd = (ppd_info_t *)cupsArrayNext(matches)) in list_ppds()
1559 if (_cups_strcasecmp(this_make, ppd->record.make)) in list_ppds()
1600 ppd_info_t *ppd; // Current PPD in load_drv() local
1678 ppd = NULL; in load_drv()
1684ppd = add_ppd(name, uri, "en", d->manufacturer->value, make_model, device_id ? device_id->value->v… in load_drv()
1687 …strlcpy(ppd->record.products[products_found], product->value->value, sizeof(ppd->record.products[0… in load_drv()
1735 ppd_info_t *ppd; /* Newly added PPD */ in load_drivers() local
1900 ppd = add_ppd(filename, name, languages, make, make_and_model, in load_drivers()
1903 if (!ppd) in load_drivers()
1919 strlcpy(ppd->record.languages[i], start, in load_drivers()
1920 sizeof(ppd->record.languages[0])); in load_drivers()
1953 ppd_info_t *ppd, /* I - Existing PPD file or NULL */ in load_ppd() argument
2277 new_ppd = !ppd; in load_ppd()
2287ppd = add_ppd(name, name, lang_version, manufacturer, make_model, device_id, (char *)cupsArrayFirs… in load_ppd()
2289 if (!ppd) in load_ppd()
2300 memset(ppd, 0, sizeof(ppd_info_t)); in load_ppd()
2302 ppd->found = 1; in load_ppd()
2303 ppd->record.mtime = fileinfo->st_mtime; in load_ppd()
2304 ppd->record.size = fileinfo->st_size; in load_ppd()
2305 ppd->record.model_number = model_number; in load_ppd()
2306 ppd->record.type = type; in load_ppd()
2308 strlcpy(ppd->record.filename, name, sizeof(ppd->record.filename)); in load_ppd()
2309 strlcpy(ppd->record.name, name, sizeof(ppd->record.name)); in load_ppd()
2310 strlcpy(ppd->record.languages[0], lang_version, in load_ppd()
2311 sizeof(ppd->record.languages[0])); in load_ppd()
2312 strlcpy(ppd->record.products[0], (char *)cupsArrayFirst(products), in load_ppd()
2313 sizeof(ppd->record.products[0])); in load_ppd()
2314 strlcpy(ppd->record.psversions[0], (char *)cupsArrayFirst(psversions), in load_ppd()
2315 sizeof(ppd->record.psversions[0])); in load_ppd()
2316 strlcpy(ppd->record.make, manufacturer, sizeof(ppd->record.make)); in load_ppd()
2317 strlcpy(ppd->record.make_and_model, make_model, in load_ppd()
2318 sizeof(ppd->record.make_and_model)); in load_ppd()
2319 strlcpy(ppd->record.device_id, device_id, sizeof(ppd->record.device_id)); in load_ppd()
2320 strlcpy(ppd->record.scheme, scheme, sizeof(ppd->record.scheme)); in load_ppd()
2330 strlcpy(ppd->record.products[i], ptr, in load_ppd()
2331 sizeof(ppd->record.products[0])); in load_ppd()
2336 strlcpy(ppd->record.psversions[i], ptr, in load_ppd()
2337 sizeof(ppd->record.psversions[0])); in load_ppd()
2342 strlcpy(ppd->record.languages[i], ptr, in load_ppd()
2343 sizeof(ppd->record.languages[0])); in load_ppd()
2375 ppd_info_t *ppd, /* New PPD file */ in load_ppds() local
2498 ppd = (ppd_info_t *)cupsArrayFind(PPDsByName, &key); in load_ppds()
2500 if (ppd && in load_ppds()
2501 ppd->record.size == dent->fileinfo.st_size && in load_ppds()
2502 ppd->record.mtime == dent->fileinfo.st_mtime) in load_ppds()
2508 while ((ppd = (ppd_info_t *)cupsArrayPrev(PPDsByName)) != NULL && in load_ppds()
2509 !strcmp(ppd->record.filename, name)); in load_ppds()
2515 while ((ppd = (ppd_info_t *)cupsArrayNext(PPDsByName)) != NULL && in load_ppds()
2516 !strcmp(ppd->record.filename, name)) in load_ppds()
2517 ppd->found = 1; in load_ppds()
2542 load_ppd(filename, name, "file", &dent->fileinfo, ppd, fp, 0); in load_ppds()
2583 ppd_info_t *ppd; /* Current PPD file */ in load_ppds_dat() local
2622 if ((ppd = (ppd_info_t *)calloc(1, sizeof(ppd_info_t))) == NULL) in load_ppds_dat()
2630 if (cupsFileRead(fp, (char *)&(ppd->record), sizeof(ppd_rec_t)) > 0) in load_ppds_dat()
2632 cupsArrayAdd(PPDsByName, ppd); in load_ppds_dat()
2633 cupsArrayAdd(PPDsByMakeModel, ppd); in load_ppds_dat()
2637 free(ppd); in load_ppds_dat()