comparison seobeo/seobeo.h @ 175:71ad34a8bc9a hg-web

[HgWeb] Can stream hg response now. Added react page for hg web since we use json anyway.
author MrJuneJune <me@mrjunejune.com>
date Tue, 20 Jan 2026 06:06:47 -0800
parents 827c6ac504cd
children 8cf4ec5e2191
comparison
equal deleted inserted replaced
174:1ba8c1df082c 175:71ad34a8bc9a
323 extern void Seobeo_WebSocket_Server_Broadcast_Binary(const uint8 *data, size_t length); 323 extern void Seobeo_WebSocket_Server_Broadcast_Binary(const uint8 *data, size_t length);
324 /* Close WebSocket connection with status code and reason. */ 324 /* Close WebSocket connection with status code and reason. */
325 extern void Seobeo_WebSocket_Server_Connection_Close(Seobeo_WebSocket_Server_Connection *p_conn, uint16 code, const char *reason); 325 extern void Seobeo_WebSocket_Server_Connection_Close(Seobeo_WebSocket_Server_Connection *p_conn, uint16 code, const char *reason);
326 326
327 /* Initialize the router system (called automatically by Seobeo_Web_Server_Start) */ 327 /* Initialize the router system (called automatically by Seobeo_Web_Server_Start) */
328 extern void Seobeo_Router_Init(); 328 extern void Seobeo_Router_Init();
329 /* Register an API route handler. Call before starting server. */ 329 /* Register an API route handler. Call before starting server. */
330 extern void Seobeo_Router_Register(const char *method, const char *path_pattern, Seobeo_Route_Handler handler); 330 extern void Seobeo_Router_Register(const char *method, const char *path_pattern, Seobeo_Route_Handler handler);
331 /* Register a streaming route handler. Handler receives client handle for direct streaming. */
332 extern void Seobeo_Router_Register_Stream(const char *method, const char *path_pattern, Seobeo_Stream_Handler handler);
331 /* Clean up router resources */ 333 /* Clean up router resources */
332 extern void Seobeo_Router_Destroy(); 334 extern void Seobeo_Router_Destroy();
333 /* Find matching route handler (internal use) */ 335 /* Find matching route handler (internal use) */
334 extern Seobeo_Route_Handler Seobeo_Router_Find_Handler(const char *method, const char *path, Seobeo_Request_Entry **pp_request_map, Dowa_Arena *p_arena); 336 extern Seobeo_Route_Handler Seobeo_Router_Find_Handler(const char *method, const char *path, Seobeo_Request_Entry **pp_request_map, Dowa_Arena *p_arena);
335 /* Send HTTP response from response map (internal use) */ 337 /* Send HTTP response from response map (internal use) */
336 extern void Seobeo_Router_Send_Response(Seobeo_Handle *p_handle, Seobeo_Request_Entry *p_response_map, Dowa_Arena *p_arena); 338 extern void Seobeo_Router_Send_Response(Seobeo_Handle *p_handle, Seobeo_Request_Entry *p_response_map, Dowa_Arena *p_arena);
337 extern char *Seobeo_Web_LoadFile(const char *file_path, size_t *p_file_size); 339 extern char *Seobeo_Web_LoadFile(const char *file_path, size_t *p_file_size);
340 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);
341
338 342
339 // --- Helper functions --- // 343 // --- Helper functions --- //
340 /* Destroy handle. It will handle all NULL poointers. */ 344 /* Destroy handle. It will handle all NULL poointers. */
341 extern void Seobeo_Handle_Destroy(Seobeo_Handle *p_handle); 345 extern void Seobeo_Handle_Destroy(Seobeo_Handle *p_handle);
342 /* Write to socket from write_buffer in the handle. */ 346 /* Write to socket from write_buffer in the handle. */