Add new error code which can be used to notify the user about
general input/output errors.

Signed-off-by: Bartosz Golaszewski <bgolaszew...@baylibre.com>
---
 include/libsigrok/libsigrok.h | 1 +
 src/error.c                   | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h
index ced0346..4eef903 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 d4e22d5..af92015 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";
        }
-- 
2.1.4


------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to