]> git.decadent.org.uk Git - ion3.git/blob - libextl/readconfig.h
[svn-inject] Installing original source of ion3
[ion3.git] / libextl / readconfig.h
1 /*
2  * libextl/readconfig.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2005.
5  *
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.
10  */
11
12 #ifndef LIBEXTL_READCONFIG_H
13 #define LIBEXTL_READCONFIG_H
14
15 #include "extl.h"
16
17 typedef int ExtlTryConfigFn(const char *file, void *param);
18
19 enum{
20     EXTL_TRYCONFIG_MEMERROR=-3,
21     EXTL_TRYCONFIG_NOTFOUND=-2,
22     EXTL_TRYCONFIG_LOAD_FAILED=-1,
23     EXTL_TRYCONFIG_CALL_FAILED=0,
24     EXTL_TRYCONFIG_OK=1
25 };
26
27
28 extern bool extl_set_userdirs(const char *appname);
29 extern bool extl_set_sessiondir(const char *session);
30 extern bool extl_set_searchpath(const char *path);
31 extern bool extl_add_searchdir(const char *dir);
32
33 extern const char *extl_userdir();
34 extern const char *extl_sessiondir();
35 extern const char *extl_searchpath();
36
37 extern int extl_try_config(const char *fname, const char *cfdir,
38                            ExtlTryConfigFn *tryfn, void *tryfnparam,
39                            const char *ext1, const char *ext2);
40
41 extern char *extl_lookup_script(const char *file, const char *sp);
42
43 extern bool extl_read_config(const char *file, const char *sp, 
44                              bool warn_nx);
45
46 extern char *extl_get_savefile(const char *module);
47 extern bool extl_read_savefile(const char *module, ExtlTab *tabret);
48 extern ExtlTab extl_extl_read_savefile(const char *module);
49 extern bool extl_write_savefile(const char *module, ExtlTab tab);
50
51 #endif /* LIBEXTL_READCONFIG_H */