X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=backend.c;h=0e22e6ed00a5eddff32bf8ad70ca1b3edecc1ea9;hb=4abf8dd0a540db8c8f5af5e6bd78c6eb7b473d9f;hp=4edc78123b41269d5c8aba4e7902956ec53bcc78;hpb=484760d1a8a26ba830b3d63d1451dc30985babd1;p=libsigrok.git diff --git a/backend.c b/backend.c index 4edc7812..0e22e6ed 100644 --- a/backend.c +++ b/backend.c @@ -18,15 +18,27 @@ */ #include -#include +#include "sigrok.h" +#include "sigrok-internal.h" -int sigrok_init(void) +/** + * 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 sigrok_cleanup(void) +/** + * Shutdown libsigrok. + * + * @return SR_OK upon success, a (negative) error code otherwise. + */ +int sr_exit(void) { - device_close_all(); + sr_cleanup_hwplugins(); + + return SR_OK; }