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

Function rigerror

src/rig.c:520–549  ·  view source on GitHub ↗

* @brief Add error message to debug output. * * \param errnum The error code defined in #rig_errcode_e, e.g. RIG_OK. * * @return Pointer to the complete debug output otherwise `"ERR_OUT_OF_RANGE"` * if `errnum` exceeds the number of strings defined in `rigerror_table`. * * @sa add2debugmsgsave() * * \todo Support gettext/localization */

Source from the content-addressed store, hash-verified

518 * \todo Support gettext/localization
519 */
520const char *HAMLIB_API rigerror(int errnum)
521{
522 errnum = abs(errnum);
523
524 if (errnum >= ERROR_TBL_SZ)
525 {
526 // This should not happen, but if it happens don't return NULL
527 return "ERR_OUT_OF_RANGE";
528 }
529
530 static char msg[DEBUGMSGSAVE_SIZE];
531#if 0
532 // we have to remove LF from debugmsgsave since calling function controls LF
533 char *p = &debugmsgsave[strlen(debugmsgsave) - 1];
534
535 if (*p == '\n') { *p = 0; }
536
537#endif
538
539#if 0
540 SNPRINTF(msg, sizeof(msg), "%.80s\n%.15000s%.15000s%.15000s",
541 rigerror_table[errnum],
542 debugmsgsave3, debugmsgsave2, debugmsgsave);
543#else
544 snprintf(msg, sizeof(msg), "%s\n", rigerror_table[errnum]);
545 add2debugmsgsave(msg);
546 snprintf(msg, sizeof(msg), "%s", debugmsgsave);
547#endif
548 return msg;
549}
550
551// We use a couple of defined pointer to determine if the shared library changes
552void *caps_test_rig_model = &caps_test.rig_model;

Callers 15

quisk_closeFunction · 0.85
netrigctl_openFunction · 0.85
netrigctl_closeFunction · 0.85
flrig_openFunction · 0.85
flrig_get_freqFunction · 0.85
flrig_set_modeFunction · 0.85
flrig_get_modeFunction · 0.85
flrig_set_vfoFunction · 0.85
flrig_get_levelFunction · 0.85
tci1x_openFunction · 0.85
tci1x_get_freqFunction · 0.85
tci1x_set_modeFunction · 0.85

Calls 1

add2debugmsgsaveFunction · 0.85

Tested by 7

mainFunction · 0.68
mainFunction · 0.68
rig_test_cwFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
callbackFunction · 0.68
mainFunction · 0.68