X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=include%2Fsend.h;h=1825e4db2b5a9a98519f15f7bc5766dff8de0130;hb=refs%2Fheads%2Fupstream;hp=73be18c58e788a5a8824cda26382b47d7a1222eb;hpb=b70944c4b84fc2b707d0853ddf03975569dac2bd;p=ircu2.10.12-pk.git diff --git a/include/send.h b/include/send.h index 73be18c..1825e4d 100644 --- a/include/send.h +++ b/include/send.h @@ -1,62 +1,123 @@ -#ifndef SEND_H -#define SEND_H +/** @file send.h + * @brief Send messages to certain targets. + * @version $Id$ + */ +#ifndef INCLUDED_send_h +#define INCLUDED_send_h +#ifndef INCLUDED_stdarg_h +#include /* va_list */ +#define INCLUDED_stdarg_h +#endif +#ifndef INCLUDED_time_h +#include /* time_t */ +#define INCLUDED_time_h +#endif + +struct Channel; +struct Client; +struct DBuf; +struct MsgBuf; -/*============================================================================= - * Macros +/* + * Prototypes */ +extern struct SLink *opsarray[]; + +extern void send_buffer(struct Client* to, struct MsgBuf* buf, int prio); -#define LastDeadComment(cptr) ((cptr)->info) +extern void kill_highest_sendq(int servers_too); +extern void flush_connections(struct Client* cptr); +extern void send_queued(struct Client *to); -/*============================================================================= - * Proto types +/* Send a raw message to one client; USE ONLY IF YOU MUST SEND SOMETHING + * WITHOUT A PREFIX! */ +extern void sendrawto_one(struct Client *to, const char *pattern, ...); + +/* Send a command to one client */ +extern void sendcmdto_one(struct Client *from, const char *cmd, + const char *tok, struct Client *to, + const char *pattern, ...); + +/* Same as above, except it puts the message on the priority queue */ +extern void sendcmdto_prio_one(struct Client *from, const char *cmd, + const char *tok, struct Client *to, + const char *pattern, ...); + +/* Send command to servers by flags except one */ +extern void sendcmdto_flag_serv_butone(struct Client *from, const char *cmd, + const char *tok, struct Client *one, + int require, int forbid, + const char *pattern, ...); + +/* Send command to all servers except one */ +extern void sendcmdto_serv_butone(struct Client *from, const char *cmd, + const char *tok, struct Client *one, + const char *pattern, ...); + +/* Send command to all channels user is on */ +extern void sendcmdto_common_channels_butone(struct Client *from, + const char *cmd, + const char *tok, + struct Client *one, + const char *pattern, ...); + +/* Send command to all channel users on this server */ +extern void sendcmdto_channel_butserv_butone(struct Client *from, + const char *cmd, + const char *tok, + struct Channel *to, + struct Client *one, + unsigned int skip, + const char *pattern, ...); + +/* Send command to all servers interested in a channel */ +extern void sendcmdto_channel_servers_butone(struct Client *from, + const char *cmd, + const char *tok, + struct Channel *to, + struct Client *one, + unsigned int skip, + const char *pattern, ...); + +/* Send command to all interested channel users */ +extern void sendcmdto_channel_butone(struct Client *from, const char *cmd, + const char *tok, struct Channel *to, + struct Client *one, unsigned int skip, + const char *pattern, ...); + +#define SKIP_DEAF 0x01 /**< skip users that are +d */ +#define SKIP_BURST 0x02 /**< skip users that are bursting */ +#define SKIP_NONOPS 0x04 /**< skip users that aren't chanops */ +#define SKIP_NONVOICES 0x08 /**< skip users that aren't voiced (includes + chanops) */ + +/* Send command to all users having a particular flag set */ +extern void sendwallto_group_butone(struct Client *from, int type, + struct Client *one, const char *pattern, + ...); + +#define WALL_DESYNCH 1 /**< send as a DESYNCH message */ +#define WALL_WALLOPS 2 /**< send to all +w opers */ +#define WALL_WALLUSERS 3 /**< send to all +w users */ + +/* Send command to all matching clients */ +extern void sendcmdto_match_butone(struct Client *from, const char *cmd, + const char *tok, const char *to, + struct Client *one, unsigned int who, + const char *pattern, ...); + +/* Send server notice to opers but one--one can be NULL */ +extern void sendto_opmask_butone(struct Client *one, unsigned int mask, + const char *pattern, ...); + +/* Same as above, but rate limited */ +extern void sendto_opmask_butone_ratelimited(struct Client *one, + unsigned int mask, time_t *rate, + const char *pattern, ...); + +/* Same as above, but with variable argument list */ +extern void vsendto_opmask_butone(struct Client *one, unsigned int mask, + const char *pattern, va_list vl); -extern void sendto_one(aClient *to, char *pattern, ...) - __attribute__ ((format(printf, 2, 3))); -extern void sendbufto_one(aClient *to); -extern void sendto_ops(const char *pattern, ...) - __attribute__ ((format(printf, 1, 2))); -extern void sendto_channel_butserv(aChannel *chptr, aClient *from, - char *pattern, ...) __attribute__ ((format(printf, 3, 4))); -extern void sendto_serv_butone(aClient *one, char *pattern, ...) - __attribute__ ((format(printf, 2, 3))); -extern void sendto_match_servs(aChannel *chptr, aClient *from, - char *format, ...) __attribute__ ((format(printf, 3, 4))); -extern void sendto_lowprot_butone(aClient *cptr, int p, char *pattern, ...) - __attribute__ ((format(printf, 3, 4))); -extern void sendto_highprot_butone(aClient *cptr, int p, char *pattern, ...) - __attribute__ ((format(printf, 3, 4))); -extern void sendto_prefix_one(Reg1 aClient *to, Reg2 aClient *from, - char *pattern, ...) __attribute__ ((format(printf, 3, 4))); -extern void flush_connections(int fd); -extern void send_queued(aClient *to); -extern void vsendto_one(aClient *to, char *pattern, va_list vl); -extern void sendto_channel_butone(aClient *one, aClient *from, - aChannel *chptr, char *pattern, ...) __attribute__ ((format(printf, 4, 5))); -extern void sendto_lchanops_butone(aClient *one, aClient *from, - aChannel *chptr, char *pattern, ...) __attribute__ ((format(printf, 4, 5))); -extern void sendto_chanopsserv_butone(aClient *one, aClient *from, - aChannel *chptr, char *pattern, ...) __attribute__ ((format(printf, 4, 5))); -extern void sendto_common_channels(aClient *user, char *pattern, ...) - __attribute__ ((format(printf, 2, 3))); -extern void sendto_match_butone(aClient *one, aClient *from, char *mask, - int what, char *pattern, ...) __attribute__ ((format(printf, 5, 6))); -extern void sendto_lops_butone(aClient *one, char *pattern, ...) - __attribute__ ((format(printf, 2, 3))); -extern void vsendto_ops(const char *pattern, va_list vl); -extern void sendto_ops_butone(aClient *one, aClient *from, char *pattern, ...) - __attribute__ ((format(printf, 3, 4))); -extern void sendto_g_serv_butone(aClient *one, char *pattern, ...) - __attribute__ ((format(printf, 2, 3))); -extern void sendto_realops(const char *pattern, ...) - __attribute__ ((format(printf, 1, 2))); -extern void vsendto_op_mask(register snomask_t mask, - const char *pattern, va_list vl); -extern void sendto_op_mask(snomask_t mask, const char *pattern, ...) - __attribute__ ((format(printf, 2, 3))); -extern void sendbufto_op_mask(snomask_t mask); -extern void sendbufto_serv_butone(aClient *one); - -extern char sendbuf[2048]; - -#endif /* SEND_H */ +#endif /* INCLUDED_send_h */