From: Uwe Hermann Date: Tue, 22 Feb 2011 17:13:32 +0000 (+0100) Subject: sr_exit(): Return int to be able to report errors. X-Git-Tag: libsigrok-0.1.0~310 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=cd009d55619181e2fa7e7112f32fe85e4b49cf14;p=libsigrok.git sr_exit(): Return int to be able to report errors. --- 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 -----------------------------------------------------------*/