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
17
18 /*
19  * Prototypes
20  */
21 extern void send_buffer(struct Client* to, char* buf);
22 extern void flush_sendq_except(const struct DBuf* one);
23
24 extern void sendto_one(struct Client *to, const char* fmt, ...);
25 extern void sendbufto_one(struct Client *to);
26 extern void sendto_ops(const char* fmt, ...);
27 extern void sendto_channel_butserv(struct Channel *chptr, struct Client *from,
28                                    const char* fmt, ...);
29 extern void sendto_serv_butone(struct Client *one, const char* fmt, ...);
30 extern void sendto_match_servs(struct Channel* chptr, struct Client* from,
31                                const char* fmt, ...);
32 extern void sendto_lowprot_butone(struct Client *cptr, int p,
33                                   const char* fmt, ...);
34 extern void sendto_highprot_butone(struct Client *cptr, int p,
35                                    const char* fmt, ...);
36 extern void sendto_prefix_one(struct Client *to, struct Client *from,
37                               const char* fmt, ...);
38 extern void flush_connections(struct Client* cptr);
39 extern void send_queued(struct Client *to);
40 extern void vsendto_one(struct Client *to, const char* fmt, va_list vl);
41 extern void sendto_channel_butone(struct Client *one, struct Client *from,
42                                   struct Channel *chptr, const char* fmt, ...);
43 extern void sendmsgto_channel_butone(struct Client *one, struct Client *from,
44                                   struct Channel *chptr, const char *sender,
45                                   const char *cmd, const char *chname, const char *msg);
46 extern void sendto_lchanops_butone(struct Client *one, struct Client *from,
47                                    struct Channel *chptr, const char* fmt, ...);
48 extern void sendto_chanopsserv_butone(struct Client *one, struct Client *from,
49                                    struct Channel *chptr, const char* fmt, ...);
50 extern void sendto_common_channels(struct Client *user, const char* fmt, ...);
51 extern void sendto_match_butone(struct Client *one, struct Client *from,
52                                 const char *mask, int what, const char* fmt, ...);
53 extern void sendto_lops_butone(struct Client *one, const char* fmt, ...);
54 extern void vsendto_ops(const char *pattern, va_list vl);
55 extern void sendto_ops_butone(struct Client *one, struct Client *from,
56                               const char* fmt, ...);
57 extern void sendto_g_serv_butone(struct Client *one, const char* fmt, ...);
58 extern void sendto_realops(const char* fmt, ...);
59 extern void vsendto_op_mask(unsigned int mask,
60                             const char* fmt, va_list vl);
61 extern void sendto_op_mask(unsigned int mask, const char* fmt, ...);
62 extern void sendbufto_op_mask(unsigned int mask);
63 extern void sendbufto_serv_butone(struct Client *one);
64
65 extern char sendbuf[2048];
66
67 #define IRC_BUFSIZE     512
68
69 /* Send a command to one client */
70 extern void sendcmdto_one(struct Client *from, const char *cmd,
71                           const char *tok, struct Client *to,
72                           const char *pattern, ...);
73
74
75 /* Same as above, except it takes a va_list */
76 extern void vsendcmdto_one(struct Client *from, const char *cmd,
77                            const char *tok, struct Client *to,
78                            const char *pattern, va_list vl);
79
80 /* Send command to all servers except one */
81 extern void sendcmdto_serv_butone(struct Client *from, const char *cmd,
82                                   const char *tok, struct Client *one,
83                                   const char *pattern, ...);
84
85 /* Send command to all channels user is on */
86 extern void sendcmdto_common_channels(struct Client *from, const char *cmd,
87                                       const char *tok, const char *pattern,
88                                       ...);
89
90
91 /* Send command to all channel users on this server */
92 extern void sendcmdto_channel_butserv(struct Client *from, const char *cmd,
93                                       const char *tok, struct Channel *to,
94                                       const char *pattern, ...);
95
96 /* Send command to all interested channel users */
97 extern void sendcmdto_channel_butone(struct Client *from, const char *cmd,
98                                      const char *tok, struct Channel *to,
99                                      struct Client *one, unsigned int skip,
100                                      const char *pattern, ...);
101
102 #define SKIP_DEAF       0x01    /* skip users that are +d */
103 #define SKIP_BURST      0x02    /* skip users that are bursting */
104 #define SKIP_NONOPS     0x04    /* skip users that aren't chanops */
105
106 /* Send command to all users having a particular flag set */
107 extern void sendcmdto_flag_butone(struct Client *from, const char *cmd,
108                                   const char *tok, struct Client *one,
109                                   unsigned int flag, const char *pattern, ...);
110
111 /* Send server notice to opers but one--one can be NULL */
112 extern void sendto_opmask_butone(struct Client *one, unsigned int mask,
113                                  const char *pattern, ...);
114
115 /* Same as above, but with variable argument list */
116 extern void vsendto_opmask_butone(struct Client *one, unsigned int mask,
117                                   const char *pattern, va_list vl);
118
119 #endif /* INCLUDED_send_h */