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
+36 -1
View File
@@ -4,6 +4,17 @@
#include "mbuf.h"
#include "iomux.h"
/** @addtogroup IOMux
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* Return code from users write callback
*/
enum UC_WQ_RESULT {
/** INdicates the MBuf was fully processed and can be freed*/
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);
/** 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 {
/** Underlying IOMuxFD. This member needs to be registered
* with an IOMux, see the description of uc_wqueue_init
*/
struct IOMuxFD fd;
/** Linked list of struct MBuf
*/
struct TailQ queue;
/** Associated mux
*/
struct IOMux *mux;
/** Users callback for read events
*/
wqueue_read_cb read_cb;
/** Users callback for write events
*/
wqueue_write_cb write_cb;
/** Current number of queued struct MBuf
*/
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);
#ifdef __cplusplus
}
#endif
/** @} (addtogroup)*/
#endif