* \brief Get the string describing the passed error code. * * Simple version of rigerror() as it only outputs a short predefined string. * * \param errnum The error code defined in #rig_errcode_e, e.g. RIG_OK. * * \return The matched description string from `rigerror_table`, otherwise * `"ERR_OUT_OF_RANGE"` if `errnum` exceeds the number of strings defined in * `rigerror_table`. * * \tod
| 490 | * \todo Support gettext/localization |
| 491 | */ |
| 492 | const char *HAMLIB_API rigerror2(int errnum) // returns single-line message |
| 493 | { |
| 494 | errnum = abs(errnum); |
| 495 | |
| 496 | if (errnum >= ERROR_TBL_SZ) |
| 497 | { |
| 498 | // This should not happen, but if it happens don't return NULL |
| 499 | return "ERR_OUT_OF_RANGE"; |
| 500 | } |
| 501 | |
| 502 | static char msg[DEBUGMSGSAVE_SIZE / 2]; |
| 503 | snprintf(msg, sizeof(msg), "%s\n", rigerror_table[errnum]); |
| 504 | return msg; |
| 505 | } |
| 506 | |
| 507 | |
| 508 | /** |
no outgoing calls
no test coverage detected