* Version $Id$
*/
/*
- Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
+ Copyright (C) 2000-2005 Kern Sibbald
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
*/
-struct RES_ITEM; /* Declare forward referenced structure */
+struct RES_ITEM; /* Declare forward referenced structure */
typedef void (MSG_RES_HANDLER)(LEX *lc, RES_ITEM *item, int index, int pass);
/* This is the structure that defines
/* For storing name_addr items in res_items table */
#define ITEM(x) ((void **)&res_all.x)
-#define MAX_RES_ITEMS 50 /* maximum resource items per RES */
+#define MAX_RES_ITEMS 70 /* maximum resource items per RES */
/* This is the universal header that is
* at the beginning of every resource
};
-/*
+/*
* Master Resource configuration structure definition
* This is the structure that defines the
* resources that are available to this daemon.
*/
-struct RES_TABLE {
+struct RES_TABLE {
const char *name; /* resource name */
- RES_ITEM *items; /* list of resource keywords */
+ RES_ITEM *items; /* list of resource keywords */
int rcode; /* code if needed */
- RES *res_head; /* where to store it */
};
/* Common Resource definitions */
/* Configuration routines */
-int parse_config(const char *cf, int exit_on_error = 1);
-void free_config_resources(void);
+int parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error = NULL);
+void free_config_resources(void);
RES **save_config_resources(void);
+RES **new_res_head();
+
/* Resource routines */
RES *GetResWithName(int rcode, char *name);
/* Loop through each resource of type, returning in var */
#define foreach_res(var, type) \
- for(var=NULL; (*((void **)&(var))=(void *)GetNextRes((type), (RES *)var));)
+ for(var=NULL; (*((void **)&(var))=(void *)GetNextRes((type), (RES *)var));)
#ifdef the_old_way
#define foreach_res(var, type) \
- for((var)=NULL; (((void *)(var))=GetNextRes((type), (RES *)var));)
+ for((var)=NULL; (((void *)(var))=GetNextRes((type), (RES *)var));)
#endif
void store_name(LEX *lc, RES_ITEM *item, int index, int pass);
void store_strname(LEX *lc, RES_ITEM *item, int index, int pass);
void store_res(LEX *lc, RES_ITEM *item, int index, int pass);
+void store_alist_res(LEX *lc, RES_ITEM *item, int index, int pass);
+void store_alist_str(LEX *lc, RES_ITEM *item, int index, int pass);
void store_int(LEX *lc, RES_ITEM *item, int index, int pass);
void store_pint(LEX *lc, RES_ITEM *item, int index, int pass);
void store_msgs(LEX *lc, RES_ITEM *item, int index, int pass);
void store_time(LEX *lc, RES_ITEM *item, int index, int pass);
void store_size(LEX *lc, RES_ITEM *item, int index, int pass);
void store_defs(LEX *lc, RES_ITEM *item, int index, int pass);
+void store_label(LEX *lc, RES_ITEM *item, int index, int pass);