Implement invitation announcements (RPL_ISSUEDINVITE).
[ircu2.10.12-pk.git] / include / send.h
1 /*
2  * send.h
3  *
4  * $Id$
5  */
6 #ifndef INCLUDED_send_h
7 #define INCLUDED_send_h
8 #ifndef INCLUDED_stdarg_h
9 #include <stdarg.h>         /* va_list */
10 #define INCLUDED_stdarg_h 
11 #endif
12 #ifndef INCLUDED_time_h
13 #include <time.h>       /* time_t */
14 #define INCLUDED_time_h
15 #endif
16
17 struct Channel;
18 struct Client;
19 struct DBuf;
20 struct MsgBuf;
21
22 /*
23  * Prototypes
24  */
25 extern void send_buffer(struct Client* to, struct MsgBuf* buf, int prio);
26
27 extern void kill_highest_sendq(int servers_too);
28 extern void flush_connections(struct Client* cptr);
29 extern void send_queued(struct Client *to);
30
31 /* Send a raw message to one client; USE ONLY IF YOU MUST SEND SOMETHING
32  * WITHOUT A PREFIX!
33  */
34 extern void sendrawto_one(struct Client *to, const char *pattern, ...);
35
36 /* Send a command to one client */
37 extern void sendcmdto_one(struct Client *from, const char *cmd,
38                           const char *tok, struct Client *to,
39                           const char *pattern, ...);
40
41 /* Same as above, except it puts the message on the priority queue */
42 extern void sendcmdto_prio_one(struct Client *from, const char *cmd,
43                                const char *tok, struct Client *to,
44                                const char *pattern, ...);
45
46 /* Send command to all servers except one */
47 extern void sendcmdto_serv_butone(struct Client *from, const char *cmd,
48                                   const char *tok, struct Client *one,
49                                   const char *pattern, ...);
50
51 /* Send command to all channels user is on */
52 extern void sendcmdto_common_channels_butone(struct Client *from,
53                                              const char *cmd,
54                                              const char *tok,
55                                              struct Client *one,
56                                              const char *pattern, ...);
57
58 /* Send command to all channel users on this server */
59 extern void sendcmdto_channel_butserv_butone(struct Client *from,
60                                              const char *cmd,
61                                              const char *tok,
62                                              struct Channel *to,
63                                              struct Client *one,
64                                              unsigned int skip,
65                                              const char *pattern, ...);
66
67 /* Send command to all servers interested in a channel */
68 extern void sendcmdto_channel_servers_butone(struct Client *from,
69                                              const char *cmd,
70                                              const char *tok,
71                                              struct Channel *to,
72                                              struct Client *one,
73                                              unsigned int skip,
74                                              const char *pattern, ...);
75
76 /* Send command to all interested channel users */
77 extern void sendcmdto_channel_butone(struct Client *from, const char *cmd,
78                                      const char *tok, struct Channel *to,
79                                      struct Client *one, unsigned int skip,
80                                      const char *pattern, ...);
81
82 #define SKIP_DEAF       0x01    /* skip users that are +d */
83 #define SKIP_BURST      0x02    /* skip users that are bursting */
84 #define SKIP_NONOPS     0x04    /* skip users that aren't chanops */
85 #define SKIP_NONVOICES  0x08    /* skip users that aren't voiced (includes
86                                    chanops) */
87
88 /* Send command to all users having a particular flag set */
89 extern void sendwallto_group_butone(struct Client *from, int type, 
90                                     struct Client *one, const char *pattern,
91                                     ...);
92
93 #define WALL_DESYNCH    1
94 #define WALL_WALLOPS    2
95 #define WALL_WALLUSERS  3
96
97 /* Send command to all matching clients */
98 extern void sendcmdto_match_butone(struct Client *from, const char *cmd,
99                                    const char *tok, const char *to,
100                                    struct Client *one, unsigned int who,
101                                    const char *pattern, ...);
102
103 /* Send server notice to opers but one--one can be NULL */
104 extern void sendto_opmask_butone(struct Client *one, unsigned int mask,
105                                  const char *pattern, ...);
106
107 /* Same as above, but rate limited */
108 extern void sendto_opmask_butone_ratelimited(struct Client *one,
109                                              unsigned int mask, time_t *rate,
110                                              const char *pattern, ...);
111
112 /* Same as above, but with variable argument list */
113 extern void vsendto_opmask_butone(struct Client *one, unsigned int mask,
114                                   const char *pattern, va_list vl);
115
116 #endif /* INCLUDED_send_h */