-struct dictionary
- {
- struct variable **var; /* Variable descriptions. */
- struct hsh_table *name_tab; /* Variables arranged by name. */
- int nvar; /* Number of variables. */
-
- int N; /* Current case limit (N command). */
- int nval; /* Number of value structures per case. */
-
- int n_splits; /* Number of SPLIT FILE variables. */
- struct variable **splits; /* List of SPLIT FILE vars. */
-
- char *label; /* File label. */
-
- int n_documents; /* Number of lines of documents. */
- char *documents; /* Documents; 80*n_documents bytes in size. */
-
- int weight_index; /* `value' index of $WEIGHT, or -1 if none.
- Call update_weighting() before using! */
- char weight_var[9]; /* Name of WEIGHT variable. */
-
- char filter_var[9]; /* Name of FILTER variable. */
- /* Do not make another field the last field! or see
- temporary.c:restore_dictionary() before doing so! */
- };
+struct dictionary;
+
+struct dictionary *dict_create (void);
+struct dictionary *dict_clone (const struct dictionary *);
+void dict_clear (struct dictionary *);
+void dict_destroy (struct dictionary *);
+
+size_t dict_get_var_cnt (const struct dictionary *);
+struct variable *dict_get_var (const struct dictionary *, size_t idx);
+void dict_get_vars (const struct dictionary *,
+ struct variable ***vars, size_t *cnt,
+ unsigned exclude_classes);
+
+struct variable *dict_create_var (struct dictionary *, const char *,
+ int width);
+struct variable *dict_clone_var (struct dictionary *, const struct variable *,
+ const char *);
+void dict_rename_var (struct dictionary *, struct variable *, const char *);
+
+struct variable *dict_lookup_var (const struct dictionary *, const char *);
+int dict_contains_var (const struct dictionary *, const struct variable *);
+void dict_delete_var (struct dictionary *, struct variable *);
+void dict_delete_vars (struct dictionary *,
+ struct variable *const *, size_t count);
+void dict_reorder_vars (struct dictionary *,
+ struct variable *const *, size_t count);
+int dict_rename_vars (struct dictionary *,
+ struct variable **, char **new_names,
+ size_t count, char **err_name);
+
+struct variable *dict_get_weight (const struct dictionary *);
+double dict_get_case_weight (const struct dictionary *, const struct ccase *);
+void dict_set_weight (struct dictionary *, struct variable *);
+
+struct variable *dict_get_filter (const struct dictionary *);
+void dict_set_filter (struct dictionary *, struct variable *);
+
+int dict_get_case_limit (const struct dictionary *);
+void dict_set_case_limit (struct dictionary *, int);
+
+int dict_get_value_cnt (const struct dictionary *);
+void dict_compact_values (struct dictionary *);
+
+struct variable *const *dict_get_split_vars (const struct dictionary *);
+size_t dict_get_split_cnt (const struct dictionary *);
+void dict_set_split_vars (struct dictionary *,
+ struct variable *const *, size_t cnt);
+
+const char *dict_get_label (const struct dictionary *);
+void dict_set_label (struct dictionary *, const char *);
+
+const char *dict_get_documents (const struct dictionary *);
+void dict_set_documents (struct dictionary *, const char *);
+
+int dict_create_vector (struct dictionary *,
+ const char *name,
+ struct variable **, size_t cnt);
+const struct vector *dict_get_vector (const struct dictionary *,
+ size_t idx);
+size_t dict_get_vector_cnt (const struct dictionary *);
+const struct vector *dict_lookup_vector (const struct dictionary *,
+ const char *name);
+void dict_clear_vectors (struct dictionary *);
+\f
+void discard_variables (void);