1 /* Configuration file parsing.
2 * - by Richard W.M. Jones <rich@annexia.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 * $Id: cfg.h,v 1.3 2001/03/24 17:26:28 rich Exp $
26 /* Reread the configuration file. */
27 extern void cfg_reread_config (const char *path);
29 /* If there is host matching HOST, return an opaque pointer to the host's
32 extern void *cfg_get_host (const char *host);
34 /* If there is an alias exactly matching PATH for host HOST_PTR, return
35 * an opaque pointer to the alias's configuration data.
37 extern void *cfg_get_alias (void *host_ptr, const char *path);
39 /* Return the configuration string named KEY.
41 * HOST_PTR and ALIAS_PTR may be optionally given to narrow the search
42 * down to a particular host/alias combination.
44 * If the configuration string named KEY cannot be found, then DEFAULT_
45 * VALUE is returned instead.
47 extern const char *cfg_get_string (void *host_ptr, void *alias_ptr,
49 const char *default_value);
51 /* Similar to CFG_GET_STRING but the string is converted to an integer.
53 extern int cfg_get_int (void *host_ptr, void *alias_ptr,
54 const char *key, int default_value);
56 /* Similar to CFG_GET_STRING but the string is converted to a boolean.
58 extern int cfg_get_bool (void *host_ptr, void *alias_ptr,
59 const char *key, int default_value);