add emitter_forward

This commit is contained in:
xianjimli 2020-01-28 17:03:12 +08:00
parent 8b72d7c081
commit 69d43a1c89
3 changed files with 9 additions and 0 deletions

View File

@ -383,3 +383,8 @@ ret_t emitter_dispatch_simple_event(emitter_t* emitter, uint32_t type) {
return emitter_dispatch(emitter, &e);
}
ret_t emitter_forward(void* ctx, event_t* e) {
emitter_dispatch(EMITTER(ctx), e);
}

View File

@ -291,6 +291,8 @@ emitter_t* emitter_cast(emitter_t* emitter);
ret_t emitter_remove_item(emitter_t* emitter, emitter_item_t* item);
emitter_item_t* emitter_get_item(emitter_t* emitter, uint32_t index);
ret_t emitter_forward(void* ctx, event_t* e);
END_C_DECLS
#endif /*TK_EMITTER_H*/

View File

@ -358,4 +358,6 @@ typedef struct _event_source_manager_t event_source_manager_t;
#define EAGAIN 11
#endif /*EAGAIN*/
#define TK_SET_NULL(p) (p) = NULL
#endif /*TYPES_DEF_H*/