Merge branch 'master' of dragon:/home/dav/yacasl2
[YACASL2.git] / include / hash.h
index 16f02b2..caac5f1 100644 (file)
@@ -1,3 +1,10 @@
+#ifndef YACASL2_HASH_INCLUDED
+#define YACASL2_HASH_INCLUDED
+
+#ifndef ARRAYSIZE
+#define ARRAYSIZE(array) (sizeof(array)/sizeof(array[0]))
+#endif
+
 /* ハッシュ共用体の型 */
 typedef enum {
     CHARS = 0,
@@ -13,5 +20,10 @@ typedef struct {
     } val;
 } HKEY;
 
+/* ハッシュ表のサイズを決めるため、引数の数値未満で最大の素数を返す */
+int hashtabsize(int size);
+
 /* ハッシュ値を取得する */
 unsigned hash(int keyc, HKEY *keyv[], int tabsize);
+
+#endif