summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--runtime/ChangeLog3
-rw-r--r--runtime/runtime.h23
2 files changed, 26 insertions, 0 deletions
diff --git a/runtime/ChangeLog b/runtime/ChangeLog
index d8798fb9..c45912ab 100644
--- a/runtime/ChangeLog
+++ b/runtime/ChangeLog
@@ -1,5 +1,8 @@
2005-07-08 Martin Hunt <hunt@redhat.com>
+ * runtime.h: Move some common pieces of modules into this file.
+ Includes MODULE_LICENSE, cleanup_module and init_module.
+
* print.c (_stp_print_flush): Rename "t" to "_stp_tport".
* io.c (_stp_vlog): Ditto.
diff --git a/runtime/runtime.h b/runtime/runtime.h
index 1be35b77..62de5b20 100644
--- a/runtime/runtime.h
+++ b/runtime/runtime.h
@@ -55,4 +55,27 @@ static struct
#include "print.c"
#include "string.c"
+/************* Module Stuff ********************/
+int probe_start(void);
+
+int init_module(void)
+{
+ int ret;
+
+ /* First open connection. This exits on failure. */
+ TRANSPORT_OPEN;
+
+ ret = probe_start();
+ if (ret < 0)
+ _stp_transport_close();
+}
+
+void cleanup_module(void)
+{
+ _stp_transport_cleanup();
+ _stp_transport_close();
+}
+
+MODULE_LICENSE("GPL");
+
#endif /* _RUNTIME_H_ */