📄 irc-lowlevel.txt
字号:
/* * Lachesis low-level IRC Interface API */const char * IRC_VersionInfo(); This returns a string identifying the low-level interface. Since the old BotNet interface required tampering with BotNet's CTCP VERSION handling, this was added so that the copyright notice could be maintained. This string will be sent as part of the CTCP VERSION reply, after Lachesis' own identification.void IRC_Connect(const char *server, const int port, const char *nick, const char *user, const char *name); This function is called to connect to IRC. The low-level interface is expected to store its own copies of our nick and the user and host information. After we are connected and registered, call ConnectionReady. (Note to self, make sure this properly handles being called more than once.)void IRC_Userhost(const char *target); Send a USERHOST command to the server.void IRC_Quote(const char *str, TF priority); Send a raw command to the server. Priority is used in some interfaces (BotNet) but the current native interface doesn't use it. Maybe it will be used if we ever switch to non-blocking writes.void IRC_Notice(const char *target, const char *); Send a NOTICE command to the server.void IRC_Part(const char *channel, const char *); Send a PART command to the server. Second argument, if non-null, is a part message, as supported by modern servers.void IRC_CTCP(const char *target, const char *command, const char *data); Send a PRIVMSG containing a CTCP command. If data is non-null it is sent as the parameter to the command.void IRC_CTCPReply(const char *target, const char *command, const char *data); Send a NOTICE containing a CTCP command. data should be non-null.void IRC_Nick(const char *); Send a NICK command to the server.void IRC_Public(const char *channel, const char *); Send a public message to the channel. In the native interface this is the same as IRC_MSG.void IRC_Action(const char *channel, const char *message); Send an "action" to the channel. In the native interface this is the same as IRC_CTCP(channel, "ACTION", message);void IRC_MSG(const char *target, const char *); Send a PRIVMSG command to the server.void IRC_Describe(const char *target, const char *); Send an "action" directly to a user. In the native interface this is the same as IRC_Action.void IRC_Wallop(const char *); Send a WALLOPS command to the server. Note that many servers no longer implement WALLOPS, but it's included here because it's part of the RFC.void IRC_Join(const char *channel, const char *key); Send a JOIN command to the server. If key is non-null it is used as the key for a mode +k channel.void IRC_Quit(const char *); Send a QUIT command to the server, clean up connection.void IRC_Disconnect(TF flag); Clean up connection without sending QUIT. flag is passed as the second argument to HandleDisconnect (indicates whether we're trying to shut down).TF IRC_IsConnected(); Returns TRUE if we are connected to a server, otherwise FALSE.const char * IRC_GetNick(); Returns our current nick.const char * IRC_GetHost(); Returns our hostname as reported by the server.void * IRC_DCCChatSend(const char *); Offer a DCC CHAT to the target. This is invoked by AUTH DCC and is useful for users behind a firewall/NAT setup that prevents them from accepting connections.void IRC_DCCChatAccept(void *); Accept a DCC CHAT that is offered. Argument is the same value passed to HandleDCCChatRequest or HandleDCCChatRequestPfx.void IRC_DCCChatReject(void *); Reject a DCC CHAT that is offered. Argument is the same value passed to HandleDCCChatRequest or HandleDCCChatRequestPfx.void IRC_DCCChatMessage(void *, const char *); Send a message via a DCC CHAT connection. First argument is the same value passed to HandleDCCChatOpened.void IRC_DCCChatClose(void *); Close a DCC CHAT connection. Argument is the same value passed to HandleDCCChatOpened.const char * IRC_DCCGetNick(void *); Return the IRC nick associated with a DCC CHAT connection/request.void IRC_DCCSend(const char *, const char *fn); Send file fn to target. This is part of the API, but the native interface does not currently implement it.// NOTE: The following functions use an internal buffer to store the// string; if you need to keep it, copy it to another location.// Note also: In the old BotNet interface, these all used the same buffer// such that you had to save the result of one before calling// the next. The native interface does use the same buffer, but// in a way that each function will not clobber each other's// results as long as they are called with the same prefix. Most// code still treats these functions as though they clobber each// other's returns.const char * IRC_HostmaskNick(const char *); Returns the nick portion of a prefix.const char * IRC_HostmaskUser(const char *); Returns the user portion of a prefix.const char * IRC_HostmaskHost(const char *); Returns the hostname portion of a prefix.void LowIrcCleanup(); Does any final cleanup needed by the interface before the program shuts down. (Note to self, this should only be called once.)@(#) $Id: irc-lowlevel.txt,v 1.1.1.1 2004/01/16 07:28:15 lachesis Exp $
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -