1267
|
1 /* db.h: lookups in an externally built db file. |
|
2 |
|
3 Copyright (C) 1994 Karl Berry. |
|
4 |
|
5 This program is free software; you can redistribute it and/or modify |
|
6 it under the terms of the GNU General Public License as published by |
|
7 the Free Software Foundation; either version 2, or (at your option) |
|
8 any later version. |
|
9 |
|
10 This program is distributed in the hope that it will be useful, |
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 GNU General Public License for more details. |
|
14 |
|
15 You should have received a copy of the GNU General Public License |
|
16 along with this program; if not, write to the Free Software |
1315
|
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
1267
|
18 |
|
19 #ifndef KPATHSEA_DB_H |
|
20 #define KPATHSEA_DB_H |
|
21 |
|
22 #include <kpathsea/c-proto.h> |
|
23 #include <kpathsea/types.h> |
|
24 #include <kpathsea/str-list.h> |
|
25 |
|
26 /* It's not an error if this doesn't exist; we just go ahead and search |
|
27 the actual directories. See the `Filename database' node in the |
|
28 kpathsea documentation for details. The variable reference here is |
|
29 expanded by kpathsea. This lets you have different databases for |
|
30 different TeX hierarchies (only one at a time, though!) without |
|
31 having to change anything. */ |
|
32 #ifndef KPSE_DB_DIR |
|
33 #define KPSE_DB_DIR "$TEXMF" |
|
34 #endif |
|
35 #ifndef KPSE_DB_NAME |
|
36 #define KPSE_DB_NAME "ls-R" |
|
37 #endif |
|
38 |
|
39 /* The expansion of DB_DIR; set by `read_files' in cnf.c, used by |
|
40 `elt_in_db' in pathsearch.c. */ |
|
41 extern string kpse_db_dir; |
|
42 |
|
43 /* Return list of matches for NAME in the ls-R file matching PATH. If |
|
44 ALL is set, return (null-terminated list) of all matches, else just |
|
45 the first. If no matches, return a pointer to an empty list. If the |
|
46 database can't be read, returns NULL. */ |
|
47 extern str_list_type *kpse_db_search P3H(const_string name, |
|
48 const_string path, boolean all); |
|
49 |
|
50 /* Insert the filename FNAME into the database. */ |
|
51 extern void db_insert P1H(const_string fname); |
|
52 |
|
53 #endif /* not KPATHSEA_DB_H */ |