(concord_open_ds): Use <char*> instead of <unsigned char*> for
[chise/concord.git] / concord.c
index 6ed7bb6..1c42ebc 100644 (file)
--- a/concord.c
+++ b/concord.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003,2004,2005 MORIOKA Tomohiko
+/* Copyright (C) 2003,2004,2005,2006 MORIOKA Tomohiko
    This file is part of the CONCORD Library.
 
    The CONCORD Library is free software; you can redistribute it and/or
@@ -92,7 +92,7 @@ concord_default_read_object (const unsigned char* str, size_t length)
 }
 
 CONCORD_DS
-concord_open_ds (CONCORD_Backend_Type type, const unsigned char* location,
+concord_open_ds (CONCORD_Backend_Type type, const char* location,
                 int subtype, int modemask)
 {
   CONCORD_DS ds = (CONCORD_DS)malloc (sizeof (CONCORD_DS_Table));
@@ -136,7 +136,7 @@ concord_close_ds (CONCORD_DS ds)
   return 0;
 }
 
-unsigned char*
+char*
 concord_ds_location (CONCORD_DS ds)
 {
   return ds->location;
@@ -160,7 +160,7 @@ concord_ds_set_read_object_function (CONCORD_DS ds,
 }
 
 CONCORD_Genre
-concord_ds_get_genre (CONCORD_DS ds, const unsigned char* name)
+concord_ds_get_genre (CONCORD_DS ds, const char* name)
 {
   CONCORD_Genre genre;
 
@@ -182,8 +182,7 @@ concord_ds_get_genre (CONCORD_DS ds, const unsigned char* name)
 
 int
 concord_ds_foreach_genre_name (CONCORD_DS ds,
-                              int (*func) (CONCORD_DS ds,
-                                           unsigned char* name))
+                              int (*func) (CONCORD_DS ds, char* name))
 {
   unsigned char* dname = ds->location;
   DIR *dir;
@@ -346,7 +345,7 @@ concord_close_genre (CONCORD_Genre genre)
   return status;
 }
 
-unsigned char*
+char*
 concord_genre_get_name (CONCORD_Genre genre)
 {
   return genre->name;
@@ -361,7 +360,7 @@ concord_genre_get_data_source (CONCORD_Genre genre)
 int
 concord_genre_foreach_feature_name (CONCORD_Genre genre,
                                    int (*func) (CONCORD_Genre genre,
-                                                unsigned char* name))
+                                                char* name))
 {
   unsigned char *dname
     = alloca (strlen (genre->ds->location)
@@ -477,7 +476,7 @@ concord_genre_get_feature_0 (CONCORD_Genre genre, const unsigned char* name)
 }
 
 CONCORD_Feature
-concord_genre_get_feature (CONCORD_Genre genre, const unsigned char* name)
+concord_genre_get_feature (CONCORD_Genre genre, const char* name)
 {
   CONCORD_Genre g_feature
     = concord_ds_get_genre (genre->ds, "feature");
@@ -508,7 +507,7 @@ concord_genre_get_feature (CONCORD_Genre genre, const unsigned char* name)
 }
 
 CONCORD_INDEX
-concord_genre_get_index (CONCORD_Genre genre, const unsigned char* name)
+concord_genre_get_index (CONCORD_Genre genre, const char* name)
 {
   CONCORD_INDEX index;
 
@@ -587,7 +586,7 @@ concord_close_feature (CONCORD_Feature feature)
   return status;
 }
 
-unsigned char*
+char*
 concord_feature_get_name (CONCORD_Feature feature)
 {
   return feature->name;
@@ -654,7 +653,7 @@ concord_feature_sync (CONCORD_Feature feature)
 }
 
 int
-concord_obj_put_feature_value_str (const unsigned char* object_id,
+concord_obj_put_feature_value_str (const char* object_id,
                                   CONCORD_Feature feature,
                                   unsigned char* value)
 {
@@ -666,7 +665,7 @@ concord_obj_put_feature_value_str (const unsigned char* object_id,
 }
 
 int
-concord_obj_get_feature_value_string (const unsigned char* object_id,
+concord_obj_get_feature_value_string (const char* object_id,
                                      CONCORD_Feature feature,
                                      CONCORD_String value)
 {
@@ -679,7 +678,7 @@ concord_obj_get_feature_value_string (const unsigned char* object_id,
 }
 
 CONCORD_Object
-concord_obj_get_feature_value (const unsigned char* object_id,
+concord_obj_get_feature_value (const char* object_id,
                               CONCORD_Feature feature)
 {
   DBT valdatum;
@@ -694,7 +693,7 @@ concord_obj_get_feature_value (const unsigned char* object_id,
 }
 
 unsigned char*
-concord_obj_gets_feature_value (const unsigned char* object_id,
+concord_obj_gets_feature_value (const char* object_id,
                                CONCORD_Feature feature,
                                unsigned char* dst, size_t size)
 {
@@ -857,8 +856,7 @@ concord_index_sync (CONCORD_INDEX index)
 
 int
 concord_index_strid_put_obj (CONCORD_INDEX index,
-                            const unsigned char* strid,
-                            unsigned char* object_id)
+                            const char* strid, char* object_id)
 {
   if (index == NULL)
     return -1;
@@ -871,7 +869,7 @@ concord_index_strid_put_obj (CONCORD_INDEX index,
 
 int
 concord_index_strid_get_obj_string (CONCORD_INDEX index,
-                                   const unsigned char* strid,
+                                   const char* strid,
                                    CONCORD_String object_id)
 {
   if (index == NULL)