X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=libubus.h;h=48ee056975882096cb294cbe6e7186dd85e7ecb6;hb=f6a6b0d492900b7a087a8a89d11fa5b94f4c5cb5;hp=49a147a931c3b270fc88a0ce5d252ccd2cdae18a;hpb=36b1a80b075203c650a6612f1ef45674210fb7a6;p=project%2Fubus.git diff --git a/libubus.h b/libubus.h index 49a147a..48ee056 100644 --- a/libubus.h +++ b/libubus.h @@ -125,16 +125,16 @@ struct ubus_request { 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); -/* ----------- 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 ----------- */ @@ -171,3 +171,7 @@ int ubus_publish(struct ubus_context *ctx, struct ubus_object *obj); /* send a reply to an incoming object method call */ int ubus_send_reply(struct ubus_context *ctx, struct ubus_request_data *req, struct blob_attr *msg); + +/* ----------- events ----------- */ +int ubus_register_event_handler(struct ubus_context *ctx, struct ubus_object *obj, + const char *pattern);