strcpy (buf, msymbol_name (tags[0]));
for (i = 1; i < 4; i++)
{
- strcat (buf, ", ");
+ strcat (buf, ",");
strcat (buf, msymbol_name (tags[i]));
}
return buf;
void *value;
char *filename = get_database_file (db_info, NULL);
FILE *fp;
+ int mdebug_mask = MDEBUG_DATABASE;
+ char buf[256];
+ MDEBUG_PRINT1 (" [DB] <%s>", gen_database_name (buf, tags));
if (! filename || ! (fp = fopen (filename, "r")))
- MERROR (MERROR_DB, NULL);
+ {
+ if (filename)
+ MDEBUG_PRINT1 (" open fail: %s\n", filename);
+ else
+ MDEBUG_PRINT1 (" not found: %s\n", db_info->filename);
+ MERROR (MERROR_DB, NULL);
+ }
+
+ MDEBUG_PRINT1 (" from %s\n", filename);
if (tags[0] == Mchar_table)
value = load_chartable (fp, tags[1]);
}
static void
-register_databases_in_files (MSymbol tags[4], glob_t *globbuf)
+register_databases_in_files (MSymbol tags[4], glob_t *globbuf, int headlen)
{
int i, j;
MPlist *load_key = mplist ();
: (tags[j] != Mnil && tags[j] != tags2[j]))
break;
if (j == 4)
- register_database (tags2, load_database, globbuf->gl_pathv[i],
+ register_database (tags2, load_database,
+ globbuf->gl_pathv[i] + headlen,
MDB_STATUS_AUTO);
}
M17N_OBJECT_UNREF (plist);
{
if (glob (path, GLOB_NOSORT, NULL, &globbuf))
continue;
- register_databases_in_files (tags, &globbuf);
+ register_databases_in_files (tags, &globbuf, 0);
globfree (&globbuf);
}
else
continue;
if (glob (path, GLOB_NOSORT, NULL, &globbuf))
continue;
- register_databases_in_files (tags, &globbuf);
+ register_databases_in_files (tags, &globbuf, d_info->len);
globfree (&globbuf);
}
}
|| mdb->tag[0] == Mchar_table
|| mdb->tag[0] == Mcharset)
MERROR (MERROR_DB, NULL);
- MDEBUG_PRINT1 (" [DATABASE] loading <%s>.\n",
+ MDEBUG_PRINT1 (" [DB] <%s>.\n",
gen_database_name (name, mdb->tag));
db_info = mdb->extra_info;
filename = get_database_file (db_info, NULL);
void *
mdatabase_load (MDatabase *mdb)
{
- int mdebug_mask = MDEBUG_DATABASE;
- char buf[256];
-
- MDEBUG_PRINT1 (" [DATABASE] loading <%s>.\n",
- gen_database_name (buf, mdb->tag));
return (*mdb->loader) (mdb->tag, mdb->extra_info);
}