]> sigrok.org Git - libsigrok.git/blobdiff - backend.c
MSO19: Always use glib's memory allocation functions.
[libsigrok.git] / backend.c
index eb23ad229bd36238380b17fd4c37a89a636ed8a9..b52766474d0d98eb929e5722aee1b8b4dd29f4f5 100644 (file)
--- a/backend.c
+++ b/backend.c
 
 #include <glib.h>
 #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)
 {
-       device_close_all();
+       sr_device_close_all();
+
+       return SR_OK;
 }