]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/gnome2-console/console_conf.c
- Modify the depend section of each Makefile.in to reference
[bacula/bacula] / bacula / src / gnome2-console / console_conf.c
index c2873f39411cf226a2025260973dab14fcd9ae18..44f81a5c316f9b36f2a0f12759eb22a56e92a330 100644 (file)
@@ -49,6 +49,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 */
 
@@ -97,10 +99,10 @@ static RES_ITEM con_font_items[] = {
  * It must have one item for each of the resources.
  */
 RES_TABLE resources[] = {
-   {"director",      dir_items,   R_DIRECTOR,  NULL},
-   {"console",       con_items,   R_CONSOLE,   NULL},
-   {"consolefont",   con_font_items, R_CONSOLE_FONT,   NULL},
-   {NULL,           NULL,        0,           NULL}
+   {"director",      dir_items,   R_DIRECTOR},
+   {"console",       con_items,   R_CONSOLE},
+   {"consolefont",   con_font_items, R_CONSOLE_FONT},
+   {NULL,           NULL,        0}
 };
 
 
@@ -108,7 +110,7 @@ RES_TABLE resources[] = {
 void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fmt, ...), void *sock)
 {
    URES *res = (URES *)reshdr;
-   int recurse = 1;
+   bool recurse = true;
 
    if (res == NULL) {
       printf("No record for %d %s\n", type, res_to_str(type));
@@ -116,7 +118,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm
    }
    if (type < 0) {                   /* no recursion */
       type = - type;
-      recurse = 0;
+      recurse = false;
    }
    switch (type) {
    case R_DIRECTOR:
@@ -265,12 +267,12 @@ 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;
         /* 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->dir_res.hdr.name) == 0) {
               Emsg2(M_ERROR_TERM, 0,
                   _("Attempt to define second %s resource named \"%s\" is not permitted.\n"),