MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / rigerror2

Function rigerror2

src/rig.c:492–505  ·  view source on GitHub ↗

* \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

Source from the content-addressed store, hash-verified

490 * \todo Support gettext/localization
491 */
492const 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/**

Callers 4

list_modelsFunction · 0.85
list_modelsFunction · 0.85
usage_rigFunction · 0.85
list_modelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected