improve ordq
This commit is contained in:
parent
abea3375ca
commit
c12fcf6905
4 changed files with 70 additions and 35 deletions
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#define _ORDQ_H_ 1
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "mylock.h"
|
||||
|
|
@ -13,7 +14,7 @@ typedef struct _ordq_item {
|
|||
|
||||
typedef int (*ordq_cmp_fn_t)(void*, void*, void*);
|
||||
typedef void (*ordq_data_killer_t)(void*);
|
||||
typedef int (*ordq_skip_fn_t)(void*, void*);
|
||||
typedef int (*ordq_skip_fn_t)(void*, va_list);
|
||||
|
||||
typedef struct {
|
||||
mylock_t lock;
|
||||
|
|
@ -26,8 +27,8 @@ typedef struct {
|
|||
extern int ordq_init(ordq_t*, ordq_data_killer_t, ordq_cmp_fn_t);
|
||||
extern void ordq_fini(ordq_t* q);
|
||||
extern int ordq_put(ordq_t*, void*);
|
||||
extern ordq_item_t* ordq_get(ordq_t*, ordq_skip_fn_t);
|
||||
extern ordq_item_t* ordq_peek(ordq_t*, ordq_skip_fn_t);
|
||||
extern ordq_item_t* ordq_get(ordq_t*, ordq_skip_fn_t, ...);
|
||||
extern ordq_item_t* ordq_peek(ordq_t*, ordq_skip_fn_t, ...);
|
||||
extern void ordq_set_ctx(ordq_t*, void*);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue