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