From: tomo Date: Tue, 12 Aug 2003 17:15:48 +0000 (+0000) Subject: (chise_open_decoding_table): Use `CHISE_Decoding_Table *' instead of X-Git-Tag: b1-r0_2_0-pre1~5 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=c334c5225035cef665c4e6c55d4167f065026d67;p=chise%2Flibchise.git (chise_open_decoding_table): Use `CHISE_Decoding_Table *' instead of `CHISE_Decoding_Table **' as the type of the first argument. (chise_open_feature_table): Use `CHISE_Feature_Table *' instead of `CHISE_Feature_Table **' as the type of the first argument. (chise_ft_iterate): Modify for the structure `CHISE_Feature_Table'. (chise_open_attribute_table): Use `CHISE_Attribute_Table *' instead of `CHISE_Attribute_Table **' as the type of the first argument; modify for the structure `CHISE_Feature_Table'. (chise_close_attribute_table): Modify for the structure `CHISE_Feature_Table'. (chise_get_attribute_table): Likewise. (chise_put_attribute_table): Likewise. --- diff --git a/chise.c b/chise.c index e76f8e1..5d382c1 100644 --- a/chise.c +++ b/chise.c @@ -237,7 +237,7 @@ chise_close_data_source (CHISE_DS *ds) int -chise_open_decoding_table (CHISE_Decoding_Table **db, +chise_open_decoding_table (CHISE_Decoding_Table *db, CHISE_DS *ds, const char *ccs, DBTYPE real_subtype, u_int32_t accessmask, int modemask) @@ -291,7 +291,7 @@ chise_dt_put_char (CHISE_Decoding_Table *db, int -chise_open_feature_table (CHISE_Feature_Table **db, +chise_open_feature_table (CHISE_Feature_Table *db, CHISE_DS *ds, const char *feature, DBTYPE real_subtype, u_int32_t accessmask, int modemask) @@ -321,8 +321,8 @@ chise_ft_get_value (CHISE_Feature_Table *db, } void -chise_ft_iterate (CHISE_Feature_Table *dbp, - int (*func) (CHISE_Feature_Table *db, +chise_ft_iterate (CHISE_Feature_Table *ft, + int (*func) (CHISE_Feature_Table *ft, CHISE_Char_ID cid, CHISE_Value *valdatum)) { DBT keydatum, valdatum; @@ -332,7 +332,7 @@ chise_ft_iterate (CHISE_Feature_Table *dbp, xzero (keydatum); xzero (valdatum); - status = dbp->cursor (dbp, NULL, &dbcp, 0); + status = ft->dbp->cursor (ft->dbp, NULL, &dbcp, 0); for (status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_FIRST); status == 0; status = dbcp->c_get (dbcp, &keydatum, &valdatum, DB_NEXT)) @@ -342,14 +342,14 @@ chise_ft_iterate (CHISE_Feature_Table *dbp, CHISE_Char_ID key = chise_char_id_parse_c_string (key_str, key_len); int ret; - if (ret = func (dbp, key, &valdatum)) + if (ret = func (ft, key, &valdatum)) break; } dbcp->c_close (dbcp); } int -chise_open_attribute_table (CHISE_Attribute_Table **db, +chise_open_attribute_table (CHISE_Attribute_Table *ft, const char *db_dir, const char *encoding, const char *feature, DBTYPE real_subtype, @@ -399,23 +399,23 @@ chise_open_attribute_table (CHISE_Attribute_Table **db, dbase->close (dbase, 0); return -1; } - *db = dbase; + ft->dbp = dbase; return 0; } int -chise_close_attribute_table (CHISE_Attribute_Table *db) +chise_close_attribute_table (CHISE_Attribute_Table *ft) { - if (db) + if (ft->dbp) { - db->sync (db, 0); - db->close (db, 0); + ft->dbp->sync (ft->dbp, 0); + ft->dbp->close (ft->dbp, 0); } return 0; } int -chise_get_attribute_table (CHISE_Attribute_Table *db, +chise_get_attribute_table (CHISE_Attribute_Table *ft, char *key, CHISE_Value *valdatum) { DBT keydatum; @@ -428,12 +428,12 @@ chise_get_attribute_table (CHISE_Attribute_Table *db, keydatum.data = key; keydatum.size = strlen (key); - status = db->get (db, NULL, &keydatum, valdatum, 0); + status = ft->dbp->get (ft->dbp, NULL, &keydatum, valdatum, 0); return status; } int -chise_put_attribute_table (CHISE_Attribute_Table *db, +chise_put_attribute_table (CHISE_Attribute_Table *ft, char *key, char *value) { DBT keydatum, valdatum; @@ -449,6 +449,6 @@ chise_put_attribute_table (CHISE_Attribute_Table *db, valdatum.data = value; valdatum.size = strlen (value); - status = db->put (db, NULL, &keydatum, &valdatum, 0); + status = ft->dbp->put (ft->dbp, NULL, &keydatum, &valdatum, 0); return status; }