]> jfr.im git - irc/quakenet/snircd.git/blame - include/send.h
forward port of asuka-check.patch to .12
[irc/quakenet/snircd.git] / include / send.h
CommitLineData
189935b1 1/** @file send.h
2 * @brief Send messages to certain targets.
3 * @version $Id: send.h,v 1.22 2004/12/16 03:28:51 entrope Exp $
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
16struct Channel;
17struct Client;
18struct DBuf;
19struct MsgBuf;
20
21/*
22 * Prototypes
23 */
24extern struct SLink *opsarray[];
25
26extern void send_buffer(struct Client* to, struct MsgBuf* buf, int prio);
27
28extern void kill_highest_sendq(int servers_too);
29extern void flush_connections(struct Client* cptr);
30extern 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 */
35extern void sendrawto_one(struct Client *to, const char *pattern, ...);
36
37/* Send a command to one client */
38extern 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 */
43extern 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 */
48extern 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 */
54extern 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 */
59extern 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 channel users on this server */
66extern void sendcmdto_channel_butserv_butone(struct Client *from,
67 const char *cmd,
68 const char *tok,
69 struct Channel *to,
70 struct Client *one,
71 unsigned int skip,
72 const char *pattern, ...);
73
74/* Send command to all servers interested in a channel */
75extern void sendcmdto_channel_servers_butone(struct Client *from,
76 const char *cmd,
77 const char *tok,
78 struct Channel *to,
79 struct Client *one,
80 unsigned int skip,
81 const char *pattern, ...);
82
83/* Send command to all interested channel users */
84extern void sendcmdto_channel_butone(struct Client *from, const char *cmd,
85 const char *tok, struct Channel *to,
86 struct Client *one, unsigned int skip,
87 const char *pattern, ...);
88
89#define SKIP_DEAF 0x01 /**< skip users that are +d */
90#define SKIP_BURST 0x02 /**< skip users that are bursting */
91#define SKIP_NONOPS 0x04 /**< skip users that aren't chanops */
92#define SKIP_NONVOICES 0x08 /**< skip users that aren't voiced (includes
93 chanops) */
94
95/* Send command to all users having a particular flag set */
96extern void sendwallto_group_butone(struct Client *from, int type,
97 struct Client *one, const char *pattern,
98 ...);
99
100#define WALL_DESYNCH 1 /**< send as a DESYNCH message */
101#define WALL_WALLOPS 2 /**< send to all +w opers */
102#define WALL_WALLUSERS 3 /**< send to all +w users */
103
104/* Send command to all matching clients */
105extern void sendcmdto_match_butone(struct Client *from, const char *cmd,
106 const char *tok, const char *to,
107 struct Client *one, unsigned int who,
108 const char *pattern, ...);
109
110/* Send server notice to opers but one--one can be NULL */
111extern void sendto_opmask_butone(struct Client *one, unsigned int mask,
112 const char *pattern, ...);
113
114/* Same as above, but rate limited */
115extern void sendto_opmask_butone_ratelimited(struct Client *one,
116 unsigned int mask, time_t *rate,
117 const char *pattern, ...);
118
119/* Same as above, but with variable argument list */
120extern void vsendto_opmask_butone(struct Client *one, unsigned int mask,
121 const char *pattern, va_list vl);
122
123#endif /* INCLUDED_send_h */