From 13108f1f4837d89ca0c70f07b78ae38a1545f226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Wed, 31 Jul 2013 03:37:50 +0200 Subject: [PATCH] Add doxygen groups --- include/ucore/clock.h | 6 +++++- include/ucore/iomux.h | 32 +++++++++++++++++++++++++++++--- include/ucore/saturating_math.h | 9 ++++++--- include/ucore/timers.h | 6 ++++++ 4 files changed, 46 insertions(+), 7 deletions(-) diff --git a/include/ucore/clock.h b/include/ucore/clock.h index b64c4a9..7014c63 100644 --- a/include/ucore/clock.h +++ b/include/ucore/clock.h @@ -3,7 +3,10 @@ #include #include - +/** @addtogroup Timers + * @{ + * Clock abstractions + */ #ifdef __cplusplus extern "C" { #endif @@ -117,5 +120,6 @@ void uc_settable_clock_set(struct UCoreSettableClock *uclock, } #endif +/** @} (addtogroup) */ #endif diff --git a/include/ucore/iomux.h b/include/ucore/iomux.h index 20a64cb..78e4ccd 100644 --- a/include/ucore/iomux.h +++ b/include/ucore/iomux.h @@ -2,7 +2,18 @@ #define IO_MUX_H_ #include "timers.h" - +/** @addtogroup IOMux + * @{ + * The IOMux is an I/O multiplexer, implementing a main eventloop. + * The event loop can be used to register callbacks for activity on + * file descriptors such as sockets and pips, and for timers. + * + * The IOMux is backed either by the select() system call, or the epoll + * facility on Linux. Several IOMuxes can run in different threads concurrently, + * but note that the IOMux itself is not thread safe so operations in one thread + * cannot work on an IOMux running in another thread. + * + * */ #ifdef __cplusplus extern "C" { #endif @@ -22,9 +33,20 @@ enum IOMUX_TYPE { IOMUX_TYPE_EPOLL }; -/** Opaque struct */ +/** The IOMux used to issue mux operations. This is to be treated as an opaque + * handle. Use iomux_create() or iomux_create_ex() to create an IOMux, register + * callbakcs, and call iomux_run() to process the events + */ struct IOMux; + struct IOMuxFD; + +/** Callback function used in struct IOMuxFD + * @param mux the mux that issued the callback. + * @param fd the file desciptor structure. + * @param event A bitmask of the MUX_EV_XX values. Both a read and a write event + * might be signalled in the same callback + */ typedef void (*iomux_cb)(struct IOMux *mux, struct IOMuxFD *fd, unsigned int event); /** Represents a watched file descriptor */ @@ -76,7 +98,10 @@ int iomux_run(struct IOMux *mux); */ int iomux_register_fd(struct IOMux *mux, struct IOMuxFD *fd); -/** Removes the file descriptor*/ +/** Removes the file descriptor + * + * @return 0 on success, an errno value on error + */ int iomux_unregister_fd(struct IOMux *mux, struct IOMuxFD *fd); /** Updates the events to watch for in fd->what @@ -120,5 +145,6 @@ struct UCTimers *iomux_get_timers(struct IOMux *mux); } #endif +/** @} (addtogroup)*/ #endif diff --git a/include/ucore/saturating_math.h b/include/ucore/saturating_math.h index f870222..e10539d 100644 --- a/include/ucore/saturating_math.h +++ b/include/ucore/saturating_math.h @@ -1,8 +1,11 @@ #include -/** Implementation of saturated operation on uintaa_t. - * Opaerations are clamped betweehn 0 and UINTaa_MAa instead of - * wrapping around*/ +/** Implementation of saturated operation on uintxx_t. + * + * Operations are clamped between 0 and UINTxx_MAX instead of + * wrapping around. + * + * multiplication, subtraction and addition operations are provided.*/ #define UC_SAT_ADD(a, b, type, max_val)\ ((type)((a) + (b)) >= (a) ? (a) + (b) : (max_val)) diff --git a/include/ucore/timers.h b/include/ucore/timers.h index f4769e3..6aa34b5 100644 --- a/include/ucore/timers.h +++ b/include/ucore/timers.h @@ -6,6 +6,11 @@ #include #include "rbtree.h" +/** @addtogroup Timers + * @{ + * Timer management for managing timeouts + */ + #ifdef __cplusplus extern "C" { #endif @@ -147,4 +152,5 @@ int uc_timers_run(struct UCTimers *timers); } #endif +/** @{ (addtogroup) */ #endif