aboutsummaryrefslogtreecommitdiffstats
path: root/hashlib.h
diff options
context:
space:
mode:
authorJari Aalto <jari.aalto@cante.net>2001-11-13 17:56:06 +0000
committerJari Aalto <jari.aalto@cante.net>2009-09-12 16:46:54 +0000
commitf73dda092b33638d2d5e9c35375f687a607b5403 (patch)
treef21584e70a444d6a1ecba0fb5e2cf79e8cce91db /hashlib.h
parent28ef6c316f1aff914bb95ac09787a3c83c1815fd (diff)
downloadandroid_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.gz
android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.tar.bz2
android_external_bash-f73dda092b33638d2d5e9c35375f687a607b5403.zip
Imported from ../bash-2.05a.tar.gz.
Diffstat (limited to 'hashlib.h')
-rw-r--r--hashlib.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/hashlib.h b/hashlib.h
index d8cc793..9c3dee0 100644
--- a/hashlib.h
+++ b/hashlib.h
@@ -36,12 +36,14 @@ typedef struct hash_table {
int nentries; /* How many entries does this table have. */
} HASH_TABLE;
-extern int hash_string __P((char *, HASH_TABLE *));
+extern int hash_string __P((const char *, HASH_TABLE *));
+extern int hash_table_nentries __P((HASH_TABLE *));
extern HASH_TABLE *make_hash_table __P((int));
-extern BUCKET_CONTENTS *find_hash_item __P((char *, HASH_TABLE *));
-extern BUCKET_CONTENTS *remove_hash_item __P((char *, HASH_TABLE *));
+extern HASH_TABLE *copy_hash_table __P((HASH_TABLE *, sh_string_func_t *));
+extern BUCKET_CONTENTS *find_hash_item __P((const char *, HASH_TABLE *));
+extern BUCKET_CONTENTS *remove_hash_item __P((const char *, HASH_TABLE *));
extern BUCKET_CONTENTS *add_hash_item __P((char *, HASH_TABLE *));
-extern void flush_hash_table __P((HASH_TABLE *, VFunction *));
+extern void flush_hash_table __P((HASH_TABLE *, sh_free_func_t *));
extern void dispose_hash_table __P((HASH_TABLE *));
/* Redefine the function as a macro for speed. */
@@ -53,7 +55,7 @@ extern void dispose_hash_table __P((HASH_TABLE *));
/* Default number of buckets in the hash table. */
#define DEFAULT_HASH_BUCKETS 53 /* was 107 */
-#define HASH_ENTRIES(ht) (ht)->nentries
+#define HASH_ENTRIES(ht) ((ht) ? (ht)->nentries : 0)
#if !defined (NULL)
# if defined (__STDC__)