diff --git a/README.md b/README.md index ad721aa..6fabec5 100644 --- a/README.md +++ b/README.md @@ -64,13 +64,13 @@ sorts of events: ```c /* New client. */ -void onopen(ws_cli_conn_t *client); +void onopen(ws_cli_conn_t client); /* Client disconnected. */ -void onclose(ws_cli_conn_t *client); +void onclose(ws_cli_conn_t client); /* Client sent a text message. */ -void onmessage(ws_cli_conn_t *client, const unsigned char *msg, +void onmessage(ws_cli_conn_t client, const unsigned char *msg, uint64_t size, int type); ``` @@ -93,7 +93,7 @@ folder, ;-). * @brief This function is called whenever a new connection is opened. * @param client Client connection. */ -void onopen(ws_cli_conn_t *client) +void onopen(ws_cli_conn_t client) { char *cli; cli = ws_getaddress(client); @@ -104,7 +104,7 @@ void onopen(ws_cli_conn_t *client) * @brief This function is called whenever a connection is closed. * @param client Client connection. */ -void onclose(ws_cli_conn_t *client) +void onclose(ws_cli_conn_t client) { char *cli; cli = ws_getaddress(client); @@ -118,7 +118,7 @@ void onclose(ws_cli_conn_t *client) * @param size Message size. * @param type Message type. */ -void onmessage(ws_cli_conn_t *client, +void onmessage(ws_cli_conn_t client, const unsigned char *msg, uint64_t size, int type) { char *cli; diff --git a/doc/man/man3/ws_close_client.3 b/doc/man/man3/ws_close_client.3 index b714cce..7bed19c 100644 --- a/doc/man/man3/ws_close_client.3 +++ b/doc/man/man3/ws_close_client.3 @@ -21,7 +21,7 @@ ws_close_connection \- Close the client connection. .nf .B #include .sp -.BI "int ws_close_client(ws_cli_conn_t " *client "); +.BI "int ws_close_client(ws_cli_conn_t " client "); .fi .SH DESCRIPTION .BR ws_close_client () diff --git a/doc/man/man3/ws_get_state.3 b/doc/man/man3/ws_get_state.3 index d1257c6..6884614 100644 --- a/doc/man/man3/ws_get_state.3 +++ b/doc/man/man3/ws_get_state.3 @@ -21,7 +21,7 @@ ws_get_state \- Get a client current state .nf .B #include .sp -.BI "int ws_get_state(ws_cli_conn_t " *client "); +.BI "int ws_get_state(ws_cli_conn_t " client "); .fi .SH DESCRIPTION .BR ws_get_state () diff --git a/doc/man/man3/ws_getaddress.3 b/doc/man/man3/ws_getaddress.3 index e00b71d..97f5b5d 100644 --- a/doc/man/man3/ws_getaddress.3 +++ b/doc/man/man3/ws_getaddress.3 @@ -21,7 +21,7 @@ ws_getaddress \- Gets the client IP address .nf .B #include .sp -.BI "char* ws_getaddress(ws_cli_conn_t " "*client" ); +.BI "char* ws_getaddress(ws_cli_conn_t " "client" ); .fi .SH DESCRIPTION .BR ws_getaddress () diff --git a/doc/man/man3/ws_getport.3 b/doc/man/man3/ws_getport.3 index 0fd28e0..5677157 100644 --- a/doc/man/man3/ws_getport.3 +++ b/doc/man/man3/ws_getport.3 @@ -21,7 +21,7 @@ ws_getaddress \- Gets the client connected port .nf .B #include .sp -.BI "char* ws_getport(ws_cli_conn_t " "*client" ); +.BI "char* ws_getport(ws_cli_conn_t " "client" ); .fi .SH DESCRIPTION .BR ws_getport () diff --git a/doc/man/man3/ws_ping.3 b/doc/man/man3/ws_ping.3 index 993ce9c..9d19362 100644 --- a/doc/man/man3/ws_ping.3 +++ b/doc/man/man3/ws_ping.3 @@ -21,7 +21,7 @@ ws_ping \- Sends a ping to a single client or broadcast .nf .B #include .sp -.BI "void ws_ping(ws_cli_conn_t " *client ", int " broadcast ");" +.BI "void ws_ping(ws_cli_conn_t " client ", int " broadcast ");" .fi .SH DESCRIPTION .BR ws_ping () diff --git a/doc/man/man3/ws_sendframe.3 b/doc/man/man3/ws_sendframe.3 index 431930f..ab08aad 100644 --- a/doc/man/man3/ws_sendframe.3 +++ b/doc/man/man3/ws_sendframe.3 @@ -21,7 +21,7 @@ ws_sendframe \- Creates and send a masked WebSocket frame with some payload data .nf .B #include .sp -.BI "int ws_sendframe(ws_cli_conn_t " *client ", const char " *msg ", ssize_t " size ", int " type "); +.BI "int ws_sendframe(ws_cli_conn_t " client ", const char " *msg ", ssize_t " size ", int " type "); .fi .SH DESCRIPTION .BR ws_sendframe () diff --git a/doc/man/man3/ws_sendframe_bin.3 b/doc/man/man3/ws_sendframe_bin.3 index 4190216..783f58a 100644 --- a/doc/man/man3/ws_sendframe_bin.3 +++ b/doc/man/man3/ws_sendframe_bin.3 @@ -21,7 +21,7 @@ ws_sendframe_bin \- Sends a WebSocket binary frame. .nf .B #include .sp -.BI "int ws_sendframe_bin(ws_cli_conn_t " *client ", const char " *msg ", size " size "); +.BI "int ws_sendframe_bin(ws_cli_conn_t " client ", const char " *msg ", size " size "); .fi .SH DESCRIPTION .BR ws_sendframe_bin () diff --git a/doc/man/man3/ws_sendframe_txt.3 b/doc/man/man3/ws_sendframe_txt.3 index e9ee583..88db12b 100644 --- a/doc/man/man3/ws_sendframe_txt.3 +++ b/doc/man/man3/ws_sendframe_txt.3 @@ -21,7 +21,7 @@ ws_sendframe_txt \- Sends a WebSocket text frame. .nf .B #include .sp -.BI "int ws_sendframe_txt(ws_cli_conn_t " *client ", const char " *msg "); +.BI "int ws_sendframe_txt(ws_cli_conn_t " client ", const char " *msg "); .fi .SH DESCRIPTION .BR ws_sendframe_txt () diff --git a/doc/man/man3/ws_socket.3 b/doc/man/man3/ws_socket.3 index 12721cb..22c84f8 100644 --- a/doc/man/man3/ws_socket.3 +++ b/doc/man/man3/ws_socket.3 @@ -75,9 +75,9 @@ is defined as follows: .nf struct ws_events { - void (*onopen)(ws_cli_conn_t *client); - void (*onclose)(ws_cli_conn_t *client); - void (*onmessage)(ws_cli_conn_t *client, + void (*onopen)(ws_cli_conn_t client); + void (*onclose)(ws_cli_conn_t client); + void (*onmessage)(ws_cli_conn_t client, const unsigned char * msg, uint64_t size, int type); }; @@ -107,9 +107,9 @@ creating a new thread. .nf #include -void onopen(ws_cli_conn_t *client) {} -void onclose(ws_cli_conn_t *client) {} -void onmessage(ws_cli_conn_t *client) {} +void onopen(ws_cli_conn_t client) {} +void onclose(ws_cli_conn_t client) {} +void onmessage(ws_cli_conn_t client) {} int main(void) { ws_socket(&(struct ws_server){