diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 082bd43b..3f4e1190 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -655,7 +655,7 @@ lws_canonical_hostname(struct lws_context *context) return (const char *)context->canonical_hostname; } -int user_callback_handle_rxflow(callback_function callback_function, +int user_callback_handle_rxflow(lws_callback_function callback_function, struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len) diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index 3199ec45..7b771ea8 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -758,7 +758,7 @@ struct lws_context; struct lws_extension; /** - * callback_function() - User server actions + * typedef lws_callback_function() - User server actions * @wsi: Opaque websocket instance pointer * @reason: The reason for the call * @user: Pointer to per-session user data allocated by library @@ -1052,17 +1052,13 @@ struct lws_extension; * connection. If you return nonzero lws will just close the * connection. */ -LWS_VISIBLE LWS_EXTERN int -callback(const struct lws *wsi, enum lws_callback_reasons reason, void *user, - void *in, size_t len); - typedef int -(callback_function)(struct lws *wsi, enum lws_callback_reasons reason, +lws_callback_function(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); #ifndef LWS_NO_EXTENSIONS /** - * extension_callback_function() - Hooks to allow extensions to operate + * typedef lws_extension_callback_function() - Hooks to allow extensions to operate * @context: Websockets context * @ext: This extension * @wsi: Opaque websocket instance pointer @@ -1119,13 +1115,8 @@ typedef int * buffer safely, it should copy the data into its own buffer and * set the lws_tokens token pointer to it. */ -LWS_VISIBLE LWS_EXTERN int -extension_callback(struct lws_context *context, const struct lws_extension *ext, - struct lws *wsi, enum lws_extension_callback_reasons reason, - void *user, void *in, size_t len); - typedef int -(extension_callback_function)(struct lws_context *context, +lws_extension_callback_function(struct lws_context *context, const struct lws_extension *ext, struct lws *wsi, enum lws_extension_callback_reasons reason, void *user, void *in, size_t len); @@ -1173,7 +1164,7 @@ typedef int struct lws_protocols { const char *name; - callback_function *callback; + lws_callback_function *callback; size_t per_session_data_size; size_t rx_buffer_size; unsigned int id; @@ -1199,7 +1190,7 @@ struct lws_protocols { struct lws_extension { const char *name; - extension_callback_function *callback; + lws_extension_callback_function *callback; size_t per_session_data_size; void *per_context_private_data; @@ -1209,7 +1200,7 @@ struct lws_extension { #endif /** - * struct lws_context_creation_info: parameters to create context with + * struct lws_context_creation_info - parameters to create context with * * @port: Port to listen on... you can use CONTEXT_PORT_NO_LISTEN to * suppress listening on any port, that's what you want if you are diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h index b443daf4..36ae98fe 100644 --- a/lib/private-libwebsockets.h +++ b/lib/private-libwebsockets.h @@ -1069,7 +1069,7 @@ LWS_EXTERN void lws_union_transition(struct lws *wsi, enum connection_mode mode); LWS_EXTERN int -user_callback_handle_rxflow(callback_function, struct lws *wsi, +user_callback_handle_rxflow(lws_callback_function, struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len); #ifdef LWS_USE_HTTP2 diff --git a/libwebsockets-api-doc.html b/libwebsockets-api-doc.html index 779c84e0..a3d4bbd3 100644 --- a/libwebsockets-api-doc.html +++ b/libwebsockets-api-doc.html @@ -823,10 +823,10 @@ These provide platform-agnostic ways to deal with filesystem access in the library and in the user code.
-

callback - User server actions

-LWS_EXTERN int -callback -(const struct lws * wsi, +

lws_callback_function - User server actions

+typedef int +lws_callback_function +(struct lws * wsi, enum lws_callback_reasons reason, void * user, void * in, @@ -1207,9 +1207,9 @@ connection. If you return nonzero lws will just close the connection.
-

extension_callback - Hooks to allow extensions to operate

-LWS_EXTERN int -extension_callback +

lws_extension_callback_function - Hooks to allow extensions to operate

+typedef int +lws_extension_callback_function (struct lws_context * context, const struct lws_extension * ext, struct lws * wsi, @@ -1298,7 +1298,7 @@ set the lws_tokens token pointer to it.

struct lws_protocols - List of protocols and handlers server supports.

struct lws_protocols {
    const char * name;
-    callback_function * callback;
+    lws_callback_function * callback;
    size_t per_session_data_size;
    size_t rx_buffer_size;
    unsigned int id;
@@ -1357,7 +1357,7 @@ header.

struct lws_extension - An extension we know how to cope with

struct lws_extension {
    const char * name;
-    extension_callback_function * callback;
+    lws_extension_callback_function * callback;
    size_t per_session_data_size;
    void * per_context_private_data;
};
@@ -1377,7 +1377,7 @@ is per-context, so it can track stuff across all sessions, etc, if it wants
-

struct lws_context_creation_info -

+

struct lws_context_creation_info - parameters to create context with

struct lws_context_creation_info {
    int port;
    const char * iface;