summaryrefslogtreecommitdiff
path: root/include/text.h
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2018-06-25 15:50:58 +0300
committerOxore <oxore@protonmail.com>2018-06-25 15:50:58 +0300
commitbf0e5690a31d4c3cecd2ba512729a0b73989bbda (patch)
tree5b95c5a52c8a9025593231ee0285d81d40890f0f /include/text.h
parent63e929f7a23b44ff2b1e33ccf16307de20c2bdc8 (diff)
Major refactoring
Fix memleak in KeyMap, fix memleak caused by loading a yaml file in main.c. Change Copyright information. Rename functions.c and .h to engine.c and .h. Take field and shape related functions to separate file (still not all of them) and refactor them a lot. Refactor collision detection. Add more warnings. Add sanitizer option commented out.
Diffstat (limited to 'include/text.h')
-rw-r--r--include/text.h48
1 files changed, 35 insertions, 13 deletions
diff --git a/include/text.h b/include/text.h
index 1171a51..73285bf 100644
--- a/include/text.h
+++ b/include/text.h
@@ -1,17 +1,39 @@
-FILE *openFile(char *filename);
-void checkArgs(int argc, char **argv);
+typedef struct List {
+ void *obj;
+ void *next;
+ void *prev;
+} List;
+
+typedef struct Pair {
+ void *k;
+ void *v;
+} Pair;
+
+typedef struct KeyMap {
+ Pair *pair;
+ void *next;
+ void *prev;
+} KeyMap;
+
+typedef struct Text {
+ char *font;
+ char *type;
+ char *scene;
+ char *text;
+ void *sfText;
+} Text;
+
+FILE *openFile(char *filename);
+void checkArgs(int argc, char **argv);
KeyMap *KeyMap_getLast(KeyMap **keyMap);
KeyMap *KeyMap_new(KeyMap **keyMap);
KeyMap *KeyMap_get(KeyMap **keyMap, const void *key);
KeyMap *KeyMap_put(KeyMap **keyMap, const void *key, const void *value);
-List *List_getLast(List **list);
-List *List_new(List **list);
-List *ListOfKeyMapOfString_getFromYaml(char *filename);
-void KeyMapOfString_free(KeyMap *keyMap);
-void ListOfKeyMapOfString_free(List **list);
-int _loadText_getInt(void *obj, char *key);
-char *_loadText_getString(void *obj, char *key);
-void _loadText_initSfText(Text *objo, void *obji);
-List *ListOfText_getFromListOfKeyMapOfString(List *list);
-void Text_free(Text *obj);
-void ListOfText_free(List **list);
+List *List_getLast(List **list);
+List *List_new(List **list);
+List *ListOfKeyMapOfString_getFromYaml(char *filename);
+void KeyMapOfString_free(KeyMap *keyMap);
+void ListOfKeyMapOfString_free(List **list);
+List *ListOfText_getFromListOfKeyMapOfString(List *list);
+void Text_free(Text *obj);
+void ListOfText_free(List **list);