summaryrefslogtreecommitdiff
path: root/src/include/aplwc.h
diff options
context:
space:
mode:
authorpeter <peter@pmikkelsen.com>2026-09-03 19:31:52 +0000
committerpeter <peter@pmikkelsen.com>2026-09-03 19:31:52 +0000
commitfa6a3ee5b24d5e227798330cff5f9ff060d6d863 (patch)
treeb251207d74ae183b0e0bb155e4e0f9f86334c3d3 /src/include/aplwc.h
parent84dd0d9fa985c1c740b3145c6b0d858cca978911 (diff)
Don't dynamically allocate external reference counted pointers, just use what the user puts on the stack.
FossilOrigin-Name: 270cf0d72050bea15fc40a1e2811ba642e3ef26cbe1fa6231c5aa6f1872ccb34
Diffstat (limited to 'src/include/aplwc.h')
-rw-r--r--src/include/aplwc.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/include/aplwc.h b/src/include/aplwc.h
index 5bd2d89..cb4fe84 100644
--- a/src/include/aplwc.h
+++ b/src/include/aplwc.h
@@ -37,7 +37,8 @@ struct aplwc;
struct aplwc_ref {
struct aplwc *aplwc;
- int id;
+ void *ptr;
+ struct aplwc_ref *link;
};
typedef struct { struct aplwc_ref ref; } AplwcLine;
@@ -52,16 +53,16 @@ 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);
+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 *);
-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);
+void aplwc_read(struct aplwc *, const char *, AplwcLine *);
+void aplwc_free_line(AplwcLine *);
+void aplwc_eval(AplwcLine *, AplwcValue *);
+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);
#endif /* APLWC_H */