summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2013-09-02 14:52:37 +0200
committerJo-Philipp Wich <jow@openwrt.org>2013-09-02 15:23:09 +0200
commitc849d04fc8512771013f9ccae5144b66d363668d (patch)
tree6ab3b47252511bf3658e6d71c70d2ec564865549 /file.c
parentbc100538d3883639a948f4158015f6a0b255bcd7 (diff)
downloadrpcd-c849d04fc8512771013f9ccae5144b66d363668d.tar.gz
file: convert to plugin library
Diffstat (limited to 'file.c')
-rw-r--r--file.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/file.c b/file.c
index b0bdd99..2d33272 100644
--- a/file.c
+++ b/file.c
@@ -16,17 +16,8 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <fcntl.h>
-#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-
#include "file.h"
+#include "plugin.h"
static struct blob_buf buf;
@@ -546,7 +537,8 @@ rpc_file_exec(struct ubus_context *ctx, struct ubus_object *obj,
}
-int rpc_file_api_init(struct ubus_context *ctx)
+static int
+rpc_file_api_init(const struct rpc_daemon_ops *o, struct ubus_context *ctx)
{
static const struct ubus_method file_methods[] = {
UBUS_METHOD("read", rpc_file_read, rpc_file_policy),
@@ -568,3 +560,7 @@ int rpc_file_api_init(struct ubus_context *ctx)
return ubus_add_object(ctx, &obj);
}
+
+const struct rpc_plugin rpc_plugin = {
+ .init = rpc_file_api_init
+};