]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/dird_conf.c
Add heap stats to Dir and SD -- eliminate #ifdefs
[bacula/bacula] / bacula / src / dird / dird_conf.c
index 6800fead5f54d2fff143a4cc5e3a97fa4e851aa5..18591c256ff9aa5d494267fc65e8a99d6ef9426d 100644 (file)
@@ -50,6 +50,8 @@
  */
 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);
@@ -318,19 +320,19 @@ extern RES_ITEM msgs_items[];
  *  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}
 };
 
 
@@ -1092,14 +1094,14 @@ void save_resource(int type, RES_ITEM *items, int pass)
    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"),