summaryrefslogtreecommitdiffhomepage
path: root/ir/be/bemodule.h
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2006-12-21 15:36:27 +0100
committerMatthias Braun <matze@braunis.de>2006-12-21 15:36:27 +0100
commit6d2368b06b89d3d1bc34e04588e32b658f4c5f8d (patch)
treecefb4fe450e39bda41793f93152bfdf192934f18 /ir/be/bemodule.h
parent511aeabe9b78ea09a5feb0283ec0c70b77953684 (diff)
introduction of bemodule
Diffstat (limited to 'ir/be/bemodule.h')
-rw-r--r--ir/be/bemodule.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/ir/be/bemodule.h b/ir/be/bemodule.h
new file mode 100644
index 0000000..659e5f7
--- /dev/null
+++ b/ir/be/bemodule.h
@@ -0,0 +1,50 @@
+/*
+ * Author: Matthias Braun
+ * Date: 11.12.2006
+ * Copyright: (c) Universitaet Karlsruhe
+ * Licence: This file protected by GPL - GNU GENERAL PUBLIC LICENSE.
+ */
+#ifndef BEMODULE_H_
+#define BEMODULE_H_
+
+/**
+ * Mark a function as module constructor.
+ * Currently you have to add modules manually in the list in bemodule.c.
+ * However future extensions might allow them to be automatically discovered
+ * when they are marked with BE_REGISTER_MODULE_CONSTRUCTOR
+ */
+#define BE_REGISTER_MODULE_CONSTRUCTOR(func)
+
+/**
+ * Mark a function as module destructor.
+ */
+#define BE_REGISTER_MODULE_DESTRUCTOR(func)
+
+/**
+ * Call all module constructors
+ */
+void be_init_modules(void);
+
+/**
+ * Call all module destructors
+ */
+void be_quit_modules(void);
+
+//---------------------------------------------------------------------------
+
+#ifdef WITH_LIBCORE
+
+#include <libcore/lc_opts.h>
+
+typedef struct be_module_list_entry_t be_module_list_entry_t;
+
+void be_add_module_to_list(be_module_list_entry_t **list_head, const char *name,
+ void *module);
+
+void be_add_module_list_opt(lc_opt_entry_t *grp, const char *name,
+ const char *description,
+ const be_module_list_entry_t * const * first, void **var);
+
+#endif
+
+#endif