1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 1997-9, 2000, 2009 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU 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, see <http://www.gnu.org/licenses/>. */
17 #ifndef DATA_VARDICT_H
18 #define DATA_VARDICT_H 1
20 /* Interface between dictionary and variable code.
21 This header file should only be included by variable.c and
26 /* Binds a variable to a dictionary. */
29 struct dictionary *dict;
31 struct hmap_node name_node; /* In struct dictionary's name_map. */
32 int case_index; /* Index into case of variable data. */
35 /* Called by dictionary code, defined in variable.c. */
36 struct vardict_info *var_get_vardict (const struct variable *);
37 void var_set_vardict (struct variable *, struct vardict_info *);
38 bool var_has_vardict (const struct variable *);
39 void var_clear_vardict (struct variable *);
41 /* Called by variable.c, defined in dictionary.c. */
42 void dict_var_changed (const struct variable *v, unsigned int what, struct variable *ov);
44 int vardict_get_dict_index (const struct vardict_info *);
47 vardict_get_case_index (const struct vardict_info *vardict)
49 return vardict->case_index;
52 static inline struct dictionary *
53 vardict_get_dictionary (const struct vardict_info *vardict)
58 #endif /* data/vardict.h */