#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.
+ */
+SR_API int sr_init(void)
{
- int ret;
-
- ret = load_hwplugins();
-
- return ret;
+ return load_hwplugins();
}
-
-void sigrok_cleanup(void)
+/**
+ * Shutdown libsigrok.
+ *
+ * @return SR_OK upon success, a (negative) error code otherwise.
+ */
+SR_API int sr_exit(void)
{
+ sr_cleanup_hwplugins();
- device_close_all();
-
+ return SR_OK;
}
-
-