diff seobeo/seobeo.h @ 195:f8f5004a920a

Merging back hg-web-tip
author MrJuneJune <me@mrjunejune.com>
date Tue, 27 Jan 2026 06:51:44 -0800
parents 8cf4ec5e2191
children
line wrap: on
line diff
--- a/seobeo/seobeo.h	Sat Jan 24 06:37:43 2026 -0800
+++ b/seobeo/seobeo.h	Tue Jan 27 06:51:44 2026 -0800
@@ -91,6 +91,9 @@
 /* Destroy response and free all resources. */
 extern void                    Seobeo_Client_Response_Destroy(Seobeo_Client_Response *p_resp);
 
+// --- HTTP Web related helper functions --- //
+extern void    Seobeo_Url_Decode(char *dst, const char *src);
+
 /**
  * WebSocket Client API
  * ------
@@ -324,18 +327,22 @@
 extern void                               Seobeo_WebSocket_Server_Connection_Close(Seobeo_WebSocket_Server_Connection *p_conn, uint16 code, const char *reason);
 
 /* Initialize the router system (called automatically by Seobeo_Web_Server_Start) */
-extern void           Seobeo_Router_Init();
+extern void                  Seobeo_Router_Init();
 /* Register an API route handler. Call before starting server. */
-extern void           Seobeo_Router_Register(const char *method, const char *path_pattern, Seobeo_Route_Handler handler);
+extern void                  Seobeo_Router_Register(const char *method, const char *path_pattern, Seobeo_Route_Handler handler);
+/* Register a streaming route handler. Handler receives client handle for direct streaming. */
+extern void                  Seobeo_Router_Register_Stream(const char *method, const char *path_pattern, Seobeo_Stream_Handler handler);
 /* Clean up router resources */
-extern void           Seobeo_Router_Destroy();
+extern void                  Seobeo_Router_Destroy();
 /* Find matching route handler (internal use) */
-extern Seobeo_Route_Handler Seobeo_Router_Find_Handler(const char *method, const char *path, Seobeo_Request_Entry **pp_request_map, Dowa_Arena *p_arena);
+extern Seobeo_Route_Handler  Seobeo_Router_Find_Handler(const char *method, const char *path, Seobeo_Request_Entry **pp_request_map, Dowa_Arena *p_arena);
 /* Send HTTP response from response map (internal use) */
-extern void           Seobeo_Router_Send_Response(Seobeo_Handle *p_handle, Seobeo_Request_Entry *p_response_map, Dowa_Arena *p_arena);
+extern void                  Seobeo_Router_Send_Response(Seobeo_Handle *p_handle, Seobeo_Request_Entry *p_response_map, Dowa_Arena *p_arena);
 /* Send HTTP response with keep-alive option */
-extern void           Seobeo_Router_Send_Response_KeepAlive(Seobeo_Handle *p_handle, Seobeo_Request_Entry *p_response_map, Dowa_Arena *p_arena, boolean keep_alive);
-extern char          *Seobeo_Web_LoadFile(const char *file_path, size_t *p_file_size);
+extern void                  Seobeo_Router_Send_Response_KeepAlive(Seobeo_Handle *p_handle, Seobeo_Request_Entry *p_response_map, Dowa_Arena *p_arena, boolean keep_alive);
+extern char                 *Seobeo_Web_LoadFile(const char *file_path, size_t *p_file_size);
+/* Being a proxy and keeping the client open */
+extern Seobeo_Stream_Handler Seobeo_Router_Find_Stream_Handler(const char *method, const char *path, Seobeo_Request_Entry **pp_request_map, Dowa_Arena *p_arena);
 
 // --- Helper functions --- //
 /* Destroy handle. It will handle all NULL poointers. */