conf.h
00001
00002
00003
00004
00005
00006
00007 #ifndef OPENCT_CONF_H
00008 #define OPENCT_CONF_H
00009
00010 #ifdef __cplusplus
00011 extern "C" {
00012 #endif
00013
00014 extern struct ct_config {
00015 int debug;
00016 int autoload;
00017 int hotplug;
00018 int suppress_errors;
00019 const char * ifdhandler;
00020 const char * modules_dir;
00021 const char * driver_modules_dir;
00022 const char * protocol_modules_dir;
00023 const char * socket_dir;
00024 } ct_config;
00025
00026 typedef struct ifd_conf_node {
00027 struct ifd_conf_node *next;
00028 struct ifd_conf_node *children;
00029 char * name;
00030 char * value;
00031 } ifd_conf_node_t;
00032
00033 extern int ifd_config_parse(const char *);
00034 extern int ifd_conf_get_string(const char *, char **);
00035 extern int ifd_conf_get_integer(const char *, unsigned int *);
00036 extern int ifd_conf_get_bool(const char *, unsigned int *);
00037 extern int ifd_conf_get_string_list(const char *, char **, size_t);
00038 extern int ifd_conf_get_nodes(const char *, ifd_conf_node_t **, size_t);
00039 extern int ifd_conf_node_get_string(ifd_conf_node_t *,
00040 const char *, char **);
00041 extern int ifd_conf_node_get_integer(ifd_conf_node_t *,
00042 const char *, unsigned int *);
00043 extern int ifd_conf_node_get_bool(ifd_conf_node_t *,
00044 const char *, unsigned int *);
00045 extern int ifd_conf_node_get_string_list(ifd_conf_node_t *,
00046 const char *, char **, size_t);
00047 extern int ifd_conf_node_get_nodes(ifd_conf_node_t *,
00048 const char *, ifd_conf_node_t **, size_t);
00049
00050 #ifdef __cplusplus
00051 }
00052 #endif
00053
00054 #endif