irc.h 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #define PRIO_DEOP 1
  11. #define PRIO_KICK 2
  12. /* For flushmodes */
  13. #define NORMAL 0
  14. #define QUICK 1
  15. #ifdef MAKING_IRC
  16. #ifdef S_AUTHCMDS
  17. static int check_bind_pubc(char *, char *, char *, struct userrec *, char *, char *);
  18. #endif /* S_AUTHCMDS */
  19. static void makeopline(struct chanset_t *, char *, char *);
  20. static int me_voice(struct chanset_t *);
  21. static int any_ops(struct chanset_t *);
  22. static char *getchanmode(struct chanset_t *);
  23. static void flush_mode(struct chanset_t *, int);
  24. /* reset(bans|exempts|invites) are now just macros that call resetmasks
  25. * in order to reduce the code duplication. <cybah>
  26. */
  27. #define resetbans(chan) resetmasks((chan), (chan)->channel.ban, (chan)->bans, global_bans, 'b')
  28. #define resetexempts(chan) resetmasks((chan), (chan)->channel.exempt, (chan)->exempts, global_exempts, 'e')
  29. #define resetinvites(chan) resetmasks((chan), (chan)->channel.invite, (chan)->invites, global_invites, 'I')
  30. static void detect_autokick(char *, char *, struct chanset_t *, char *);
  31. /* static int target_priority(struct chanset_t *, memberlist *, int); */
  32. static int do_op(char *, struct chanset_t *, int, int);
  33. static void request_op(struct chanset_t *);
  34. static void request_in(struct chanset_t *);
  35. static void reset_chan_info(struct chanset_t *);
  36. static void my_setkey(struct chanset_t *, char *);
  37. static void maybe_revenge(struct chanset_t *, char *, char *, int);
  38. static int detect_chan_flood(char *, char *, char *, struct chanset_t *, int,
  39. char *);
  40. static void new_mask(masklist *, char *, char *);
  41. static void doban(struct chanset_t *, memberlist *);
  42. static char *quickban(struct chanset_t *, char *);
  43. static void got_op(struct chanset_t *chan, char *nick, char *from, char *who,
  44. struct userrec *opu, struct flag_record *opper);
  45. static int real_killmember(struct chanset_t *chan, char *nick, const char *file, int line);
  46. #define killmember(chan, nick) real_killmember((chan), (nick), __FILE__,__LINE__)
  47. static void check_lonely_channel(struct chanset_t *chan);
  48. static int gotmode(char *, char *);
  49. #define newban(chan, mask, who) new_mask((chan)->channel.ban, mask, who)
  50. #define newexempt(chan, mask, who) new_mask((chan)->channel.exempt, mask, who)
  51. #define newinvite(chan, mask, who) new_mask((chan)->channel.invite, mask, who)
  52. #endif /* MAKING_IRC */
  53. void add_mode(struct chanset_t *, const unsigned char, const unsigned char, const char *);
  54. int me_op(struct chanset_t *);
  55. void check_this_ban(struct chanset_t *, char *, int);
  56. void check_this_exempt(struct chanset_t *, char *, int);
  57. void check_this_invite(struct chanset_t *, char *, int);
  58. void check_this_user(char *, int, char *);
  59. void raise_limit(struct chanset_t *);
  60. void enforce_closed(struct chanset_t *);
  61. void recheck_channel(struct chanset_t *, int);
  62. void recheck_channel_modes(struct chanset_t *);
  63. void do_channel_part(struct chanset_t *);
  64. void irc_report(int, int);
  65. void flush_modes();
  66. #endif /* _EGG_MOD_IRC_IRC_H */
  67. #endif /* LEAF */