* tables.
*/
struct res_items {
- char *name; /* Resource name i.e. Director, ... */
+ const char *name; /* Resource name i.e. Director, ... */
MSG_RES_HANDLER *handler; /* Routine storing the resource item */
void **value; /* Where to store the item */
int code; /* item code/additional info */
* resources that are available to this daemon.
*/
struct s_res {
- char *name; /* resource name */
+ const char *name; /* resource name */
struct res_items *items; /* list of resource keywords */
int rcode; /* code if needed */
RES *res_head; /* where to store it */
void free_resource(int type);
void init_resource(int type, struct res_items *item);
void save_resource(int type, struct res_items *item, int pass);
-char *res_to_str(int rcode);
+const char *res_to_str(int rcode);
+
/* Loop through each resource of type, returning in var */
#define foreach_res(var, type) \
- for((var)=NULL; (((void *)(var))=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));)
+#endif
void store_str(LEX *lc, struct res_items *item, int index, int pass);