1
0

modules.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. #ifndef MAKING_NUMMODS
  14. /* Modules specific functions and functions called by eggdrop
  15. */
  16. void do_module_report(int, int, char *);
  17. int module_register(char *name, Function * funcs,
  18. int major, int minor);
  19. const char *module_load(char *module_name);
  20. char *module_unload(char *module_name, char *nick);
  21. module_entry *module_find(char *name, int, int);
  22. Function *module_depend(char *, char *, int major, int minor);
  23. int module_undepend(char *);
  24. void add_hook(int hook_num, Function func);
  25. void del_hook(int hook_num, Function func);
  26. void *get_next_hook(int hook_num, void *func);
  27. extern struct hook_entry {
  28. struct hook_entry *next;
  29. int (*func) ();
  30. } *hook_list[REAL_HOOKS];
  31. #define call_hook(x) do { \
  32. register struct hook_entry *p, *pn; \
  33. \
  34. for (p = hook_list[x]; p; p = pn) { \
  35. pn = p->next; \
  36. p->func(); \
  37. } \
  38. } while (0)
  39. int call_hook_cccc(int, char *, char *, char *, char *);
  40. #endif
  41. typedef struct _dependancy {
  42. struct _module_entry *needed;
  43. struct _module_entry *needing;
  44. struct _dependancy *next;
  45. int major;
  46. int minor;
  47. } dependancy;
  48. extern dependancy *dependancy_list;
  49. #endif /* _EGG_MODULE_H */