X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=backend.c;h=8f5fd1f449e8e26b3efa11c10f2c09713036c72a;hb=dff75c0df1be07db2e63ef242e843c925779bddb;hp=4edc78123b41269d5c8aba4e7902956ec53bcc78;hpb=484760d1a8a26ba830b3d63d1451dc30985babd1;p=libsigrok.git diff --git a/backend.c b/backend.c index 4edc7812..8f5fd1f4 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. + */ +SR_API 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. + */ +SR_API int sr_exit(void) { - device_close_all(); + sr_cleanup_hwplugins(); + + return SR_OK; }