aboutsummaryrefslogtreecommitdiff
path: root/src/symtab.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/symtab.c')
-rw-r--r--src/symtab.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/symtab.c b/src/symtab.c
index ac1581b..297787c 100644
--- a/src/symtab.c
+++ b/src/symtab.c
@@ -73,11 +73,9 @@ syment_alloc(struct grecs_symtab *st, void *key)
}
-static unsigned
-def_hash(void *data, unsigned long hashsize)
+unsigned
+grecs_hash_string(const char *name, unsigned long hashsize)
{
- struct grecs_syment *sym = data;
- const char *name = sym->name;
unsigned i;
for (i = 0; *name; name++) {
@@ -87,6 +85,13 @@ def_hash(void *data, unsigned long hashsize)
return i % hashsize;
}
+static unsigned
+def_hash(void *data, unsigned long hashsize)
+{
+ struct grecs_syment *sym = data;
+ return grecs_hash_string(sym->name, hashsize);
+}
+
static int
def_cmp(const void *a, const void *b)
{

Return to:

Send suggestions and report system problems to the System administrator.