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

Function cupsBackendDeviceURI

cups/backend.c:38–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 */
37
38const char * /* O - Device URI or @code NULL@ */
39cupsBackendDeviceURI(char **argv) /* I - Command-line arguments */
40{
41 const char *device_uri, /* Device URI */
42 *auth_info_required; /* AUTH_INFO_REQUIRED env var */
43 _cups_globals_t *cg = _cupsGlobals(); /* Global info */
44 int options; /* Resolve options */
45 ppd_file_t *ppd; /* PPD file */
46 ppd_attr_t *ppdattr; /* PPD attribute */
47
48
49 if ((device_uri = getenv("DEVICE_URI")) == NULL)
50 {
51 if (!argv || !argv[0] || !strchr(argv[0], ':'))
52 return (NULL);
53
54 device_uri = argv[0];
55 }
56
57 options = _HTTP_RESOLVE_STDERR;
58 if ((auth_info_required = getenv("AUTH_INFO_REQUIRED")) != NULL &&
59 !strcmp(auth_info_required, "negotiate"))
60 options |= _HTTP_RESOLVE_FQDN;
61
62 if ((ppd = ppdOpenFile(getenv("PPD"))) != NULL)
63 {
64 if ((ppdattr = ppdFindAttr(ppd, "cupsIPPFaxOut", NULL)) != NULL &&
65 !_cups_strcasecmp(ppdattr->value, "true"))
66 options |= _HTTP_RESOLVE_FAXOUT;
67
68 ppdClose(ppd);
69 }
70
71 return (_httpResolveURI(device_uri, cg->resolved_uri,
72 sizeof(cg->resolved_uri), options, NULL, NULL));
73}
74
75
76/*

Callers 5

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
exec_backendFunction · 0.85

Calls 5

_cupsGlobalsFunction · 0.85
ppdOpenFileFunction · 0.85
ppdFindAttrFunction · 0.85
_cups_strcasecmpFunction · 0.85
ppdCloseFunction · 0.85

Tested by

no test coverage detected