fixed ssl.c bug when ssl backend returns IO_BLOCKED but IO engine doesn't get informe...
[ircu2.10.12-pk.git] / include / send.h
1 /** @file send.h
2  * @brief Send messages to certain targets.
3  * @version $Id: send.h 1274 2004-12-16 03:28:52Z entrope $
4  */
5 #ifndef INCLUDED_send_h
6 #define INCLUDED_send_h
7 #ifndef INCLUDED_stdarg_h
8 #include <stdarg.h>         /* va_list */
9 #define INCLUDED_stdarg_h 
10 #endif
11 #ifndef INCLUDED_time_h
12 #include <time.h>       /* time_t */
13 #define INCLUDED_time_h
14 #endif
15
16 struct Channel;
17 struct Client;
18 struct DBuf;
19 struct MsgBuf;
20
21 /*
22  * Prototypes
23  */
24 extern struct SLink *opsarray[];
25
26 extern void send_buffer(struct Client* to, struct MsgBuf* buf, int prio);
27
28 extern void kill_highest_sendq(int servers_too);
29 extern void flush_connections(struct Client* cptr);
30 extern void send_queued(struct Client *to);
31
32 /* Send a raw message to one client; USE ONLY IF YOU MUST SEND SOMETHING
33  * WITHOUT A PREFIX!
34  */
35 extern void sendrawto_one(struct Client *to, const char *pattern, ...);
36
37 /* Send a command to one client */
38 extern void sendcmdto_one(struct Client *from, const char *cmd,
39                           const char *tok, struct Client *to,
40                           const char *pattern, ...);
41
42 /* Same as above, except it puts the message on the priority queue */
43 extern void sendcmdto_prio_one(struct Client *from, const char *cmd,
44                                const char *tok, struct Client *to,
45                                const char *pattern, ...);
46
47 /* Send command to servers by flags except one */
48 extern void sendcmdto_flag_serv_butone(struct Client *from, const char *cmd,
49                                        const char *tok, struct Client *one,
50                                        int require, int forbid,
51                                        const char *pattern, ...);
52
53 /* Send command to all servers except one */
54 extern void sendcmdto_serv_butone(struct Client *from, const char *cmd,
55                                   const char *tok, struct Client *one,
56                                   const char *pattern, ...);
57
58 /* Send command to all channels user is on */
59 extern void sendcmdto_common_channels_butone(struct Client *from,
60                                              const char *cmd,
61                                              const char *tok,
62                                              struct Client *one,
63                                              const char *pattern, ...);
64                          
65 /* Send command to all channels user is on (check audit) */
66 extern void sendcmdto_common_channels_butone_audit(struct Client *from,
67                                              const char *cmd,
68                                              const char *tok,
69                                              struct Client *one,
70                                              const char *pattern, ...);
71
72 /* Send command to all channel users on this server */
73 extern void sendcmdto_channel_butserv_butone(struct Client *from,
74                                              const char *cmd,
75                                              const char *tok,
76                                              struct Channel *to,
77                                              struct Client *one,
78                                              unsigned int skip,
79                                              const char *pattern, ...);
80
81 /* Send command to all servers interested in a channel */
82 extern void sendcmdto_channel_servers_butone(struct Client *from,
83                                              const char *cmd,
84                                              const char *tok,
85                                              struct Channel *to,
86                                              struct Client *one,
87                                              unsigned int skip,
88                                              const char *pattern, ...);
89
90 /* Send command to all interested channel users */
91 extern void sendcmdto_channel_butone(struct Client *from, const char *cmd,
92                                      const char *tok, struct Channel *to,
93                                      struct Client *one, unsigned int skip,
94                                      unsigned char prefix, const char *pattern, ...);
95
96 #define SKIP_DEAF       0x01    /**< skip users that are +d */
97 #define SKIP_BURST      0x02    /**< skip users that are bursting */
98 #define SKIP_NONOPS     0x04    /**< skip users that aren't chanops */
99 #define SKIP_NONVOICES  0x08    /**< skip users that aren't voiced (includes
100                                    chanops) */
101 #define SKIP_OPS    0x10        /**< skip users that are chanops */
102
103 /* Send command to all users having a particular flag set */
104 extern void sendwallto_group_butone(struct Client *from, int type, 
105                                     struct Client *one, const char *pattern,
106                                     ...);
107
108 #define WALL_DESYNCH    1       /**< send as a DESYNCH message */
109 #define WALL_WALLOPS    2       /**< send to all +w opers */
110 #define WALL_WALLUSERS  3       /**< send to all +w users */
111
112 /* Send command to all matching clients */
113 extern void sendcmdto_match_butone(struct Client *from, const char *cmd,
114                                    const char *tok, const char *to,
115                                    struct Client *one, unsigned int who,
116                                    const char *pattern, ...);
117
118 /* Send server notice to opers but one--one can be NULL */
119 extern void sendto_opmask_butone(struct Client *one, unsigned int mask,
120                                  const char *pattern, ...);
121
122 /* Same as above, but rate limited */
123 extern void sendto_opmask_butone_ratelimited(struct Client *one,
124                                              unsigned int mask, time_t *rate,
125                                              const char *pattern, ...);
126
127 /* Same as above, but with variable argument list */
128 extern void vsendto_opmask_butone(struct Client *one, unsigned int mask,
129                                   const char *pattern, va_list vl);
130
131 #endif /* INCLUDED_send_h */