beta-0.89.2
[luatex.git] / source / texk / kpathsea / db.h
blobb77b1f04b0c796e6f032a6c13264df3caae092c7
1 /* db.h: lookups in an externally built db file.
3 Copyright 1994, 1995, 2008, 2010, 2011 Karl Berry.
4 Copyright 1999, 2003, 2005 Olaf Weber.
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with this library; if not, see <http://www.gnu.org/licenses/>. */
19 #ifndef KPATHSEA_DB_H
20 #define KPATHSEA_DB_H
22 #ifdef MAKE_KPSE_DLL /* libkpathsea internal only */
24 #include <kpathsea/c-proto.h>
25 #include <kpathsea/types.h>
26 #include <kpathsea/str-list.h>
28 /* Initialize the database. Until this is called, no ls-R matches will
29 be found. */
30 extern void kpathsea_init_db (kpathsea kpse);
32 /* Return list of matches for NAME in the ls-R file matching PATH_ELT. If
33 ALL is set, return (null-terminated list) of all matches, else just
34 the first. If no matches, return a pointer to an empty list. If no
35 databases can be read, or PATH_ELT is not in any of the databases,
36 return NULL. */
38 extern str_list_type *kpathsea_db_search (kpathsea kpse, const_string name,
39 const_string path_elt, boolean all);
41 /* Note: NAMES[i] is not modified. */
42 extern str_list_type *kpathsea_db_search_list (kpathsea kpse,
43 string* names,
44 const_string path_elt,
45 boolean all);
47 /* Insert the filename FNAME into the database.
48 Called by mktex() in tex-make.c. */
49 extern void kpathsea_db_insert (kpathsea kpse, const_string fname);
51 #endif /* MAKE_KPSE_DLL */
53 #endif /* not KPATHSEA_DB_H */