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

Function ippErrorString

cups/ipp-support.c:2239–2276  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2237 */
2238
2239const char * /* O - Text string */
2240ippErrorString(ipp_status_t error) /* I - Error status */
2241{
2242 _cups_globals_t *cg = _cupsGlobals(); /* Pointer to library globals */
2243
2244
2245 /*
2246 * See if the error code is a known value...
2247 */
2248
2249 if (error >= IPP_STATUS_OK && error <= IPP_STATUS_OK_EVENTS_COMPLETE)
2250 return (ipp_status_oks[error]);
2251 else if (error == IPP_STATUS_REDIRECTION_OTHER_SITE)
2252 return ("redirection-other-site");
2253 else if (error == IPP_STATUS_CUPS_SEE_OTHER)
2254 return ("cups-see-other");
2255 else if (error >= IPP_STATUS_ERROR_BAD_REQUEST &&
2256 error <= IPP_STATUS_ERROR_ACCOUNT_AUTHORIZATION_FAILED)
2257 return (ipp_status_400s[error - IPP_STATUS_ERROR_BAD_REQUEST]);
2258 else if (error >= 0x480 &&
2259 error <= IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED)
2260 return (ipp_status_480s[error - 0x0480]);
2261 else if (error >= IPP_STATUS_ERROR_INTERNAL &&
2262 error <= IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS)
2263 return (ipp_status_500s[error - IPP_STATUS_ERROR_INTERNAL]);
2264 else if (error >= IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED &&
2265 error <= IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED)
2266 return (ipp_status_1000s[error -
2267 IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED]);
2268
2269 /*
2270 * No, build an "0xxxxx" error string...
2271 */
2272
2273 snprintf(cg->ipp_unknown, sizeof(cg->ipp_unknown), "0x%04x", error);
2274
2275 return (cg->ipp_unknown);
2276}
2277
2278
2279/*

Callers 15

do_testFunction · 0.85
debug_attributesFunction · 0.85
respond_ippFunction · 0.85
cupsdLogRequestFunction · 0.85
mainFunction · 0.85
create_local_bg_threadFunction · 0.85
send_ipp_statusFunction · 0.85
send_responseFunction · 0.85
mainFunction · 0.85
check_printer_stateFunction · 0.85
monitor_printerFunction · 0.85
mainFunction · 0.85

Calls 1

_cupsGlobalsFunction · 0.85

Tested by 2

mainFunction · 0.68
show_attributesFunction · 0.68