1 /* PSPP - computes sample statistics.
2 Copyright (C) 2004 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful, but
10 WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
32 void (*var_added) (struct dictionary *, int, void *);
33 void (*var_deleted) (struct dictionary *, int, void *);
34 void (*var_changed) (struct dictionary *, int, void *);
38 struct dictionary *dict_create (void);
39 struct dictionary *dict_clone (const struct dictionary *);
40 void dict_set_callbacks (struct dictionary *, const struct dict_callbacks *,
42 void dict_copy_callbacks (struct dictionary *, const struct dictionary *);
45 void dict_clear (struct dictionary *);
46 void dict_clear_aux (struct dictionary *);
47 void dict_destroy (struct dictionary *);
49 size_t dict_get_var_cnt (const struct dictionary *);
50 struct variable *dict_get_var (const struct dictionary *, size_t idx);
51 void dict_get_vars (const struct dictionary *,
52 struct variable ***vars, size_t *cnt,
53 unsigned exclude_classes);
55 struct variable *dict_create_var (struct dictionary *, const char *,
58 struct variable *dict_create_var_assert (struct dictionary *, const char *,
60 struct variable *dict_clone_var (struct dictionary *, const struct variable *,
62 struct variable *dict_clone_var_assert (struct dictionary *,
63 const struct variable *, const char *);
65 struct variable *dict_lookup_var (const struct dictionary *, const char *);
66 struct variable *dict_lookup_var_assert (const struct dictionary *,
68 bool dict_contains_var (const struct dictionary *, const struct variable *);
69 void dict_delete_var (struct dictionary *, struct variable *);
70 void dict_delete_vars (struct dictionary *,
71 struct variable *const *, size_t count);
72 void dict_delete_consecutive_vars (struct dictionary *d,
73 size_t idx, size_t count);
74 void dict_delete_scratch_vars (struct dictionary *);
75 void dict_reorder_var (struct dictionary *d, struct variable *v,
77 void dict_reorder_vars (struct dictionary *,
78 struct variable *const *, size_t count);
79 void dict_rename_var (struct dictionary *, struct variable *, const char *);
80 bool dict_rename_vars (struct dictionary *,
81 struct variable **, char **new_names,
82 size_t count, char **err_name);
85 struct variable *dict_get_weight (const struct dictionary *);
86 double dict_get_case_weight (const struct dictionary *,
87 const struct ccase *, bool *);
88 void dict_set_weight (struct dictionary *, struct variable *);
90 struct variable *dict_get_filter (const struct dictionary *);
91 void dict_set_filter (struct dictionary *, struct variable *);
93 size_t dict_get_case_limit (const struct dictionary *);
94 void dict_set_case_limit (struct dictionary *, size_t);
96 int dict_get_next_value_idx (const struct dictionary *);
97 size_t dict_get_case_size (const struct dictionary *);
99 void dict_compact_values (struct dictionary *);
100 size_t dict_get_compacted_value_cnt (const struct dictionary *);
101 int *dict_get_compacted_dict_index_to_case_index (const struct dictionary *);
102 bool dict_compacting_would_shrink (const struct dictionary *);
103 bool dict_compacting_would_change (const struct dictionary *);
105 struct dict_compactor *dict_make_compactor (const struct dictionary *);
106 void dict_compactor_compact (const struct dict_compactor *,
107 struct ccase *, const struct ccase *);
108 void dict_compactor_destroy (struct dict_compactor *);
110 struct variable *const *dict_get_split_vars (const struct dictionary *);
111 size_t dict_get_split_cnt (const struct dictionary *);
112 void dict_set_split_vars (struct dictionary *,
113 struct variable *const *, size_t cnt);
115 const char *dict_get_label (const struct dictionary *);
116 void dict_set_label (struct dictionary *, const char *);
118 const char *dict_get_documents (const struct dictionary *);
119 void dict_set_documents (struct dictionary *, const char *);
121 bool dict_create_vector (struct dictionary *,
123 struct variable **, size_t cnt);
124 const struct vector *dict_get_vector (const struct dictionary *,
126 size_t dict_get_vector_cnt (const struct dictionary *);
127 const struct vector *dict_lookup_vector (const struct dictionary *,
129 void dict_clear_vectors (struct dictionary *);
131 void dict_assign_short_names (struct dictionary *);
133 /* Called only from variable.c */
134 void dict_var_changed (const struct variable *v);
137 #endif /* dictionary.h */