1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2012 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_RELATION_H
18 #define DATA_RELATION_H 1
20 #include "libpspp/compiler.h"
21 #include "data/column.h"
23 struct relation_column
25 struct hmap_node hmap_node;
27 struct column *column;
30 struct relation *relation_create (void);
31 bool relation_destroy (struct relation *);
33 void relation_add_column (struct relation *,
34 const char *name, struct column *);
35 void relation_delete_column (struct relation *, const char *name);
36 void relation_rename_column (struct relation *, const char *old_name,
37 const char *new_name);
39 const struct column *relation_get_column (const struct relation *,
41 struct column *relation_get_column_rw (struct relation *, const char *name);
43 struct pxd_object *relation_save (const struct relation *, struct pxd *);
44 struct relation *relation_load (struct pxd_object *, const struct pxd *);
46 #endif /* data/relation.h */