From 4d3d0389f8b29a3768f9ac7db94025ce57a3983c Mon Sep 17 00:00:00 2001 From: Demchenko Eugene Date: Wed, 10 Jun 2020 12:13:07 +0400 Subject: [PATCH 1/2] Update wsclient.h Add user_data field to _wsclient structure. --- wsclient.h | 1 + 1 file changed, 1 insertion(+) diff --git a/wsclient.h b/wsclient.h index 5850aa8..e52a4f9 100644 --- a/wsclient.h +++ b/wsclient.h @@ -109,6 +109,7 @@ typedef struct _wsclient { wsclient_frame *current_frame; struct sockaddr_un helper_sa; int helper_sock; + void *user_data; #ifdef HAVE_LIBSSL SSL_CTX *ssl_ctx; SSL *ssl; From 8262b9922672ddbdfa99f736d1e98469a8d6b0c2 Mon Sep 17 00:00:00 2001 From: Demchenko Eugene Date: Wed, 10 Jun 2020 15:33:45 +0400 Subject: [PATCH 2/2] Update wsclient.h --- wsclient.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/wsclient.h b/wsclient.h index e52a4f9..356771c 100644 --- a/wsclient.h +++ b/wsclient.h @@ -138,6 +138,12 @@ void libwsclient_close(wsclient *c); int libwsclient_helper_socket(wsclient *c, const char *path); void *libwsclient_helper_socket_thread(void *ptr); +void libwsclient_onclose(wsclient *client, int (*cb)(wsclient *c)); +void libwsclient_onopen(wsclient *client, int (*cb)(wsclient *c)); +void libwsclient_onmessage(wsclient *client, int (*cb)(wsclient *c, wsclient_message *msg)); +void libwsclient_onerror(wsclient *client, int (*cb)(wsclient *c, wsclient_error *err)); +int libwsclient_send(wsclient *client, char *strdata); + //Define errors char *errors[] = { "Unknown error occured",