From 388451654e4651d9abf99cc97d927f3b97fc31d3 Mon Sep 17 00:00:00 2001 From: hunt Date: Fri, 8 Jul 2005 20:51:09 +0000 Subject: 2005-07-08 Martin Hunt * runtime.h: Move some common pieces of modules into this file. Includes MODULE_LICENSE, cleanup_module and init_module. --- runtime/ChangeLog | 3 +++ runtime/runtime.h | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) 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 + * 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_ */ -- cgit