summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-05-28 10:57:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-05-28 10:57:30 -0700
commit802d3ddb277739b204689e922005b578158cbb83 (patch)
tree71059506e77bebf920c9902637a922f727ea87b6 /hash.c
parentfaff9755a3c84eeb1b51a961777468b899a17a30 (diff)
downloadtxr-802d3ddb277739b204689e922005b578158cbb83.tar.gz
txr-802d3ddb277739b204689e922005b578158cbb83.tar.bz2
txr-802d3ddb277739b204689e922005b578158cbb83.zip
Move registration of hash module functions to hash.c
* eval.c (gethash_s): Global symbol variable removed, due to being used only in one place. (eval_init): Remove registration of make-hash, make-similar-hash, copy-hash, hash, hash-construct, hash-from-pairs, hash-list, inhash, sethash, pushhash, remhash, hash-count, get-hash-userdata, set-hash-userdata, hashp, maphash, hash-eql, hash-equal, hash-keys, hash-values, hash-pairs, hash-alist, hash-uni, hash-diff, hash-isec, hash-subset, hash-proper-subset, group-by, group-reduce, hash-update, hash-update-1, hash-revget, hash-begin, hash-next. * hash.c (hash_init): Registrations removed from eval_init moved here.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index feecce28..b9c113e0 100644
--- a/hash.c
+++ b/hash.c
@@ -39,6 +39,7 @@
#include "signal.h"
#include "unwind.h"
#include "stream.h"
+#include "eval.h"
#include "hash.h"
typedef enum hash_flags {
@@ -1325,4 +1326,44 @@ void hash_init(void)
weak_keys_k = intern(lit("weak-keys"), keyword_package);
weak_vals_k = intern(lit("weak-vals"), keyword_package);
equal_based_k = intern(lit("equal-based"), keyword_package);
+
+ reg_fun(intern(lit("make-hash"), user_package), func_n3(make_hash));
+ reg_fun(intern(lit("make-similar-hash"), user_package), func_n1(make_similar_hash));
+ reg_fun(intern(lit("copy-hash"), user_package), func_n1(copy_hash));
+ reg_fun(intern(lit("hash"), user_package), func_n0v(hashv));
+ reg_fun(intern(lit("hash-construct"), user_package), func_n2(hash_construct));
+ reg_fun(intern(lit("hash-from-pairs"), user_package), func_n1v(hash_from_pairs_v));
+ reg_fun(intern(lit("hash-list"), user_package), func_n1v(hash_list));
+ reg_fun(intern(lit("gethash"), user_package), func_n3o(gethash_n, 2));
+ reg_fun(intern(lit("inhash"), user_package), func_n3o(inhash, 2));
+ reg_fun(intern(lit("sethash"), user_package), func_n3(sethash));
+ reg_fun(intern(lit("pushhash"), user_package), func_n3(pushhash));
+ reg_fun(intern(lit("remhash"), user_package), func_n2(remhash));
+ reg_fun(intern(lit("hash-count"), user_package), func_n1(hash_count));
+ reg_fun(intern(lit("get-hash-userdata"), user_package),
+ func_n1(get_hash_userdata));
+ reg_fun(intern(lit("set-hash-userdata"), user_package),
+ func_n2(set_hash_userdata));
+ reg_fun(intern(lit("hashp"), user_package), func_n1(hashp));
+ reg_fun(intern(lit("maphash"), user_package), func_n2(maphash));
+ reg_fun(intern(lit("hash-eql"), user_package), func_n1(hash_eql));
+ reg_fun(intern(lit("hash-equal"), user_package), func_n1(hash_equal));
+ reg_fun(intern(lit("hash-keys"), user_package), func_n1(hash_keys));
+ reg_fun(intern(lit("hash-values"), user_package), func_n1(hash_values));
+ reg_fun(intern(lit("hash-pairs"), user_package), func_n1(hash_pairs));
+ reg_fun(intern(lit("hash-alist"), user_package), func_n1(hash_alist));
+ reg_fun(intern(lit("hash-uni"), user_package), func_n3o(hash_uni, 2));
+ reg_fun(intern(lit("hash-diff"), user_package), func_n2(hash_diff));
+ reg_fun(intern(lit("hash-isec"), user_package), func_n3o(hash_isec, 2));
+ reg_fun(intern(lit("hash-subset"), user_package), func_n2(hash_subset));
+ reg_fun(intern(lit("hash-proper-subset"), user_package), func_n2(hash_proper_subset));
+ reg_fun(intern(lit("group-by"), user_package), func_n2v(group_by));
+ reg_fun(intern(lit("group-reduce"), user_package),
+ func_n6o(group_reduce, 4));
+ reg_fun(intern(lit("hash-update"), user_package), func_n2(hash_update));
+ reg_fun(intern(lit("hash-update-1"), user_package),
+ func_n4o(hash_update_1, 3));
+ reg_fun(intern(lit("hash-revget"), user_package), func_n4o(hash_revget, 2));
+ reg_fun(intern(lit("hash-begin"), user_package), func_n1(hash_begin));
+ reg_fun(intern(lit("hash-next"), user_package), func_n1(hash_next));
}