summaryrefslogtreecommitdiffstats
path: root/lib.h
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-01-29 21:32:56 -0800
committerKaz Kylheku <kaz@kylheku.com>2015-01-29 21:32:56 -0800
commit0ba5923568ef1bf13eee30012fbf2977fe8b5a7c (patch)
tree76dad63ef029e3ed14eaac2eb329eee58582a58b /lib.h
parenta11dd30b417e1f48da573748fa4ab5fe09f0b212 (diff)
downloadtxr-0ba5923568ef1bf13eee30012fbf2977fe8b5a7c.tar.gz
txr-0ba5923568ef1bf13eee30012fbf2977fe8b5a7c.tar.bz2
txr-0ba5923568ef1bf13eee30012fbf2977fe8b5a7c.zip
Use macro to initialize cobj_ops.
* lib.h (cobj_ops_init): New macro. * hash.c (hash_ops, hash_iter_ops): Initialize with cobj_ops_init. * rand.c (random_state_ops): Likewise. * regex.c (char_set_obj_ops, regex_obj_ops): Likewise.
Diffstat (limited to 'lib.h')
-rw-r--r--lib.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index 511f6838..39ffbdbf 100644
--- a/lib.h
+++ b/lib.h
@@ -204,6 +204,9 @@ struct cobj_ops {
cnum (*hash)(val self);
};
+#define cobj_ops_init(equal, print, destroy, mark, hash) \
+ { equal, print, destroy, mark, hash }
+
/* Default operations for above structure.
* Default equal is eq
*/