From: Bartosz Golaszewski Date: Mon, 9 Feb 2015 17:31:14 +0000 (+0100) Subject: SR_ERR_IO: new error code X-Git-Tag: libsigrok-0.4.0~649 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=3c5582595a024e6221018eced858e62f0bed849b SR_ERR_IO: new error code Add new error code which can be used to notify the user about general input/output errors. Signed-off-by: Bartosz Golaszewski --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index c0ec19ff..353860d9 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -76,6 +76,7 @@ enum sr_error_code { SR_ERR_TIMEOUT = -8, /**< A timeout occurred. */ SR_ERR_CHANNEL_GROUP = -9, /**< A channel group must be specified. */ SR_ERR_DATA =-10, /**< Data is invalid. */ + SR_ERR_IO =-11, /**< Input/output error. */ /* * Note: When adding entries here, don't forget to also update the diff --git a/src/error.c b/src/error.c index d4e22d5a..af920156 100644 --- a/src/error.c +++ b/src/error.c @@ -82,6 +82,8 @@ SR_API const char *sr_strerror(int error_code) return "no channel group specified"; case SR_ERR_DATA: return "data is invalid"; + case SR_ERR_IO: + return "input/output error"; default: return "unknown error"; }