]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/wx-console/console_conf.c
- wxbRestorePanel : implemented restore before=<Date> parameter.
[bacula/bacula] / bacula / src / wx-console / console_conf.c
index d2afe3f1ae457dcf36b4360f56b8e382c3bc2dd6..e112c58e318af1fcbd292c0f743a6a9739fd2a9a 100644 (file)
@@ -47,6 +47,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;
 
 /* Forward referenced subroutines */
 
@@ -99,14 +101,14 @@ static RES_ITEM dir_items[] = {
  * It must have one item for each of the resources.
  */
 RES_TABLE resources[] = {
-   {"console",       cons_items,  R_CONSOLE,   NULL},
-   {"director",      dir_items,   R_DIRECTOR,  NULL},
-   {NULL,        NULL,    0,         NULL}
+   {"console",       cons_items,  R_CONSOLE},
+   {"director",      dir_items,   R_DIRECTOR},
+   {NULL,       NULL,    0}
 };
 
 
 /* Dump contents of resource */
-void dump_resource(int type, RES *reshdr, void sendit(void *sock, char *fmt, ...), void *sock)
+void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fmt, ...), void *sock)
 {
    URES *res = (URES *)reshdr;
    int recurse = 1;
@@ -115,7 +117,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, char *fmt, ...
       printf("No record for %d %s\n", type, res_to_str(type));
       return;
    }
-   if (type < 0) {            /* no recursion */
+   if (type < 0) {           /* no recursion */
       type = - type;
       recurse = 0;
    }
@@ -201,7 +203,7 @@ void save_resource(int type, RES_ITEM *items, int pass)
        if (!bit_is_set(i, res_all.res_dir.hdr.item_present)) {
                Emsg2(M_ABORT, 0, "%s item is required in %s resource, but not found.\n",
        items[i].name, resources[rindex]);
-        }
+       }
       }
    }
 
@@ -254,20 +256,20 @@ 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 */
       } else {
     RES *next;
-    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,
+         Emsg2(M_ERROR_TERM, 0,
                   _("Attempt to define second %s resource named \"%s\" is not permitted.\n"),
-        resources[rindex].name, res->res_dir.hdr.name);
+       resources[rindex].name, res->res_dir.hdr.name);
        }
     }
     next->next = (RES *)res;
          Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type),
-          res->res_dir.hdr.name);
+         res->res_dir.hdr.name);
       }
    }
 }