29 |
#include "hash.h" |
#include "hash.h" |
30 |
#include "lexer.h" |
#include "lexer.h" |
31 |
#include "misc.h" |
#include "misc.h" |
32 |
|
#include "pool.h" |
33 |
#include "size_max.h" |
#include "size_max.h" |
34 |
#include "str.h" |
#include "str.h" |
35 |
|
|
509 |
|
|
510 |
fail: |
fail: |
511 |
for (i = 0; i < *nnames; i++) |
for (i = 0; i < *nnames; i++) |
512 |
free ((*names)[*nnames]); |
free ((*names)[i]); |
513 |
free (names); |
free (*names); |
514 |
*names = NULL; |
*names = NULL; |
515 |
*nnames = 0; |
*nnames = 0; |
516 |
return 0; |
return 0; |
517 |
} |
} |
518 |
|
|
519 |
|
/* Parses a list of variables where some of the variables may be |
520 |
|
existing and the rest are to be created. Same args as |
521 |
|
parse_DATA_LIST_vars(), except that all allocations are taken |
522 |
|
from the given POOL. */ |
523 |
|
int |
524 |
|
parse_mixed_vars_pool (struct pool *pool, |
525 |
|
char ***names, size_t *nnames, int pv_opts) |
526 |
|
{ |
527 |
|
int retval = parse_mixed_vars (names, nnames, pv_opts); |
528 |
|
if (retval) |
529 |
|
{ |
530 |
|
size_t i; |
531 |
|
|
532 |
|
for (i = 0; i < *nnames; i++) |
533 |
|
pool_register (pool, free, (*names)[i]); |
534 |
|
pool_register (pool, free, *names); |
535 |
|
} |
536 |
|
return retval; |
537 |
|
} |
538 |
|
|
539 |
|
|
540 |
/* A set of variables. */ |
/* A set of variables. */ |
541 |
struct var_set |
struct var_set |