uvt: add SHL_EXPORT to cdev+ctx subsystems

We need to export the symbols to make use of them. This exports all useful
ctx+cdev functions for outside use. The other subsystems still need to get
reviewed before we export them.

Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
This commit is contained in:
David Herrmann 2013-03-05 01:27:32 +01:00
parent fdf045317f
commit e62850ded5
3 changed files with 17 additions and 0 deletions

View File

@ -30,6 +30,12 @@ global:
uvt_ctx_unref; uvt_ctx_unref;
uvt_ctx_get_fd; uvt_ctx_get_fd;
uvt_ctx_dispatch; uvt_ctx_dispatch;
uvt_cdev_new;
uvt_cdev_ref;
uvt_cdev_unref;
uvt_cdev_register_cb;
uvt_cdev_unregister_cb;
local: local:
*; *;
}; };

View File

@ -400,6 +400,7 @@ static void uvt_cdev_destroy(struct uvt_cdev *cdev)
close(cdev->fd); close(cdev->fd);
} }
SHL_EXPORT
int uvt_cdev_new(struct uvt_cdev **out, struct uvt_ctx *ctx, int uvt_cdev_new(struct uvt_cdev **out, struct uvt_ctx *ctx,
const char *name, unsigned int major, unsigned int minor) const char *name, unsigned int major, unsigned int minor)
{ {
@ -442,6 +443,7 @@ err_free:
return ret; return ret;
} }
SHL_EXPORT
void uvt_cdev_ref(struct uvt_cdev *cdev) void uvt_cdev_ref(struct uvt_cdev *cdev)
{ {
if (!cdev || !cdev->ref) if (!cdev || !cdev->ref)
@ -450,6 +452,7 @@ void uvt_cdev_ref(struct uvt_cdev *cdev)
++cdev->ref; ++cdev->ref;
} }
SHL_EXPORT
void uvt_cdev_unref(struct uvt_cdev *cdev) void uvt_cdev_unref(struct uvt_cdev *cdev)
{ {
if (!cdev || !cdev->ref || --cdev->ref) if (!cdev || !cdev->ref || --cdev->ref)
@ -463,6 +466,7 @@ void uvt_cdev_unref(struct uvt_cdev *cdev)
free(cdev); free(cdev);
} }
SHL_EXPORT
int uvt_cdev_register_cb(struct uvt_cdev *cdev, uvt_cdev_cb cb, void *data) int uvt_cdev_register_cb(struct uvt_cdev *cdev, uvt_cdev_cb cb, void *data)
{ {
if (!cdev) 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); 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) void uvt_cdev_unregister_cb(struct uvt_cdev *cdev, uvt_cdev_cb cb, void *data)
{ {
if (!cdev) if (!cdev)

View File

@ -37,11 +37,13 @@
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "shl_llog.h" #include "shl_llog.h"
#include "shl_misc.h"
#include "uvt.h" #include "uvt.h"
#include "uvt_internal.h" #include "uvt_internal.h"
#define LLOG_SUBSYSTEM "uvt_ctx" #define LLOG_SUBSYSTEM "uvt_ctx"
SHL_EXPORT
int uvt_ctx_new(struct uvt_ctx **out, uvt_log_t log, void *log_data) int uvt_ctx_new(struct uvt_ctx **out, uvt_log_t log, void *log_data)
{ {
struct uvt_ctx *ctx; struct uvt_ctx *ctx;
@ -80,6 +82,7 @@ err_free:
return ret; return ret;
} }
SHL_EXPORT
void uvt_ctx_ref(struct uvt_ctx *ctx) void uvt_ctx_ref(struct uvt_ctx *ctx)
{ {
if (!ctx || !ctx->ref) if (!ctx || !ctx->ref)
@ -88,6 +91,7 @@ void uvt_ctx_ref(struct uvt_ctx *ctx)
++ctx->ref; ++ctx->ref;
} }
SHL_EXPORT
void uvt_ctx_unref(struct uvt_ctx *ctx) void uvt_ctx_unref(struct uvt_ctx *ctx)
{ {
if (!ctx || !ctx->ref || --ctx->ref) if (!ctx || !ctx->ref || --ctx->ref)
@ -100,6 +104,7 @@ void uvt_ctx_unref(struct uvt_ctx *ctx)
free(ctx); free(ctx);
} }
SHL_EXPORT
int uvt_ctx_get_fd(struct uvt_ctx *ctx) int uvt_ctx_get_fd(struct uvt_ctx *ctx)
{ {
if (!ctx) if (!ctx)
@ -108,6 +113,7 @@ int uvt_ctx_get_fd(struct uvt_ctx *ctx)
return ev_eloop_get_fd(ctx->eloop); return ev_eloop_get_fd(ctx->eloop);
} }
SHL_EXPORT
void uvt_ctx_dispatch(struct uvt_ctx *ctx) void uvt_ctx_dispatch(struct uvt_ctx *ctx)
{ {
if (!ctx) if (!ctx)