add worspace type
[calc.git] / workspace.h
diff --git a/workspace.h b/workspace.h
new file mode 100644 (file)
index 0000000..7bca4e0
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef __WORKSPACE_H__
+#define __WORKSPACE_H__
+
+#include "element.h"
+#include "tabular.h"
+
+/* global variables */
+
+/* workspace type */
+
+typedef struct _workspace_t {
+    double answer;
+    tab_t *argument;
+    int id;
+    element_t *root;
+    tab_t *stack;
+    tab_t *storage;
+    char *string;
+} workspace_t;
+
+/* workspace functions */
+
+workspace_t *alloc_ws ();
+workspace_t *backup_ws (workspace_t *ws);
+workspace_t *clean_ws (workspace_t *ws);
+void free_ws (workspace_t *ws);
+void restore_ws (workspace_t *ws);
+
+#endif /*  __WORKSPACE_H__ */
+
+/* vim: set ts=4 sw=4 et: */