Mercurial
diff seobeo/seobeo.h @ 72:4532ce6d9eb8
[Seobeo] Added router to the server logic. Few dowa string manipulation logics.
| author | June Park <parkjune1995@gmail.com> |
|---|---|
| date | Mon, 29 Dec 2025 07:50:07 -0800 |
| parents | a0f0ad5e42eb |
| children | c348ac875294 |
line wrap: on
line diff
--- a/seobeo/seobeo.h Sun Dec 28 20:34:22 2025 -0800 +++ b/seobeo/seobeo.h Mon Dec 29 07:50:07 2025 -0800 @@ -63,6 +63,18 @@ /* Generic HTTP GET Rquest to given host and port with path. It will mimic chrome. */ extern int Seobeo_Web_Client_Get(const char *host, const char *port, const char *path); +// --- Router --- // +/* Initialize the router system (called automatically by Seobeo_Web_Server_Start) */ +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); +/* Clean up router resources */ +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); +/* 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); + // --- Helper functions --- // /* Destroy handle. It will handle all NULL poointers. */ extern void Seobeo_Handle_Destroy(Seobeo_Handle *p_handle);