X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=backend.c;h=0e22e6ed00a5eddff32bf8ad70ca1b3edecc1ea9;hb=c37d2b1ba12b62d63590509879bf58adf842896d;hp=17983cd7a51a9537fffb8f5e30c5f94229f2b66c;hpb=2bf4aca64ad435a09359662446762840ac55db1d;p=libsigrok.git diff --git a/backend.c b/backend.c index 17983cd7..0e22e6ed 100644 --- a/backend.c +++ b/backend.c @@ -18,15 +18,27 @@ */ #include -#include +#include "sigrok.h" +#include "sigrok-internal.h" +/** + * 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(); + sr_cleanup_hwplugins(); + + return SR_OK; }