projects
/
YACASL2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reset関数の位置を変更
[YACASL2.git]
/
include
/
hash.h
diff --git
a/include/hash.h
b/include/hash.h
index
9821b44
..
caac5f1
100644
(file)
--- a/
include/hash.h
+++ b/
include/hash.h
@@
-1,6
+1,10
@@
#ifndef YACASL2_HASH_INCLUDED
#define YACASL2_HASH_INCLUDED
#ifndef YACASL2_HASH_INCLUDED
#define YACASL2_HASH_INCLUDED
+#ifndef ARRAYSIZE
+#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
+#endif
+
/* ハッシュ共用体の型 */
typedef enum {
CHARS = 0,
/* ハッシュ共用体の型 */
typedef enum {
CHARS = 0,
@@
-16,6
+20,9
@@
typedef struct {
} val;
} HKEY;
} val;
} HKEY;
+/* ハッシュ表のサイズを決めるため、引数の数値未満で最大の素数を返す */
+int hashtabsize(int size);
+
/* ハッシュ値を取得する */
unsigned hash(int keyc, HKEY *keyv[], int tabsize);
/* ハッシュ値を取得する */
unsigned hash(int keyc, HKEY *keyv[], int tabsize);