From: tomo Date: Sun, 17 Aug 2003 17:27:11 +0000 (+0000) Subject: (CHISE_Attribute_Table): Moved from chise.h. X-Git-Tag: b1-r0_2_0-pre3~3 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=53b0c9fefa6ce151ddf7d7defa6138d0fddfb077;p=chise%2Flibchise.git (CHISE_Attribute_Table): Moved from chise.h. (struct CHISE_Decoding_Table): New structure. (chise_ds_open_decoding_table): Cast the return value to . (chise_dt_close): Cast back to . (chise_dt_get_char): Likewise. (struct CHISE_Feature_Table): New structure. (chise_ds_open_feature_table): Cast the return value to . (chise_ft_close): Cast back to . (chise_ft_get_value): Likewise. --- diff --git a/chise.c b/chise.c index bb6578b..7ddb79b 100644 --- a/chise.c +++ b/chise.c @@ -20,6 +20,12 @@ strnlen (register const char *s, register int maxlen) #include "chise.h" +typedef struct CHISE_Attribute_Table +{ + CHISE_DS *ds; + DB *db; +} CHISE_Attribute_Table; + CHISE_Attribute_Table* chise_open_attribute_table (CHISE_DS *ds, const char *encoding, const char *feature, @@ -268,12 +274,19 @@ chise_ds_close (CHISE_DS *ds) } +struct CHISE_Decoding_Table +{ + CHISE_DS *ds; + DB *db; +}; + CHISE_Decoding_Table* chise_ds_open_decoding_table (CHISE_DS *ds, const char *ccs, DBTYPE real_subtype, u_int32_t accessmask, int modemask) { return + (CHISE_Decoding_Table*) chise_open_attribute_table (ds, ccs, "system-char-id", real_subtype, accessmask, modemask); @@ -283,7 +296,7 @@ int chise_dt_close (CHISE_Decoding_Table *table) { if (table) - return chise_close_attribute_table (table); + return chise_close_attribute_table ((CHISE_Attribute_Table*)table); return -1; } @@ -295,7 +308,8 @@ chise_dt_get_char (CHISE_Decoding_Table *table, int code_point) char key_buf[16]; sprintf(key_buf, "%d", code_point); - status = chise_get_attribute_table (table, key_buf, &valdatum); + status = chise_get_attribute_table ((CHISE_Attribute_Table*)table, + key_buf, &valdatum); if (!status) { unsigned char *str @@ -320,6 +334,11 @@ chise_dt_put_char (CHISE_Decoding_Table *table, } +struct CHISE_Feature_Table +{ + CHISE_DS *ds; + DB *db; +}; CHISE_Feature_Table* chise_ds_open_feature_table (CHISE_DS *ds, const char *feature, @@ -327,6 +346,7 @@ chise_ds_open_feature_table (CHISE_DS *ds, const char *feature, u_int32_t accessmask, int modemask) { return + (CHISE_Feature_Table*) chise_open_attribute_table (ds, "system-char-id", feature, real_subtype, accessmask, modemask); @@ -336,7 +356,7 @@ int chise_ft_close (CHISE_Feature_Table *table) { if (table) - return chise_close_attribute_table (table); + return chise_close_attribute_table ((CHISE_Attribute_Table*)table); return -1; } @@ -347,7 +367,8 @@ chise_ft_get_value (CHISE_Feature_Table *table, unsigned char key_buf[8]; chise_format_char_id (cid, key_buf, 8); - return chise_get_attribute_table (table, key_buf, valdatum); + return chise_get_attribute_table ((CHISE_Attribute_Table*)table, + key_buf, valdatum); } void