1fd642136d40220aada363669b7034d88c931aae
[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(struct Client *from, const char *cmd,
52                                       const char *tok, const char *pattern,
53                                       ...);
54
55
56 /* Send command to all channel users on this server */
57 extern void sendcmdto_channel_butserv(struct Client *from, const char *cmd,
58                                       const char *tok, struct Channel *to,
59                                       const char *pattern, ...);
60
61 /* Send command to all interested channel users */
62 extern void sendcmdto_channel_butone(struct Client *from, const char *cmd,
63                                      const char *tok, struct Channel *to,
64                                      struct Client *one, unsigned int skip,
65                                      const char *pattern, ...);
66
67 #define SKIP_DEAF       0x01    /* skip users that are +d */
68 #define SKIP_BURST      0x02    /* skip users that are bursting */
69 #define SKIP_NONOPS     0x04    /* skip users that aren't chanops */
70
71 /* Send command to all users having a particular flag set */
72 extern void sendwallto_group_butone(struct Client *from, int type, 
73                                     struct Client *one, const char *pattern,
74                                     ...);
75
76 #define WALL_DESYNCH    1
77 #define WALL_WALLOPS    2
78 #define WALL_WALLUSERS  3
79
80 /* Send command to all matching clients */
81 extern void sendcmdto_match_butone(struct Client *from, const char *cmd,
82                                    const char *tok, const char *to,
83                                    struct Client *one, unsigned int who,
84                                    const char *pattern, ...);
85
86 /* Send server notice to opers but one--one can be NULL */
87 extern void sendto_opmask_butone(struct Client *one, unsigned int mask,
88                                  const char *pattern, ...);
89
90 /* Same as above, but rate limited */
91 extern void sendto_opmask_butone_ratelimited(struct Client *one,
92                                              unsigned int mask, time_t *rate,
93                                              const char *pattern, ...);
94
95 /* Same as above, but with variable argument list */
96 extern void vsendto_opmask_butone(struct Client *one, unsigned int mask,
97                                   const char *pattern, va_list vl);
98
99 #endif /* INCLUDED_send_h */