summary refs log tree commit diff
path: root/src/main.c
diff options
context:
space:
mode:
authorzlago2024-10-03 15:50:44 +0200
committerzlago2024-10-03 15:50:44 +0200
commit54ff18bd32c932b47aa77497bc8a6fb6344894b6 (patch)
tree5b84a9930cd0d0988b7783c6369327ea5a2a59e7 /src/main.c
parentce13cd4be59c0415877571d92aaea3fd0d5a7e49 (diff)
refactor entities
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 8fc400f..2d3e89d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -187,11 +187,11 @@ int main(int const argc, char *const *const argv) {
 			}
 			char *name = a;
 			puts(name);
-			struct entity *(*fun)(void) = res_get_newfun(name);
+			struct funs fun = res_get_fun(name);
 			a += len + 1;
 			map.size -= len + 1;
-			if (fun) {
-				struct entity *entity = fun();
+			if (fun.newfun) {
+				struct entity *entity = fun.newfun();
 				while (1) {
 					if ((len = strnlen(a, map.size)) == map.size) {
 						return 1; // hack
@@ -209,7 +209,7 @@ int main(int const argc, char *const *const argv) {
 					char *value = a;
 					a += len + 1;
 					map.size -= len + 1;
-					if (res_get_setfun(name)(entity, key, value)) {
+					if (fun.setfun(entity, key, value)) {
 						return 1; // hack
 					}
 				}