Skip to content

Commit

Permalink
Update README and manpages to reflect recent changes
Browse files Browse the repository at this point in the history
  • Loading branch information
henriquetft authored and Theldus committed Sep 5, 2024
1 parent a999870 commit ea8a029
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
```
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion doc/man/man3/ws_close_client.3
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ws_close_connection \- Close the client connection.
.nf
.B #include <ws.h>
.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 ()
Expand Down
2 changes: 1 addition & 1 deletion doc/man/man3/ws_get_state.3
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ws_get_state \- Get a client current state
.nf
.B #include <ws.h>
.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 ()
Expand Down
2 changes: 1 addition & 1 deletion doc/man/man3/ws_getaddress.3
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ws_getaddress \- Gets the client IP address
.nf
.B #include <ws.h>
.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 ()
Expand Down
2 changes: 1 addition & 1 deletion doc/man/man3/ws_getport.3
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ws_getaddress \- Gets the client connected port
.nf
.B #include <ws.h>
.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 ()
Expand Down
2 changes: 1 addition & 1 deletion doc/man/man3/ws_ping.3
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ws_ping \- Sends a ping to a single client or broadcast
.nf
.B #include <ws.h>
.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 ()
Expand Down
2 changes: 1 addition & 1 deletion doc/man/man3/ws_sendframe.3
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ws_sendframe \- Creates and send a masked WebSocket frame with some payload data
.nf
.B #include <ws.h>
.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 ()
Expand Down
2 changes: 1 addition & 1 deletion doc/man/man3/ws_sendframe_bin.3
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ws_sendframe_bin \- Sends a WebSocket binary frame.
.nf
.B #include <ws.h>
.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 ()
Expand Down
2 changes: 1 addition & 1 deletion doc/man/man3/ws_sendframe_txt.3
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ws_sendframe_txt \- Sends a WebSocket text frame.
.nf
.B #include <ws.h>
.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 ()
Expand Down
12 changes: 6 additions & 6 deletions doc/man/man3/ws_socket.3
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down Expand Up @@ -107,9 +107,9 @@ creating a new thread.
.nf
#include <ws.h>

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){
Expand Down

0 comments on commit ea8a029

Please sign in to comment.