/* Return a pointer to a string containing the name of the symbol of the error code in the error value ERR. Returns NULL if the error code is not known. */ const char *prelude_strerror_sym(prelude_error_t err) { int idx; prelude_error_code_t code = prelude_error_get_code(err); if ( code & PRELUDE_ERROR_SYSTEM_ERROR ) { code &= ~PRELUDE_ERROR_SYSTEM_ERROR; idx = errnos_msgidxof (code); if ( idx >= 0 ) return errnos_msgstr + errnos_msgidx[idx]; else return NULL; } if ( msgidxof(code) == msgidxof(PRELUDE_ERROR_CODE_DIM) ) return NULL; return msgstr + msgidx[msgidxof(code)]; }
/* Return a pointer to a string containing the name of the symbol of the error code in the error value ERR. Returns NULL if the error code is not known. */ const char * gpg_strerror_sym (gpg_error_t err) { gpg_err_code_t code = gpg_err_code (err); if (code & GPG_ERR_SYSTEM_ERROR) { int idx; code &= ~GPG_ERR_SYSTEM_ERROR; idx = errnos_msgidxof (code); if (idx >= 0) return errnos_msgstr + errnos_msgidx[idx]; else return NULL; } if (msgidxof (code) == msgidxof (GPG_ERR_CODE_DIM)) return NULL; return msgstr + msgidx[msgidxof (code)]; }