*/
int r_first = R_FIRST;
int r_last = R_LAST;
+static RES *sres_head[R_LAST - R_FIRST + 1];
+RES **res_head = sres_head;
/* Imported subroutines */
extern void store_run(LEX *lc, RES_ITEM *item, int index, int pass);
* name items rcode res_head
*/
RES_TABLE resources[] = {
- {"director", dir_items, R_DIRECTOR, NULL},
- {"client", cli_items, R_CLIENT, NULL},
- {"job", job_items, R_JOB, NULL},
- {"storage", store_items, R_STORAGE, NULL},
- {"catalog", cat_items, R_CATALOG, NULL},
- {"schedule", sch_items, R_SCHEDULE, NULL},
- {"fileset", fs_items, R_FILESET, NULL},
- {"pool", pool_items, R_POOL, NULL},
- {"messages", msgs_items, R_MSGS, NULL},
- {"counter", counter_items, R_COUNTER, NULL},
- {"console", con_items, R_CONSOLE, NULL},
- {"jobdefs", job_items, R_JOBDEFS, NULL},
- {NULL, NULL, 0, NULL}
+ {"director", dir_items, R_DIRECTOR},
+ {"client", cli_items, R_CLIENT},
+ {"job", job_items, R_JOB},
+ {"storage", store_items, R_STORAGE},
+ {"catalog", cat_items, R_CATALOG},
+ {"schedule", sch_items, R_SCHEDULE},
+ {"fileset", fs_items, R_FILESET},
+ {"pool", pool_items, R_POOL},
+ {"messages", msgs_items, R_MSGS},
+ {"counter", counter_items, R_COUNTER},
+ {"console", con_items, R_CONSOLE},
+ {"jobdefs", job_items, R_JOBDEFS},
+ {NULL, NULL, 0}
};
if (!error) {
res = (URES *)malloc(size);
memcpy(res, &res_all, size);
- if (!resources[rindex].res_head) {
- resources[rindex].res_head = (RES *)res; /* store first entry */
+ if (!res_head[rindex]) {
+ res_head[rindex] = (RES *)res; /* store first entry */
Dmsg3(900, "Inserting first %s res: %s index=%d\n", res_to_str(type),
res->res_dir.hdr.name, rindex);
} else {
RES *next;
/* Add new res to end of chain */
- for (next=resources[rindex].res_head; next->next; next=next->next) {
+ for (next=res_head[rindex]; next->next; next=next->next) {
if (strcmp(next->name, res->res_dir.hdr.name) == 0) {
Emsg2(M_ERROR_TERM, 0,
_("Attempt to define second %s resource named \"%s\" is not permitted.\n"),