1 /* database.h -- header file for the database module.
2 Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
3 National Institute of Advanced Industrial Science and Technology (AIST)
4 Registration Number H15PRO112
6 This file is part of the m17n library.
8 The m17n library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public License
10 as published by the Free Software Foundation; either version 2.1 of
11 the License, or (at your option) any later version.
13 The m17n library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with the m17n library; if not, write to the Free
20 Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 #ifndef _M17N_DATABASE_H_
24 #define _M17N_DATABASE_H_
27 #define M17NDIR "/usr/local/share/m17n"
34 #ifndef PATH_SEPARATOR
35 #define PATH_SEPARATOR '/'
40 /* The database was defined automatically (from mdb.dir file(s))
41 with no wildcard tag. */
43 /* The database was defined automatically (from mdb.dir file(s)).
44 with a wildcard tag. */
45 MDB_STATUS_AUTO_WILDCARD,
46 /* The database was defined explicitely (by mdatabase_define ()). */
48 /* The databse is currently disabled. (usually because it is
49 deleted from mdb.dir file(s)). */
57 /* Name of the file containing the database. */
59 /* Length of FILENAME. */
61 /* Absolute path of filename. */
62 char *absolute_filename;
63 /* The current status of the database. */
64 enum MDatabaseStatus status;
65 /* When the database was loaded last. 0 if it has never been
68 char *lock_file, *uniq_file;
73 extern MPlist *mdatabase__dir_list;
75 extern void mdatabase__update (void);
77 extern MPlist *mdatabase__load_for_keys (MDatabase *mdb, MPlist *keys);
79 extern int mdatabase__check (MDatabase *mdb);
81 extern char *mdatabase__find_file (char *filename);
83 extern char *mdatabase__file (MDatabase *mdb);
85 extern int mdatabase__lock (MDatabase *mdb);
87 extern int mdatabase__save (MDatabase *mdb, MPlist *data);
89 extern int mdatabase__unlock (MDatabase *mdb);
91 extern MPlist *mdatabase__props (MDatabase *mdb);
93 extern void *(*mdatabase__load_charset_func) (FILE *fp, MSymbol charset_name);
95 #endif /* not _M17N_DATABASE_H_ */