+2003-08-12 MORIOKA Tomohiko <tomo@mousai.as.wakwak.ne.jp>
+
+ * configure.in: Update version to 0.2.0.
+
+ * Makefile.in (ABI_VERSION): New variable.
+ (libchise.la): Specify $(ABI_VERSION) as -version-info of libtool.
+
+2003-08-12 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
+ * sample.c (main): Use <CHISE_Decoding_Table> instead of
+ <CHISE_Decoding_Table*> to define `dt_daikanwa'; use
+ <CHISE_Feature_Table> instead of <CHISE_Feature_Table*> to define
+ `ft_ideographic_structure' and `ft_ascii'.
+
+ * chise.c (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.
+
+ * chise.h (CHISE_Attribute_Table): Define as a structure.
+ (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_open_attribute_table): Use <CHISE_Attribute_Table*> instead
+ of <CHISE_Attribute_Table**> as the type of the first argument.
+
2003-08-11 MORIOKA Tomohiko <tomo@mousai.as.wakwak.ne.jp>
* chise.h (chise_dt_put_char): New prototype.
VERSION = @PACKAGE_VERSION@
+ABI_VERSION = 1:0:0
+
all: libchise.la
libchise.la: chise.lo
- $(LIBTOOL) $(CC) -o libchise.la chise.lo $(LIBS) -rpath ${libdir}
+ $(LIBTOOL) $(CC) -o libchise.la chise.lo $(LIBS) \
+ -rpath ${libdir} -version-info $(ABI_VERSION)
chise.lo: chise.c chise.h
$(LIBTOOL) $(CC) $(CFLAGS) chise.c
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)
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)
}
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;
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))
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,
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;
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;
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;
}
}
-typedef DB CHISE_Attribute_Table;
+typedef struct CHISE_Attribute_Table
+{
+ DB *dbp;
+} CHISE_Attribute_Table;
typedef CHISE_Attribute_Table CHISE_Decoding_Table;
-int chise_open_decoding_table (CHISE_Decoding_Table **db,
+int chise_open_decoding_table (CHISE_Decoding_Table *db,
CHISE_DS *ds, const char *ccs,
DBTYPE real_subtype,
u_int32_t accessmask, int modemask);
typedef CHISE_Attribute_Table CHISE_Feature_Table;
-int chise_open_feature_table (CHISE_Feature_Table **db,
+int chise_open_feature_table (CHISE_Feature_Table *db,
CHISE_DS *ds, const char *feature,
DBTYPE real_subtype,
u_int32_t accessmask, int modemask);
char *key, CHISE_Value *valdatum);
-int chise_open_attribute_table (CHISE_Attribute_Table **db,
+int chise_open_attribute_table (CHISE_Attribute_Table *db,
const char *db_dir,
const char *encoding, const char *feature,
DBTYPE real_subtype,
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.57 for libchise 0.1.1.
+# Generated by GNU Autoconf 2.57 for libchise 0.2.0.
#
# Report bugs to <chise-en@m17n.org>.
#
# Identity of this package.
PACKAGE_NAME='libchise'
PACKAGE_TARNAME='libchise'
-PACKAGE_VERSION='0.1.1'
-PACKAGE_STRING='libchise 0.1.1'
+PACKAGE_VERSION='0.2.0'
+PACKAGE_STRING='libchise 0.2.0'
PACKAGE_BUGREPORT='chise-en@m17n.org'
ac_unique_file="chise.c"
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libchise 0.1.1 to adapt to many kinds of systems.
+\`configure' configures libchise 0.2.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libchise 0.1.1:";;
+ short | recursive ) echo "Configuration of libchise 0.2.0:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-libchise configure 0.1.1
+libchise configure 0.2.0
generated by GNU Autoconf 2.57
Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libchise $as_me 0.1.1, which was
+It was created by libchise $as_me 0.2.0, which was
generated by GNU Autoconf 2.57. Invocation command line was
$ $0 $@
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core core.* *.core &&
+ rm -f core *.core &&
rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
( exit $ac_status )
ac_cv_c_stack_direction=-1
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
( exit $ac_status )
ac_cv_func_strnlen_working=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_func_strnlen_working" >&5
} >&5
cat >&5 <<_CSEOF
-This file was extended by libchise $as_me 0.1.1, which was
+This file was extended by libchise $as_me 0.2.0, which was
generated by GNU Autoconf 2.57. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-libchise config.status 0.1.1
+libchise config.status 0.2.0
configured by $0, generated by GNU Autoconf 2.57,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
-AC_INIT(libchise, 0.1.1, chise-en@m17n.org)
+AC_INIT(libchise, 0.2.0, chise-en@m17n.org)
AC_CONFIG_SRCDIR(chise.c)
AC_CONFIG_HEADER(config.h)
main (int argc, char* argv[])
{
CHISE_DS ds;
- CHISE_Decoding_Table *dt_daikanwa;
- CHISE_Feature_Table *ft_ideographic_structure;
- CHISE_Feature_Table *ft_ascii;
+ CHISE_Decoding_Table dt_daikanwa;
+ CHISE_Feature_Table ft_ideographic_structure;
+ CHISE_Feature_Table ft_ascii;
int modemask;
int accessmask = 0;
DBTYPE real_subtype;
accessmask, modemask);
if (status)
{
- chise_close_decoding_table (dt_daikanwa);
+ chise_close_decoding_table (&dt_daikanwa);
chise_close_data_source (&ds);
return -1;
}
/* get a character from the decoding-table */
- char_id = chise_dt_get_char (dt_daikanwa, 364);
+ char_id = chise_dt_get_char (&dt_daikanwa, 364);
/* close the decoding-table */
- chise_close_decoding_table (dt_daikanwa);
+ chise_close_decoding_table (&dt_daikanwa);
/*
real_subtype, accessmask, modemask);
if (status)
{
- chise_close_feature_table (ft_ideographic_structure);
+ chise_close_feature_table (&ft_ideographic_structure);
chise_close_data_source (&ds);
return -1;
}
real_subtype, accessmask, modemask);
if (status)
{
- chise_close_feature_table (ft_ascii);
+ chise_close_feature_table (&ft_ascii);
chise_close_data_source (&ds);
return -1;
}
/* get a feature-value of the character */
- status = chise_ft_get_value (ft_ideographic_structure, char_id, &value);
+ status = chise_ft_get_value (&ft_ideographic_structure, char_id, &value);
if (!status)
printf ("#x%X => %s\n", char_id, chise_value_to_c_string(&value));
else
printf ("#x%X (%d)\n", char_id, status);
- chise_ft_iterate (ft_ascii, &test_map_func);
- chise_ft_iterate (ft_ideographic_structure, &test_map_func);
+ chise_ft_iterate (&ft_ascii, &test_map_func);
+ chise_ft_iterate (&ft_ideographic_structure, &test_map_func);
/* close the feature-table */
- chise_close_feature_table (ft_ideographic_structure);
+ chise_close_feature_table (&ft_ideographic_structure);
- chise_close_feature_table (ft_ascii);
+ chise_close_feature_table (&ft_ascii);
/* close the data-source */