]> sigrok.org Git - libsigrok.git/blobdiff - backend.c
autogen.sh: aclocal support for Windows XP/Vista/7.
[libsigrok.git] / backend.c
index 4edc78123b41269d5c8aba4e7902956ec53bcc78..8f5fd1f449e8e26b3efa11c10f2c09713036c72a 100644 (file)
--- a/backend.c
+++ b/backend.c
  */
 
 #include <glib.h>
-#include <sigrok.h>
+#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;
 }