work on making transformations use relative return values
[pspp] / src / data / transformations.h
index 5e1488323b1936808f46496843fdfcd5c7ac3a45..66ddb4e0fb63a4688f05b7f70e78d5000b0a5040 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef TRANSFORMATIONS_H
 #define TRANSFORMATIONS_H 1
 
+#include <limits.h>
 #include <stdbool.h>
 #include <stddef.h>
 #include "data/case.h"
 /* trns_proc_func return values. */
 enum trns_result
   {
-    TRNS_CONTINUE = -1,         /* Continue to next transformation. */
-    TRNS_DROP_CASE = -2,        /* Drop this case. */
-    TRNS_ERROR = -3,            /* A serious error, so stop the procedure. */
-    TRNS_END_CASE = -4,         /* Skip to next case.  INPUT PROGRAM only. */
-    TRNS_END_FILE = -5          /* End of input.  INPUT PROGRAM only. */
+    TRNS_CONTINUE = INT_MIN,    /* Continue to next transformation. */
+    TRNS_DROP_CASE,             /* Drop this case. */
+    TRNS_ERROR,                 /* A serious error, so stop the procedure. */
+    TRNS_END_CASE,              /* Skip to next case.  INPUT PROGRAM only. */
+    TRNS_END_FILE               /* End of input.  INPUT PROGRAM only. */
   };
 
 struct ccase;
 typedef int trns_proc_func (void *, struct ccase **, casenumber);
 typedef bool trns_free_func (void *);
+typedef struct pxd_object *trns_save_func (void *, struct pxd *);
+typedef void *trns_load_func (struct pxd_object *, const struct pxd *);
+
+#if 0
+struct trns_class
+  {
+    int (*execute) (struct trns_class *, struct ccase **, casenumber);
+    bool (*destroy) (struct ccase *);
+  };
+#endif
 \f
 /* Transformation chains. */