modules.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * modules.h
  3. * support for modules in eggdrop
  4. *
  5. * by Darrin Smith (beldin@light.iinet.net.au)
  6. *
  7. */
  8. #ifndef _EGG_MODULE_H
  9. #define _EGG_MODULE_H
  10. /* Module related structures
  11. */
  12. #include "mod/modvals.h"
  13. #include "types.h"
  14. #ifndef MAKING_NUMMODS
  15. /* Modules specific functions and functions called by eggdrop
  16. */
  17. void do_module_report(int, int, char *);
  18. int module_register(char *name, Function * funcs,
  19. int major, int minor);
  20. const char *module_load(char *module_name);
  21. char *module_unload(char *module_name, char *nick);
  22. module_entry *module_find(char *name, int, int);
  23. Function *module_depend(char *, char *, int major, int minor);
  24. int module_undepend(char *);
  25. void add_hook(int hook_num, Function func);
  26. void del_hook(int hook_num, Function func);
  27. void *get_next_hook(int hook_num, void *func);
  28. extern struct hook_entry {
  29. struct hook_entry *next;
  30. int (*func) ();
  31. } *hook_list[REAL_HOOKS];
  32. #define call_hook(x) do { \
  33. register struct hook_entry *p, *pn; \
  34. \
  35. for (p = hook_list[x]; p; p = pn) { \
  36. pn = p->next; \
  37. p->func(); \
  38. } \
  39. } while (0)
  40. int call_hook_cccc(int, char *, char *, char *, char *);
  41. #endif
  42. typedef struct _dependancy {
  43. struct _module_entry *needed;
  44. struct _module_entry *needing;
  45. struct _dependancy *next;
  46. int major;
  47. int minor;
  48. } dependancy;
  49. extern dependancy *dependancy_list;
  50. #endif /* _EGG_MODULE_H */