summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorpeter <peter@pmikkelsen.com>2026-08-31 20:22:47 +0000
committerpeter <peter@pmikkelsen.com>2026-08-31 20:22:47 +0000
commit8b0beb9e6a57c1d4f1e7b0b06523dd0fc538771a (patch)
tree9bb8b689020d5098ea3c31251ddcd2fbb9524a7c /src/include
parentd361abaeb8dcf19446a9322737ea600b22568a5b (diff)
parentf9f9b10c1d17077632d7a09e447e629b8d33b23d (diff)
Merge memory manager changes into trunk
FossilOrigin-Name: af583e3ba70b2d10efdead8e03a42fe5c1b94d6b387522833606c138b527a653
Diffstat (limited to 'src/include')
-rw-r--r--src/include/aplwc.h33
1 files changed, 23 insertions, 10 deletions
diff --git a/src/include/aplwc.h b/src/include/aplwc.h
index 3061500..6ba2e35 100644
--- a/src/include/aplwc.h
+++ b/src/include/aplwc.h
@@ -15,21 +15,34 @@ enum aplwc_rc {
};
struct aplwc;
-struct aplwc_line;
-struct aplwc_value;
-enum aplwc_rc aplwc_new(struct aplwc **, uint8_t *, size_t);
+struct aplwc_ref {
+ struct aplwc *aplwc;
+ int id;
+};
+
+typedef struct { struct aplwc_ref ref; } AplwcLine;
+typedef struct { struct aplwc_ref ref; } AplwcValue;
+
+struct aplwc_fns {
+ void *(*alloc)(size_t, size_t, size_t *);
+ void (*dealloc)(void *);
+};
+
+struct aplwc *aplwc_new(struct aplwc_fns, enum aplwc_rc *);
void aplwc_destroy(struct aplwc *);
+void aplwc_clear_line(AplwcLine *);
+void aplwc_clear_value(AplwcValue *);
+int aplwc_valid_line(AplwcLine);
+int aplwc_valid_value(AplwcValue);
const char *aplwc_errstr_rc(enum aplwc_rc);
const char *aplwc_errstr(struct aplwc *);
enum aplwc_rc aplwc_last_error(struct aplwc *);
-struct aplwc_line *aplwc_read(struct aplwc *, const char *);
-void aplwc_free_line(struct aplwc_line *);
-struct aplwc_value *aplwc_eval(struct aplwc_line *);
-void aplwc_free_value(struct aplwc_value *);
-const char *aplwc_value_string(struct aplwc_value *);
+AplwcLine aplwc_read(struct aplwc *, const char *);
+void aplwc_free_line(AplwcLine);
+AplwcValue aplwc_eval(AplwcLine);
+void aplwc_free_value(AplwcValue);
+const char *aplwc_value_string(AplwcValue);
enum aplwc_rc aplwc_load_module(struct aplwc *, const char *, const char *, int n);
-#define APLWC_MIN_MEM (64000)
-
#endif /* APLWC_H */