From 54ff18bd32c932b47aa77497bc8a6fb6344894b6 Mon Sep 17 00:00:00 2001 From: zlago Date: Thu, 3 Oct 2024 15:50:44 +0200 Subject: refactor entities --- src/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main.c') 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 } } -- cgit 1.4.1-2-gfad0