Guest User

Event.h

a guest
Apr 22nd, 2015
22
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Event.h
  2.  
  3. #ifndef _EVENT_h
  4. #define _EVENT_h
  5.  
  6. #if defined(ARDUINO) && ARDUINO >= 100
  7. #include "arduino.h"
  8. #else
  9. #include "WProgram.h"
  10. #endif
  11.  
  12. #define INITIAL_EVENT_CAP 2
  13.  
  14. typedef struct
  15. {
  16. char* eventName;
  17. void **callbacks;
  18.  
  19. short size;
  20. short capacity;
  21. } Event;
  22.  
  23. void event_create(Event *event_s, char *eventName);
  24.  
  25. void event_send(Event *event_s, void *context);
  26. void event_add(Event *event_s, void(*callback)(void *));
  27.  
  28. #endif
RAW Paste Data