]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/lib/parse_conf.c
BFILE I/O, new console @ commands, regression, file mode restore fixes
[bacula/bacula] / bacula / src / lib / parse_conf.c
1 /*
2  *   Master Configuration routines.
3  *  
4  *   This file contains the common parts of the Bacula
5  *   configuration routines.
6  *
7  *   Note, the configuration file parser consists of three parts
8  *
9  *   1. The generic lexical scanner in lib/lex.c and lib/lex.h
10  *
11  *   2. The generic config  scanner in lib/parse_conf.c and 
12  *      lib/parse_conf.h.
13  *      These files contain the parser code, some utility
14  *      routines, and the common store routines (name, int,
15  *      string).
16  *
17  *   3. The daemon specific file, which contains the Resource
18  *      definitions as well as any specific store routines
19  *      for the resource records.
20  *
21  *    N.B. This is a two pass parser, so if you malloc() a string
22  *         in a "store" routine, you must ensure to do it during
23  *         only one of the two passes, or to free it between.
24  *         Also, note that the resource record is malloced and
25  *         saved in save_resource() during pass 1.  Anything that
26  *         you want saved after pass two (e.g. resource pointers)
27  *         must explicitly be done in save_resource. Take a look
28  *         at the Job resource in src/dird/dird_conf.c to see how
29  *         it is done.
30  *
31  *     Kern Sibbald, January MM
32  *
33  *   Version $Id$
34  */
35
36 /*
37    Copyright (C) 2000-2003 Kern Sibbald and John Walker
38
39    This program is free software; you can redistribute it and/or
40    modify it under the terms of the GNU General Public License as
41    published by the Free Software Foundation; either version 2 of
42    the License, or (at your option) any later version.
43
44    This program is distributed in the hope that it will be useful,
45    but WITHOUT ANY WARRANTY; without even the implied warranty of
46    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
47    General Public License for more details.
48
49    You should have received a copy of the GNU General Public
50    License along with this program; if not, write to the Free
51    Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
52    MA 02111-1307, USA.
53
54  */
55
56
57 #include "bacula.h"
58
59 extern int debug_level;
60
61 /* Each daemon has a slightly different set of 
62  * resources, so it will define the following
63  * global values.
64  */
65 extern int r_first;
66 extern int r_last;
67 extern pthread_mutex_t res_mutex;
68 extern struct s_res resources[];
69 extern CURES res_all;
70 extern int res_all_size;
71
72 static int res_locked = 0;             /* set when resource chains locked */
73
74 /* Forward referenced subroutines */
75 static void scan_types(LEX *lc, MSGS *msg, int dest, char *where, char *cmd);
76
77
78 /* Common Resource definitions */
79
80 /* Message resource directives
81  *  name         handler      value       code   flags  default_value
82  */
83 struct res_items msgs_items[] = {
84    {"name",        store_name,    ITEM(res_msgs.hdr.name),  0, 0, 0},
85    {"description", store_str,     ITEM(res_msgs.hdr.desc),  0, 0, 0},
86    {"mailcommand", store_str,     ITEM(res_msgs.mail_cmd),  0, 0, 0},
87    {"operatorcommand", store_str, ITEM(res_msgs.operator_cmd), 0, 0, 0},
88    {"syslog",      store_msgs, ITEM(res_msgs), MD_SYSLOG,   0, 0}, 
89    {"mail",        store_msgs, ITEM(res_msgs), MD_MAIL,     0, 0},
90    {"mailonerror", store_msgs, ITEM(res_msgs), MD_MAIL_ON_ERROR, 0, 0},
91    {"file",        store_msgs, ITEM(res_msgs), MD_FILE,     0, 0},
92    {"append",      store_msgs, ITEM(res_msgs), MD_APPEND,   0, 0},
93    {"stdout",      store_msgs, ITEM(res_msgs), MD_STDOUT,   0, 0},
94    {"stderr",      store_msgs, ITEM(res_msgs), MD_STDERR,   0, 0},
95    {"director",    store_msgs, ITEM(res_msgs), MD_DIRECTOR, 0, 0},
96    {"console",     store_msgs, ITEM(res_msgs), MD_CONSOLE,  0, 0},   
97    {"operator",    store_msgs, ITEM(res_msgs), MD_OPERATOR, 0, 0},
98    {NULL, NULL,    NULL, 0}
99 };
100
101 struct s_mtypes {       
102    char *name;
103    int token;   
104 };
105 /* Various message types */
106 static struct s_mtypes msg_types[] = {
107    {"debug",         M_DEBUG},
108    {"abort",         M_ABORT},
109    {"fatal",         M_FATAL},
110    {"error",         M_ERROR},
111    {"warning",       M_WARNING},
112    {"info",          M_INFO},
113    {"saved",         M_SAVED},
114    {"notsaved",      M_NOTSAVED},
115    {"skipped",       M_SKIPPED},
116    {"mount",         M_MOUNT},
117    {"terminate",     M_TERM},
118    {"restored",      M_RESTORED},
119    {"all",           M_MAX+1},
120    {NULL,            0}
121 };
122
123
124 /* Simply print a message */
125 static void prtmsg(void *sock, char *fmt, ...)
126 {
127    va_list arg_ptr;
128
129    va_start(arg_ptr, fmt);
130    vfprintf(stdout, fmt, arg_ptr);
131    va_end(arg_ptr);
132 }
133
134 char *res_to_str(int rcode)
135 {
136    if (rcode < r_first || rcode > r_last) {
137       return "***UNKNOWN***";
138    } else {
139       return resources[rcode-r_first].name;
140    }
141 }
142
143
144 /* 
145  * Initialize the static structure to zeros, then
146  *  apply all the default values.
147  */
148 void init_resource(int type, struct res_items *items)
149 {
150    int i;
151    int rindex = type - r_first;
152
153    memset(&res_all, 0, res_all_size);
154    res_all.hdr.rcode = type;
155    res_all.hdr.refcnt = 1;
156
157    for (i=0; items[i].name; i++) {
158       Dmsg3(300, "Item=%s def=%s defval=%d\n", items[i].name,
159             (items[i].flags & ITEM_DEFAULT) ? "yes" : "no",      
160             items[i].default_value);
161       if (items[i].flags & ITEM_DEFAULT && items[i].default_value != 0) {
162          if (items[i].handler == store_yesno) {
163             *(int *)(items[i].value) |= items[i].code;
164          } else if (items[i].handler == store_pint || 
165                     items[i].handler == store_int) {
166             *(int *)(items[i].value) = items[i].default_value;
167          } else if (items[i].handler == store_int64) {
168             *(int64_t *)(items[i].value) = items[i].default_value;
169          } else if (items[i].handler == store_size ||
170                     items[i].handler == store_time) {
171             *(uint64_t *)(items[i].value) = items[i].default_value;
172          }
173       }
174       /* If this triggers, take a look at lib/parse_conf.h */
175       if (i >= MAX_RES_ITEMS) {
176          Emsg1(M_ERROR_TERM, 0, _("Too many items in %s resource\n"), resources[rindex]);
177       }
178    }
179 }
180
181
182 /* Store Messages Destination information */
183 void store_msgs(LEX *lc, struct res_items *item, int index, int pass)
184 {
185    int token;
186    char *cmd;
187    POOLMEM *dest;
188    int dest_len;    
189
190    Dmsg2(200, "store_msgs pass=%d code=%d\n", pass, item->code);
191    if (pass == 1) {
192       switch (item->code) {
193          case MD_STDOUT:
194          case MD_STDERR:
195          case MD_SYSLOG:              /* syslog */
196          case MD_CONSOLE:
197             scan_types(lc, (MSGS *)(item->value), item->code, NULL, NULL);
198             break;
199          case MD_OPERATOR:            /* send to operator */
200          case MD_DIRECTOR:            /* send to Director */
201          case MD_MAIL:                /* mail */
202          case MD_MAIL_ON_ERROR:       /* mail if Job errors */
203             if (item->code == MD_OPERATOR) {
204                cmd = res_all.res_msgs.operator_cmd;
205             } else {
206                cmd = res_all.res_msgs.mail_cmd;
207             }
208             dest = get_pool_memory(PM_MESSAGE);
209             dest[0] = 0;
210             dest_len = 0;
211             /* Pick up comma separated list of destinations */
212             for ( ;; ) {
213                token = lex_get_token(lc, T_NAME);   /* scan destination */
214                dest = check_pool_memory_size(dest, dest_len + lc->str_len + 2);
215                if (dest[0] != 0) {
216                   strcat(dest, " ");  /* separate multiple destinations with space */
217                   dest_len++;
218                }
219                strcat(dest, lc->str);
220                dest_len += lc->str_len;
221                Dmsg2(100, "store_msgs newdest=%s: dest=%s:\n", lc->str, NPRT(dest));
222                token = lex_get_token(lc, T_ALL);
223                if (token == T_COMMA) { 
224                   continue;           /* get another destination */
225                }
226                if (token != T_EQUALS) {
227                   scan_err1(lc, "expected an =, got: %s", lc->str); 
228                }
229                break;
230             }
231             Dmsg1(200, "mail_cmd=%s\n", NPRT(cmd));
232             scan_types(lc, (MSGS *)(item->value), item->code, dest, cmd);
233             free_pool_memory(dest);
234             Dmsg0(200, "done with dest codes\n");
235             break;
236          case MD_FILE:                /* file */
237          case MD_APPEND:              /* append */
238             dest = get_pool_memory(PM_MESSAGE);
239             /* Pick up a single destination */
240             token = lex_get_token(lc, T_NAME);   /* scan destination */
241             pm_strcpy(&dest, lc->str);
242             dest_len = lc->str_len;
243             token = lex_get_token(lc, T_ALL);
244             Dmsg1(200, "store_msgs dest=%s:\n", NPRT(dest));
245             if (token != T_EQUALS) {
246                scan_err1(lc, "expected an =, got: %s", lc->str); 
247             }
248             scan_types(lc, (MSGS *)(item->value), item->code, dest, NULL);
249             free_pool_memory(dest);
250             Dmsg0(200, "done with dest codes\n");
251             break;
252
253          default:
254             scan_err1(lc, "Unknown item code: %d\n", item->code);
255             break;
256       }
257    }
258    scan_to_eol(lc);
259    set_bit(index, res_all.hdr.item_present);
260    Dmsg0(200, "Done store_msgs\n");
261 }
262
263 /* 
264  * Scan for message types and add them to the message
265  * destination. The basic job here is to connect message types
266  *  (WARNING, ERROR, FATAL, INFO, ...) with an appropriate
267  *  destination (MAIL, FILE, OPERATOR, ...)
268  */
269 static void scan_types(LEX *lc, MSGS *msg, int dest_code, char *where, char *cmd)
270 {
271    int i, found, quit, is_not;
272    int msg_type = 0;
273    char *str;
274
275    for (quit=0; !quit;) {
276       lex_get_token(lc, T_NAME);            /* expect at least one type */       
277       found = FALSE;
278       if (lc->str[0] == '!') {
279          is_not = TRUE;
280          str = &lc->str[1];
281       } else {
282          is_not = FALSE;
283          str = &lc->str[0];
284       }
285       for (i=0; msg_types[i].name; i++) {
286          if (strcmp(str, msg_types[i].name) == 0) {
287             msg_type = msg_types[i].token;
288             found = TRUE;
289             break;
290          }
291       }
292       if (!found) {
293          scan_err1(lc, "message type: %s not found", str);
294          /* NOT REACHED */
295       }
296
297       if (msg_type == M_MAX+1) {         /* all? */
298          for (i=1; i<=M_MAX; i++) {      /* yes set all types */
299             add_msg_dest(msg, dest_code, i, where, cmd);
300          }
301       } else {
302          if (is_not) {
303             rem_msg_dest(msg, dest_code, msg_type, where);
304          } else {
305             add_msg_dest(msg, dest_code, msg_type, where, cmd);
306          }
307       }
308       if (lc->ch != ',') {
309          break;
310       }
311       Dmsg0(200, "call lex_get_token() to eat comma\n");
312       lex_get_token(lc, T_ALL);          /* eat comma */
313    }
314    Dmsg0(200, "Done scan_types()\n");
315 }
316
317
318 /* 
319  * This routine is ONLY for resource names
320  *  Store a name at specified address.
321  */
322 void store_name(LEX *lc, struct res_items *item, int index, int pass)
323 {
324    lex_get_token(lc, T_NAME);
325    /* Store the name both pass 1 and pass 2 */
326    *(item->value) = bstrdup(lc->str);
327    scan_to_eol(lc);
328    set_bit(index, res_all.hdr.item_present);
329 }
330
331
332 /*
333  * Store a name string at specified address
334  * A name string is limited to MAX_RES_NAME_LENGTH
335  */
336 void store_strname(LEX *lc, struct res_items *item, int index, int pass)
337 {
338    lex_get_token(lc, T_NAME);
339    /* Store the name */
340    if (pass == 1) {
341       *(item->value) = bstrdup(lc->str);
342    }
343    scan_to_eol(lc);
344    set_bit(index, res_all.hdr.item_present);
345 }
346
347
348
349 /* Store a string at specified address */
350 void store_str(LEX *lc, struct res_items *item, int index, int pass)
351 {
352    lex_get_token(lc, T_STRING);
353    if (pass == 1) {
354       *(item->value) = bstrdup(lc->str);
355    }
356    scan_to_eol(lc);
357    set_bit(index, res_all.hdr.item_present);
358 }
359
360 /*
361  * Store a directory name at specified address. Note, we do
362  *   shell expansion except if the string begins with a vertical
363  *   bar (i.e. it will likely be passed to the shell later).
364  */
365 void store_dir(LEX *lc, struct res_items *item, int index, int pass)
366 {
367    lex_get_token(lc, T_STRING);
368    if (pass == 1) {
369       if (lc->str[0] != '|') {
370          do_shell_expansion(lc->str);
371       }
372       *(item->value) = bstrdup(lc->str);
373    }
374    scan_to_eol(lc);
375    set_bit(index, res_all.hdr.item_present);
376 }
377
378
379 /* Store a password specified address in MD5 coding */
380 void store_password(LEX *lc, struct res_items *item, int index, int pass)
381 {
382    unsigned int i, j;
383    struct MD5Context md5c;
384    unsigned char signature[16];
385    char sig[100];
386
387
388    lex_get_token(lc, T_STRING);
389    if (pass == 1) {
390       MD5Init(&md5c);
391       MD5Update(&md5c, (unsigned char *) (lc->str), lc->str_len);
392       MD5Final(signature, &md5c);
393       for (i = j = 0; i < sizeof(signature); i++) {
394          sprintf(&sig[j], "%02x", signature[i]); 
395          j += 2;
396       }
397       *(item->value) = bstrdup(sig);
398    }
399    scan_to_eol(lc);
400    set_bit(index, res_all.hdr.item_present);
401 }
402
403
404 /* Store a resource at specified address.
405  * If we are in pass 2, do a lookup of the 
406  * resource.
407  */
408 void store_res(LEX *lc, struct res_items *item, int index, int pass)
409 {
410    RES *res;
411
412    lex_get_token(lc, T_NAME);
413    if (pass == 2) {
414      res = GetResWithName(item->code, lc->str);
415      if (res == NULL) {
416         scan_err3(lc, "Could not find Resource %s referenced on line %d : %s\n", 
417            lc->str, lc->line_no, lc->line);
418      }
419      *(item->value) = (char *)res;
420    }
421    scan_to_eol(lc);
422    set_bit(index, res_all.hdr.item_present);
423 }
424
425
426 /* Store an integer at specified address */
427 void store_int(LEX *lc, struct res_items *item, int index, int pass)
428 {
429    lex_get_token(lc, T_INT32);
430    *(int *)(item->value) = lc->int32_val;
431    scan_to_eol(lc);
432    set_bit(index, res_all.hdr.item_present);
433 }
434
435 /* Store a positive integer at specified address */
436 void store_pint(LEX *lc, struct res_items *item, int index, int pass)
437 {
438    lex_get_token(lc, T_PINT32);
439    *(int *)(item->value) = lc->pint32_val;
440    scan_to_eol(lc);
441    set_bit(index, res_all.hdr.item_present);
442 }
443
444
445 /* Store an 64 bit integer at specified address */
446 void store_int64(LEX *lc, struct res_items *item, int index, int pass)
447 {
448    lex_get_token(lc, T_INT64);
449    *(int64_t *)(item->value) = lc->int64_val;
450    scan_to_eol(lc);
451    set_bit(index, res_all.hdr.item_present);
452 }
453
454 /* Store a size in bytes */
455 void store_size(LEX *lc, struct res_items *item, int index, int pass)
456 {
457    int token;
458    double dvalue;
459    uint64_t uvalue;
460
461    Dmsg0(400, "Enter store_size\n");
462    token = lex_get_token(lc, T_ALL);
463    errno = 0;
464    switch (token) {
465    case T_NUMBER:
466       Dmsg2(400, "size num=:%s: %f\n", lc->str, strtod(lc->str, NULL)); 
467       dvalue = strtod(lc->str, NULL);
468       if (errno != 0 || token < 0) {
469          scan_err1(lc, "expected a size number, got: %s", lc->str);
470       }
471       *(uint64_t *)(item->value) = (uint64_t)dvalue;
472       break;
473    case T_IDENTIFIER:
474    case T_UNQUOTED_STRING:
475       if (!size_to_uint64(lc->str, lc->str_len, &uvalue)) {
476          scan_err1(lc, "expected a size number, got: %s", lc->str);
477       }
478       *(uint64_t *)(item->value) = uvalue;
479       break;
480    default:
481       scan_err1(lc, "expected a size, got: %s", lc->str);
482       break;
483    }
484    scan_to_eol(lc);
485    set_bit(index, res_all.hdr.item_present);
486    Dmsg0(400, "Leave store_size\n");
487 }
488
489
490 /* Store a time period in seconds */
491 void store_time(LEX *lc, struct res_items *item, int index, int pass)
492 {
493    int token; 
494    double value;
495    utime_t utime;
496
497    token = lex_get_token(lc, T_ALL);
498    errno = 0;
499    switch (token) {
500    case T_NUMBER:
501       value = strtod(lc->str, NULL);
502       if (errno != 0 || value < 0) {
503          scan_err1(lc, "expected a time period, got: %s", lc->str);
504       }
505       *(utime_t *)(item->value) = (utime_t)value;
506       break;
507    case T_IDENTIFIER:
508    case T_UNQUOTED_STRING:
509       if (!duration_to_utime(lc->str, &utime)) {
510          scan_err1(lc, "expected a time period, got: %s", lc->str);
511       }
512       *(utime_t *)(item->value) = utime;
513       break;
514    default:
515       scan_err1(lc, "expected a time period, got: %s", lc->str);
516       break;
517    }
518    scan_to_eol(lc);
519    set_bit(index, res_all.hdr.item_present);
520 }
521
522
523 /* Store a yes/no in a bit field */
524 void store_yesno(LEX *lc, struct res_items *item, int index, int pass)
525 {
526    lex_get_token(lc, T_NAME);
527    if (strcasecmp(lc->str, "yes") == 0) {
528       *(int *)(item->value) |= item->code;
529    } else if (strcasecmp(lc->str, "no") == 0) {
530       *(int *)(item->value) &= ~(item->code);
531    } else {
532       scan_err1(lc, "Expect a YES or NO, got: %s", lc->str);
533    }
534    scan_to_eol(lc);
535    set_bit(index, res_all.hdr.item_present);
536 }
537
538
539
540 void LockRes()
541 {
542    P(res_mutex);
543    res_locked = 1;
544 }
545
546 void UnlockRes()
547 {
548    res_locked = 0;
549    V(res_mutex);
550 }
551
552 /*
553  * Return resource of type rcode that matches name
554  */
555 RES *
556 GetResWithName(int rcode, char *name)
557 {
558    RES *res;
559    int rindex = rcode - r_first;
560
561    LockRes();
562    res = resources[rindex].res_head;
563    while (res) {
564       if (strcmp(res->name, name) == 0) {
565          break;
566       }
567       res = res->next;
568    }
569    UnlockRes();
570    return res;
571    
572 }
573
574 /*
575  * Return next resource of type rcode. On first
576  * call second arg (res) is NULL, on subsequent
577  * calls, it is called with previous value.
578  */
579 RES *
580 GetNextRes(int rcode, RES *res)
581 {
582    RES *nres;
583    int rindex = rcode - r_first;
584        
585
586    if (!res_locked) {
587       Emsg0(M_ABORT, 0, "Resource chain not locked.\n");
588    }
589    if (res == NULL) {
590       nres = resources[rindex].res_head;
591    } else {
592       nres = res->next;
593    }
594    return nres;
595 }
596
597
598 /* Parser state */
599 enum parse_state {
600    p_none,
601    p_resource
602 };
603
604 /*********************************************************************
605  *
606  *      Parse configuration file
607  *
608  */
609 void 
610 parse_config(char *cf)
611 {
612    LEX *lc = NULL;
613    int token, i, pass;
614    int res_type = 0;
615    enum parse_state state = p_none;
616    struct res_items *items = NULL;
617    int level = 0;
618
619    /* Make two passes. The first builds the name symbol table,
620     * and the second picks up the items. 
621     */
622    Dmsg0(200, "Enter parse_config()\n");
623    for (pass=1; pass <= 2; pass++) {
624       Dmsg1(200, "parse_config pass %d\n", pass);
625       lc = lex_open_file(lc, cf, NULL);
626       while ((token=lex_get_token(lc, T_ALL)) != T_EOF) {
627          Dmsg1(150, "parse got token=%s\n", lex_tok_to_str(token));
628          switch (state) {
629             case p_none:
630                if (token == T_EOL) {
631                   break;
632                }
633                if (token != T_IDENTIFIER) {
634                   scan_err1(lc, "Expected a Resource name identifier, got: %s", lc->str);
635                   /* NOT REACHED */
636                }
637                for (i=0; resources[i].name; i++)
638                   if (strcasecmp(resources[i].name, lc->str) == 0) {
639                      state = p_resource;
640                      items = resources[i].items;
641                      res_type = resources[i].rcode;
642                      init_resource(res_type, items);
643                      break;
644                   }
645                if (state == p_none) {
646                   scan_err1(lc, "expected resource name, got: %s", lc->str);
647                   /* NOT REACHED */
648                }
649                break;
650             case p_resource:
651                switch (token) {
652                   case T_BOB:
653                      level++;
654                      break;
655                   case T_IDENTIFIER:
656                      if (level != 1) {
657                         scan_err1(lc, "not in resource definition: %s", lc->str);
658                         /* NOT REACHED */
659                      }
660                      for (i=0; items[i].name; i++) {
661                         if (strcasecmp(items[i].name, lc->str) == 0) {
662                            /* If the ITEM_NO_EQUALS flag is set we do NOT              
663                             *   scan for = after the keyword  */
664                            if (!(items[i].flags & ITEM_NO_EQUALS)) {
665                               token = lex_get_token(lc, T_ALL);
666                               Dmsg1 (150, "in T_IDENT got token=%s\n", lex_tok_to_str(token));
667                               if (token != T_EQUALS) {
668                                  scan_err1(lc, "expected an equals, got: %s", lc->str);
669                                  /* NOT REACHED */
670                               }
671                            }
672                            Dmsg1(150, "calling handler for %s\n", items[i].name);
673                            /* Call item handler */
674                            items[i].handler(lc, &items[i], i, pass);
675                            i = -1;
676                            break;
677                         }
678                      }
679                      if (i >= 0) {
680                         Dmsg2(150, "level=%d id=%s\n", level, lc->str);
681                         Dmsg1(150, "Keyword = %s\n", lc->str);
682                         scan_err1(lc, "Keyword \"%s\" not permitted in this resource", lc->str);
683                         /* NOT REACHED */
684                      }
685                      break;
686
687                   case T_EOB:
688                      level--;
689                      state = p_none;
690                      Dmsg0(150, "T_EOB => define new resource\n");
691                      save_resource(res_type, items, pass);  /* save resource */
692                      break;
693
694                   case T_EOL:
695                      break;
696
697                   default:
698                      scan_err2(lc, "unexpected token %d %s in resource definition",    
699                         token, lex_tok_to_str(token));
700                      /* NOT REACHED */
701                }
702                break;
703             default:
704                scan_err1(lc, "Unknown parser state %d\n", state);
705                /* NOT REACHED */
706          }
707       }
708       if (state != p_none) {
709          scan_err0(lc, "End of conf file reached with unclosed resource.");
710       }
711       if (debug_level > 50 && pass == 2) {
712          int i;
713          for (i=r_first; i<=r_last; i++) {
714             dump_resource(i, resources[i-r_first].res_head, prtmsg, NULL);
715          }
716       }
717       lc = lex_close_file(lc);
718    }
719    Dmsg0(200, "Leave parse_config()\n");
720 }
721
722 /*********************************************************************
723  *
724  *      Free configuration resources
725  *
726  */
727 void 
728 free_config_resources()
729 {
730    int i;
731    for (i=r_first; i<=r_last; i++) {
732       free_resource(i);
733    }
734 }