Fix memory leaks.
[pspp-builds.git] / src / var.h
index 6d5cad7938ea2589cb6047b55ac6a3d8b21af14c..a07772a3887ccde463f1bc1be0d80747d2445522 100644 (file)
--- a/src/var.h
+++ b/src/var.h
@@ -115,36 +115,6 @@ struct list_proc
     int vert;                  /* Whether to print the varname vertically. */
   };
 
-/* DESCRIPTIVES private data.  Note that the DESCRIPTIVES procedure also
-   has a transformation, descriptives_trns. */
-enum
-  {
-    /* As these are used as bit indexes, there must be 32 or fewer.
-       Be very careful in adjusting these, see the structure below
-       and the table in descriptives.q. */
-    dsc_mean = 0, dsc_semean, dsc_stddev, dsc_variance, dsc_kurt,
-    dsc_sekurt, dsc_skew, dsc_seskew, dsc_range, dsc_min,
-    dsc_max, dsc_sum, dsc_n_stats
-  };
-
-struct descriptives_proc
-  {
-    /* Miscellaneous. */
-    int dup;                   /* Finds duplicates in list of
-                                  variables. */
-    char zname[10];            /* Name for z-score variable. */
-
-    /* Counts. */
-    double valid, miss;                /* Valid, missing--general. */
-
-    /* Mean, moments about the mean. */
-    double X_bar, M2, M3, M4;
-    double min, max;
-
-    /* Statistics. */
-    double stats[dsc_n_stats]; /* Everything glommed together. */
-  };
-
 /* GET private data. */
 struct get_proc
   {
@@ -244,7 +214,6 @@ struct variable
     union
       {
        struct crosstab_proc crs;
-       struct descriptives_proc dsc;
        struct frequencies_proc frq;
        struct list_proc lst;
        struct means_proc mns;
@@ -278,22 +247,6 @@ struct vector
     int cnt;                   /* Number of variables. */
   };
 \f
-/* Cases. */
-
-/* A single case.  (This doesn't need to be a struct anymore, but it
-   remains so for hysterical raisins.) */
-struct ccase
-  {
-    union value data[1];
-  };
-
-/* Linked list of cases. */
-struct case_list 
-  {
-    struct case_list *next;
-    struct ccase c;
-  };
-\f
 /* Dictionary. */ 
 
 /* Complete dictionary state. */
@@ -331,8 +284,10 @@ int dict_rename_vars (struct dictionary *,
                       struct variable **, char **new_names,
                       size_t count, char **err_name);
 
+struct ccase;
 struct variable *dict_get_weight (const struct dictionary *);
-double dict_get_case_weight (const struct dictionary *, const struct ccase *);
+double dict_get_case_weight (const struct dictionary *, 
+                            const struct ccase *, int *);
 void dict_set_weight (struct dictionary *, struct variable *);
 
 struct variable *dict_get_filter (const struct dictionary *);
@@ -444,12 +399,14 @@ void cancel_transformations (void);
 \f
 struct var_set;
 
-struct var_set *var_set_create_from_dict (struct dictionary *d);
-struct var_set *var_set_create_from_array (struct variable **var, size_t);
+struct var_set *var_set_create_from_dict (const struct dictionary *d);
+struct var_set *var_set_create_from_array (struct variable *const *var,
+                                           size_t);
 
-size_t var_set_get_cnt (struct var_set *vs);
-struct variable *var_set_get_var (struct var_set *vs, size_t idx);
-struct variable *var_set_lookup_var (struct var_set *vs, const char *name);
+size_t var_set_get_cnt (const struct var_set *vs);
+struct variable *var_set_get_var (const struct var_set *vs, size_t idx);
+struct variable *var_set_lookup_var (const struct var_set *vs,
+                                     const char *name);
 void var_set_destroy (struct var_set *vs);
 \f
 /* Variable parsers. */
@@ -464,14 +421,14 @@ enum
     PV_NUMERIC = 0020,         /* Vars must be numeric. */
     PV_STRING = 0040,          /* Vars must be string. */
     PV_SAME_TYPE = 00100,      /* All vars must be the same type. */
-    PV_NO_SCRATCH = 00200,     /* Disallow scratch variables. */
+    PV_NO_SCRATCH = 00200      /* Disallow scratch variables. */
   };
 
 struct variable *parse_variable (void);
-struct variable *parse_dict_variable (struct dictionary *);
-int parse_variables (struct dictionary *, struct variable ***, int *,
+struct variable *parse_dict_variable (const struct dictionary *);
+int parse_variables (const struct dictionary *, struct variable ***, int *,
                      int opts);
-int parse_var_set_vars (struct var_set *, struct variable ***, int *,
+int parse_var_set_vars (const struct var_set *, struct variable ***, int *,
                         int opts);
 int parse_DATA_LIST_vars (char ***names, int *cnt, int opts);
 int parse_mixed_vars (char ***names, int *cnt, int opts);