diff --git a/backend.c b/backend.c index 2bf9d41a..b5276647 100644 --- a/backend.c +++ b/backend.c @@ -21,13 +21,24 @@ #include #include +/** + * Initialize libsigrok. + * + * @return SR_OK upon success, a (negative) error code otherwise. + */ int sr_init(void) { return load_hwplugins(); } -/* TODO: Should return int to be able to report back error codes. */ -void sr_exit(void) +/** + * Shutdown libsigrok. + * + * @return SR_OK upon success, a (negative) error code otherwise. + */ +int sr_exit(void) { sr_device_close_all(); + + return SR_OK; } diff --git a/sigrok-proto.h b/sigrok-proto.h index 65fd4362..dc29721a 100644 --- a/sigrok-proto.h +++ b/sigrok-proto.h @@ -23,7 +23,7 @@ /*--- backend.c -------------------------------------------------------------*/ int sr_init(void); -void sr_exit(void); +int sr_exit(void); /*--- datastore.c -----------------------------------------------------------*/