8e62ca34fff2988192a502a7391cc3313c717140
[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 /* Same as above, except it puts the message on the priority queue */
37 extern void sendcmdto_prio_one(struct Client *from, const char *cmd,
38                                const char *tok, struct Client *to,
39                                const char *pattern, ...);
40
41 /* Send command to all servers except one */
42 extern void sendcmdto_serv_butone(struct Client *from, const char *cmd,
43                                   const char *tok, struct Client *one,
44                                   const char *pattern, ...);
45
46 /* Send command to all channels user is on */
47 extern void sendcmdto_common_channels(struct Client *from, const char *cmd,
48                                       const char *tok, const char *pattern,
49                                       ...);
50
51
52 /* Send command to all channel users on this server */
53 extern void sendcmdto_channel_butserv(struct Client *from, const char *cmd,
54                                       const char *tok, struct Channel *to,
55                                       const char *pattern, ...);
56
57 /* Send command to all interested channel users */
58 extern void sendcmdto_channel_butone(struct Client *from, const char *cmd,
59                                      const char *tok, struct Channel *to,
60                                      struct Client *one, unsigned int skip,
61                                      const char *pattern, ...);
62
63 #define SKIP_DEAF       0x01    /* skip users that are +d */
64 #define SKIP_BURST      0x02    /* skip users that are bursting */
65 #define SKIP_NONOPS     0x04    /* skip users that aren't chanops */
66
67 /* Send command to all users having a particular flag set */
68 extern void sendcmdto_flag_butone(struct Client *from, const char *cmd,
69                                   const char *tok, struct Client *one,
70                                   unsigned int flag, const char *pattern, ...);
71
72 /* Send command to all matching clients */
73 extern void sendcmdto_match_butone(struct Client *from, const char *cmd,
74                                    const char *tok, const char *to,
75                                    struct Client *one, unsigned int who,
76                                    const char *pattern, ...);
77
78 /* Send server notice to opers but one--one can be NULL */
79 extern void sendto_opmask_butone(struct Client *one, unsigned int mask,
80                                  const char *pattern, ...);
81
82 /* Same as above, but with variable argument list */
83 extern void vsendto_opmask_butone(struct Client *one, unsigned int mask,
84                                   const char *pattern, va_list vl);
85
86 #endif /* INCLUDED_send_h */