diff options
author | Ludovic Courtès <ludo@gnu.org> | 2012-10-12 23:03:39 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2012-10-12 23:21:39 +0200 |
commit | 8ac870dee4397c3b3f0ac24b072e88e87b91e47e (patch) | |
tree | c5e2484df42fcd1e7f1c5abae0b3cdc84cd68df7 /libguile/struct.h | |
parent | 6996f07f577416505b2e33e5967f9fcc933559b7 (diff) | |
download | guile-8ac870dee4397c3b3f0ac24b072e88e87b91e47e.tar.gz |
Implement `hash' for structs.
* libguile/hash.c (scm_hasher): Call `scm_i_struct_hash' upon
`scm_tcs_struct'.
* libguile/struct.c (scm_i_struct_hash): New function.
* libguile/struct.h (scm_i_struct_hash): New declaration.
* test-suite/tests/structs.test ("hash"): New test prefix.
Diffstat (limited to 'libguile/struct.h')
-rw-r--r-- | libguile/struct.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libguile/struct.h b/libguile/struct.h index 3072f24bf..643fd9dc9 100644 --- a/libguile/struct.h +++ b/libguile/struct.h @@ -193,6 +193,8 @@ SCM_API void scm_print_struct (SCM exp, SCM port, scm_print_state *); SCM_INTERNAL SCM scm_i_struct_equalp (SCM s1, SCM s2); SCM_INTERNAL unsigned long scm_struct_ihashq (SCM, unsigned long, void *); +SCM_INTERNAL unsigned long scm_i_struct_hash (SCM s, unsigned long n, + size_t depth); SCM_INTERNAL SCM scm_i_alloc_struct (scm_t_bits *vtable_data, int n_words); SCM_INTERNAL void scm_i_struct_inherit_vtable_magic (SCM vtable, SCM obj); SCM_INTERNAL void scm_init_struct (void); |