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