X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=libubus.h;h=6925514adb0fcea7929e52f67adabc04cbeacfaa;hb=HEAD;hp=4e45cb620a28befe23c27d3b8dc7eb1a1d12fb1a;hpb=91acde66b963e238aba35fb4f2030a147df84cd4;p=oweals%2Fubus.git diff --git a/libubus.h b/libubus.h index 4e45cb6..6925514 100644 --- a/libubus.h +++ b/libubus.h @@ -14,6 +14,10 @@ #ifndef __LIBUBUS_H #define __LIBUBUS_H +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -56,6 +60,8 @@ typedef void (*ubus_fd_handler_t)(struct ubus_request *req, int fd); typedef void (*ubus_complete_handler_t)(struct ubus_request *req, int ret); typedef void (*ubus_notify_complete_handler_t)(struct ubus_notify_request *req, int idx, int ret); +typedef void (*ubus_notify_data_handler_t)(struct ubus_notify_request *req, + int type, struct blob_attr *msg); typedef void (*ubus_connect_handler_t)(struct ubus_context *ctx); #define UBUS_OBJECT_TYPE(_name, _methods) \ @@ -221,6 +227,7 @@ struct ubus_notify_request { ubus_notify_complete_handler_t status_cb; ubus_notify_complete_handler_t complete_cb; + ubus_notify_data_handler_t data_cb; uint32_t pending; uint32_t id[UBUS_MAX_NOTIFY_PEERS + 1]; @@ -411,4 +418,8 @@ static inline int ubus_unregister_event_handler(struct ubus_context *ctx, return ubus_remove_object(ctx, &ev->obj); } +#ifdef __cplusplus +} +#endif + #endif