int rcode; /* code if needed */
};
-class PARSER {
-public:
- const char *m_cf; /* config file */
- LEX_ERROR_HANDLER *m_scan_error; /* error handler if non-null */
- int m_err_type; /* the way to terminate on failure */
- void *m_res_all; /* pointer to res_all buffer */
- int m_res_all_size; /* length of buffer */
- /* The below are not yet implemented */
- int m_r_first; /* first daemon resource type */
- int m_r_last; /* last daemon resource type */
- RES_TABLE *m_resources; /* pointer to table of permitted resources */
- RES **m_res_head; /* pointer to defined resources */
- brwlock_t m_res_lock; /* resource lock */
-
- /* functions */
- void init(
- const char *cf,
- LEX_ERROR_HANDLER *scan_error,
- int err_type,
- void *vres_all,
- int res_all_size,
- int r_first,
- int r_last,
- RES_TABLE *resources,
- RES **res_head);
-
- bool parse_config();
-};
-
-PARSER *new_parser();
/* Common Resource definitions */
inline char *MSGS::name() const { return hdr.name; }
-/* Configuration routines */
-
+/*
+ * Old C style configuration routines -- deprecated do not use.
+ */
int parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error = NULL, int err_type=M_ERROR_TERM);
void free_config_resources(void);
RES **save_config_resources(void);
RES **new_res_head();
+/*
+ * New C++ configuration routines
+ */
+
+class CONFIG {
+public:
+ const char *m_cf; /* config file */
+ LEX_ERROR_HANDLER *m_scan_error; /* error handler if non-null */
+ int m_err_type; /* the way to terminate on failure */
+ void *m_res_all; /* pointer to res_all buffer */
+ int m_res_all_size; /* length of buffer */
+ /* The below are not yet implemented */
+ int m_r_first; /* first daemon resource type */
+ int m_r_last; /* last daemon resource type */
+ RES_TABLE *m_resources; /* pointer to table of permitted resources */
+ RES **m_res_head; /* pointer to defined resources */
+ brwlock_t m_res_lock; /* resource lock */
+
+ /* functions */
+ void init(
+ const char *cf,
+ LEX_ERROR_HANDLER *scan_error,
+ int err_type,
+ void *vres_all,
+ int res_all_size,
+ int r_first,
+ int r_last,
+ RES_TABLE *resources,
+ RES **res_head);
+
+ bool parse_config();
+ void free_resources();
+ RES **save_resources();
+ RES **new_res_head();
+};
+
+CONFIG *new_config_parser();
+
/* Resource routines */
RES *GetResWithName(int rcode, const char *name);