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

Function _ppdOpenFile

cups/ppd.c:2265–2309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2263 */
2264
2265ppd_file_t * /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
2266_ppdOpenFile(const char *filename, /* I - File to read from */
2267 _ppd_localization_t localization) /* I - Localization to load */
2268{
2269 cups_file_t *fp; /* File pointer */
2270 ppd_file_t *ppd; /* PPD file record */
2271 _ppd_globals_t *pg = _ppdGlobals();
2272 /* Global data */
2273
2274
2275 /*
2276 * Set the line number to 0...
2277 */
2278
2279 pg->ppd_line = 0;
2280
2281 /*
2282 * Range check input...
2283 */
2284
2285 if (filename == NULL)
2286 {
2287 pg->ppd_status = PPD_NULL_FILE;
2288
2289 return (NULL);
2290 }
2291
2292 /*
2293 * Try to open the file and parse it...
2294 */
2295
2296 if ((fp = cupsFileOpen(filename, "r")) != NULL)
2297 {
2298 ppd = _ppdOpen(fp, localization);
2299
2300 cupsFileClose(fp);
2301 }
2302 else
2303 {
2304 pg->ppd_status = PPD_FILE_OPEN_ERROR;
2305 ppd = NULL;
2306 }
2307
2308 return (ppd);
2309}
2310
2311
2312/*

Callers 7

add_printer_filtersFunction · 0.85
apple_register_profilesFunction · 0.85
colord_register_printerFunction · 0.85
add_printerFunction · 0.85
load_ppdFunction · 0.85
mainFunction · 0.85
ppdOpenFileFunction · 0.85

Calls 4

_ppdGlobalsFunction · 0.85
cupsFileOpenFunction · 0.85
_ppdOpenFunction · 0.85
cupsFileCloseFunction · 0.85

Tested by 1

mainFunction · 0.68