]> sigrok.org Git - libsigrok.git/blobdiff - backend.c
Other method to avoid "unused var" compiler warnings.
[libsigrok.git] / backend.c
index 4edc78123b41269d5c8aba4e7902956ec53bcc78..c3c3087a9d11315a28744db990cc6da4bf31f7f2 100644 (file)
--- a/backend.c
+++ b/backend.c
 
 #include <glib.h>
 #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;
 }