From 83f85858ca317fd004f6c007c4ec7a7aac424559 Mon Sep 17 00:00:00 2001 From: Richard Thier Date: Sun, 29 Sep 2024 15:50:53 +0200 Subject: [PATCH] better nopsym --- main.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 482508e..197c9f7 100644 --- a/main.c +++ b/main.c @@ -6,16 +6,24 @@ #define SLC_DEBUG #include "engine/slc.h" -symptr nopsym(SLC_SYM_OP op, slc_tmp_charptr key, symptr ptr) { +symptr nopsym(SLC_SYM_OP op, do_not_save_charptr key, symptr ptr) { + if(op == SLC_SYM_ERASE) { + printf("SYM_ERASE\n"); + } else { + if(op == SLC_SYM_GET) printf("SYM_GET:"); + if(op == SLC_SYM_SET) printf("SYM_SET:"); + printf(" %s", key.ptr); + } + symptr ret; ret.worp = NULL; return ret; // TODO: Create a "peasantly" symbol table where we have: - // - 32 length // - 32 previndex // - 32 nextindex - // - char* name inline stored - // - padding (divisible by 4) + // - void* value; + // - char name[]; // inline stored + // - padding (divisible by 8) // // Then I can do a lookup basically via strstr-like (but 4byte steps!) // with first few characters zero-padded in the search term parameter