From 1b6f0b08946e6b03cad228ede15e7f066b3680b5 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Sat, 30 Jan 2010 08:52:18 +0900 Subject: [PATCH] =?utf8?q?=E3=83=A9=E3=83=99=E3=83=AB=E3=83=8F=E3=83=83?= =?utf8?q?=E3=82=B7=E3=83=A5=E8=A1=A8=E4=BD=9C=E6=88=90=E6=99=82=E3=81=ABh?= =?utf8?q?ash=E9=96=A2=E6=95=B0=E3=82=92=E4=BD=BF=E7=94=A8=E3=81=99?= =?utf8?q?=E3=82=8B=E3=82=88=E3=81=86=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- include/hash.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 include/hash.h diff --git a/include/hash.h b/include/hash.h new file mode 100644 index 0000000..16f02b2 --- /dev/null +++ b/include/hash.h @@ -0,0 +1,17 @@ +/* ハッシュ共用体の型 */ +typedef enum { + CHARS = 0, + INT = 1, +} UTYPE; + +/* ハッシュ共用体 */ +typedef struct { + UTYPE type; + union { + char *s; + int i; + } val; +} HKEY; + +/* ハッシュ値を取得する */ +unsigned hash(int keyc, HKEY *keyv[], int tabsize); -- 2.18.0