agileRTOS (zrtos)  Version 0.8.0 (ghostbuster)
event_handler.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024 ykat UG (haftungsbeschraenkt) - All Rights Reserved
3  *
4  * Permission for non-commercial use is hereby granted,
5  * free of charge, without warranty of any kind.
6  */
7 #ifndef ZRTOS_EVENT_HANDLER_H
8 #define ZRTOS_EVENT_HANDLER_H
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 
14 #include <zrtos/types.h>
15 
16 struct _zrtos_event_t;
18 
20  struct _zrtos_event_handler_t *thiz
21  ,struct _zrtos_event_t *args
22 );
23 
24 typedef struct _zrtos_event_handler_t{
26  zrtos_event_type_t type;
27  void *ctx;
29 
30 #define ZRTOS_EVENT_HANDLER(callback_,type_,ctx_) \
31  { \
32  .callback=callback_ \
33  ,.type=type_ \
34  ,.ctx=ctx_ \
35  }
36 
39 ){
40  return thiz->ctx;
41 }
42 
43 #ifdef __cplusplus
44 }
45 #endif
46 #endif
bool(* zrtos_event_handler_callback_t)(struct _zrtos_event_handler_t *thiz, struct _zrtos_event_t *args)
Definition: event_handler.h:19
zrtos_event_type_t type
Definition: event_handler.h:26
zrtos_event_handler_callback_t callback
Definition: event_handler.h:25
struct _zrtos_event_handler_t zrtos_event_handler_t
void * zrtos_event_handler__get_context(zrtos_event_handler_t *thiz)
Definition: event_handler.h:37