From 127f5cfdbcf35e7325684cff44fa8c7375962e62 Mon Sep 17 00:00:00 2001 From: tomo Date: Wed, 8 Oct 2003 13:14:34 +0000 Subject: [PATCH] (char db_dir): Deleted. (main): Use ${chise_db_dir}/db/ for the location of data-source. --- sample.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/sample.c b/sample.c index 3b27e8e..ab4b7a7 100644 --- a/sample.c +++ b/sample.c @@ -1,6 +1,6 @@ +#include #include -char db_dir[] = "/usr/local/lib/chise/char-db"; int test_map_func (CHISE_Char_ID cid, CHISE_Feature_Table *db, @@ -35,6 +35,19 @@ main (int argc, char* argv[]) CHISE_Char_ID char_id; CHISE_Value value; unsigned char buf[1024]; + unsigned char *db_dir; + + printf("chise_db_dir = %s\n", chise_db_dir); + + db_dir = (unsigned char*)alloca (strlen (chise_db_dir) + 4); + if (db_dir == NULL) + { + printf ("Can't open data source\n"); + return -1; + } + strcpy (db_dir, chise_db_dir); + strcat (db_dir, "db/"); + printf("db_dir = '%s'\n", db_dir); /* open a data-source */ ds = CHISE_DS_open (CHISE_DS_Berkeley_DB, db_dir, -- 1.7.10.4