introduce lws_wsi_user

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2015-12-14 07:16:32 +08:00
parent 1a366bf946
commit 3f62870e67
3 changed files with 13 additions and 1 deletions

View file

@ -4,7 +4,7 @@ Changelog
User api additions
------------------
lws now exposes his internal platform file abstraction in a way that can be
1) lws now exposes his internal platform file abstraction in a way that can be
both used by user code to make it platform-agnostic, and be overridden or
subclassed by user code. This allows things like handling the URI "directory
space" as a virtual filesystem that may or may not be backed by a regular
@ -45,6 +45,9 @@ lws_plat_file_write(struct lws_plat_file_ops *fops, lws_filefd_type fd,
The user code can also override or subclass the file operations, to either
wrap or replace them. An example is shown in test server.
2) A new API void * lws_wsi_user(struct lws *wsi) lets you get the pointer to
the user data associated with the wsi, just from the wsi.
User api changes
----------------

View file

@ -941,6 +941,12 @@ lws_get_ctx(const struct lws *wsi)
return wsi->context;
}
LWS_VISIBLE LWS_EXTERN void *
lws_wsi_user(struct lws *wsi)
{
return wsi->user_space;
}
#ifdef LWS_WITH_OLD_API_WRAPPERS
/*

View file

@ -1414,6 +1414,9 @@ lws_service_fd(struct lws_context *context,
LWS_VISIBLE LWS_EXTERN void *
lws_context_user(struct lws_context *context);
LWS_VISIBLE LWS_EXTERN void *
lws_wsi_user(struct lws *wsi);
/*
* NOTE: These public enums are part of the abi. If you want to add one,
* add it at where specified so existing users are unaffected.