hook.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. /** \file lib/hook.h
  2. * \brief Header: hooks
  3. */
  4. #ifndef MC_HOOK_H
  5. #define MC_HOOK_H
  6. #include "lib/global.h"
  7. /*** typedefs(not structures) and defined constants **********************************************/
  8. /*** enums ***************************************************************************************/
  9. /*** structures declarations (and typedefs of structures)*****************************************/
  10. typedef struct hook_t
  11. {
  12. void (*hook_fn) (void *);
  13. void *hook_data;
  14. struct hook_t *next;
  15. } hook_t;
  16. /*** global variables defined in .c file *********************************************************/
  17. /*** declarations of public functions ************************************************************/
  18. void add_hook (hook_t ** hook_list, void (*hook_fn) (void *), void *data);
  19. void execute_hooks (hook_t * hook_list);
  20. void delete_hook (hook_t ** hook_list, void (*hook_fn) (void *));
  21. gboolean hook_present (hook_t * hook_list, void (*hook_fn) (void *));
  22. /*** inline functions **************************************************/
  23. #endif /* MC_HOOK_H */