/[pspp]/pspp/src/vars-prs.c
ViewVC logotype

Diff of /pspp/src/vars-prs.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.22 by blp, Wed Oct 26 05:06:14 2005 UTC revision 1.23 by blp, Sat Nov 5 03:45:28 2005 UTC
# Line 29  Line 29 
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    
# Line 508  parse_mixed_vars (char ***names, size_t Line 509  parse_mixed_vars (char ***names, size_t
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

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26