diff --git a/docs/sym/libuvt.sym b/docs/sym/libuvt.sym index d4eed58..a747c43 100644 --- a/docs/sym/libuvt.sym +++ b/docs/sym/libuvt.sym @@ -30,6 +30,12 @@ global: uvt_ctx_unref; uvt_ctx_get_fd; uvt_ctx_dispatch; + + uvt_cdev_new; + uvt_cdev_ref; + uvt_cdev_unref; + uvt_cdev_register_cb; + uvt_cdev_unregister_cb; local: *; }; diff --git a/src/uvt_cdev.c b/src/uvt_cdev.c index e63bcf0..291857b 100644 --- a/src/uvt_cdev.c +++ b/src/uvt_cdev.c @@ -400,6 +400,7 @@ static void uvt_cdev_destroy(struct uvt_cdev *cdev) close(cdev->fd); } +SHL_EXPORT int uvt_cdev_new(struct uvt_cdev **out, struct uvt_ctx *ctx, const char *name, unsigned int major, unsigned int minor) { @@ -442,6 +443,7 @@ err_free: return ret; } +SHL_EXPORT void uvt_cdev_ref(struct uvt_cdev *cdev) { if (!cdev || !cdev->ref) @@ -450,6 +452,7 @@ void uvt_cdev_ref(struct uvt_cdev *cdev) ++cdev->ref; } +SHL_EXPORT void uvt_cdev_unref(struct uvt_cdev *cdev) { if (!cdev || !cdev->ref || --cdev->ref) @@ -463,6 +466,7 @@ void uvt_cdev_unref(struct uvt_cdev *cdev) free(cdev); } +SHL_EXPORT int uvt_cdev_register_cb(struct uvt_cdev *cdev, uvt_cdev_cb cb, void *data) { if (!cdev) @@ -471,6 +475,7 @@ int uvt_cdev_register_cb(struct uvt_cdev *cdev, uvt_cdev_cb cb, void *data) return shl_hook_add_cast(cdev->hook, cb, data, false); } +SHL_EXPORT void uvt_cdev_unregister_cb(struct uvt_cdev *cdev, uvt_cdev_cb cb, void *data) { if (!cdev) diff --git a/src/uvt_ctx.c b/src/uvt_ctx.c index a70e687..60185ec 100644 --- a/src/uvt_ctx.c +++ b/src/uvt_ctx.c @@ -37,11 +37,13 @@ #include #include #include "shl_llog.h" +#include "shl_misc.h" #include "uvt.h" #include "uvt_internal.h" #define LLOG_SUBSYSTEM "uvt_ctx" +SHL_EXPORT int uvt_ctx_new(struct uvt_ctx **out, uvt_log_t log, void *log_data) { struct uvt_ctx *ctx; @@ -80,6 +82,7 @@ err_free: return ret; } +SHL_EXPORT void uvt_ctx_ref(struct uvt_ctx *ctx) { if (!ctx || !ctx->ref) @@ -88,6 +91,7 @@ void uvt_ctx_ref(struct uvt_ctx *ctx) ++ctx->ref; } +SHL_EXPORT void uvt_ctx_unref(struct uvt_ctx *ctx) { if (!ctx || !ctx->ref || --ctx->ref) @@ -100,6 +104,7 @@ void uvt_ctx_unref(struct uvt_ctx *ctx) free(ctx); } +SHL_EXPORT int uvt_ctx_get_fd(struct uvt_ctx *ctx) { if (!ctx) @@ -108,6 +113,7 @@ int uvt_ctx_get_fd(struct uvt_ctx *ctx) return ev_eloop_get_fd(ctx->eloop); } +SHL_EXPORT void uvt_ctx_dispatch(struct uvt_ctx *ctx) { if (!ctx)