diff seobeo/s_web.c @ 65:ecb6ee6a22c3

[Misc] I will no longer drink cool aids of capital P.
author June Park <parkjune1995@gmail.com>
date Wed, 24 Dec 2025 06:22:59 -0800
parents ea9ef388ab97
children a0f0ad5e42eb
line wrap: on
line diff
--- a/seobeo/s_web.c	Tue Dec 23 15:18:46 2025 -0800
+++ b/seobeo/s_web.c	Wed Dec 24 06:22:59 2025 -0800
@@ -55,22 +55,22 @@
   );
 }
 
-void Seobeo_Web_HandleClientRequest(Seobeo_PHandle p_cli_handle,
-                                    Dowa_PHashMap p_html_cache)
+void Seobeo_Web_HandleClientRequest(Seobeo_PHandle  p_cli_handle,
+                                    Dowa_HashMap   *p_html_cache)
 {
   printf("p_cli_handle: %p", p_cli_handle);
-  Dowa_PHashEntry entry = NULL;
-  Dowa_PHashMap p_current = p_html_cache;
+  Dowa_HashEntry *entry = NULL;
+  Dowa_HashMap *p_current = p_html_cache;
   char *slash;
 
-  Dowa_PArena p_response_arena = Dowa_Arena_Create(1*1024*1024);
+  Dowa_Arena *p_response_arena = Dowa_Arena_Create(1*1024*1024);
   if (!p_response_arena) { perror("Dowa_Arena_Initialize"); goto clean_up; }
 
   void *p_response_header = Dowa_Arena_Allocate(p_response_arena, (size_t)2048);
   if (!p_response_header) { perror("Dowa_Arena_Allocate"); goto clean_up; }
 
   // Parse request headers into hashmap
-  Dowa_PHashMap p_req_map = Dowa_HashMap_Create_With_Arena(100, p_response_arena);
+  Dowa_HashMap *p_req_map = Dowa_HashMap_Create_With_Arena(100, p_response_arena);
   if (Seobeo_Web_Header_Parse(p_cli_handle, p_req_map) != 0)
   {
     Seobeo_Web_Header_Generate(p_response_header,
@@ -101,7 +101,7 @@
   }
 
   // --- Separate GET map for caching or routing ---
-  Dowa_PHashMap p_get_map = Dowa_HashMap_Create(64);
+  Dowa_HashMap *p_get_map = Dowa_HashMap_Create(64);
   if (!p_get_map)
   {
     perror("Dowa_HashMap_Create (p_get_map)");
@@ -260,7 +260,7 @@
 }
 
 
-int Seobeo_Web_Header_Parse(Seobeo_PHandle p_handle, Dowa_PHashMap map)
+int Seobeo_Web_Header_Parse(Seobeo_PHandle p_handle, Dowa_HashMap *map)
 {
   // 1) Fill read_buffer until we see "\r\n\r\n"
   while (1)
@@ -316,7 +316,7 @@
   if (query_str && *query_str)
   {
     // create nested map for GET params
-    Dowa_PHashMap p_query_map = Dowa_HashMap_Create_With_Arena(100, map->p_arena);
+    Dowa_HashMap *p_query_map = Dowa_HashMap_Create_With_Arena(100, map->p_arena);
 
     char *cur = query_str;
     while (cur && *cur)
@@ -369,7 +369,7 @@
   }
 
   // int qp = Dowa_HashMap_Get_Position(map, "QueryParams");
-  // Dowa_PHashEntry p_qp_entry = map->entries[qp];
+  // Dowa_HashEntry *p_qp_entry = map->entries[qp];
   // printf("query param key: %s\n", p_qp_entry->key);
   // printf("query param value: %s\n",(char *)Dowa_HashMap_Get(p_qp_entry->buffer, "hello"));
 
@@ -418,7 +418,7 @@
 
   // 4) If Content-Length was provided, read that much body
   int content_length_pos = Dowa_HashMap_Get_Position(map, "Content-Length");
-  Dowa_PHashEntry p_content_length_entry = map->entries[content_length_pos];
+  Dowa_HashEntry *p_content_length_entry = map->entries[content_length_pos];
   if (p_content_length_entry)
   {
     size_t body_len = atoi((char*)p_content_length_entry->buffer);
@@ -461,7 +461,7 @@
     Seobeo_ServerMode mode,
     int                thread_count)
 {
-  Dowa_PHashMap p_html_cache = Dowa_HashMap_Create(200);
+  Dowa_HashMap *p_html_cache = Dowa_HashMap_Create(200);
   if (Dowa_HashMap_Cache_Folder(p_html_cache,
                                 folder_path) != 0)
   {
@@ -522,7 +522,7 @@
     return -1;
   }
 
-  Dowa_PArena p_request_arena = Dowa_Arena_Create(1 * 1024 * 1024);
+  Dowa_Arena *p_request_arena = Dowa_Arena_Create(1 * 1024 * 1024);
   if (!p_request_arena) { perror("Dowa_Arena_Create"); return -1; }
 
   void *p_request_header = Dowa_Arena_Allocate(p_request_arena, 4096);