Author: Ghostwolf <foxxe@wtfs.net>
[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 flush_connections(struct Client* cptr);
28 extern void send_queued(struct Client *to);
29
30 /* Send a raw message to one client; USE ONLY IF YOU MUST SEND SOMETHING
31  * WITHOUT A PREFIX!
32  */
33 extern void sendrawto_one(struct Client *to, const char *pattern, ...);
34
35 /* Send a command to one client */
36 extern void sendcmdto_one(struct Client *from, const char *cmd,
37                           const char *tok, struct Client *to,
38                           const char *pattern, ...);
39
40 /* Same as above, except it puts the message on the priority queue */
41 extern void sendcmdto_prio_one(struct Client *from, const char *cmd,
42                                const char *tok, struct Client *to,
43                                const char *pattern, ...);
44
45 /* Send command to all servers except one */
46 extern void sendcmdto_serv_butone(struct Client *from, const char *cmd,
47                                   const char *tok, struct Client *one,
48                                   const char *pattern, ...);
49
50 /* Send command to all channels user is on */
51 extern void sendcmdto_common_channels_butone(struct Client *from,
52                                              const char *cmd,
53                                              const char *tok,
54                                              struct Client *one,
55                                              const char *pattern, ...);
56
57 /* Send command to all channel users on this server */
58 extern void sendcmdto_channel_butserv_butone(struct Client *from,
59                                              const char *cmd,
60                                              const char *tok,
61                                              struct Channel *to,
62                                              struct Client *one,
63                                              const char *pattern, ...);
64
65 /* Send command to all interested channel users */
66 extern void sendcmdto_channel_butone(struct Client *from, const char *cmd,
67                                      const char *tok, struct Channel *to,
68                                      struct Client *one, unsigned int skip,
69                                      const char *pattern, ...);
70
71 #define SKIP_DEAF       0x01    /* skip users that are +d */
72 #define SKIP_BURST      0x02    /* skip users that are bursting */
73 #define SKIP_NONOPS     0x04    /* skip users that aren't chanops */
74
75 /* Send command to all users having a particular flag set */
76 extern void sendwallto_group_butone(struct Client *from, int type, 
77                                     struct Client *one, const char *pattern,
78                                     ...);
79
80 #define WALL_DESYNCH    1
81 #define WALL_WALLOPS    2
82 #define WALL_WALLUSERS  3
83
84 /* Send command to all matching clients */
85 extern void sendcmdto_match_butone(struct Client *from, const char *cmd,
86                                    const char *tok, const char *to,
87                                    struct Client *one, unsigned int who,
88                                    const char *pattern, ...);
89
90 /* Send server notice to opers but one--one can be NULL */
91 extern void sendto_opmask_butone(struct Client *one, unsigned int mask,
92                                  const char *pattern, ...);
93
94 /* Same as above, but rate limited */
95 extern void sendto_opmask_butone_ratelimited(struct Client *one,
96                                              unsigned int mask, time_t *rate,
97                                              const char *pattern, ...);
98
99 /* Same as above, but with variable argument list */
100 extern void vsendto_opmask_butone(struct Client *one, unsigned int mask,
101                                   const char *pattern, va_list vl);
102
103 #endif /* INCLUDED_send_h */