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

Function _cupsSetError

cups/request.c:1085–1129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1083 */
1084
1085void
1086_cupsSetError(ipp_status_t status, /* I - IPP status code */
1087 const char *message, /* I - status-message value */
1088 int localize) /* I - Localize the message? */
1089{
1090 _cups_globals_t *cg; /* Global data */
1091
1092
1093 if (!message && errno)
1094 {
1095 message = strerror(errno);
1096 localize = 0;
1097 }
1098
1099 cg = _cupsGlobals();
1100 cg->last_error = status;
1101
1102 if (cg->last_status_message)
1103 {
1104 _cupsStrFree(cg->last_status_message);
1105
1106 cg->last_status_message = NULL;
1107 }
1108
1109 if (message)
1110 {
1111 if (localize)
1112 {
1113 /*
1114 * Get the message catalog...
1115 */
1116
1117 if (!cg->lang_default)
1118 cg->lang_default = cupsLangDefault();
1119
1120 cg->last_status_message = _cupsStrAlloc(_cupsLangString(cg->lang_default,
1121 message));
1122 }
1123 else
1124 cg->last_status_message = _cupsStrAlloc(message);
1125 }
1126
1127 DEBUG_printf(("4_cupsSetError: last_error=%s, last_status_message=\"%s\"",
1128 ippErrorString(cg->last_error), cg->last_status_message));
1129}
1130
1131
1132/*

Callers 15

do_testFunction · 0.85
cupsSetServerCredentialsFunction · 0.85
httpCredentialsGetTrustFunction · 0.85
_httpTLSStartFunction · 0.85
_httpTLSStopFunction · 0.85
http-addrlist.cFile · 0.85
httpAddrGetListFunction · 0.85
httpAddrListenFunction · 0.85
get_cupsd_confFunction · 0.85

Calls 6

_cupsGlobalsFunction · 0.85
_cupsStrFreeFunction · 0.85
cupsLangDefaultFunction · 0.85
_cupsStrAllocFunction · 0.85
_cupsLangStringFunction · 0.85
ippErrorStringFunction · 0.85

Tested by

no test coverage detected