Include "chise-name.h".
authortomo <tomo>
Thu, 28 Aug 2003 16:16:33 +0000 (16:16 +0000)
committertomo <tomo>
Thu, 28 Aug 2003 16:16:33 +0000 (16:16 +0000)
(chise_name_table_put): Use <const unsigned char*> instead of
<unsigned char*> for key.
(chise_name_table_get): Likewise.

name.c

diff --git a/name.c b/name.c
index 501df93..607f006 100644 (file)
--- a/name.c
+++ b/name.c
@@ -1,16 +1,17 @@
 #include <string.h>
+#include "chise-name.h"
 
-typedef struct CHISE_HASH_TABLE_ENTRY
+struct CHISE_HASH_TABLE_ENTRY
 {
   void *key;
   void *value;
-} CHISE_HASH_TABLE_ENTRY;
+};
 
-typedef struct CHISE_HASH_TABLE
+struct CHISE_HASH_TABLE
 {
   size_t size;
   CHISE_HASH_TABLE_ENTRY *data;
-} CHISE_HASH_TABLE;
+};
 
 CHISE_HASH_TABLE*
 chise_make_hash_table (size_t size)
@@ -63,9 +64,6 @@ chise_hash_c_string (const unsigned char *ptr)
 }
 
 
-typedef CHISE_HASH_TABLE CHISE_NAME_TABLE;
-typedef CHISE_HASH_TABLE_ENTRY CHISE_NAME_TABLE_ENTRY;
-
 CHISE_NAME_TABLE*
 chise_make_name_table ()
 {
@@ -80,7 +78,7 @@ chise_destroy_name_table (CHISE_NAME_TABLE* table)
 
 int
 chise_name_table_put (CHISE_NAME_TABLE* table,
-                     unsigned char *key, void *value)
+                     const unsigned char *key, void *value)
 {
   int i, index;
   CHISE_NAME_TABLE_ENTRY* entry;
@@ -116,7 +114,7 @@ chise_name_table_put (CHISE_NAME_TABLE* table,
 
 void *
 chise_name_table_get (CHISE_NAME_TABLE* table,
-                     unsigned char *key)
+                     const unsigned char *key)
 {
   int i, index;
   CHISE_NAME_TABLE_ENTRY entry;