328
328
*pc_file_name++ = '\0';
331
if (!strncmp(resource, "/Library/Printers/PPDs.drv/", 27))
331
if (!strncmp(resource, "/Library/Printers/PPDs/Contents/Resources/", 42) ||
332
!strncmp(resource, "/System/Library/Printers/PPDs/Contents/Resources/", 49))
332
333
strlcpy(filename, resource, sizeof(filename));
334
335
#endif // __APPLE__
1493
1494
ppd->record.size == dent->fileinfo.st_size &&
1494
1495
ppd->record.mtime == dent->fileinfo.st_mtime)
1498
* Rewind to the first entry for this file...
1501
while ((ppd = (ppd_info_t *)cupsArrayPrev(PPDsByName)) != NULL &&
1502
!strcmp(ppd->record.filename, name));
1505
* Then mark all of the matches for this file as found...
1508
while ((ppd = (ppd_info_t *)cupsArrayNext(PPDsByName)) != NULL &&
1509
!strcmp(ppd->record.filename, name))
1498
1510
ppd->found = 1;
1500
while ((ppd = (ppd_info_t *)cupsArrayNext(PPDsByName)) != NULL &&
1501
!strcmp(ppd->record.filename, name));
1904
1913
*cups_fax, // cupsFax attribute
1905
1914
*nick_name; // NickName attribute
1906
1915
ppdcFilter *filter; // Current filter
1907
bool product_found; // Found product?
1916
ppd_info_t *ppd; // Current PPD
1917
int products_found; // Number of products found
1908
1918
char uri[1024], // Driver URI
1909
1919
make_model[1024]; // Make and model
1910
1920
int type; // Driver type
1929
1939
* Add a dummy entry for the file...
1932
add_ppd(filename, filename, "", "", "", "", "", "", mtime, size, 0,
1942
add_ppd(name, name, "", "", "", "", "", "", mtime, size, 0,
1933
1943
PPD_TYPE_DRV, "drv");
1934
1944
ChangedPPD = 1;
1981
1991
type = PPD_TYPE_PDF;
1984
for (product = (ppdcAttr *)d->attrs->first(), product_found = false;
1994
for (product = (ppdcAttr *)d->attrs->first(), products_found = 0;
1986
1996
product = (ppdcAttr *)d->attrs->next())
1987
1997
if (!strcmp(product->name->value, "Product"))
1989
product_found = true;
1999
if (!products_found)
2000
ppd = add_ppd(name, uri, "en", d->manufacturer->value, make_model,
2001
device_id ? device_id->value->value : "",
2002
product->value->value,
2003
ps_version ? ps_version->value->value : "(3010) 0",
2004
mtime, size, d->model_number, type, "drv");
2005
else if (products_found < PPD_MAX_PROD)
2006
strlcpy(ppd->record.products[products_found], product->value->value,
2007
sizeof(ppd->record.products[0]));
1991
add_ppd(filename, uri, "en", d->manufacturer->value, make_model,
1992
device_id ? device_id->value->value : "",
1993
product->value->value,
1994
ps_version ? ps_version->value->value : "(3010) 0",
1995
mtime, size, d->model_number, type, "drv");
1999
add_ppd(filename, uri, "en", d->manufacturer->value, make_model,
2014
if (!products_found)
2015
add_ppd(name, uri, "en", d->manufacturer->value, make_model,
2000
2016
device_id ? device_id->value->value : "",
2001
2017
d->model_name->value,
2002
2018
ps_version ? ps_version->value->value : "(3010) 0",