summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-02-27 08:24:15 -0800
committerKaz Kylheku <kaz@kylheku.com>2024-02-27 08:24:15 -0800
commitae35620d9fa6a0bd5656952154b7e1866a79b9f5 (patch)
treec307088221623cb3e586945650864dd442466eca /lib.h
parentef524fdf234fe51a37021b8c1a3bb700d5501132 (diff)
downloadtxr-ae35620d9fa6a0bd5656952154b7e1866a79b9f5.tar.gz
txr-ae35620d9fa6a0bd5656952154b7e1866a79b9f5.tar.bz2
txr-ae35620d9fa6a0bd5656952154b7e1866a79b9f5.zip
seq_build: put self name into structure.
* lib.h (struct seq_build): New member, self. (struct seq_build_ops): Remove self parameter from pend function. (seq_build_init, seq_pend): Declarations updated. * lib.c (seq_build_generic_pend): Drop self parameter, take the value from structure. (seq_build_buf_pend): Drop self parameter. (seq_build_init): New self parameter. Pass recursively. (seq_pend): Self parameter dropped. (rem_impl, rem_if_impl, keep_keys_if, separate, separate_keys): Pass self to seq_build_init.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib.h b/lib.h
index 5084c1dc..a6e4869e 100644
--- a/lib.h
+++ b/lib.h
@@ -471,6 +471,7 @@ struct seq_iter_ops {
typedef struct seq_build {
val obj;
+ val self;
union {
val from_list_meth;
val carray_type;
@@ -480,7 +481,7 @@ typedef struct seq_build {
struct seq_build_ops {
void (*add)(struct seq_build *, val);
- void (*pend)(struct seq_build *, val, val self);
+ void (*pend)(struct seq_build *, val);
void (*finish)(struct seq_build *);
void (*mark)(struct seq_build *);
};
@@ -763,9 +764,9 @@ val iter_more(val iter);
val iter_item(val iter);
val iter_step(val iter);
val iter_reset(val iter, val obj);
-void seq_build_init(seq_build_t *bu, val likeobj);
+void seq_build_init(val self, seq_build_t *bu, val likeobj);
void seq_add(seq_build_t *bu, val item);
-void seq_pend(seq_build_t *bu, val items, val self);
+void seq_pend(seq_build_t *bu, val items);
val seq_finish(seq_build_t *bu);
NORETURN val throw_mismatch(val self, val obj, type_t);
INLINE val type_check(val self, val obj, type_t typecode)