aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc/include-stack.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-04 18:31:28 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-04 18:31:28 +0100
commita8dec5c7bb0969d6f92610bd327648ae9d31a06d (patch)
treee04ae9e02e4da66742b55c531458b36ecd7c3c7f /src/mds-kbdc/include-stack.h
parentmds-kbdc: more progress on the compilation (diff)
downloadmds-a8dec5c7bb0969d6f92610bd327648ae9d31a06d.tar.gz
mds-a8dec5c7bb0969d6f92610bd327648ae9d31a06d.tar.bz2
mds-a8dec5c7bb0969d6f92610bd327648ae9d31a06d.tar.xz
mds-kbdc: m + include stack for macro and check for redefinitions of macros
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-kbdc/include-stack.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/mds-kbdc/include-stack.h b/src/mds-kbdc/include-stack.h
index 6758589..49a6248 100644
--- a/src/mds-kbdc/include-stack.h
+++ b/src/mds-kbdc/include-stack.h
@@ -63,6 +63,30 @@
/**
+ * A saved state of the include stack
+ */
+typedef struct mds_kbdc_include_stack
+{
+ /**
+ * Stack of visited include-statements
+ */
+ const mds_kbdc_tree_include_t** stack;
+
+ /**
+ * The number elements stored in `stack` (do not edit)
+ */
+ size_t ptr;
+
+ /**
+ * The number of duplicates there are of this object
+ */
+ size_t duplicates;
+
+} mds_kbdc_include_stack_t;
+
+
+
+/**
* The number elements stored by `mds_kbdc_include_stack_push`
* but not removed by `mds_kbdc_include_stack_pop`
*/
@@ -113,6 +137,28 @@ int mds_kbdc_include_stack_push(const mds_kbdc_tree_include_t* restrict tree, vo
*/
void mds_kbdc_include_stack_pop(void* data);
+/**
+ * Save the current include-stack
+ *
+ * @return The include-stack, `NULL` on error
+ */
+mds_kbdc_include_stack_t* mds_kbdc_include_stack_save(void);
+
+/**
+ * Restore a previous include-stack
+ *
+ * @param stack The include-stack
+ * @return Zero on success, -1 on error
+ */
+int mds_kbdc_include_stack_restore(mds_kbdc_include_stack_t* restrict stack);
+
+/**
+ * Destroy a previous include-stack and free its allocation
+ *
+ * @param stack The include-stack
+ */
+void mds_kbdc_include_stack_free(mds_kbdc_include_stack_t* restrict stack);
+
#endif