pxd: initial work
[pspp] / src / data / relation.h
diff --git a/src/data/relation.h b/src/data/relation.h
new file mode 100644 (file)
index 0000000..0865ae5
--- /dev/null
@@ -0,0 +1,46 @@
+/* PSPP - a program for statistical analysis.
+   Copyright (C) 2012 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>. */
+
+#ifndef DATA_RELATION_H
+#define DATA_RELATION_H 1
+
+#include "libpspp/compiler.h"
+#include "data/column.h"
+
+struct relation_column
+  {
+    struct hmap_node hmap_node;
+    const char *name;
+    struct column *column;
+  };
+
+struct relation *relation_create (void);
+bool relation_destroy (struct relation *);
+
+void relation_add_column (struct relation *,
+                          const char *name, struct column *);
+void relation_delete_column (struct relation *, const char *name);
+void relation_rename_column (struct relation *, const char *old_name,
+                             const char *new_name);
+
+const struct column *relation_get_column (const struct relation *,
+                                          const char *name);
+struct column *relation_get_column_rw (struct relation *, const char *name);
+
+struct pxd_object *relation_save (const struct relation *, struct pxd *);
+struct relation *relation_load (struct pxd_object *, const struct pxd *);
+
+#endif /* data/relation.h */