add an inline function to add the ubus socket to uloop
[project/ubus.git] / libubus.h
index 49a147a..c93ad8f 100644 (file)
--- a/libubus.h
+++ b/libubus.h
@@ -125,16 +125,16 @@ struct ubus_request {
        void *priv;
 };
 
        void *priv;
 };
 
-#define BLOBMSG_END_TABLE      BLOBMSG_TYPE_UNSPEC
 
 struct ubus_context *ubus_connect(const char *path);
 void ubus_free(struct ubus_context *ctx);
 
 const char *ubus_strerror(int error);
 
 
 struct ubus_context *ubus_connect(const char *path);
 void ubus_free(struct ubus_context *ctx);
 
 const char *ubus_strerror(int error);
 
-/* ----------- helpers for message handling ----------- */
-
-struct blob_attr **ubus_parse_msg(struct blob_attr *msg);
+static inline void ubus_add_uloop(struct ubus_context *ctx)
+{
+       uloop_fd_add(&ctx->sock, ULOOP_EDGE_TRIGGER | ULOOP_BLOCKING | ULOOP_READ);
+}
 
 /* ----------- raw request handling ----------- */
 
 
 /* ----------- raw request handling ----------- */