Author: Kev <klmitch@mit.edu>
[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
13 struct Channel;
14 struct Client;
15 struct DBuf;
16 struct MsgBuf;
17
18 /*
19  * Prototypes
20  */
21 extern void send_buffer(struct Client* to, struct MsgBuf* buf, int prio);
22
23 extern void flush_connections(struct Client* cptr);
24 extern void send_queued(struct Client *to);
25
26 /* Send a raw message to one client; USE ONLY IF YOU MUST SEND SOMETHING
27  * WITHOUT A PREFIX!
28  */
29 extern void sendrawto_one(struct Client *to, const char *pattern, ...);
30
31 /* Send a command to one client */
32 extern void sendcmdto_one(struct Client *from, const char *cmd,
33                           const char *tok, struct Client *to,
34                           const char *pattern, ...);
35
36
37 /* Same as above, except it takes a va_list */
38 extern void vsendcmdto_one(struct Client *from, const char *cmd,
39                            const char *tok, struct Client *to,
40                            const char *pattern, va_list vl);
41
42 /* Send command to all servers except one */
43 extern void sendcmdto_serv_butone(struct Client *from, const char *cmd,
44                                   const char *tok, struct Client *one,
45                                   const char *pattern, ...);
46
47 /* Send command to all channels user is on */
48 extern void sendcmdto_common_channels(struct Client *from, const char *cmd,
49                                       const char *tok, const char *pattern,
50                                       ...);
51
52
53 /* Send command to all channel users on this server */
54 extern void sendcmdto_channel_butserv(struct Client *from, const char *cmd,
55                                       const char *tok, struct Channel *to,
56                                       const char *pattern, ...);
57
58 /* Send command to all interested channel users */
59 extern void sendcmdto_channel_butone(struct Client *from, const char *cmd,
60                                      const char *tok, struct Channel *to,
61                                      struct Client *one, unsigned int skip,
62                                      const char *pattern, ...);
63
64 #define SKIP_DEAF       0x01    /* skip users that are +d */
65 #define SKIP_BURST      0x02    /* skip users that are bursting */
66 #define SKIP_NONOPS     0x04    /* skip users that aren't chanops */
67
68 /* Send command to all users having a particular flag set */
69 extern void sendcmdto_flag_butone(struct Client *from, const char *cmd,
70                                   const char *tok, struct Client *one,
71                                   unsigned int flag, const char *pattern, ...);
72
73 /* Send command to all matching clients */
74 extern void sendcmdto_match_butone(struct Client *from, const char *cmd,
75                                    const char *tok, const char *to,
76                                    struct Client *one, unsigned int who,
77                                    const char *pattern, ...);
78
79 /* Send server notice to opers but one--one can be NULL */
80 extern void sendto_opmask_butone(struct Client *one, unsigned int mask,
81                                  const char *pattern, ...);
82
83 /* Same as above, but with variable argument list */
84 extern void vsendto_opmask_butone(struct Client *one, unsigned int mask,
85                                   const char *pattern, va_list vl);
86
87 #endif /* INCLUDED_send_h */