irc.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifdef LEAF
  2. /*
  3. * irc.h -- part of irc.mod
  4. *
  5. */
  6. #ifndef _EGG_MOD_IRC_IRC_H
  7. #define _EGG_MOD_IRC_IRC_H
  8. #define REVENGE_KICK 1 /* Kicked victim */
  9. #define REVENGE_DEOP 2 /* Took op */
  10. #ifdef MAKING_IRC
  11. #ifdef S_AUTH
  12. static int check_tcl_pubc(char *, char *, char *, struct userrec *, char *, char *);
  13. #endif /* S_AUTH */
  14. static void makeopline(struct chanset_t *, char *, char *);
  15. static int me_op(struct chanset_t *);
  16. static int me_voice(struct chanset_t *);
  17. static int any_ops(struct chanset_t *);
  18. static char *getchanmode(struct chanset_t *);
  19. static void flush_mode(struct chanset_t *, int);
  20. /* reset(bans|exempts|invites) are now just macros that call resetmasks
  21. * in order to reduce the code duplication. <cybah>
  22. */
  23. #define resetbans(chan) resetmasks((chan), (chan)->channel.ban, \
  24. (chan)->bans, global_bans, 'b')
  25. #define resetexempts(chan) resetmasks((chan), (chan)->channel.exempt, \
  26. (chan)->exempts, global_exempts, 'e')
  27. #define resetinvites(chan) resetmasks((chan), (chan)->channel.invite, \
  28. (chan)->invites, global_invites, 'I')
  29. static int target_priority(struct chanset_t *, memberlist *, int);
  30. static void request_op(struct chanset_t *);
  31. static void request_in(struct chanset_t *);
  32. static void reset_chan_info(struct chanset_t *);
  33. static void recheck_channel(struct chanset_t *, int);
  34. static void my_setkey(struct chanset_t *, char *);
  35. static void maybe_revenge(struct chanset_t *, char *, char *, int);
  36. static int detect_chan_flood(char *, char *, char *, struct chanset_t *, int,
  37. char *);
  38. static void newmask(masklist *, char *, char *);
  39. static char *quickban(struct chanset_t *, char *);
  40. static void got_op(struct chanset_t *chan, char *nick, char *from, char *who,
  41. struct userrec *opu, struct flag_record *opper);
  42. static int killmember(struct chanset_t *chan, char *nick);
  43. static void check_lonely_channel(struct chanset_t *chan);
  44. static int gotmode(char *, char *);
  45. #define newban(chan, mask, who) newmask((chan)->channel.ban, mask, who)
  46. #define newexempt(chan, mask, who) newmask((chan)->channel.exempt, mask, \
  47. who)
  48. #define newinvite(chan, mask, who) newmask((chan)->channel.invite, mask, \
  49. who)
  50. #else
  51. /* 4 - 7 */
  52. /* 8 - 11 */
  53. /* 12 - 15 */
  54. /* recheck_channel is here */
  55. /* 16 - 19 */
  56. #define me_op ((int(*)(struct chanset_t *))irc_funcs[16])
  57. /* recheck_channel_modes is here */
  58. /* do_channel_part is here. */
  59. /* 20 - 23 */
  60. /* check_this_ban is here. */
  61. /* check_this_user is here. */
  62. #define me_voice ((int(*)(struct chanset_t *))irc_funcs[22])
  63. //#define getchanmode ((char *(*)(struct chanset_t *))irc_funcs[23])
  64. #endif /* MAKING_IRC */
  65. #endif /* _EGG_MOD_IRC_IRC_H */
  66. #endif /* LEAF */