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

Function ppdOpenFd

cups/ppd.c:2215–2258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2213 */
2214
2215ppd_file_t * /* O - PPD file record or @code NULL@ if the PPD file could not be opened. */
2216ppdOpenFd(int fd) /* I - File to read from */
2217{
2218 cups_file_t *fp; /* CUPS file pointer */
2219 ppd_file_t *ppd; /* PPD file record */
2220 _ppd_globals_t *pg = _ppdGlobals();
2221 /* Global data */
2222
2223
2224 /*
2225 * Set the line number to 0...
2226 */
2227
2228 pg->ppd_line = 0;
2229
2230 /*
2231 * Range check input...
2232 */
2233
2234 if (fd < 0)
2235 {
2236 pg->ppd_status = PPD_NULL_FILE;
2237
2238 return (NULL);
2239 }
2240
2241 /*
2242 * Try to open the file and parse it...
2243 */
2244
2245 if ((fp = cupsFileOpenFd(fd, "r")) != NULL)
2246 {
2247 ppd = ppdOpen2(fp);
2248
2249 cupsFileClose(fp);
2250 }
2251 else
2252 {
2253 pg->ppd_status = PPD_FILE_OPEN_ERROR;
2254 ppd = NULL;
2255 }
2256
2257 return (ppd);
2258}
2259
2260
2261/*

Callers

nothing calls this directly

Calls 4

_ppdGlobalsFunction · 0.85
cupsFileOpenFdFunction · 0.85
ppdOpen2Function · 0.85
cupsFileCloseFunction · 0.85

Tested by

no test coverage detected