comparison mrjunejune/main.c @ 80:d55157451947

[MrJuneJune] Updating my homepage.
author June Park <parkjune1995@gmail.com>
date Thu, 01 Jan 2026 08:23:46 -0800
parents 5710108c949e
children bcc76a156aea
comparison
equal deleted inserted replaced
79:5710108c949e 80:d55157451947
39 memcpy(include_name, start_tag + token_len, name_len); 39 memcpy(include_name, start_tag + token_len, name_len);
40 include_name[name_len] = '\0'; 40 include_name[name_len] = '\0';
41 41
42 size_t sub_file_size = 0; 42 size_t sub_file_size = 0;
43 char *sub_content = Seobeo_Web_LoadFile(include_name, &sub_file_size); 43 char *sub_content = Seobeo_Web_LoadFile(include_name, &sub_file_size);
44 printf("sub_content %s", sub_content);
44 if (sub_content) 45 if (sub_content)
45 { 46 {
46 memcpy(final_body + current_offset, sub_content, sub_file_size); 47 memcpy(final_body + current_offset, sub_content, sub_file_size);
47 current_offset += sub_file_size; 48 current_offset += sub_file_size;
48 free(sub_content); 49 free(sub_content);
55 } 56 }
56 57
57 Seobeo_Request_Entry* GetHomePage(Seobeo_Request_Entry *req, Dowa_Arena *arena) 58 Seobeo_Request_Entry* GetHomePage(Seobeo_Request_Entry *req, Dowa_Arena *arena)
58 { 59 {
59 Seobeo_Request_Entry *resp = NULL; 60 Seobeo_Request_Entry *resp = NULL;
60 char *final_body = Dowa_Arena_Allocate(arena, 50 * 1024); // 50KB buffer 61 char *final_body = Dowa_Arena_Allocate(arena, 50 * 1024);
61 Seobeo_ServerSideRender(final_body, "/index.html", arena); 62 Seobeo_ServerSideRender(final_body, "/index.html", arena);
62 Dowa_HashMap_Push_Arena(resp, "body", final_body, arena); 63 Dowa_HashMap_Push_Arena(resp, "body", final_body, arena);
63 return resp; 64 return resp;
64 } 65 }
65 66