Add doxygen groups

This commit is contained in:
Nils O. Selåsdal
2013-07-31 03:37:50 +02:00
parent 679b4b12e5
commit 13108f1f48
4 changed files with 46 additions and 7 deletions
+5 -1
View File
@@ -3,7 +3,10 @@
#include <sys/time.h> #include <sys/time.h>
#include <time.h> #include <time.h>
/** @addtogroup Timers
* @{
* Clock abstractions
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@@ -117,5 +120,6 @@ void uc_settable_clock_set(struct UCoreSettableClock *uclock,
} }
#endif #endif
/** @} (addtogroup) */
#endif #endif
+29 -3
View File
@@ -2,7 +2,18 @@
#define IO_MUX_H_ #define IO_MUX_H_
#include "timers.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 #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@@ -22,9 +33,20 @@ enum IOMUX_TYPE {
IOMUX_TYPE_EPOLL 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 IOMux;
struct IOMuxFD; 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); typedef void (*iomux_cb)(struct IOMux *mux, struct IOMuxFD *fd, unsigned int event);
/** Represents a watched file descriptor */ /** 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); 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); int iomux_unregister_fd(struct IOMux *mux, struct IOMuxFD *fd);
/** Updates the events to watch for in fd->what /** Updates the events to watch for in fd->what
@@ -120,5 +145,6 @@ struct UCTimers *iomux_get_timers(struct IOMux *mux);
} }
#endif #endif
/** @} (addtogroup)*/
#endif #endif
+6 -3
View File
@@ -1,8 +1,11 @@
#include <stdint.h> #include <stdint.h>
/** Implementation of saturated operation on uintaa_t. /** Implementation of saturated operation on uintxx_t.
* Opaerations are clamped betweehn 0 and UINTaa_MAa instead of *
* wrapping around*/ * 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)\ #define UC_SAT_ADD(a, b, type, max_val)\
((type)((a) + (b)) >= (a) ? (a) + (b) : (max_val)) ((type)((a) + (b)) >= (a) ? (a) + (b) : (max_val))
+6
View File
@@ -6,6 +6,11 @@
#include <sys/time.h> #include <sys/time.h>
#include "rbtree.h" #include "rbtree.h"
/** @addtogroup Timers
* @{
* Timer management for managing timeouts
*/
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@@ -147,4 +152,5 @@ int uc_timers_run(struct UCTimers *timers);
} }
#endif #endif
/** @{ (addtogroup) */
#endif #endif