diff options
author | Harald Welte <laforge@gnumonks.org> | 2011-08-17 16:19:46 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2011-08-17 17:14:12 +0200 |
commit | af8e4352b5880a20cfdaf89303a71e222ab8badd (patch) | |
tree | b1933332f6e4bca60057262404a1aaea855882e6 | |
parent | eee3790d246600c9145f9b972e67ebfded8fde98 (diff) |
doxygen: Add documentation to signal.[ch]
-rw-r--r-- | include/osmocom/core/signal.h | 12 | ||||
-rw-r--r-- | src/signal.c | 24 |
2 files changed, 33 insertions, 3 deletions
diff --git a/include/osmocom/core/signal.h b/include/osmocom/core/signal.h index 2442e510..097aa193 100644 --- a/include/osmocom/core/signal.h +++ b/include/osmocom/core/signal.h @@ -3,13 +3,18 @@ #include <stdint.h> +/*! \defgroup signal Intra-application signals + * @{ + */ +/*! \file signal.h */ + /* subsystem signaling numbers: we split the numberspace for applications and * libraries: from 0 to UINT_MAX/2 for applications, from UINT_MAX/2 to * UINT_MAX for libraries. */ #define OSMO_SIGNAL_SS_APPS 0 #define OSMO_SIGNAL_SS_RESERVED 2147483648 -/* signal subsystems. */ +/*! \brief signal subsystems */ enum { SS_L_GLOBAL = OSMO_SIGNAL_SS_RESERVED, SS_L_INPUT, @@ -19,11 +24,12 @@ enum { #define OSMO_SIGNAL_T_APPS 0 #define OSMO_SIGNAL_T_RESERVED 2147483648 -/* signal types. */ +/*! \brief signal types. */ enum { S_L_GLOBAL_SHUTDOWN = OSMO_SIGNAL_T_RESERVED, }; +/*! signal callback function type */ typedef int osmo_signal_cbfn(unsigned int subsys, unsigned int signal, void *handler_data, void *signal_data); @@ -34,4 +40,6 @@ void osmo_signal_unregister_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, /* Dispatch */ void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data); +/*! }@ */ + #endif /* OSMO_SIGNAL_H */ diff --git a/src/signal.c b/src/signal.c index bc339bb9..7ddc2e04 100644 --- a/src/signal.c +++ b/src/signal.c @@ -25,6 +25,12 @@ #include <string.h> #include <errno.h> +/*! \addtogroup signal + * @{ + */ +/*! \file signal.c */ + + void *tall_sigh_ctx; static LLIST_HEAD(signal_handler_list); @@ -36,6 +42,11 @@ struct signal_handler { }; +/*! \brief Register a new signal handler + * \param[in] subsys Subsystem number + * \param[in] cbfn Callback function + * \param[in] data Data passed through to callback + */ int osmo_signal_register_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data) { @@ -58,6 +69,11 @@ int osmo_signal_register_handler(unsigned int subsys, return 0; } +/*! \brief Unregister signal handler + * \param[in] subsys Subsystem number + * \param[in] cbfn Callback function + * \param[in] data Data passed through to callback + */ void osmo_signal_unregister_handler(unsigned int subsys, osmo_signal_cbfn *cbfn, void *data) { @@ -73,7 +89,11 @@ void osmo_signal_unregister_handler(unsigned int subsys, } } - +/*! \brief dispatch (deliver) a new signal to all registered handlers + * \param[in] subsys Subsystem number + * \param[in] signal Signal number, + * \param[in] signal_data Data to be passed along to handlers + */ void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, void *signal_data) { @@ -85,3 +105,5 @@ void osmo_signal_dispatch(unsigned int subsys, unsigned int signal, (*handler->cbfn)(subsys, signal, handler->data, signal_data); } } + +/*! }@ */ |