Added code.

This commit is contained in:
2026-02-14 16:02:53 -05:00
commit 22f62844e4
23 changed files with 22331 additions and 0 deletions

25
server/src/include/chat.h Normal file
View File

@@ -0,0 +1,25 @@
#ifndef CHAT_H
#define CHAT_H
#include <libwebsockets.h>
/**
* cb_chat - libwebsockets protocol callback for COMS chat.
*
* This function is registered in the protocols array passed to the
* lws_context and handles connection, receive, writable, and close events.
*
* @wsi: The WebSocket instance pointer
* @reason: One of the LWS_CALLBACK_* reasons
* @user: Pointer to a session_t* for this connection
* @in: Pointer to incoming data (for receive events)
* @len: Length of the incoming data buffer
*
* Return: 0 on success, non-zero on error.
*/
int cb_chat(
struct lws* wsi, enum lws_callback_reasons reason, void* user, void* in,
size_t len
);
#endif // CHAT_H