libsigrokdecode
unreleased development snapshot
sigrok protocol decoding library
|
Error handling in libsigrokdecode. More...
Functions | |
const char * | srd_strerror (int error_code) |
Return a human-readable error string for the given libsigrokdecode error code. More... | |
const char * | srd_strerror_name (int error_code) |
Return the "name" string of the given libsigrokdecode error code. More... | |
Error handling in libsigrokdecode.
libsigrokdecode functions usually return SRD_OK upon success, or a negative error code on failure.
const char* srd_strerror | ( | int | error_code | ) |
Return a human-readable error string for the given libsigrokdecode error code.
error_code | A libsigrokdecode error code number, such as SRD_ERR_MALLOC. |
Definition at line 55 of file error.c.
References SRD_ERR, SRD_ERR_ARG, SRD_ERR_BUG, SRD_ERR_DECODERS_DIR, SRD_ERR_MALLOC, SRD_ERR_PYTHON, and SRD_OK.
const char* srd_strerror_name | ( | int | error_code | ) |
Return the "name" string of the given libsigrokdecode error code.
For example, the "name" of the SRD_ERR_MALLOC error code is "SRD_ERR_MALLOC", the name of the SRD_OK code is "SRD_OK", and so on.
This function can be used for various purposes where the "name" string of a libsigrokdecode error code is useful.
error_code | A libsigrokdecode error code number, such as SRD_ERR_MALLOC. |
Definition at line 113 of file error.c.
References SRD_ERR, SRD_ERR_ARG, SRD_ERR_BUG, SRD_ERR_DECODERS_DIR, SRD_ERR_MALLOC, SRD_ERR_PYTHON, and SRD_OK.