libsigrok
0.4.0
sigrok hardware access and backend library
|
Error handling in libsigrok. More...
Functions | |
const char * | sr_strerror (int error_code) |
Return a human-readable error string for the given libsigrok error code. More... | |
const char * | sr_strerror_name (int error_code) |
Return the "name" string of the given libsigrok error code. More... | |
Error handling in libsigrok.
libsigrok functions usually return SR_OK upon success, or a negative error code on failure.
const char* sr_strerror | ( | int | error_code | ) |
Return a human-readable error string for the given libsigrok error code.
error_code | A libsigrok error code number, such as SR_ERR_MALLOC. |
Definition at line 54 of file error.c.
References SR_ERR, SR_ERR_ARG, SR_ERR_BUG, SR_ERR_CHANNEL_GROUP, SR_ERR_DATA, SR_ERR_DEV_CLOSED, SR_ERR_IO, SR_ERR_MALLOC, SR_ERR_NA, SR_ERR_SAMPLERATE, SR_ERR_TIMEOUT, and SR_OK.
Referenced by sr_session_dev_add().
const char* sr_strerror_name | ( | int | error_code | ) |
Return the "name" string of the given libsigrok error code.
For example, the "name" of the SR_ERR_MALLOC error code is "SR_ERR_MALLOC", the name of the SR_OK code is "SR_OK", and so on.
This function can be used for various purposes where the "name" string of a libsigrok error code is useful.
error_code | A libsigrok error code number, such as SR_ERR_MALLOC. |
Definition at line 109 of file error.c.
References SR_ERR, SR_ERR_ARG, SR_ERR_BUG, SR_ERR_CHANNEL_GROUP, SR_ERR_DATA, SR_ERR_DEV_CLOSED, SR_ERR_IO, SR_ERR_MALLOC, SR_ERR_NA, SR_ERR_SAMPLERATE, SR_ERR_TIMEOUT, and SR_OK.