From: tomo Date: Wed, 8 Oct 2003 13:14:34 +0000 (+0000) Subject: (char db_dir): Deleted. X-Git-Tag: b1-r0_2_0-pre8~6 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=127f5cfdbcf35e7325684cff44fa8c7375962e62;p=chise%2Flibchise.git (char db_dir): Deleted. (main): Use ${chise_db_dir}/db/ for the location of data-source. --- 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,