From: tomo Date: Fri, 14 Apr 2006 15:58:08 +0000 (+0000) Subject: (concord_open_ds): Use instead of for X-Git-Tag: libconcord-0_0_0~5 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5ef940dc3fdb924beec6313ce28b5ad550d72948;p=chise%2Fconcord.git (concord_open_ds): Use instead of for location. (concord_ds_location): Likewise. (concord_ds_foreach_genre_name): Use instead of for genre-name. (concord_ds_get_genre): Likewise. (concord_genre_get_name): Likewise. (concord_genre_foreach_feature_name): Likewise. (concord_genre_get_feature): Use instead of for feature-name. (concord_feature_get_name): Likewise. (concord_obj_put_feature_value_str): Use instead of for object-id. (concord_obj_get_feature_value): Likewise. (concord_obj_get_feature_value_string): Likewise. (concord_obj_gets_feature_value): Likewise. (concord_genre_get_index): Use instead of for index-name. (concord_index_strid_put_obj): Use instead of for indexer and object-id. (concord_index_strid_get_obj_string): Use instead of for indexer. --- diff --git a/concord.c b/concord.c index 6ed7bb6..1c42ebc 100644 --- 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) diff --git a/concord.h b/concord.h index 92e9398..3b8ec69 100644 --- a/concord.h +++ b/concord.h @@ -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 @@ -48,12 +48,12 @@ typedef struct CONCORD_DS_Table CONCORD_DS_Table; typedef CONCORD_DS_Table* CONCORD_DS; 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); int concord_close_ds (CONCORD_DS ds); -unsigned char* concord_ds_location (CONCORD_DS ds); +char* concord_ds_location (CONCORD_DS ds); int concord_ds_set_object_failure (CONCORD_DS ds, CONCORD_Object object_nil); @@ -65,34 +65,32 @@ concord_ds_set_read_object_function (CONCORD_DS ds, int concord_ds_foreach_genre_name (CONCORD_DS ds, - int (*func) (CONCORD_DS ds, - unsigned char* name)); + int (*func) (CONCORD_DS ds, char* name)); typedef struct CONCORD_Genre_Table CONCORD_Genre_Table; typedef CONCORD_Genre_Table* CONCORD_Genre; CONCORD_Genre -concord_ds_get_genre (CONCORD_DS ds, const unsigned char* name); +concord_ds_get_genre (CONCORD_DS ds, const char* name); -unsigned char* concord_genre_get_name (CONCORD_Genre genre); +char* concord_genre_get_name (CONCORD_Genre genre); CONCORD_DS 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)); typedef struct CONCORD_Feature_Table CONCORD_Feature_Table; typedef CONCORD_Feature_Table* CONCORD_Feature; CONCORD_Feature -concord_genre_get_feature (CONCORD_Genre genre, const unsigned char* name); +concord_genre_get_feature (CONCORD_Genre genre, const char* name); -unsigned char* -concord_feature_get_name (CONCORD_Feature feature); +char* concord_feature_get_name (CONCORD_Feature feature); CONCORD_Genre concord_feature_get_genre (CONCORD_Feature feature); @@ -101,19 +99,19 @@ int concord_feature_setup_db (CONCORD_Feature feature, int writable); int 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); CONCORD_Object -concord_obj_get_feature_value (const unsigned char* object_id, +concord_obj_get_feature_value (const char* object_id, CONCORD_Feature feature); 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); 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); @@ -129,18 +127,18 @@ typedef struct CONCORD_INDEX_Table CONCORD_INDEX_Table; typedef CONCORD_INDEX_Table* CONCORD_INDEX; CONCORD_INDEX -concord_genre_get_index (CONCORD_Genre genre, const unsigned char* name); +concord_genre_get_index (CONCORD_Genre genre, const char* name); int concord_index_setup_db (CONCORD_INDEX index, int writable); int 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); int concord_index_strid_get_obj_string (CONCORD_INDEX index, - const unsigned char* strid, + const char* strid, CONCORD_String object_id); #if 0