/*
* This file is part of the sigrok project.
*
- * Copyright (C) 2010 Bert Vermeulen <bert@biot.com>
+ * Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*/
#include <glib.h>
-#include <sigrok.h>
+#include "libsigrok.h"
+#include "libsigrok-internal.h"
-int sr_init(void)
+/**
+ * Initialize libsigrok.
+ *
+ * @return SR_OK upon success, a (negative) error code otherwise.
+ */
+SR_API int sr_init(void)
{
- return load_hwplugins();
+ return SR_OK;
}
-/* TODO: Should return int to be able to report back error codes. */
-void sr_cleanup(void)
+/**
+ * Shutdown libsigrok.
+ *
+ * @return SR_OK upon success, a (negative) error code otherwise.
+ */
+SR_API int sr_exit(void)
{
- device_close_all();
+ sr_hw_cleanup_all();
+
+ return SR_OK;
}