annotate dowa/dowa.h @ 59:e06bc03d9618

[Color Game] Making game with a friend.
author June Park <parkjune1995@gmail.com>
date Sat, 20 Dec 2025 10:53:13 -0800
parents 636eab07809d
children fff1b048dda6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
1 #ifndef DOWA
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
2 #define DOWA
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
3
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
4 #include <stdio.h>
2
8a43dedbe530 [Dowa] Added HashMap and Updated Arena naming.
June Park <parkjune1995@gmail.com>
parents: 1
diff changeset
5 #include <string.h> // stdup
1
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
6 #include <stdlib.h> // only for malloc, free, stuff
21
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
7 #include <assert.h> // mostly for TODO
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
8 #include <dirent.h> // some functions loop through files
59
e06bc03d9618 [Color Game] Making game with a friend.
June Park <parkjune1995@gmail.com>
parents: 52
diff changeset
9 #include <math.h> // I am not re-writing stuff I guess...
3
2758f5527d2b [Seobeo] Working on simple TCP server and client logic.
June Park <parkjune1995@gmail.com>
parents: 2
diff changeset
10
2758f5527d2b [Seobeo] Working on simple TCP server and client logic.
June Park <parkjune1995@gmail.com>
parents: 2
diff changeset
11 #include <sys/stat.h>
2758f5527d2b [Seobeo] Working on simple TCP server and client logic.
June Park <parkjune1995@gmail.com>
parents: 2
diff changeset
12 #include <limits.h>
2758f5527d2b [Seobeo] Working on simple TCP server and client logic.
June Park <parkjune1995@gmail.com>
parents: 2
diff changeset
13
1
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
14 #include "dowa_internal.h"
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
15
2
8a43dedbe530 [Dowa] Added HashMap and Updated Arena naming.
June Park <parkjune1995@gmail.com>
parents: 1
diff changeset
16 #define HASH_KEY_NUMBER 5381 // DJD hash number
5
3e12bf044589 Fixed Dowa hashmap to recursively add files into memory.
June Park <parkjune1995@gmail.com>
parents: 3
diff changeset
17 #define ONE_MEGA_BYTE 1048576
18
fa2b8af609d9 [Seobeo] Fixed a bug with pathing. Support SSL.
June Park <parkjune1995@gmail.com>
parents: 5
diff changeset
18 #define TRUE 1
fa2b8af609d9 [Seobeo] Fixed a bug with pathing. Support SSL.
June Park <parkjune1995@gmail.com>
parents: 5
diff changeset
19 #define FALSE 0
fa2b8af609d9 [Seobeo] Fixed a bug with pathing. Support SSL.
June Park <parkjune1995@gmail.com>
parents: 5
diff changeset
20
36
84672efec192 [Zenbu] WIP fixing issues regarding to using edge only. I think there is a problem where socket closes before sending back the info.
MrJuneJune <me@mrjunejune.com>
parents: 22
diff changeset
21 #define Dowa_Free(p) do { \
84672efec192 [Zenbu] WIP fixing issues regarding to using edge only. I think there is a problem where socket closes before sending back the info.
MrJuneJune <me@mrjunejune.com>
parents: 22
diff changeset
22 if (p) { \
84672efec192 [Zenbu] WIP fixing issues regarding to using edge only. I think there is a problem where socket closes before sending back the info.
MrJuneJune <me@mrjunejune.com>
parents: 22
diff changeset
23 free(p); \
84672efec192 [Zenbu] WIP fixing issues regarding to using edge only. I think there is a problem where socket closes before sending back the info.
MrJuneJune <me@mrjunejune.com>
parents: 22
diff changeset
24 (p) = NULL; \
84672efec192 [Zenbu] WIP fixing issues regarding to using edge only. I think there is a problem where socket closes before sending back the info.
MrJuneJune <me@mrjunejune.com>
parents: 22
diff changeset
25 } \
84672efec192 [Zenbu] WIP fixing issues regarding to using edge only. I think there is a problem where socket closes before sending back the info.
MrJuneJune <me@mrjunejune.com>
parents: 22
diff changeset
26 } while (0)
84672efec192 [Zenbu] WIP fixing issues regarding to using edge only. I think there is a problem where socket closes before sending back the info.
MrJuneJune <me@mrjunejune.com>
parents: 22
diff changeset
27
21
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
28 // Fixed-width integer types
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
29 typedef unsigned int uint32; // 32-bit unsigned integer
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
30 typedef int int32; // 32-bit signed integer
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
31 typedef unsigned short uint16; // 16-bit unsigned integer
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
32 typedef short int16; // 16-bit signed integer
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
33 typedef unsigned char uint8; // 8-bit unsigned integer
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
34 typedef char int8; // 8-bit signed integer
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
35 typedef char boolean; // Boolean type (0 = false, nonzero = true)
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
36
1
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
37
21
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
38 // --- Miscellaneous --- //
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
39 /* Just use atoid lmao*/
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
40 char *Dowa_Int32ToString(uint32 value, char *buffer);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
41
1
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
42
21
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
43 // --- Arena Allocator --- //
1
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
44 typedef struct {
22
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
45 char *buffer;
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
46 size_t offset;
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
47 size_t capacity;
5
3e12bf044589 Fixed Dowa hashmap to recursively add files into memory.
June Park <parkjune1995@gmail.com>
parents: 3
diff changeset
48 } Dowa_Arena, *Dowa_PArena;
2
8a43dedbe530 [Dowa] Added HashMap and Updated Arena naming.
June Park <parkjune1995@gmail.com>
parents: 1
diff changeset
49
21
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
50 /* Creates a new arena with the specified capacity (in bytes). Returns a pointer to the arena, or NULL on failure. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
51 extern Dowa_PArena Dowa_Arena_Create(size_t capacity);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
52 /* Allocates a block of memory of the given size from the arena. Returns pointer to the allocated memory, or NULL if there is insufficient space. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
53 extern void *Dowa_Arena_Allocate(Dowa_PArena arena, size_t size);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
54 /* Destroys the arena and frees its underlying memory block.*/
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
55 extern void Dowa_Arena_Destroy(Dowa_PArena arena);
22
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
56 /* Strdup but saves within the arena */
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
57 extern void *Dowa_Arena_Copy(Dowa_PArena p_arena, const void *src, size_t size);
52
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
58 /* Resets the arena offset to 0, allowing reuse without freeing */
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
59 extern void Dowa_Arena_Reset(Dowa_PArena p_arena);
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
60 /* Returns the current number of bytes allocated in the arena */
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
61 extern size_t Dowa_Arena_Get_Used(Dowa_PArena p_arena);
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
62 /* Returns the remaining capacity in bytes */
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
63 extern size_t Dowa_Arena_Get_Remaining(Dowa_PArena p_arena);
21
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
64
1
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
65
5
3e12bf044589 Fixed Dowa hashmap to recursively add files into memory.
June Park <parkjune1995@gmail.com>
parents: 3
diff changeset
66 // --- HashMap --- //
3
2758f5527d2b [Seobeo] Working on simple TCP server and client logic.
June Park <parkjune1995@gmail.com>
parents: 2
diff changeset
67 typedef enum {
22
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
68 DOWA_HASH_MAP_TYPE_BUFFER, // Raw byte buffer
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
69 DOWA_HASH_MAP_TYPE_STRING, // Null-terminated string
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
70 DOWA_HASH_MAP_TYPE_HASHMAP, // Nested hashmap
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
71 DOWA_HASH_MAP_TYPE_INT // Integer value
5
3e12bf044589 Fixed Dowa hashmap to recursively add files into memory.
June Park <parkjune1995@gmail.com>
parents: 3
diff changeset
72 } Dowa_HashMap_ValueType;
3
2758f5527d2b [Seobeo] Working on simple TCP server and client logic.
June Park <parkjune1995@gmail.com>
parents: 2
diff changeset
73
59
e06bc03d9618 [Color Game] Making game with a friend.
June Park <parkjune1995@gmail.com>
parents: 52
diff changeset
74 typedef struct Dowa_HashEntry {
22
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
75 char *key;
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
76 void *buffer;
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
77 size_t capacity;
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
78 Dowa_HashMap_ValueType type;
947b81010aba [Dowa & Seobeo] Updated so that Dowa hashmaps can use arena and not be broken. Split up web so taht it can handle different paths. Also fixes issues with hash collisions which was pain in the ass.
June Park <parkjune1995@gmail.com>
parents: 21
diff changeset
79 struct Dowa_HashEntry *next;
2
8a43dedbe530 [Dowa] Added HashMap and Updated Arena naming.
June Park <parkjune1995@gmail.com>
parents: 1
diff changeset
80 } Dowa_HashEntry, *Dowa_PHashEntry;
8a43dedbe530 [Dowa] Added HashMap and Updated Arena naming.
June Park <parkjune1995@gmail.com>
parents: 1
diff changeset
81
8a43dedbe530 [Dowa] Added HashMap and Updated Arena naming.
June Park <parkjune1995@gmail.com>
parents: 1
diff changeset
82 typedef struct {
21
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
83 Dowa_PHashEntry *entries;
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
84 size_t capacity;
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
85 uint32 current_capacity;
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
86 Dowa_PArena p_arena;
2
8a43dedbe530 [Dowa] Added HashMap and Updated Arena naming.
June Park <parkjune1995@gmail.com>
parents: 1
diff changeset
87 } Dowa_HashMap, *Dowa_PHashMap;
8a43dedbe530 [Dowa] Added HashMap and Updated Arena naming.
June Park <parkjune1995@gmail.com>
parents: 1
diff changeset
88
21
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
89 /* Creates a new hashmap with the given initial capacity. Returns pointer to the hashmap, or NULL on failure. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
90 extern Dowa_PHashMap Dowa_HashMap_Create(size_t capacity);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
91 /* Creates a new hashmap with the given initial capacity, using the provided arena for all internal allocations. Returns pointer to the hashmap, or NULL on failure. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
92 extern Dowa_PHashMap Dowa_HashMap_Create_With_Arena(size_t capacity, Dowa_PArena arena);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
93 /* Destroys the hashmap and frees all associated memory */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
94 extern void Dowa_HashMap_Destroy(Dowa_PHashMap p_hash_map);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
95 /* Returns the index of the entry for the specified key, or -1 if the key is not found. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
96 extern int32 Dowa_HashMap_Get_Position(Dowa_PHashMap p_hash_map, const char *key);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
97 /* Retrieves the value buffer for the specified key, or NULL if the key does not exist. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
98 extern void *Dowa_HashMap_Get(Dowa_PHashMap p_hash_map, const char *key);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
99 /* Inserts a copy of the given value into the hashmap under the specified key. Uses DOWA_HASH_MAP_TYPE_BUFFER as the entry type. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
100 extern void Dowa_HashMap_Push_Value(Dowa_PHashMap p_hash_map, const char *key, void *value, size_t value_size);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
101 /* Inserts a copy of the given value with the specified type into the hashmap under the key. Returns the index of the new entry, or -1 on failure. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
102 extern int32 Dowa_HashMap_Push_Value_With_Type(Dowa_PHashMap p_hash_map, const char *key, void *value, size_t value_size, Dowa_HashMap_ValueType type);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
103 /* Inserts a value pointer into the hashmap under the specified key without copying data. The caller retains ownership of the pointer. Returns the entry index, or -1 on failure. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
104 extern int32 Dowa_HashMap_Push_Value_With_Type_NoCopy(Dowa_PHashMap p_hash_map, const char *key, void *value, size_t value_size, Dowa_HashMap_ValueType type);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
105 /* Removes the entry with the specified key from the hashmap and frees its data if owned. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
106 extern void Dowa_HashMap_Pop_Key(Dowa_PHashMap p_hash_map, const char *key);
52
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
107 /* Returns TRUE if the key exists in the hashmap, FALSE otherwise. */
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
108 extern boolean Dowa_HashMap_Has_Key(Dowa_PHashMap p_hash_map, const char *key);
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
109 /* Removes all entries from the hashmap without destroying it. */
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
110 extern void Dowa_HashMap_Clear(Dowa_PHashMap p_hash_map);
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
111 /* Returns the number of entries currently in the hashmap. */
636eab07809d Fixed dowa memory problems. Add few more utility functions.
June Park <parkjune1995@gmail.com>
parents: 36
diff changeset
112 extern uint32 Dowa_HashMap_Get_Count(Dowa_PHashMap p_hash_map);
2
8a43dedbe530 [Dowa] Added HashMap and Updated Arena naming.
June Park <parkjune1995@gmail.com>
parents: 1
diff changeset
113
21
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
114 // --- Utility Functions --- //
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
115 /* Prints all entries in the hashmap to stdout for debugging purposes. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
116 extern void Dowa_HashMap_Print(Dowa_PHashMap map);
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
117 /* Loads all files from the specified folder into the hashmap. Uses file names as keys and file contents as values. Returns 0 on success, or -1 on failure. */
09def63429b9 [Dowa] Updated the naming scheme and tests.
June Park <parkjune1995@gmail.com>
parents: 20
diff changeset
118 extern int Dowa_HashMap_Cache_Folder(Dowa_PHashMap map, const char *folder_path);
3
2758f5527d2b [Seobeo] Working on simple TCP server and client logic.
June Park <parkjune1995@gmail.com>
parents: 2
diff changeset
119
1
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
120
adcfad6e86fb Updated naming and separated out some logic within seobeo.
June Park <parkjune1995@gmail.com>
parents:
diff changeset
121 #endif