1 /* Copyright (c) 2003 Canna Project. All rights reserved.
2  *
3  * Permission to use, copy, modify, distribute and sell this software
4  * and its documentation for any purpose is hereby granted without
5  * fee, provided that the above copyright notice appear in all copies
6  * and that both that copyright notice and this permission notice
7  * appear in supporting documentation, and that the name of the
8  * author and contributors not be used in advertising or publicity
9  * pertaining to distribution of the software without specific, written
10  * prior permission.  The author and contributors no representations
11  * about the suitability of this software for any purpose.  It is
12  * provided "as is" without express or implied warranty.
13  *
14  * THE AUTHOR AND CONTRIBUTORS DISCLAIMS ALL WARRANTIES WITH REGARD TO
15  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
16  * FITNESS, IN NO EVENT SHALL THE AUTHOR AND CONTRIBUTORS BE LIABLE FOR
17  * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
18  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
19  * CONTRACT, NEGLIGENCE OR OTHER TORTUOUS ACTION, ARISING OUT OF OR IN
20  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  */
22 
23 /* $Id: conf.h,v 1.1 2003/08/05 12:03:02 aida_s Exp $ */
24 
25 #ifndef CONF_H
26 #define CONF_H
27 
28 typedef struct tagRkcConfMgr RkcConfMgr;
29 typedef struct tagRkcErrorBuf RkcErrorBuf;
30 
31 #define CONF_TYPE(i) ((i)&0xff00)
32 #define CONF_NONE 0
33 #define CONF_SPECIAL 0x100
34 #define CONF_STRING 0x200
35 #define CONF_NUMBER 0x300
36 #define CONF_YESNO 0x400
37 typedef enum {
38   /* top config */
39   CONF_CANNAHOST = CONF_STRING + 1,
40 
41   /* host config */
42   CONF_SERVER_TIMEOUT = CONF_NUMBER + 1,
43 
44   CONF_DUMMYCODE = 0x7fff
45 } ConfItem;
46 
47 extern RkcErrorBuf rkc_errors;
48 extern RkcConfMgr rkc_config;
49 
50 extern void rkc_configure pro((void));
51 extern void rkc_config_fin pro((void));
52 const char *const *RkcErrorBuf_get pro((RkcErrorBuf *cx));
53 const char *RkcConfMgr_get_string pro((const RkcConfMgr *cx,
54       ConfItem item, const char *hostname));
55 unsigned int RkcConfMgr_get_number pro((const RkcConfMgr *cx,
56       ConfItem item, const char *hostname));
57 int RkcConfMgr_get_yesno pro((const RkcConfMgr *cx,
58       ConfItem item, const char *hostname));
59 
60 #endif /* CONF_H */
61 /* vim: set sw=2: */
62