iomux_signal.h and wqueue.h should be usable in C++. Add

to IOMux doxygen group too.
This commit is contained in:
Nils O. Selåsdal
2015-12-04 22:18:29 +01:00
parent fb5b5f0692
commit 1d26348bb0
2 changed files with 51 additions and 1 deletions
+15
View File
@@ -2,6 +2,15 @@
#define UC_IOMUX_SIGNAL_H_ #define UC_IOMUX_SIGNAL_H_
#include "ucore/iomux.h" #include "ucore/iomux.h"
/** @addtogroup IOMux
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/** Callback signature for handling unix signals. /** Callback signature for handling unix signals.
* @param mux associated mux * @param mux associated mux
* @param signo unix signal number * @param signo unix signal number
@@ -45,4 +54,10 @@ int iomux_register_unixsignal(struct IOMux *mux,
*/ */
int iomux_unregister_unixsignal(struct IOMux *mux, int signo); int iomux_unregister_unixsignal(struct IOMux *mux, int signo);
#ifdef __cplusplus
}
#endif
/** @} (addtogroup)*/
#endif #endif
+36 -1
View File
@@ -4,6 +4,17 @@
#include "mbuf.h" #include "mbuf.h"
#include "iomux.h" #include "iomux.h"
/** @addtogroup IOMux
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* Return code from users write callback
*/
enum UC_WQ_RESULT { enum UC_WQ_RESULT {
/** INdicates the MBuf was fully processed and can be freed*/ /** INdicates the MBuf was fully processed and can be freed*/
UC_WQ_DONE = 1, UC_WQ_DONE = 1,
@@ -51,15 +62,33 @@ typedef enum UC_WQ_RESULT (*wqueue_write_cb)(struct IOMux *mux, struct IOMuxFD *
*/ */
typedef enum UC_WQ_RESULT (*wqueue_read_cb)(struct IOMux *mux, struct IOMuxFD *fd); typedef enum UC_WQ_RESULT (*wqueue_read_cb)(struct IOMux *mux, struct IOMuxFD *fd);
/** Represents a queue of data to write. /**
* Represents a queue of data to write.
* UCWQueue replaces a raw IOMuxFD, and manages a queue
* of data to write, held as a list of struct MBuf.
* See also uc_wqueue_init
*
*/ */
struct UCWQueue { struct UCWQueue {
/** Underlying IOMuxFD. This member needs to be registered
* with an IOMux, see the description of uc_wqueue_init
*/
struct IOMuxFD fd; struct IOMuxFD fd;
/** Linked list of struct MBuf
*/
struct TailQ queue; struct TailQ queue;
/** Associated mux
*/
struct IOMux *mux; struct IOMux *mux;
/** Users callback for read events
*/
wqueue_read_cb read_cb; wqueue_read_cb read_cb;
/** Users callback for write events
*/
wqueue_write_cb write_cb; wqueue_write_cb write_cb;
/** Current number of queued struct MBuf
*/
unsigned int queue_len; unsigned int queue_len;
}; };
@@ -120,4 +149,10 @@ int uc_wqueue_enqueue(struct UCWQueue *wqueue, struct MBuf *mbuf);
*/ */
int uc_wqueue_flush(struct UCWQueue *wqueue); int uc_wqueue_flush(struct UCWQueue *wqueue);
#ifdef __cplusplus
}
#endif
/** @} (addtogroup)*/
#endif #endif