hirc

IRC client
Log | Files | Refs

commit 3849ae5de713440e0381e17ac4b08179fe6a0054
parent 389eb3bdaa5409f2556b2c3f331e0577670de24a
Author: hhvn <dev@hhvn.uk>
Date:   Thu, 21 Apr 2022 20:34:10 +0100

Move big struct arrays into src/data dir

Diffstat:
Msrc/commands.c | 335+------------------------------------------------------------------------------
Msrc/config.c | 1242+------------------------------------------------------------------------------
Asrc/data/commands.h | 353+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/data/config.h | 1260+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/data/formats.h | 226+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/data/handlers.h | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/format.c | 209+------------------------------------------------------------------------------
Msrc/handle.c | 66+-----------------------------------------------------------------
8 files changed, 1926 insertions(+), 1848 deletions(-)

diff --git a/src/commands.c b/src/commands.c @@ -33,8 +33,6 @@ #define command_toomany(cmd) ui_error("/%s: too many arguments", cmd) #define command_needselected(cmd, type) ui_error("/%s: no %s selected", cmd, type) -#define COMMAND(func) static void func(struct Server *server, struct Channel *channel, char *str) - /* * There are some commands that may be useful that I haven't bothered to implement. * @@ -49,70 +47,7 @@ * */ -/* IRC commands */ -COMMAND(command_away); -COMMAND(command_msg); -COMMAND(command_notice); -COMMAND(command_me); -COMMAND(command_ctcp); -COMMAND(command_quit); -COMMAND(command_join); -COMMAND(command_part); -COMMAND(command_kick); -COMMAND(command_mode); -COMMAND(command_nick); -COMMAND(command_list); -COMMAND(command_whois); -COMMAND(command_who); -COMMAND(command_whowas); -COMMAND(command_ping); -COMMAND(command_quote); -COMMAND(command_connect); -COMMAND(command_disconnect); -COMMAND(command_names); -COMMAND(command_topic); -COMMAND(command_motd); -COMMAND(command_oper); -COMMAND(command_time); -COMMAND(command_stats); -COMMAND(command_kill); -COMMAND(command_links); -COMMAND(command_map); -COMMAND(command_lusers); -COMMAND(command_invite); -COMMAND(command_cycle); - -/* Channel priviledges (use modelset only) */ -COMMAND(command_op); -COMMAND(command_voice); -COMMAND(command_halfop); -COMMAND(command_admin); -COMMAND(command_owner); -COMMAND(command_deop); -COMMAND(command_devoice); -COMMAND(command_dehalfop); -COMMAND(command_deadmin); -COMMAND(command_deowner); -COMMAND(command_ban); -COMMAND(command_unban); - -/* UI commands */ -COMMAND(command_query); -COMMAND(command_select); -COMMAND(command_set); -COMMAND(command_format); -COMMAND(command_server); -COMMAND(command_bind); -COMMAND(command_help); -COMMAND(command_echo); -COMMAND(command_grep); -COMMAND(command_clear); -COMMAND(command_alias); -COMMAND(command_scroll); -COMMAND(command_source); -COMMAND(command_dump); -COMMAND(command_close); -COMMAND(command_ignore); +#include "data/commands.h" static char *command_optarg; enum { @@ -122,274 +57,6 @@ enum { CMD_ARG, }; -struct Command commands[] = { - /* IRC commands */ - {"away", command_away, 0, { - "usage: /away [message]", - "Set yourself as away on the server.", - "An empty message will unset the away.", NULL}}, - {"msg", command_msg, 1, { - "usage: /msg <nick|channel> message..", - "Send a message to a nick or channel.", - "Will appear in buffers if already open.", NULL}}, - {"notice", command_notice, 1, { - "usage: /notice <nick|channel> message..", - "Send a notice to a nick or channel.", - "Will appear in buffers if already open.", NULL}}, - {"me", command_me, 2, { - "usage: /me message..", - "Send a CTCP ACTION to the selected channel/query", NULL}}, - {"ctcp", command_ctcp, 1, { - "usage: /ctcp [channel|nick] <TYPE>", - "Send a CTCP request to a channel or nick", NULL}}, - {"quit", command_quit, 0, { - "usage: /quit", - "Cleanup and exit", NULL}}, - {"quote", command_quote, 1, { - "usage: /quote <message>", - "Send raw message to server", NULL}}, - {"join", command_join, 1, { - "usage: /join <channel>", - "Join channel", NULL}}, - {"part", command_part, 1, { - "usage: /part <channel> [reason]", - "Part channel", NULL}}, - {"cycle", command_cycle, 1, { - "usage: /cycle <channel> [reason]", - "Part channel and rejoin", NULL}}, - {"kick", command_kick, 1, { - "usage: /kick [channel] <nick> [reason]", - "Kick nick from channel", NULL}}, - {"mode", command_mode, 1, { - "usage: /mode <channel> modes...", - "Set/unset channel modes", NULL}}, - {"nick", command_nick, 1, { - "usage: /nick <nick>", - "Get a new nick", NULL}}, - {"list", command_list, 1, { - "usage: /list", - "Get list of channels.", NULL}}, - {"whois", command_whois, 1, { - "usage: /whois [server] [nick]", - "Request information on a nick or oneself", NULL}}, - {"who", command_who, 1, { - "usage: /whois [mask [options]]", - "Request short information on nicks", NULL}}, - {"whowas", command_whowas, 1, { - "usage: /whowas [nick [count [server]]]", - "Request information on old nicks", - "Count defaults to 5", NULL}}, - {"ping", command_ping, 1, { - "usage: /ping message...", - "Send a PING to server.", - "hirc will do this itself in the background,", - "but will hide it unless this command is used.", NULL}}, - {"connect", command_connect, 0, { - "usage: /connect [-network <name>] [-nick <nick>] [-user <user>]", - " [-real <comment>] [-tls] [-verify] [host] [port]", - "Connect to a network/server.", - "If no host is given, it will attempt to connect to the\n", - "selected server if it is disconnected\n", - NULL}}, - {"disconnect", command_disconnect, 0, { - "usage: /disconnect [network] [msg]", - "Disconnect from a network/server", NULL}}, - {"names", command_names, 1, { - "usage: /names <channel>", - "List nicks in channel (pretty useless with nicklist.", NULL}}, - {"topic", command_topic, 1, { - "usage: /topic [-clear] [channel] [topic]", - "Sets, clears, or checks topic in channel.", - "Provide only channel name to check.", NULL}}, - {"oper", command_oper, 1, { - "usage: /oper [user] <password>", - "Authenticate for server operator status.", - "If a user is not specified, the current nickname is used.", NULL}}, - {"motd", command_motd, 1, { - "usage: /motd [server/nick]", - "Get the Message Of The Day for the current server,", - "specified server, or the server with the specified nickname.", NULL}}, - {"time", command_time, 1, { - "usage: /time [server/nick]", - "Get the time and timezone of the current server,", - "specified server, or the server with the specified nickname.", NULL}}, - {"stats", command_stats, 1, { - "usage: /stats [type [server]]", - "Query server statistics. Servers will usually list", - "types that can be queried if no arguments are given.", NULL}}, - {"kill", command_kill, 1, { - "usage: /kill <nick> [reason]", - "Forcefully disconnect a nick from a server.", - "Uses def.killmessage if no reason provided.", NULL}}, - {"links", command_links, 1, { - "usage: /links [[server] mask]", - "Request list of linked servers from the veiwpoint", - "of the current or specified server, matching the", - "specified mask.", NULL}}, - {"lusers", command_lusers, 1, { - "usage: /lusers", - "Request a list of users from the server.", - "This is implemented in all servers, but", - "only some allow its request via a command.", NULL}}, - {"map", command_map, 1, { - "usage: /map", - "Similar to /links but prints an ascii diagram.", - "Nonstandard feature.", NULL}}, - {"invite", command_invite, 1, { - "usage: /invite <nick> [channel]", - "Invite a nick to the current or specified channel.", NULL}}, - /* Channel priviledges */ - {"op", command_op, 2, { - "usage: /op nicks...", - "Give a nickname +o on the current channel.", NULL}}, - {"voice", command_voice, 2, { - "usage: /voice nicks...", - "Give a nickname +v on the current channel.", NULL}}, - {"halfop", command_halfop, 2, { - "usage: /halfop nicks...", - "Give a nickname +h on the current channel.", NULL}}, - {"admin", command_admin, 2, { - "usage: /admin nicks...", - "Give a nickname +a on the current channel.", NULL}}, - {"owner", command_owner, 2, { - "usage: /owner nicks...", - "Give a nickname +q on the current channel.", NULL}}, - {"deop", command_deop, 2, { - "usage: /deop nicks...", - "Remove +o for a nick on the current channel.", NULL}}, - {"devoice", command_devoice, 2, { - "usage: /devoice nicks...", - "Remove +v for a nick on the current channel.", NULL}}, - {"dehalfop", command_dehalfop, 2, { - "usage: /dehalfop nicks...", - "Remove +h for a nick on the current channel.", NULL}}, - {"deadmin", command_deadmin, 2, { - "usage: /deadmin nicks...", - "Remove +a for a nick on the current channel.", NULL}}, - {"deowner", command_deowner, 2, { - "usage: /deowner nicks...", - "Remove +q for a nick on the current channel.", NULL}}, - {"ban", command_ban, 2, { - "usage: /ban masks...", - "Add masks to the +b banlist in the current channel", NULL}}, - {"unban", command_unban, 2, { - "usage: /unban masks...", - "Remove masks from the banlist in the current channel", NULL}}, - /* UI commands */ - {"query", command_query, 1, { - "usage: /query <nick>", - "Open a buffer for communication with a nick", NULL}}, - {"select", command_select, 0, { - "usage: /select [-network <name>] [-channel <name>] [buffer id]", - "Select a buffer", NULL}}, - {"set", command_set, 0, { - "usage: /set <variable> [number/range] [end of range]", - " /set <variable> string....", - "Set a configuration variable.", - "Passing only the name prints content.", NULL}}, - {"format", command_format, 0, { - "usage: /format <format> string...", - "Set a formatting variable.", - "This is equivalent to /set format.<format> string...", NULL}}, - {"server", command_server, 0, { - "usage: /server [-auto] <server> [cmd....]", - " /server [-clear] <server>", - "Evaluate a cooked command with server as target.", - " -auto if supplied with a command, run that command", - " automatically when the server connects.", - " Otherwise, list autocmds that have been set.", - " -clear clear autocmds from server", - "To send a raw command to a server, use:", - " /server <server> /quote ...", NULL}}, - {"bind", command_bind, 0, { - "usage: /bind [<keybind> [cmd [..]]]", - " /bind -delete <keybind>", - "Bind command to key.", - "Accepts caret formatted control characters (eg, ^C).", - "Accepts multiple characters (alt-c = '^[c'), though", - "these must be inputted faster than wgetch can read.", NULL}}, - {"help", command_help, 0, { - "usage: /help [command or variable]", - "Print help information.", - "`/help commands` and `/help variables` will list respectively", NULL}}, - {"echo", command_echo, 0, { - "usage: /echo ...", - "Print temporarily to selected buffer.", NULL}}, - {"grep", command_grep, 0, { - "usage: /grep [-iE] [regex]", - "Search selected buffer", - " -i case insensitive", - " -E posix extended regex", - " -raw search raw message rather than displayed text", - "Displays any lines that match the regex in the current buffer,", - "unless -raw is specified. For convenience, all whitespace is", - "squeezed down to one space.", - "If no argument is supplied, clears previous search.", - "Searches are also cleared after selecting another buffer.", - "See also variables: regex.extended and regex.icase", NULL}}, - {"clear", command_clear, 0, { - "usage: /clear [-tmp] [-err] [-serr] [-log]", - "Clear selected buffer of messages.", - "By default all messages are cleared.", - "The following options clear only certain messages:", - " -tmp: temporary messages - cleared when switching buffer", - " -err: hirc generated errors", - " -serr: server generated errors", - " -log: messages restored from log files", NULL}}, - {"alias", command_alias, 0, { - "usage: /alias [<alias> [cmd [...]]]", - " /alias -delete <alias>", - "Add or remove an alias that expands to a command.", NULL}}, - {"scroll", command_scroll, 0, { - "usage: /scroll [-buflist] [-nicklist] [-|+]lines", - "Scroll a window (main by default).", - "Positive scrolls up, negative down, 0 resets and tracks", - "Probably most useful with /bind", NULL}}, - {"source", command_source, 0, { - "usage: /source <file>", - "Read a config file. Can be used inside config files.", NULL}}, - {"dump", command_dump, 0, { - "usage: /dump [-all] [-aliases] [-bindings] [-formats] [-config]", - " [-default] [-servers] [-channels] [-queries] [-ignores] <file>", - "Dumps configuration details into a file.", - " -autocmds dump commands specified with /server -auto", - " -aliases dump /alias commands", - " -bindings dump /bind commands", - " -formats dump /format commands beginning with filter.", - " -config dump /format options excluding filters", - " -servers dump /server commands", - " -channels dump /join commands for respective servers", - " -queries dump /query commands for respective servers", - " -ignores dump /ignore commands", - " -default dump default settings (dump non-default otherwise)", - "If none (excluding -default) of the above are selected, it is", - "treated as though all are selected.", - "If -autocmds and -channels are used together, and there exists", - "an autocmd to join a channel, then only the autocmd will be dumped.", NULL}}, - {"close", command_close, 0, { - "usage: /close [id]", - "Forget about selected buffer, or a buffer by id.", NULL}}, - {"ignore", command_ignore, 0, { - "usage: /ignore [[-server] [-noact] [-format format] regex]", - " /ignore -delete id", - " /ignore -hide|-show", - "Hide future messages matching regex.", - "Regexes should match a raw IRC message.", - "Display all rules if no argument given.", - " -show show ignored messages", - " -hide hide ignored messages", - " -delete delete rule with specified ID", - " -E use extended POSIX regex", - " -i case insensitive match", - " -server only ignore for the current server", - " or server provided by /server.", - " -noact set activity to Activity_ignore,", - " but don't hide the message.", - " -format only ignore messages with >format<", - "See also: regex.extended, regex.icase", NULL}}, - {NULL, NULL}, -}; - struct Alias *aliases = NULL; COMMAND( diff --git a/src/config.c b/src/config.c @@ -57,1247 +57,7 @@ static struct { [Val_location] = {"a location (hidden/left/right)", Location_hidden, Location_right}, }; -struct Config config[] = { - {"log.dir", 1, Val_string, - .str = "~/.local/hirc", - .strhandle = NULL, - .description = { - "Directory for hirc to log to.", - "Can contain ~ to refer to $HOME", NULL}}, - {"log.toggle", 1, Val_bool, - .num = 1, - .numhandle = NULL, - .description = { - "Simple: to log, or not to log", NULL}}, - {"def.nick", 1, Val_string, - .str = NULL, - .strhandle = NULL, - .description = { - "Default nickname", NULL}}, - {"def.user", 1, Val_string, - .str = NULL, - .strhandle = NULL, - .description = { - "Default username (nick!..here..@host), ", - "may be replaced by identd response", NULL}}, - {"def.real", 1, Val_string, - .str = NULL, - .strhandle = NULL, - .description = { - "Default \"realname\", seen in /whois", NULL}}, - {"def.quitmessage", 1, Val_string, - .str = "quit", - .strhandle = NULL, - .description = { - "Message to send on /quit", NULL}}, - {"def.partmessage", 1, Val_string, - .str = "part", - .strhandle = NULL, - .description = { - "Message to send on /part", NULL}}, - {"def.killmessage", 1, Val_string, - .str = "no reason", - .strhandle = NULL, - .description = { - "Message to send on /kill", NULL}}, - {"def.chantypes", 1, Val_string, - .str = "#&!+", - .strhandle = NULL, - .description = { - "You most likely don't want to touch this.", - "If a server does not supply this in RPL_ISUPPORT,", - "hirc assumes it will use these channel types.", NULL}}, - {"def.prefixes", 1, Val_string, - .str = "(ov)@+", - .strhandle = NULL, - .description = { - "You most likely don't want to touch this.", - "If a server doesn't supply this in the nonstandard", - "RPL_ISUPPORT, it likely won't support nonstandard", - "prefixes.", NULL}}, - {"def.modes", 1, Val_signed, - .num = 1, - .numhandle = NULL, - .description = { - "You most likely don't want to touch this.", - "If a server doesn't send MODES=... in RPL_ISUPPORT,", - "use this number instead.", NULL}}, - {"reconnect.interval", 1, Val_nzunsigned, - .num = 10, - .numhandle = NULL, - .description = { - "Starting reconnect interval in seconds.", - "In reality, for each attempt this will be multipled", - "by the number of failed attemps until it reaches", - "reconnect.maxinterval", NULL}}, - {"reconnect.maxinterval", 1, Val_nzunsigned, - .num = 600, - .numhandle = NULL, - .description = { - "Maximum reconnect interval in seconds.", - "See reconnect.interval", NULL}}, - {"regex.extended", 1, Val_bool, - .num = 0, - .numhandle = NULL, - .description = { - "Use POSIX extended regex at all times.", NULL}}, - {"regex.icase", 1, Val_bool, - .num = 0, - .numhandle = NULL, - .description = { - "Use case insensitive regex at all times.", NULL}}, - {"nickcolour.self", 1, Val_colour, - .num = 90, - .numhandle = config_nickcolour_self, - .description = { - "Colour to use for onself.", - "Must be 0, 99 or anywhere between. 99 is no colours.", NULL}}, - {"nickcolour.range", 1, Val_colourpair, - .pair = {28, 63}, - .pairhandle = config_nickcolour_range, - .description = { - "Range of (mirc extended) colours used to colour nicks", - "Must be 0, 99 or anywhere between. 99 is no colour", - "Giving a single value or two identical values will", - "use that colour only", NULL}}, - {"nicklist.location", 1, Val_location, - .num = Location_right, - .numhandle = config_nicklist_location, - .description = { - "Location of nicklist.", - "Accepted values: hidden, left, right.", NULL}}, - {"nicklist.width", 1, Val_nzunsigned, - .num = 15, - .numhandle = config_nicklist_width, - .description = { - "Number of columns nicklist will take up.", NULL}}, - {"buflist.location", 1, Val_location, - .num = Location_left, - .numhandle = config_buflist_location, - .description = { - "Location of buflist.", - "Accepted values: hidden, left, right.", NULL}}, - {"buflist.width", 1, Val_nzunsigned, - .num = 25, - .numhandle = config_buflist_width, - .description = { - "Number of columns buflist will take up.", NULL}}, - {"misc.topiccolour", 1, Val_colourpair, - .pair = {99, 89}, - .pairhandle = NULL, - .description = { - "Foreground and background colour of topic bar in main window", NULL}}, - {"misc.pingtime", 1, Val_nzunsigned, - .num = 200, - .numhandle = NULL, - .description = { - "Wait this many seconds since last received message", - "from server to send PING. If ping.wait seconds", - "elapses since sending a PING, hirc will consider", - "the server disconnected.", NULL}}, - {"misc.bell", 1, Val_bool, - .num = 1, - .numhandle = config_redrawl, - .description = { - "Send an audible bell on highlights or messages.", - "Often triggers some other form of action in graphical environments.", NULL}}, - {"motd.removedash", 1, Val_bool, - .num = 1, - .numhandle = config_redrawl, - .description = { - "Remove dash characters often prepended to RPL_MOTD replies.", - "This setting only affects messages recieved after it is set.", NULL}}, - {"completion.hchar", 1, Val_string, - .str = ",", - .strhandle = NULL, - .description = { - "Character to place after hilightning a nick", - "(eg, \",\" -> \"hhvn, hi!\"", NULL}}, - {"divider.toggle", 1, Val_bool, - .num = 1, - .numhandle = config_redrawl, - .description = { - "Turn divider on/off", NULL}}, - {"divider.margin", 1, Val_nzunsigned, - .num = 15, - .numhandle = config_redrawl, - .description = { - "Number of columns on the left of the divider", NULL}}, - {"divider.string", 1, Val_string, - .str = " ", - .strhandle = config_redraws, - .description = { - "String to be used as divider", NULL}}, - {"rdate.short", 1, Val_bool, - .num = 0, - .numhandle = config_redrawl, - .description = { - "Show short units of time (eg, 1d 2h) vs", - "long (eg, 1 day 2 hours) units for %{rdate:...}"}}, - {"rdate.averages", 1, Val_bool, - .num = 1, - .numhandle = config_redrawl, - .description = { - "Months and years are calculated with averages.", - "Disabling this setting will only use absolute units."}}, /* heh, not intentional */ - {"rdate.verbose", 1, Val_bool, - .num = 0, - .numhandle = config_redrawl, - .description = { - "Show all units for %{rdate:...}"}}, - {"timestamp.toggle", 1, Val_bool, - .num = 1, - .numhandle = config_redrawl, - .description = { - "Turn on/off timestamps", NULL}}, - {"format.ui.timestamp", 1, Val_string, - .str = "%{c:92}%{time:%H:%M:%S,${time}}%{o} ", - .strhandle = config_redraws, - .description = { - "Format of timestamps", - "Only shown if timestamp.toggle is on.", - "This format is special as it is included in others.", NULL}}, - {"format.ui.topic", 1, Val_string, - .str = "%{c:99,89}${topic}", - .strhandle = config_redraws, - .description = { - "Format of topic at top of main window", NULL}}, - {"format.ui.error", 1, Val_string, - .str = "%{c:28}%{b}${4} %{b}(${3} at ${1}:${2})", - .strhandle = config_redraws, - .description = { - "Format of SELF_ERROR messages", NULL}}, - {"format.ui.misc", 1, Val_string, - .str = "${1}", - .strhandle = config_redraws, - .description = { - "Format of SELF_UI messages", NULL}}, - {"format.ui.connectlost", 1, Val_string, - .str = "Connection to ${1} (${2}:${3}) lost: ${4}", - .strhandle = config_redraws, - .description = { - "Format of SELF_CONNECTLOST messages", NULL}}, - {"format.ui.connecting", 1, Val_string, - .str = "Connecting to ${1}:${2}", - .strhandle = config_redraws, - .description = { - "Format of SELF_CONNECTING messages", NULL}}, - {"format.ui.connected", 1, Val_string, - .str = "Connection to ${1} established", - .strhandle = config_redraws, - .description = { - "Format of SELF_CONNECTED messages", NULL}}, - {"format.ui.lookupfail", 1, Val_string, - .str = "Failed to lookup ${2}: ${4}", - .strhandle = config_redraws, - .description = { - "Format of SELF_LOOKUPFAIL messages", NULL}}, - {"format.ui.connectfail", 1, Val_string, - .str = "Failed to connect to ${2}:${3}: ${4}", - .strhandle = config_redraws, - .description = { - "Format of SELF_CONNECTFAIL messages", NULL}}, -#ifndef TLS - {"format.ui.tls.notcompiled", 1, Val_string, - .str = "TLS not compiled into hirc", - .strhandle = config_redraws, - .description = { - "Format of SELF_TLSNOTCOMPILED messages", NULL}}, -#else - {"format.ui.tls.version", 1, Val_string, - .str = "Protocol: %{b}${2}%{b} (%{b}${3}%{b} bits, %{b}${4}%{b})", - .strhandle = config_redraws, - .description = { - "TLS version and crypto information.", NULL}}, - {"format.ui.tls.sni", 1, Val_string, - .str = "SNI name: %{b}${2}%{b}", - .strhandle = config_redraws, - .description = { - "TLS server name indication.", NULL}}, - {"format.ui.tls.issuer", 1, Val_string, - .str = "Cert issuer: %{b}${3}%{b}", - .strhandle = config_redraws, - .description = { - "TLS certificate issuer.", NULL}}, - {"format.ui.tls.subject", 1, Val_string, - .str = "Cert subject: %{b}${3}%{b}", - .strhandle = config_redraws, - .description = { - "TLS certificate subject.", NULL}}, -#endif /* TLS */ - {"format.ui.keybind", 1, Val_string, - .str = " ${1}: ${2}", - .strhandle = config_redraws, - .description = { - "Format of /bind output", NULL}}, - {"format.ui.keybind.start", 1, Val_string, - .str = "Keybindings:", - .strhandle = config_redraws, - .description = { - "Format of header of /bind output", NULL}}, - {"format.ui.keybind.end", 1, Val_string, - .str = "", - .strhandle = config_redraws, - .description = { - "Format of footer of /bind output", NULL}}, - {"format.ui.autocmds", 1, Val_string, - .str = " ${2}", - .strhandle = config_redraws, - .description = { - "Format of /server -auto output", NULL}}, - {"format.ui.autocmds.start", 1, Val_string, - .str = "Autocmds for ${1}:", - .strhandle = config_redraws, - .description = { - "Format of header of /server -auto output", NULL}}, - {"format.ui.autocmds.end", 1, Val_string, - .str = "", - .strhandle = config_redraws, - .description = { - "Format of footer of /server -auto output", NULL}}, - {"format.ui.logrestore", 1, Val_string, - .str = "%{c:93}---%{=}%{c:93}Restored log up until %{b}%{time:%c,${1}}%{b} ---", - .strhandle = config_redraws, - .description = { - "Format of log restore footer.", NULL}}, - {"format.ui.unread", 1, Val_string, - .str = "%{c:93}---%{=}%{c:93}%{b}${1}%{b} unread (%{b}${2}%{b} ignored) ---", - .strhandle = config_redraws, - .description = { - "Format of unread message indicator.", NULL}}, - {"format.ui.ignores.start", 1, Val_string, - .str = "Ignoring:", - .strhandle = config_redraws, - .description = { - "Format of ignore list header.", NULL}}, - {"format.ui.ignores", 1, Val_string, - .str = " %{pad:-3,${1}} (server: ${2}, noact: ${3}, format: ${4}) ${5}", - .strhandle = config_redraws, - .description = { - "Format of ignore list messages.", NULL}}, - {"format.ui.ignores.end", 1, Val_string, - .str = "", - .strhandle = config_redraws, - .description = { - "Format of ignore list footer.", NULL}}, - {"format.ui.ignores.added", 1, Val_string, - .str = "Ignore added: ${4} (server: ${1}, noact: ${2}, format: ${3})", - .strhandle = config_redraws, - .description = { - "Format of new ignores.", NULL}}, - {"format.ui.grep.start", 1, Val_string, - .str = "%{b}%{c:94}Results of ${1}:", - .strhandle = config_redraws, - .description = { - "Format of start of /grep output", NULL}}, - {"format.ui.grep.end", 1, Val_string, - .str = "", - .strhandle = config_redraws, - .description = { - "Format of end of /grep output", NULL}}, - {"format.ui.alias", 1, Val_string, - .str = " ${1}: ${2}", - .strhandle = config_redraws, - .description = { - "Format of /alias output", NULL}}, - {"format.ui.alias.start", 1, Val_string, - .str = "Aliases:", - .strhandle = config_redraws, - .description = { - "Format of header of /alias output", NULL}}, - {"format.ui.alias.end", 1, Val_string, - .str = "", - .strhandle = config_redraws, - .description = { - "Format of footer of /alias output", NULL}}, - {"format.ui.help", 1, Val_string, - .str = " ${1}", - .strhandle = config_redraws, - .description = { - "Format of /alias output", NULL}}, - {"format.ui.help.start", 1, Val_string, - .str = "${1} help:", - .strhandle = config_redraws, - .description = { - "Format of header of /alias output", NULL}}, - {"format.ui.help.end", 1, Val_string, - .str = "", - .strhandle = config_redraws, - .description = { - "Format of footer of /alias output", NULL}}, - {"format.ui.buflist.old", 1, Val_string, - .str = "%{c:91}", - .strhandle = config_redraws, - .description = { - "Indicator for disconnected servers or parted channels", NULL}}, - {"format.ui.buflist.activity.none", 1, Val_string, - .str = "", - .strhandle = config_redraws, - .description = { - "Indicator for buffer with activity of level `none`", NULL}}, - {"format.ui.buflist.activity.status", 1, Val_string, - .str = "%{c:95}", - .strhandle = config_redraws, - .description = { - "Indicator for buffer with activity of level `status`", NULL}}, - {"format.ui.buflist.activity.error", 1, Val_string, - .str = "%{c:28}", - .strhandle = config_redraws, - .description = { - "Indicator for buffer with activity of level `error`", NULL}}, - {"format.ui.buflist.activity.message", 1, Val_string, - .str = "%{c:45}", - .strhandle = config_redraws, - .description = { - "Indicator for buffer with activity of level `message`", NULL}}, - {"format.ui.buflist.activity.hilight", 1, Val_string, - .str = "%{c:45}%{r}", - .strhandle = config_redraws, - .description = { - "Indicator for buffer with activity of level `hilight`", NULL}}, - {"format.ui.buflist.more", 1, Val_string, - .str = "%{c:92}...", - .strhandle = config_redraws, - .description = { - "Shown if there are more nicks that must be scrolled to see.", NULL}}, - {"format.ui.nicklist.more", 1, Val_string, - .str = "%{c:92}...", - .strhandle = config_redraws, - .description = { - "Shown if there are more nicks that must be scrolled to see.", NULL}}, - {"format.ui.separator.vertical", 1, Val_string, - .str = "│", - .strhandle = config_redraws, - .description = { - "Used for vertical line seperating windows", NULL}}, - {"format.ui.separator.split.left", 1, Val_string, - .str = "├", - .strhandle = config_redraws, - .description = { - "Joins left vertical separator to input seperator", NULL}}, - {"format.ui.separator.split.right", 1, Val_string, - .str = "┤", - .strhandle = config_redraws, - .description = { - "Joins right vertical separator to input seperator", NULL}}, - {"format.ui.separator.horizontal", 1, Val_string, - .str = "─", - .strhandle = config_redraws, - .description = { - "Used for horizontal line separating input and main window", NULL}}, - {"format.privmsg", 1, Val_string, - .str = "%{nick:${nick}}${priv}${nick}%{o}%{=}${2}", - .strhandle = config_redraws, - .description = { - "Format of messages", NULL}}, - {"format.action", 1, Val_string, - .str = "%{nick:${nick}}*%{b}${nick}%{b}%{=}${2}", - .strhandle = config_redraws, - .description = { - "Format of actions", NULL}}, - {"format.ctcp.request", 1, Val_string, - .str = "%{nick:${nick}}${nick}%{o} %{c:94}%{b}q%{o}%{=}${2}", - .strhandle = config_redraws, - .description = { - "Format of CTCP requests", NULL}}, - {"format.ctcp.answer", 1, Val_string, - .str = "%{nick:${nick}}${nick}%{o} %{c:94}%{b}a%{o}%{=}${2}", - .strhandle = config_redraws, - .description = { - "Format of CTCP answers", NULL}}, - {"format.notice", 1, Val_string, - .str = "%{nick:${nick}}-${priv}${nick}-%{o}%{=}${2}", - .strhandle = config_redraws, - .description = { - "Format of notices", NULL}}, - {"format.nick", 1, Val_string, - .str = "%{nick:${nick}}${nick}%{o}%{=}is now known as %{nick:${1}}${1}", - .strhandle = config_redraws, - .description = { - "Format of NICK messages", NULL}}, - {"format.join", 1, Val_string, - .str = "%{b}%{c:44}+%{o}%{=}%{nick:${nick}}${nick}%{o} (${ident}@${host})", - .strhandle = config_redraws, - .description = { - "Format of JOIN messages", NULL}}, - {"format.quit", 1, Val_string, - .str = "%{b}%{c:40}<%{o}%{=}%{nick:${nick}}${nick}%{o} (${ident}@${host}): ${1}", - .strhandle = config_redraws, - .description = { - "Format of QUIT messages", NULL}}, - {"format.part", 1, Val_string, - .str = "%{b}%{c:40}-%{o}%{=}%{nick:${nick}}${nick}%{o} (${ident}@${host}): ${2}", - .strhandle = config_redraws, - .description = { - "Format of PART messages", NULL}}, - {"format.kick", 1, Val_string, - .str = "%{b}%{c:40}!%{o}%{=}%{nick:${2}}${2}${o} by %{nick:${nick}}${nick}%{o} (${ident}@${host}): ${3}", - .strhandle = config_redraws, - .description = { - "Format of PART messages", NULL}}, - {"format.mode.nick.self", 1, Val_string, - .str = "${1} set %{c:94}${2-}%{o}", - .strhandle = config_redraws, - .description = { - "Format of modes being set on self by server/self", NULL}}, - {"format.mode.nick", 1, Val_string, - .str = "${1} set %{c:94}${2-}%{o} by ${nick} (${ident}@${host})", - .strhandle = config_redraws, - .description = { - "Format of modes being on nicks", NULL}}, - {"format.mode.channel", 1, Val_string, - .str = "mode%{=}%{c:94}${2-}%{o} by %{nick:${nick}}${nick}", - .strhandle = config_redraws, - .description = { - "Format of modes being set on channels", NULL}}, - {"format.topic", 1, Val_string, - .str = "topic%{=}${2}\\nset by %{nick:${nick}}${nick}%{o} now", - .strhandle = config_redraws, - .description = { - "Format of topic being set", NULL}}, - {"format.invite", 1, Val_string, - .str = "%{nick:${nick}}${nick}%{o} invited you to ${2}", - .strhandle = config_redraws, - .description = { - "Format of an invitation being received.", NULL}}, - {"format.pong", 1, Val_string, - .str = "PONG from %{nick:${nick}}${nick}%{o}: ${2}", - .strhandle = config_redraws, - .description = { - "Format of replies to /ping", NULL}}, - {"format.error", 1, Val_string, - .str = "%{c:28}ERROR:%{o} ${1}", - .strhandle = config_redraws, - .description = { - "Format of generic ERROR messages.", - "Most commonly seen when being /kill'd.", NULL}}, - /* Generic numerics (bit boring) */ - {"format.rpl.welcome", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_WELCOME (001) numeric", NULL}}, - {"format.rpl.yourhost", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_YOURHOST (002) numeric", NULL}}, - {"format.rpl.created", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_CREATED (003) numeric", NULL}}, - {"format.rpl.myinfo", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_MYINFO (004) numeric", NULL}}, - {"format.rpl.isupport", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_MYSUPPORT (005) numeric", NULL}}, - {"format.rpl.map", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_MAP (006) numeric", NULL}}, - {"format.rpl.mapend", 1, Val_string, - .str = "", - .strhandle = config_redraws, - .description = { - "Format of RPL_MAPEND (007) numeric", NULL}}, - /* START: misc/rpl-conf-gen.awk */ - {"format.rpl.tracelink", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TRACELINK (200) numeric", NULL}}, - {"format.rpl.traceconnecting", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TRACECONNECTING (201) numeric", NULL}}, - {"format.rpl.tracehandshake", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TRACEHANDSHAKE (202) numeric", NULL}}, - {"format.rpl.traceunknown", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TRACEUNKNOWN (203) numeric", NULL}}, - {"format.rpl.traceoperator", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TRACEOPERATOR (204) numeric", NULL}}, - {"format.rpl.traceuser", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TRACEUSER (205) numeric", NULL}}, - {"format.rpl.traceserver", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TRACESERVER (206) numeric", NULL}}, - {"format.rpl.tracenewtype", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TRACENEWTYPE (208) numeric", NULL}}, - {"format.rpl.traceclass", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TRACECLASS (209) numeric", NULL}}, - {"format.rpl.statslinkinfo", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_STATSLINKINFO (211) numeric", NULL}}, - {"format.rpl.statscommands", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_STATSCOMMANDS (212) numeric", NULL}}, - {"format.rpl.statscline", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_STATSCLINE (213) numeric", NULL}}, - {"format.rpl.statsnline", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_STATSNLINE (214) numeric", NULL}}, - {"format.rpl.statsiline", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_STATSILINE (215) numeric", NULL}}, - {"format.rpl.statskline", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_STATSKLINE (216) numeric", NULL}}, - {"format.rpl.statsyline", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_STATSYLINE (218) numeric", NULL}}, - {"format.rpl.endofstats", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ENDOFSTATS (219) numeric", NULL}}, - {"format.rpl.umodeis", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_UMODEIS (221) numeric", NULL}}, - {"format.rpl.serviceinfo", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_SERVICEINFO (231) numeric", NULL}}, - {"format.rpl.service", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_SERVICE (233) numeric", NULL}}, - {"format.rpl.servlistend", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_SERVLISTEND (235) numeric", NULL}}, - {"format.rpl.statslline", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_STATSLLINE (241) numeric", NULL}}, - {"format.rpl.statsuptime", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_STATSUPTIME (242) numeric", NULL}}, - {"format.rpl.statsoline", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_STATSOLINE (243) numeric", NULL}}, - {"format.rpl.statshline", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_STATSHLINE (244) numeric", NULL}}, - {"format.rpl.luserclient", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_LUSERCLIENT (251) numeric", NULL}}, - {"format.rpl.luserop", 1, Val_string, - .str = "There are ${2} opers online", - .strhandle = config_redraws, - .description = { - "Format of RPL_LUSEROP (252) numeric", NULL}}, - {"format.rpl.luserunknown", 1, Val_string, - .str = "There are ${2} unknown connections", - .strhandle = config_redraws, - .description = { - "Format of RPL_LUSERUNKNOWN (253) numeric", NULL}}, - {"format.rpl.luserchannels", 1, Val_string, - .str = "There are ${2} channels formed", - .strhandle = config_redraws, - .description = { - "Format of RPL_LUSERCHANNELS (254) numeric", NULL}}, - {"format.rpl.luserme", 1, Val_string, - .str = "There are %{split:3, ,${2}} clients and %{split:6, ,${2}} servers connected to this server", - .strhandle = config_redraws, - .description = { - "Format of RPL_LUSERME (255) numeric", NULL}}, - {"format.rpl.adminme", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ADMINME (256) numeric", NULL}}, - {"format.rpl.adminloc1", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ADMINLOC1 (257) numeric", NULL}}, - {"format.rpl.adminloc2", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ADMINLOC2 (258) numeric", NULL}}, - {"format.rpl.adminemail", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ADMINEMAIL (259) numeric", NULL}}, - {"format.rpl.tracelog", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TRACELOG (261) numeric", NULL}}, - {"format.rpl.none", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_NONE (300) numeric", NULL}}, - {"format.rpl.away", 1, Val_string, - .str = "away%{=}%{nick:${2}}${2}%{o}: ${3}", - .strhandle = config_redraws, - .description = { - "Format of RPL_AWAY (301) numeric", NULL}}, - {"format.rpl.userhost", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_USERHOST (302) numeric", NULL}}, - {"format.rpl.ison", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ISON (303) numeric", NULL}}, - {"format.rpl.unaway", 1, Val_string, - .str = "%{c:40}<--%{o}%{=}No longer %{b}away%{b}", - .strhandle = config_redraws, - .description = { - "Format of RPL_UNAWAY (305) numeric", NULL}}, - {"format.rpl.nowaway", 1, Val_string, - .str = "%{c:32}-->%{o}%{=}Set %{b}away%{b}", - .strhandle = config_redraws, - .description = { - "Format of RPL_NOWAWAY (306) numeric", NULL}}, - {"format.rpl.whoisuser", 1, Val_string, - .str = "%{b}${2}!${3}@${4}%{b} (${6}):", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOISUSER (311) numeric", NULL}}, - {"format.rpl.whoisserver", 1, Val_string, - .str = " %{b}server %{b}: ${3} (${4})", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOISSERVER (312) numeric", NULL}}, - {"format.rpl.whoisoperator", 1, Val_string, - .str = " %{b}oper %{b}: ${3}", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOISOPERATOR (313) numeric", NULL}}, - {"format.rpl.whowasuser", 1, Val_string, - .str = "%{b}${2}!${3}@${4}%{b} (${6}) was on:", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOWASUSER (314) numeric", NULL}}, - {"format.rpl.endofwho", 1, Val_string, - .str = "End of WHO results for ${2}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ENDOFWHO (315) numeric", NULL}}, - {"format.rpl.whoisidle", 1, Val_string, - .str = " %{b}signon %{b}: %{time:%c,${4}}, idle: %{rdate:${3}}", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOISIDLE (317) numeric", NULL}}, - {"format.rpl.endofwhois", 1, Val_string, - .str = "", - .strhandle = config_redraws, - .description = { - "Format of RPL_ENDOFWHOIS (318) numeric", NULL}}, - {"format.rpl.whoischannels", 1, Val_string, - .str = " %{b}channels%{b}: ${3}", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOISCHANNELS (319) numeric", NULL}}, - {"format.rpl.liststart", 1, Val_string, - .str = "%{pad:-15,Channel} %{pad:-5,Nicks} Topic", - .strhandle = config_redraws, - .description = { - "Format of RPL_LISTSTART (321) numeric", NULL}}, - {"format.rpl.list", 1, Val_string, - .str = "%{pad:-15,${2}} %{pad:-5,${3}} ${4}", - .strhandle = config_redraws, - .description = { - "Format of RPL_LIST (322) numeric", NULL}}, - {"format.rpl.listend", 1, Val_string, - .str = "", - .strhandle = config_redraws, - .description = { - "Format of RPL_LISTEND (323) numeric", NULL}}, - {"format.rpl.channelmodeis", 1, Val_string, - .str = "mode%{=}%{c:94}${3-}%{o}", - .strhandle = config_redraws, - .description = { - "Format of RPL_CHANNELMODEIS (324) numeric", NULL}}, - {"format.rpl.notopic", 1, Val_string, - .str = "topic%{=}no topic set", - .strhandle = config_redraws, - .description = { - "Format of RPL_NOTOPIC (331) numeric", NULL}}, - {"format.rpl.topic", 1, Val_string, - .str = "topic%{=}${3}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TOPIC (332) numeric", NULL}}, - {"format.rpl.inviting", 1, Val_string, - .str = "invite%{=}${2}", - .strhandle = config_redraws, - .description = { - "Format of RPL_INVITING (341) numeric", NULL}}, - {"format.rpl.summoning", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_SUMMONING (342) numeric", NULL}}, - {"format.rpl.version", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_VERSION (351) numeric", NULL}}, - {"format.rpl.whoreply", 1, Val_string, - .str = "%{b}${6}!${3}@${4}%{b} (%{split:2, ,${8}}): ${7} %{split:1, ,${8}}", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOREPLY (352) numeric", NULL}}, - {"format.rpl.namreply", 1, Val_string, - .str = "names%{=}${4-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_NAMREPLY (353) numeric", NULL}}, - {"format.rpl.closing", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_CLOSING (362) numeric", NULL}}, - {"format.rpl.links", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_LINKS (364) numeric", NULL}}, - {"format.rpl.endoflinks", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ENDOFLINKS (365) numeric", NULL}}, - {"format.rpl.endofnames", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ENDOFNAMES (366) numeric", NULL}}, - {"format.rpl.banlist", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_BANLIST (367) numeric", NULL}}, - {"format.rpl.endofbanlist", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ENDOFBANLIST (368) numeric", NULL}}, - {"format.rpl.endofwhowas", 1, Val_string, - .str = "", - .strhandle = config_redraws, - .description = { - "Format of RPL_ENDOFWHOWAS (369) numeric", NULL}}, - {"format.rpl.info", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_INFO (371) numeric", NULL}}, - {"format.rpl.motd", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_MOTD (372) numeric", NULL}}, - {"format.rpl.infostart", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_INFOSTART (373) numeric", NULL}}, - {"format.rpl.endofinfo", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ENDOFINFO (374) numeric", NULL}}, - {"format.rpl.motdstart", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_MOTDSTART (375) numeric", NULL}}, - {"format.rpl.endofmotd", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ENDOFMOTD (376) numeric", NULL}}, - {"format.rpl.youreoper", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_YOUREOPER (381) numeric", NULL}}, - {"format.rpl.rehashing", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_REHASHING (382) numeric", NULL}}, - {"format.rpl.time", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TIME (391) numeric", NULL}}, - {"format.rpl.usersstart", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_USERSSTART (392) numeric", NULL}}, - {"format.rpl.users", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_USERS (393) numeric", NULL}}, - {"format.rpl.endofusers", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_ENDOFUSERS (394) numeric", NULL}}, - {"format.rpl.nousers", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_NOUSERS (395) numeric", NULL}}, - {"format.err.nosuchnick", 1, Val_string, - .str = "No such nick: ${2}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOSUCHNICK (401) numeric", NULL}}, - {"format.err.nosuchserver", 1, Val_string, - .str = "No such server: ${2}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOSUCHSERVER (402) numeric", NULL}}, - {"format.err.nosuchchannel", 1, Val_string, - .str = "No such channel: ${2}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOSUCHCHANNEL (403) numeric", NULL}}, - {"format.err.cannotsendtochan", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_CANNOTSENDTOCHAN (404) numeric", NULL}}, - {"format.err.toomanychannels", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_TOOMANYCHANNELS (405) numeric", NULL}}, - {"format.err.wasnosuchnick", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_WASNOSUCHNICK (406) numeric", NULL}}, - {"format.err.toomanytargets", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_TOOMANYTARGETS (407) numeric", NULL}}, - {"format.err.noorigin", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOORIGIN (409) numeric", NULL}}, - {"format.err.norecipient", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NORECIPIENT (411) numeric", NULL}}, - {"format.err.notexttosend", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOTEXTTOSEND (412) numeric", NULL}}, - {"format.err.notoplevel", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOTOPLEVEL (413) numeric", NULL}}, - {"format.err.wildtoplevel", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_WILDTOPLEVEL (414) numeric", NULL}}, - {"format.err.unknowncommand", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_UNKNOWNCOMMAND (421) numeric", NULL}}, - {"format.err.nomotd", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOMOTD (422) numeric", NULL}}, - {"format.err.noadmininfo", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOADMININFO (423) numeric", NULL}}, - {"format.err.fileerror", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_FILEERROR (424) numeric", NULL}}, - {"format.err.nonicknamegiven", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NONICKNAMEGIVEN (431) numeric", NULL}}, - {"format.err.erroneusnickname", 1, Val_string, - .str = "Erroneous nickname: ${2}", - .strhandle = config_redraws, - .description = { - "Format of ERR_ERRONEUSNICKNAME (432) numeric", NULL}}, - {"format.err.nicknameinuse", 1, Val_string, - .str = "Nickname already in use: ${2}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NICKNAMEINUSE (433) numeric", NULL}}, - {"format.err.nickcollision", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NICKCOLLISION (436) numeric", NULL}}, - {"format.err.usernotinchannel", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_USERNOTINCHANNEL (441) numeric", NULL}}, - {"format.err.notonchannel", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOTONCHANNEL (442) numeric", NULL}}, - {"format.err.useronchannel", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_USERONCHANNEL (443) numeric", NULL}}, - {"format.err.nologin", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOLOGIN (444) numeric", NULL}}, - {"format.err.summondisabled", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_SUMMONDISABLED (445) numeric", NULL}}, - {"format.err.usersdisabled", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_USERSDISABLED (446) numeric", NULL}}, - {"format.err.notregistered", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOTREGISTERED (451) numeric", NULL}}, - {"format.err.needmoreparams", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NEEDMOREPARAMS (461) numeric", NULL}}, - {"format.err.alreadyregistred", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_ALREADYREGISTRED (462) numeric", NULL}}, - {"format.err.nopermforhost", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOPERMFORHOST (463) numeric", NULL}}, - {"format.err.passwdmismatch", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_PASSWDMISMATCH (464) numeric", NULL}}, - {"format.err.yourebannedcreep", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_YOUREBANNEDCREEP (465) numeric", NULL}}, - {"format.err.youwillbebanned", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_YOUWILLBEBANNED (466) numeric", NULL}}, - {"format.err.keyset", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_KEYSET (467) numeric", NULL}}, - {"format.err.channelisfull", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_CHANNELISFULL (471) numeric", NULL}}, - {"format.err.unknownmode", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_UNKNOWNMODE (472) numeric", NULL}}, - {"format.err.inviteonlychan", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_INVITEONLYCHAN (473) numeric", NULL}}, - {"format.err.bannedfromchan", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_BANNEDFROMCHAN (474) numeric", NULL}}, - {"format.err.badchannelkey", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_BADCHANNELKEY (475) numeric", NULL}}, - {"format.err.noprivileges", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOPRIVILEGES (481) numeric", NULL}}, - {"format.err.chanoprivsneeded", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_CHANOPRIVSNEEDED (482) numeric", NULL}}, - {"format.err.cantkillserver", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_CANTKILLSERVER (483) numeric", NULL}}, - {"format.err.nooperhost", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOOPERHOST (491) numeric", NULL}}, - {"format.err.noservicehost", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_NOSERVICEHOST (492) numeric", NULL}}, - {"format.err.umodeunknownflag", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_UMODEUNKNOWNFLAG (501) numeric", NULL}}, - {"format.err.usersdontmatch", 1, Val_string, - .str = "${2-}", - .strhandle = config_redraws, - .description = { - "Format of ERR_USERSDONTMATCH (502) numeric", NULL}}, - /* END: misc/rpl-conf-gen.awk */ - /* Modern numerics */ - {"format.rpl.localusers", 1, Val_string, - .str = "There are ${2} current local users, record of ${3}", - .strhandle = config_redraws, - .description = { - "Format of RPLS_LOCALUSERS (265) numeric", NULL}}, - {"format.rpl.globalusers", 1, Val_string, - .str = "There are ${2} current global users, record of ${3}", - .strhandle = config_redraws, - .description = { - "Format of RPL_GLOBALUSERS (266) numeric", NULL}}, - {"format.rpl.whoisspecial", 1, Val_string, - .str = " %{b}info %{b}: ${3}", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOISSPECIAL (320) numeric", NULL}}, - {"format.rpl.whoisaccount", 1, Val_string, - .str = " %{b}account %{b}: ${3}", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOISACCOUNT (330) numeric", NULL}}, - {"format.rpl.topicwhotime", 1, Val_string, - .str = "set by %{nick:${3}}${3}%{o} at %{time:%Y-%m-%d %H:%M:%S,${4}}", - .strhandle = config_redraws, - .description = { - "Format of RPL_TOPICWHOTIME (333) numeric", NULL}}, - {"format.rpl.whoisactually", 1, Val_string, - .str = " %{b}actually%{b}: ${3-}", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOISACTUALLY (338) numeric", NULL}}, - {"format.rpl.whoishost", 1, Val_string, - .str = " %{b}info %{b}: ${3}", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOISHOST (378) numeric", NULL}}, - {"format.rpl.whoismodes", 1, Val_string, - .str = " %{b}modes %{b}: ${3}", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOISMODES (379) numeric", NULL}}, - {"format.rpl.whoissecure", 1, Val_string, - .str = " %{b}secure %{b}: ${3}", - .strhandle = config_redraws, - .description = { - "Format of RPL_WHOISSECURE (671) numeric", NULL}}, - /* Default formats */ - {"format.rpl.other", 1, Val_string, - .str = "${cmd} ${2-}", - .strhandle = config_redraws, - .description = { - "Format of numerics without formats", NULL}}, - {"format.other", 1, Val_string, - .str = "${raw}", - .strhandle = config_redraws, - .description = { - "Format of other messages without formats", NULL}}, - {NULL}, -}; +#include "data/config.h" struct Config * config_getp(char *name) { diff --git a/src/data/commands.h b/src/data/commands.h @@ -0,0 +1,353 @@ +/* + * src/data/commands.h from hirc + * + * Copyright (c) 2021-2022 hhvn <dev@hhvn.uk> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#define COMMAND(func) static void func(struct Server *server, struct Channel *channel, char *str) + +/* IRC commands */ +COMMAND(command_away); +COMMAND(command_msg); +COMMAND(command_notice); +COMMAND(command_me); +COMMAND(command_ctcp); +COMMAND(command_quit); +COMMAND(command_join); +COMMAND(command_part); +COMMAND(command_kick); +COMMAND(command_mode); +COMMAND(command_nick); +COMMAND(command_list); +COMMAND(command_whois); +COMMAND(command_who); +COMMAND(command_whowas); +COMMAND(command_ping); +COMMAND(command_quote); +COMMAND(command_connect); +COMMAND(command_disconnect); +COMMAND(command_names); +COMMAND(command_topic); +COMMAND(command_motd); +COMMAND(command_oper); +COMMAND(command_time); +COMMAND(command_stats); +COMMAND(command_kill); +COMMAND(command_links); +COMMAND(command_map); +COMMAND(command_lusers); +COMMAND(command_invite); +COMMAND(command_cycle); + +/* Channel priviledges (use modelset only) */ +COMMAND(command_op); +COMMAND(command_voice); +COMMAND(command_halfop); +COMMAND(command_admin); +COMMAND(command_owner); +COMMAND(command_deop); +COMMAND(command_devoice); +COMMAND(command_dehalfop); +COMMAND(command_deadmin); +COMMAND(command_deowner); +COMMAND(command_ban); +COMMAND(command_unban); + +/* UI commands */ +COMMAND(command_query); +COMMAND(command_select); +COMMAND(command_set); +COMMAND(command_format); +COMMAND(command_server); +COMMAND(command_bind); +COMMAND(command_help); +COMMAND(command_echo); +COMMAND(command_grep); +COMMAND(command_clear); +COMMAND(command_alias); +COMMAND(command_scroll); +COMMAND(command_source); +COMMAND(command_dump); +COMMAND(command_close); +COMMAND(command_ignore); + +struct Command commands[] = { + /* IRC commands */ + {"away", command_away, 0, { + "usage: /away [message]", + "Set yourself as away on the server.", + "An empty message will unset the away.", NULL}}, + {"msg", command_msg, 1, { + "usage: /msg <nick|channel> message..", + "Send a message to a nick or channel.", + "Will appear in buffers if already open.", NULL}}, + {"notice", command_notice, 1, { + "usage: /notice <nick|channel> message..", + "Send a notice to a nick or channel.", + "Will appear in buffers if already open.", NULL}}, + {"me", command_me, 2, { + "usage: /me message..", + "Send a CTCP ACTION to the selected channel/query", NULL}}, + {"ctcp", command_ctcp, 1, { + "usage: /ctcp [channel|nick] <TYPE>", + "Send a CTCP request to a channel or nick", NULL}}, + {"quit", command_quit, 0, { + "usage: /quit", + "Cleanup and exit", NULL}}, + {"quote", command_quote, 1, { + "usage: /quote <message>", + "Send raw message to server", NULL}}, + {"join", command_join, 1, { + "usage: /join <channel>", + "Join channel", NULL}}, + {"part", command_part, 1, { + "usage: /part <channel> [reason]", + "Part channel", NULL}}, + {"cycle", command_cycle, 1, { + "usage: /cycle <channel> [reason]", + "Part channel and rejoin", NULL}}, + {"kick", command_kick, 1, { + "usage: /kick [channel] <nick> [reason]", + "Kick nick from channel", NULL}}, + {"mode", command_mode, 1, { + "usage: /mode <channel> modes...", + "Set/unset channel modes", NULL}}, + {"nick", command_nick, 1, { + "usage: /nick <nick>", + "Get a new nick", NULL}}, + {"list", command_list, 1, { + "usage: /list", + "Get list of channels.", NULL}}, + {"whois", command_whois, 1, { + "usage: /whois [server] [nick]", + "Request information on a nick or oneself", NULL}}, + {"who", command_who, 1, { + "usage: /whois [mask [options]]", + "Request short information on nicks", NULL}}, + {"whowas", command_whowas, 1, { + "usage: /whowas [nick [count [server]]]", + "Request information on old nicks", + "Count defaults to 5", NULL}}, + {"ping", command_ping, 1, { + "usage: /ping message...", + "Send a PING to server.", + "hirc will do this itself in the background,", + "but will hide it unless this command is used.", NULL}}, + {"connect", command_connect, 0, { + "usage: /connect [-network <name>] [-nick <nick>] [-user <user>]", + " [-real <comment>] [-tls] [-verify] [host] [port]", + "Connect to a network/server.", + "If no host is given, it will attempt to connect to the\n", + "selected server if it is disconnected\n", + NULL}}, + {"disconnect", command_disconnect, 0, { + "usage: /disconnect [network] [msg]", + "Disconnect from a network/server", NULL}}, + {"names", command_names, 1, { + "usage: /names <channel>", + "List nicks in channel (pretty useless with nicklist.", NULL}}, + {"topic", command_topic, 1, { + "usage: /topic [-clear] [channel] [topic]", + "Sets, clears, or checks topic in channel.", + "Provide only channel name to check.", NULL}}, + {"oper", command_oper, 1, { + "usage: /oper [user] <password>", + "Authenticate for server operator status.", + "If a user is not specified, the current nickname is used.", NULL}}, + {"motd", command_motd, 1, { + "usage: /motd [server/nick]", + "Get the Message Of The Day for the current server,", + "specified server, or the server with the specified nickname.", NULL}}, + {"time", command_time, 1, { + "usage: /time [server/nick]", + "Get the time and timezone of the current server,", + "specified server, or the server with the specified nickname.", NULL}}, + {"stats", command_stats, 1, { + "usage: /stats [type [server]]", + "Query server statistics. Servers will usually list", + "types that can be queried if no arguments are given.", NULL}}, + {"kill", command_kill, 1, { + "usage: /kill <nick> [reason]", + "Forcefully disconnect a nick from a server.", + "Uses def.killmessage if no reason provided.", NULL}}, + {"links", command_links, 1, { + "usage: /links [[server] mask]", + "Request list of linked servers from the veiwpoint", + "of the current or specified server, matching the", + "specified mask.", NULL}}, + {"lusers", command_lusers, 1, { + "usage: /lusers", + "Request a list of users from the server.", + "This is implemented in all servers, but", + "only some allow its request via a command.", NULL}}, + {"map", command_map, 1, { + "usage: /map", + "Similar to /links but prints an ascii diagram.", + "Nonstandard feature.", NULL}}, + {"invite", command_invite, 1, { + "usage: /invite <nick> [channel]", + "Invite a nick to the current or specified channel.", NULL}}, + /* Channel priviledges */ + {"op", command_op, 2, { + "usage: /op nicks...", + "Give a nickname +o on the current channel.", NULL}}, + {"voice", command_voice, 2, { + "usage: /voice nicks...", + "Give a nickname +v on the current channel.", NULL}}, + {"halfop", command_halfop, 2, { + "usage: /halfop nicks...", + "Give a nickname +h on the current channel.", NULL}}, + {"admin", command_admin, 2, { + "usage: /admin nicks...", + "Give a nickname +a on the current channel.", NULL}}, + {"owner", command_owner, 2, { + "usage: /owner nicks...", + "Give a nickname +q on the current channel.", NULL}}, + {"deop", command_deop, 2, { + "usage: /deop nicks...", + "Remove +o for a nick on the current channel.", NULL}}, + {"devoice", command_devoice, 2, { + "usage: /devoice nicks...", + "Remove +v for a nick on the current channel.", NULL}}, + {"dehalfop", command_dehalfop, 2, { + "usage: /dehalfop nicks...", + "Remove +h for a nick on the current channel.", NULL}}, + {"deadmin", command_deadmin, 2, { + "usage: /deadmin nicks...", + "Remove +a for a nick on the current channel.", NULL}}, + {"deowner", command_deowner, 2, { + "usage: /deowner nicks...", + "Remove +q for a nick on the current channel.", NULL}}, + {"ban", command_ban, 2, { + "usage: /ban masks...", + "Add masks to the +b banlist in the current channel", NULL}}, + {"unban", command_unban, 2, { + "usage: /unban masks...", + "Remove masks from the banlist in the current channel", NULL}}, + /* UI commands */ + {"query", command_query, 1, { + "usage: /query <nick>", + "Open a buffer for communication with a nick", NULL}}, + {"select", command_select, 0, { + "usage: /select [-network <name>] [-channel <name>] [buffer id]", + "Select a buffer", NULL}}, + {"set", command_set, 0, { + "usage: /set <variable> [number/range] [end of range]", + " /set <variable> string....", + "Set a configuration variable.", + "Passing only the name prints content.", NULL}}, + {"format", command_format, 0, { + "usage: /format <format> string...", + "Set a formatting variable.", + "This is equivalent to /set format.<format> string...", NULL}}, + {"server", command_server, 0, { + "usage: /server [-auto] <server> [cmd....]", + " /server [-clear] <server>", + "Evaluate a cooked command with server as target.", + " -auto if supplied with a command, run that command", + " automatically when the server connects.", + " Otherwise, list autocmds that have been set.", + " -clear clear autocmds from server", + "To send a raw command to a server, use:", + " /server <server> /quote ...", NULL}}, + {"bind", command_bind, 0, { + "usage: /bind [<keybind> [cmd [..]]]", + " /bind -delete <keybind>", + "Bind command to key.", + "Accepts caret formatted control characters (eg, ^C).", + "Accepts multiple characters (alt-c = '^[c'), though", + "these must be inputted faster than wgetch can read.", NULL}}, + {"help", command_help, 0, { + "usage: /help [command or variable]", + "Print help information.", + "`/help commands` and `/help variables` will list respectively", NULL}}, + {"echo", command_echo, 0, { + "usage: /echo ...", + "Print temporarily to selected buffer.", NULL}}, + {"grep", command_grep, 0, { + "usage: /grep [-iE] [regex]", + "Search selected buffer", + " -i case insensitive", + " -E posix extended regex", + " -raw search raw message rather than displayed text", + "Displays any lines that match the regex in the current buffer,", + "unless -raw is specified. For convenience, all whitespace is", + "squeezed down to one space.", + "If no argument is supplied, clears previous search.", + "Searches are also cleared after selecting another buffer.", + "See also variables: regex.extended and regex.icase", NULL}}, + {"clear", command_clear, 0, { + "usage: /clear [-tmp] [-err] [-serr] [-log]", + "Clear selected buffer of messages.", + "By default all messages are cleared.", + "The following options clear only certain messages:", + " -tmp: temporary messages - cleared when switching buffer", + " -err: hirc generated errors", + " -serr: server generated errors", + " -log: messages restored from log files", NULL}}, + {"alias", command_alias, 0, { + "usage: /alias [<alias> [cmd [...]]]", + " /alias -delete <alias>", + "Add or remove an alias that expands to a command.", NULL}}, + {"scroll", command_scroll, 0, { + "usage: /scroll [-buflist] [-nicklist] [-|+]lines", + "Scroll a window (main by default).", + "Positive scrolls up, negative down, 0 resets and tracks", + "Probably most useful with /bind", NULL}}, + {"source", command_source, 0, { + "usage: /source <file>", + "Read a config file. Can be used inside config files.", NULL}}, + {"dump", command_dump, 0, { + "usage: /dump [-all] [-aliases] [-bindings] [-formats] [-config]", + " [-default] [-servers] [-channels] [-queries] [-ignores] <file>", + "Dumps configuration details into a file.", + " -autocmds dump commands specified with /server -auto", + " -aliases dump /alias commands", + " -bindings dump /bind commands", + " -formats dump /format commands beginning with filter.", + " -config dump /format options excluding filters", + " -servers dump /server commands", + " -channels dump /join commands for respective servers", + " -queries dump /query commands for respective servers", + " -ignores dump /ignore commands", + " -default dump default settings (dump non-default otherwise)", + "If none (excluding -default) of the above are selected, it is", + "treated as though all are selected.", + "If -autocmds and -channels are used together, and there exists", + "an autocmd to join a channel, then only the autocmd will be dumped.", NULL}}, + {"close", command_close, 0, { + "usage: /close [id]", + "Forget about selected buffer, or a buffer by id.", NULL}}, + {"ignore", command_ignore, 0, { + "usage: /ignore [[-server] [-noact] [-format format] regex]", + " /ignore -delete id", + " /ignore -hide|-show", + "Hide future messages matching regex.", + "Regexes should match a raw IRC message.", + "Display all rules if no argument given.", + " -show show ignored messages", + " -hide hide ignored messages", + " -delete delete rule with specified ID", + " -E use extended POSIX regex", + " -i case insensitive match", + " -server only ignore for the current server", + " or server provided by /server.", + " -noact set activity to Activity_ignore,", + " but don't hide the message.", + " -format only ignore messages with >format<", + "See also: regex.extended, regex.icase", NULL}}, + {NULL, NULL}, +}; diff --git a/src/data/config.h b/src/data/config.h @@ -0,0 +1,1260 @@ +/* + * src/data/config.h from hirc + * + * Copyright (c) 2021-2022 hhvn <dev@hhvn.uk> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +struct Config config[] = { + {"log.dir", 1, Val_string, + .str = "~/.local/hirc", + .strhandle = NULL, + .description = { + "Directory for hirc to log to.", + "Can contain ~ to refer to $HOME", NULL}}, + {"log.toggle", 1, Val_bool, + .num = 1, + .numhandle = NULL, + .description = { + "Simple: to log, or not to log", NULL}}, + {"def.nick", 1, Val_string, + .str = NULL, + .strhandle = NULL, + .description = { + "Default nickname", NULL}}, + {"def.user", 1, Val_string, + .str = NULL, + .strhandle = NULL, + .description = { + "Default username (nick!..here..@host), ", + "may be replaced by identd response", NULL}}, + {"def.real", 1, Val_string, + .str = NULL, + .strhandle = NULL, + .description = { + "Default \"realname\", seen in /whois", NULL}}, + {"def.quitmessage", 1, Val_string, + .str = "quit", + .strhandle = NULL, + .description = { + "Message to send on /quit", NULL}}, + {"def.partmessage", 1, Val_string, + .str = "part", + .strhandle = NULL, + .description = { + "Message to send on /part", NULL}}, + {"def.killmessage", 1, Val_string, + .str = "no reason", + .strhandle = NULL, + .description = { + "Message to send on /kill", NULL}}, + {"def.chantypes", 1, Val_string, + .str = "#&!+", + .strhandle = NULL, + .description = { + "You most likely don't want to touch this.", + "If a server does not supply this in RPL_ISUPPORT,", + "hirc assumes it will use these channel types.", NULL}}, + {"def.prefixes", 1, Val_string, + .str = "(ov)@+", + .strhandle = NULL, + .description = { + "You most likely don't want to touch this.", + "If a server doesn't supply this in the nonstandard", + "RPL_ISUPPORT, it likely won't support nonstandard", + "prefixes.", NULL}}, + {"def.modes", 1, Val_signed, + .num = 1, + .numhandle = NULL, + .description = { + "You most likely don't want to touch this.", + "If a server doesn't send MODES=... in RPL_ISUPPORT,", + "use this number instead.", NULL}}, + {"reconnect.interval", 1, Val_nzunsigned, + .num = 10, + .numhandle = NULL, + .description = { + "Starting reconnect interval in seconds.", + "In reality, for each attempt this will be multipled", + "by the number of failed attemps until it reaches", + "reconnect.maxinterval", NULL}}, + {"reconnect.maxinterval", 1, Val_nzunsigned, + .num = 600, + .numhandle = NULL, + .description = { + "Maximum reconnect interval in seconds.", + "See reconnect.interval", NULL}}, + {"regex.extended", 1, Val_bool, + .num = 0, + .numhandle = NULL, + .description = { + "Use POSIX extended regex at all times.", NULL}}, + {"regex.icase", 1, Val_bool, + .num = 0, + .numhandle = NULL, + .description = { + "Use case insensitive regex at all times.", NULL}}, + {"nickcolour.self", 1, Val_colour, + .num = 90, + .numhandle = config_nickcolour_self, + .description = { + "Colour to use for onself.", + "Must be 0, 99 or anywhere between. 99 is no colours.", NULL}}, + {"nickcolour.range", 1, Val_colourpair, + .pair = {28, 63}, + .pairhandle = config_nickcolour_range, + .description = { + "Range of (mirc extended) colours used to colour nicks", + "Must be 0, 99 or anywhere between. 99 is no colour", + "Giving a single value or two identical values will", + "use that colour only", NULL}}, + {"nicklist.location", 1, Val_location, + .num = Location_right, + .numhandle = config_nicklist_location, + .description = { + "Location of nicklist.", + "Accepted values: hidden, left, right.", NULL}}, + {"nicklist.width", 1, Val_nzunsigned, + .num = 15, + .numhandle = config_nicklist_width, + .description = { + "Number of columns nicklist will take up.", NULL}}, + {"buflist.location", 1, Val_location, + .num = Location_left, + .numhandle = config_buflist_location, + .description = { + "Location of buflist.", + "Accepted values: hidden, left, right.", NULL}}, + {"buflist.width", 1, Val_nzunsigned, + .num = 25, + .numhandle = config_buflist_width, + .description = { + "Number of columns buflist will take up.", NULL}}, + {"misc.topiccolour", 1, Val_colourpair, + .pair = {99, 89}, + .pairhandle = NULL, + .description = { + "Foreground and background colour of topic bar in main window", NULL}}, + {"misc.pingtime", 1, Val_nzunsigned, + .num = 200, + .numhandle = NULL, + .description = { + "Wait this many seconds since last received message", + "from server to send PING. If ping.wait seconds", + "elapses since sending a PING, hirc will consider", + "the server disconnected.", NULL}}, + {"misc.bell", 1, Val_bool, + .num = 1, + .numhandle = config_redrawl, + .description = { + "Send an audible bell on highlights or messages.", + "Often triggers some other form of action in graphical environments.", NULL}}, + {"motd.removedash", 1, Val_bool, + .num = 1, + .numhandle = config_redrawl, + .description = { + "Remove dash characters often prepended to RPL_MOTD replies.", + "This setting only affects messages recieved after it is set.", NULL}}, + {"completion.hchar", 1, Val_string, + .str = ",", + .strhandle = NULL, + .description = { + "Character to place after hilightning a nick", + "(eg, \",\" -> \"hhvn, hi!\"", NULL}}, + {"divider.toggle", 1, Val_bool, + .num = 1, + .numhandle = config_redrawl, + .description = { + "Turn divider on/off", NULL}}, + {"divider.margin", 1, Val_nzunsigned, + .num = 15, + .numhandle = config_redrawl, + .description = { + "Number of columns on the left of the divider", NULL}}, + {"divider.string", 1, Val_string, + .str = " ", + .strhandle = config_redraws, + .description = { + "String to be used as divider", NULL}}, + {"rdate.short", 1, Val_bool, + .num = 0, + .numhandle = config_redrawl, + .description = { + "Show short units of time (eg, 1d 2h) vs", + "long (eg, 1 day 2 hours) units for %{rdate:...}"}}, + {"rdate.averages", 1, Val_bool, + .num = 1, + .numhandle = config_redrawl, + .description = { + "Months and years are calculated with averages.", + "Disabling this setting will only use absolute units."}}, /* heh, not intentional */ + {"rdate.verbose", 1, Val_bool, + .num = 0, + .numhandle = config_redrawl, + .description = { + "Show all units for %{rdate:...}"}}, + {"timestamp.toggle", 1, Val_bool, + .num = 1, + .numhandle = config_redrawl, + .description = { + "Turn on/off timestamps", NULL}}, + {"format.ui.timestamp", 1, Val_string, + .str = "%{c:92}%{time:%H:%M:%S,${time}}%{o} ", + .strhandle = config_redraws, + .description = { + "Format of timestamps", + "Only shown if timestamp.toggle is on.", + "This format is special as it is included in others.", NULL}}, + {"format.ui.topic", 1, Val_string, + .str = "%{c:99,89}${topic}", + .strhandle = config_redraws, + .description = { + "Format of topic at top of main window", NULL}}, + {"format.ui.error", 1, Val_string, + .str = "%{c:28}%{b}${4} %{b}(${3} at ${1}:${2})", + .strhandle = config_redraws, + .description = { + "Format of SELF_ERROR messages", NULL}}, + {"format.ui.misc", 1, Val_string, + .str = "${1}", + .strhandle = config_redraws, + .description = { + "Format of SELF_UI messages", NULL}}, + {"format.ui.connectlost", 1, Val_string, + .str = "Connection to ${1} (${2}:${3}) lost: ${4}", + .strhandle = config_redraws, + .description = { + "Format of SELF_CONNECTLOST messages", NULL}}, + {"format.ui.connecting", 1, Val_string, + .str = "Connecting to ${1}:${2}", + .strhandle = config_redraws, + .description = { + "Format of SELF_CONNECTING messages", NULL}}, + {"format.ui.connected", 1, Val_string, + .str = "Connection to ${1} established", + .strhandle = config_redraws, + .description = { + "Format of SELF_CONNECTED messages", NULL}}, + {"format.ui.lookupfail", 1, Val_string, + .str = "Failed to lookup ${2}: ${4}", + .strhandle = config_redraws, + .description = { + "Format of SELF_LOOKUPFAIL messages", NULL}}, + {"format.ui.connectfail", 1, Val_string, + .str = "Failed to connect to ${2}:${3}: ${4}", + .strhandle = config_redraws, + .description = { + "Format of SELF_CONNECTFAIL messages", NULL}}, +#ifndef TLS + {"format.ui.tls.notcompiled", 1, Val_string, + .str = "TLS not compiled into hirc", + .strhandle = config_redraws, + .description = { + "Format of SELF_TLSNOTCOMPILED messages", NULL}}, +#else + {"format.ui.tls.version", 1, Val_string, + .str = "Protocol: %{b}${2}%{b} (%{b}${3}%{b} bits, %{b}${4}%{b})", + .strhandle = config_redraws, + .description = { + "TLS version and crypto information.", NULL}}, + {"format.ui.tls.sni", 1, Val_string, + .str = "SNI name: %{b}${2}%{b}", + .strhandle = config_redraws, + .description = { + "TLS server name indication.", NULL}}, + {"format.ui.tls.issuer", 1, Val_string, + .str = "Cert issuer: %{b}${3}%{b}", + .strhandle = config_redraws, + .description = { + "TLS certificate issuer.", NULL}}, + {"format.ui.tls.subject", 1, Val_string, + .str = "Cert subject: %{b}${3}%{b}", + .strhandle = config_redraws, + .description = { + "TLS certificate subject.", NULL}}, +#endif /* TLS */ + {"format.ui.keybind", 1, Val_string, + .str = " ${1}: ${2}", + .strhandle = config_redraws, + .description = { + "Format of /bind output", NULL}}, + {"format.ui.keybind.start", 1, Val_string, + .str = "Keybindings:", + .strhandle = config_redraws, + .description = { + "Format of header of /bind output", NULL}}, + {"format.ui.keybind.end", 1, Val_string, + .str = "", + .strhandle = config_redraws, + .description = { + "Format of footer of /bind output", NULL}}, + {"format.ui.autocmds", 1, Val_string, + .str = " ${2}", + .strhandle = config_redraws, + .description = { + "Format of /server -auto output", NULL}}, + {"format.ui.autocmds.start", 1, Val_string, + .str = "Autocmds for ${1}:", + .strhandle = config_redraws, + .description = { + "Format of header of /server -auto output", NULL}}, + {"format.ui.autocmds.end", 1, Val_string, + .str = "", + .strhandle = config_redraws, + .description = { + "Format of footer of /server -auto output", NULL}}, + {"format.ui.logrestore", 1, Val_string, + .str = "%{c:93}---%{=}%{c:93}Restored log up until %{b}%{time:%c,${1}}%{b} ---", + .strhandle = config_redraws, + .description = { + "Format of log restore footer.", NULL}}, + {"format.ui.unread", 1, Val_string, + .str = "%{c:93}---%{=}%{c:93}%{b}${1}%{b} unread (%{b}${2}%{b} ignored) ---", + .strhandle = config_redraws, + .description = { + "Format of unread message indicator.", NULL}}, + {"format.ui.ignores.start", 1, Val_string, + .str = "Ignoring:", + .strhandle = config_redraws, + .description = { + "Format of ignore list header.", NULL}}, + {"format.ui.ignores", 1, Val_string, + .str = " %{pad:-3,${1}} (server: ${2}, noact: ${3}, format: ${4}) ${5}", + .strhandle = config_redraws, + .description = { + "Format of ignore list messages.", NULL}}, + {"format.ui.ignores.end", 1, Val_string, + .str = "", + .strhandle = config_redraws, + .description = { + "Format of ignore list footer.", NULL}}, + {"format.ui.ignores.added", 1, Val_string, + .str = "Ignore added: ${4} (server: ${1}, noact: ${2}, format: ${3})", + .strhandle = config_redraws, + .description = { + "Format of new ignores.", NULL}}, + {"format.ui.grep.start", 1, Val_string, + .str = "%{b}%{c:94}Results of ${1}:", + .strhandle = config_redraws, + .description = { + "Format of start of /grep output", NULL}}, + {"format.ui.grep.end", 1, Val_string, + .str = "", + .strhandle = config_redraws, + .description = { + "Format of end of /grep output", NULL}}, + {"format.ui.alias", 1, Val_string, + .str = " ${1}: ${2}", + .strhandle = config_redraws, + .description = { + "Format of /alias output", NULL}}, + {"format.ui.alias.start", 1, Val_string, + .str = "Aliases:", + .strhandle = config_redraws, + .description = { + "Format of header of /alias output", NULL}}, + {"format.ui.alias.end", 1, Val_string, + .str = "", + .strhandle = config_redraws, + .description = { + "Format of footer of /alias output", NULL}}, + {"format.ui.help", 1, Val_string, + .str = " ${1}", + .strhandle = config_redraws, + .description = { + "Format of /alias output", NULL}}, + {"format.ui.help.start", 1, Val_string, + .str = "${1} help:", + .strhandle = config_redraws, + .description = { + "Format of header of /alias output", NULL}}, + {"format.ui.help.end", 1, Val_string, + .str = "", + .strhandle = config_redraws, + .description = { + "Format of footer of /alias output", NULL}}, + {"format.ui.buflist.old", 1, Val_string, + .str = "%{c:91}", + .strhandle = config_redraws, + .description = { + "Indicator for disconnected servers or parted channels", NULL}}, + {"format.ui.buflist.activity.none", 1, Val_string, + .str = "", + .strhandle = config_redraws, + .description = { + "Indicator for buffer with activity of level `none`", NULL}}, + {"format.ui.buflist.activity.status", 1, Val_string, + .str = "%{c:95}", + .strhandle = config_redraws, + .description = { + "Indicator for buffer with activity of level `status`", NULL}}, + {"format.ui.buflist.activity.error", 1, Val_string, + .str = "%{c:28}", + .strhandle = config_redraws, + .description = { + "Indicator for buffer with activity of level `error`", NULL}}, + {"format.ui.buflist.activity.message", 1, Val_string, + .str = "%{c:45}", + .strhandle = config_redraws, + .description = { + "Indicator for buffer with activity of level `message`", NULL}}, + {"format.ui.buflist.activity.hilight", 1, Val_string, + .str = "%{c:45}%{r}", + .strhandle = config_redraws, + .description = { + "Indicator for buffer with activity of level `hilight`", NULL}}, + {"format.ui.buflist.more", 1, Val_string, + .str = "%{c:92}...", + .strhandle = config_redraws, + .description = { + "Shown if there are more nicks that must be scrolled to see.", NULL}}, + {"format.ui.nicklist.more", 1, Val_string, + .str = "%{c:92}...", + .strhandle = config_redraws, + .description = { + "Shown if there are more nicks that must be scrolled to see.", NULL}}, + {"format.ui.separator.vertical", 1, Val_string, + .str = "│", + .strhandle = config_redraws, + .description = { + "Used for vertical line seperating windows", NULL}}, + {"format.ui.separator.split.left", 1, Val_string, + .str = "├", + .strhandle = config_redraws, + .description = { + "Joins left vertical separator to input seperator", NULL}}, + {"format.ui.separator.split.right", 1, Val_string, + .str = "┤", + .strhandle = config_redraws, + .description = { + "Joins right vertical separator to input seperator", NULL}}, + {"format.ui.separator.horizontal", 1, Val_string, + .str = "─", + .strhandle = config_redraws, + .description = { + "Used for horizontal line separating input and main window", NULL}}, + {"format.privmsg", 1, Val_string, + .str = "%{nick:${nick}}${priv}${nick}%{o}%{=}${2}", + .strhandle = config_redraws, + .description = { + "Format of messages", NULL}}, + {"format.action", 1, Val_string, + .str = "%{nick:${nick}}*%{b}${nick}%{b}%{=}${2}", + .strhandle = config_redraws, + .description = { + "Format of actions", NULL}}, + {"format.ctcp.request", 1, Val_string, + .str = "%{nick:${nick}}${nick}%{o} %{c:94}%{b}q%{o}%{=}${2}", + .strhandle = config_redraws, + .description = { + "Format of CTCP requests", NULL}}, + {"format.ctcp.answer", 1, Val_string, + .str = "%{nick:${nick}}${nick}%{o} %{c:94}%{b}a%{o}%{=}${2}", + .strhandle = config_redraws, + .description = { + "Format of CTCP answers", NULL}}, + {"format.notice", 1, Val_string, + .str = "%{nick:${nick}}-${priv}${nick}-%{o}%{=}${2}", + .strhandle = config_redraws, + .description = { + "Format of notices", NULL}}, + {"format.nick", 1, Val_string, + .str = "%{nick:${nick}}${nick}%{o}%{=}is now known as %{nick:${1}}${1}", + .strhandle = config_redraws, + .description = { + "Format of NICK messages", NULL}}, + {"format.join", 1, Val_string, + .str = "%{b}%{c:44}+%{o}%{=}%{nick:${nick}}${nick}%{o} (${ident}@${host})", + .strhandle = config_redraws, + .description = { + "Format of JOIN messages", NULL}}, + {"format.quit", 1, Val_string, + .str = "%{b}%{c:40}<%{o}%{=}%{nick:${nick}}${nick}%{o} (${ident}@${host}): ${1}", + .strhandle = config_redraws, + .description = { + "Format of QUIT messages", NULL}}, + {"format.part", 1, Val_string, + .str = "%{b}%{c:40}-%{o}%{=}%{nick:${nick}}${nick}%{o} (${ident}@${host}): ${2}", + .strhandle = config_redraws, + .description = { + "Format of PART messages", NULL}}, + {"format.kick", 1, Val_string, + .str = "%{b}%{c:40}!%{o}%{=}%{nick:${2}}${2}${o} by %{nick:${nick}}${nick}%{o} (${ident}@${host}): ${3}", + .strhandle = config_redraws, + .description = { + "Format of PART messages", NULL}}, + {"format.mode.nick.self", 1, Val_string, + .str = "${1} set %{c:94}${2-}%{o}", + .strhandle = config_redraws, + .description = { + "Format of modes being set on self by server/self", NULL}}, + {"format.mode.nick", 1, Val_string, + .str = "${1} set %{c:94}${2-}%{o} by ${nick} (${ident}@${host})", + .strhandle = config_redraws, + .description = { + "Format of modes being on nicks", NULL}}, + {"format.mode.channel", 1, Val_string, + .str = "mode%{=}%{c:94}${2-}%{o} by %{nick:${nick}}${nick}", + .strhandle = config_redraws, + .description = { + "Format of modes being set on channels", NULL}}, + {"format.topic", 1, Val_string, + .str = "topic%{=}${2}\\nset by %{nick:${nick}}${nick}%{o} now", + .strhandle = config_redraws, + .description = { + "Format of topic being set", NULL}}, + {"format.invite", 1, Val_string, + .str = "%{nick:${nick}}${nick}%{o} invited you to ${2}", + .strhandle = config_redraws, + .description = { + "Format of an invitation being received.", NULL}}, + {"format.pong", 1, Val_string, + .str = "PONG from %{nick:${nick}}${nick}%{o}: ${2}", + .strhandle = config_redraws, + .description = { + "Format of replies to /ping", NULL}}, + {"format.error", 1, Val_string, + .str = "%{c:28}ERROR:%{o} ${1}", + .strhandle = config_redraws, + .description = { + "Format of generic ERROR messages.", + "Most commonly seen when being /kill'd.", NULL}}, + /* Generic numerics (bit boring) */ + {"format.rpl.welcome", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_WELCOME (001) numeric", NULL}}, + {"format.rpl.yourhost", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_YOURHOST (002) numeric", NULL}}, + {"format.rpl.created", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_CREATED (003) numeric", NULL}}, + {"format.rpl.myinfo", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_MYINFO (004) numeric", NULL}}, + {"format.rpl.isupport", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_MYSUPPORT (005) numeric", NULL}}, + {"format.rpl.map", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_MAP (006) numeric", NULL}}, + {"format.rpl.mapend", 1, Val_string, + .str = "", + .strhandle = config_redraws, + .description = { + "Format of RPL_MAPEND (007) numeric", NULL}}, + /* START: misc/rpl-conf-gen.awk */ + {"format.rpl.tracelink", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TRACELINK (200) numeric", NULL}}, + {"format.rpl.traceconnecting", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TRACECONNECTING (201) numeric", NULL}}, + {"format.rpl.tracehandshake", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TRACEHANDSHAKE (202) numeric", NULL}}, + {"format.rpl.traceunknown", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TRACEUNKNOWN (203) numeric", NULL}}, + {"format.rpl.traceoperator", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TRACEOPERATOR (204) numeric", NULL}}, + {"format.rpl.traceuser", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TRACEUSER (205) numeric", NULL}}, + {"format.rpl.traceserver", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TRACESERVER (206) numeric", NULL}}, + {"format.rpl.tracenewtype", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TRACENEWTYPE (208) numeric", NULL}}, + {"format.rpl.traceclass", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TRACECLASS (209) numeric", NULL}}, + {"format.rpl.statslinkinfo", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_STATSLINKINFO (211) numeric", NULL}}, + {"format.rpl.statscommands", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_STATSCOMMANDS (212) numeric", NULL}}, + {"format.rpl.statscline", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_STATSCLINE (213) numeric", NULL}}, + {"format.rpl.statsnline", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_STATSNLINE (214) numeric", NULL}}, + {"format.rpl.statsiline", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_STATSILINE (215) numeric", NULL}}, + {"format.rpl.statskline", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_STATSKLINE (216) numeric", NULL}}, + {"format.rpl.statsyline", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_STATSYLINE (218) numeric", NULL}}, + {"format.rpl.endofstats", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ENDOFSTATS (219) numeric", NULL}}, + {"format.rpl.umodeis", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_UMODEIS (221) numeric", NULL}}, + {"format.rpl.serviceinfo", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_SERVICEINFO (231) numeric", NULL}}, + {"format.rpl.service", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_SERVICE (233) numeric", NULL}}, + {"format.rpl.servlistend", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_SERVLISTEND (235) numeric", NULL}}, + {"format.rpl.statslline", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_STATSLLINE (241) numeric", NULL}}, + {"format.rpl.statsuptime", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_STATSUPTIME (242) numeric", NULL}}, + {"format.rpl.statsoline", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_STATSOLINE (243) numeric", NULL}}, + {"format.rpl.statshline", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_STATSHLINE (244) numeric", NULL}}, + {"format.rpl.luserclient", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_LUSERCLIENT (251) numeric", NULL}}, + {"format.rpl.luserop", 1, Val_string, + .str = "There are ${2} opers online", + .strhandle = config_redraws, + .description = { + "Format of RPL_LUSEROP (252) numeric", NULL}}, + {"format.rpl.luserunknown", 1, Val_string, + .str = "There are ${2} unknown connections", + .strhandle = config_redraws, + .description = { + "Format of RPL_LUSERUNKNOWN (253) numeric", NULL}}, + {"format.rpl.luserchannels", 1, Val_string, + .str = "There are ${2} channels formed", + .strhandle = config_redraws, + .description = { + "Format of RPL_LUSERCHANNELS (254) numeric", NULL}}, + {"format.rpl.luserme", 1, Val_string, + .str = "There are %{split:3, ,${2}} clients and %{split:6, ,${2}} servers connected to this server", + .strhandle = config_redraws, + .description = { + "Format of RPL_LUSERME (255) numeric", NULL}}, + {"format.rpl.adminme", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ADMINME (256) numeric", NULL}}, + {"format.rpl.adminloc1", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ADMINLOC1 (257) numeric", NULL}}, + {"format.rpl.adminloc2", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ADMINLOC2 (258) numeric", NULL}}, + {"format.rpl.adminemail", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ADMINEMAIL (259) numeric", NULL}}, + {"format.rpl.tracelog", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TRACELOG (261) numeric", NULL}}, + {"format.rpl.none", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_NONE (300) numeric", NULL}}, + {"format.rpl.away", 1, Val_string, + .str = "away%{=}%{nick:${2}}${2}%{o}: ${3}", + .strhandle = config_redraws, + .description = { + "Format of RPL_AWAY (301) numeric", NULL}}, + {"format.rpl.userhost", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_USERHOST (302) numeric", NULL}}, + {"format.rpl.ison", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ISON (303) numeric", NULL}}, + {"format.rpl.unaway", 1, Val_string, + .str = "%{c:40}<--%{o}%{=}No longer %{b}away%{b}", + .strhandle = config_redraws, + .description = { + "Format of RPL_UNAWAY (305) numeric", NULL}}, + {"format.rpl.nowaway", 1, Val_string, + .str = "%{c:32}-->%{o}%{=}Set %{b}away%{b}", + .strhandle = config_redraws, + .description = { + "Format of RPL_NOWAWAY (306) numeric", NULL}}, + {"format.rpl.whoisuser", 1, Val_string, + .str = "%{b}${2}!${3}@${4}%{b} (${6}):", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOISUSER (311) numeric", NULL}}, + {"format.rpl.whoisserver", 1, Val_string, + .str = " %{b}server %{b}: ${3} (${4})", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOISSERVER (312) numeric", NULL}}, + {"format.rpl.whoisoperator", 1, Val_string, + .str = " %{b}oper %{b}: ${3}", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOISOPERATOR (313) numeric", NULL}}, + {"format.rpl.whowasuser", 1, Val_string, + .str = "%{b}${2}!${3}@${4}%{b} (${6}) was on:", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOWASUSER (314) numeric", NULL}}, + {"format.rpl.endofwho", 1, Val_string, + .str = "End of WHO results for ${2}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ENDOFWHO (315) numeric", NULL}}, + {"format.rpl.whoisidle", 1, Val_string, + .str = " %{b}signon %{b}: %{time:%c,${4}}, idle: %{rdate:${3}}", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOISIDLE (317) numeric", NULL}}, + {"format.rpl.endofwhois", 1, Val_string, + .str = "", + .strhandle = config_redraws, + .description = { + "Format of RPL_ENDOFWHOIS (318) numeric", NULL}}, + {"format.rpl.whoischannels", 1, Val_string, + .str = " %{b}channels%{b}: ${3}", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOISCHANNELS (319) numeric", NULL}}, + {"format.rpl.liststart", 1, Val_string, + .str = "%{pad:-15,Channel} %{pad:-5,Nicks} Topic", + .strhandle = config_redraws, + .description = { + "Format of RPL_LISTSTART (321) numeric", NULL}}, + {"format.rpl.list", 1, Val_string, + .str = "%{pad:-15,${2}} %{pad:-5,${3}} ${4}", + .strhandle = config_redraws, + .description = { + "Format of RPL_LIST (322) numeric", NULL}}, + {"format.rpl.listend", 1, Val_string, + .str = "", + .strhandle = config_redraws, + .description = { + "Format of RPL_LISTEND (323) numeric", NULL}}, + {"format.rpl.channelmodeis", 1, Val_string, + .str = "mode%{=}%{c:94}${3-}%{o}", + .strhandle = config_redraws, + .description = { + "Format of RPL_CHANNELMODEIS (324) numeric", NULL}}, + {"format.rpl.notopic", 1, Val_string, + .str = "topic%{=}no topic set", + .strhandle = config_redraws, + .description = { + "Format of RPL_NOTOPIC (331) numeric", NULL}}, + {"format.rpl.topic", 1, Val_string, + .str = "topic%{=}${3}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TOPIC (332) numeric", NULL}}, + {"format.rpl.inviting", 1, Val_string, + .str = "invite%{=}${2}", + .strhandle = config_redraws, + .description = { + "Format of RPL_INVITING (341) numeric", NULL}}, + {"format.rpl.summoning", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_SUMMONING (342) numeric", NULL}}, + {"format.rpl.version", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_VERSION (351) numeric", NULL}}, + {"format.rpl.whoreply", 1, Val_string, + .str = "%{b}${6}!${3}@${4}%{b} (%{split:2, ,${8}}): ${7} %{split:1, ,${8}}", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOREPLY (352) numeric", NULL}}, + {"format.rpl.namreply", 1, Val_string, + .str = "names%{=}${4-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_NAMREPLY (353) numeric", NULL}}, + {"format.rpl.closing", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_CLOSING (362) numeric", NULL}}, + {"format.rpl.links", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_LINKS (364) numeric", NULL}}, + {"format.rpl.endoflinks", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ENDOFLINKS (365) numeric", NULL}}, + {"format.rpl.endofnames", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ENDOFNAMES (366) numeric", NULL}}, + {"format.rpl.banlist", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_BANLIST (367) numeric", NULL}}, + {"format.rpl.endofbanlist", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ENDOFBANLIST (368) numeric", NULL}}, + {"format.rpl.endofwhowas", 1, Val_string, + .str = "", + .strhandle = config_redraws, + .description = { + "Format of RPL_ENDOFWHOWAS (369) numeric", NULL}}, + {"format.rpl.info", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_INFO (371) numeric", NULL}}, + {"format.rpl.motd", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_MOTD (372) numeric", NULL}}, + {"format.rpl.infostart", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_INFOSTART (373) numeric", NULL}}, + {"format.rpl.endofinfo", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ENDOFINFO (374) numeric", NULL}}, + {"format.rpl.motdstart", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_MOTDSTART (375) numeric", NULL}}, + {"format.rpl.endofmotd", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ENDOFMOTD (376) numeric", NULL}}, + {"format.rpl.youreoper", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_YOUREOPER (381) numeric", NULL}}, + {"format.rpl.rehashing", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_REHASHING (382) numeric", NULL}}, + {"format.rpl.time", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TIME (391) numeric", NULL}}, + {"format.rpl.usersstart", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_USERSSTART (392) numeric", NULL}}, + {"format.rpl.users", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_USERS (393) numeric", NULL}}, + {"format.rpl.endofusers", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_ENDOFUSERS (394) numeric", NULL}}, + {"format.rpl.nousers", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_NOUSERS (395) numeric", NULL}}, + {"format.err.nosuchnick", 1, Val_string, + .str = "No such nick: ${2}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOSUCHNICK (401) numeric", NULL}}, + {"format.err.nosuchserver", 1, Val_string, + .str = "No such server: ${2}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOSUCHSERVER (402) numeric", NULL}}, + {"format.err.nosuchchannel", 1, Val_string, + .str = "No such channel: ${2}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOSUCHCHANNEL (403) numeric", NULL}}, + {"format.err.cannotsendtochan", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_CANNOTSENDTOCHAN (404) numeric", NULL}}, + {"format.err.toomanychannels", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_TOOMANYCHANNELS (405) numeric", NULL}}, + {"format.err.wasnosuchnick", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_WASNOSUCHNICK (406) numeric", NULL}}, + {"format.err.toomanytargets", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_TOOMANYTARGETS (407) numeric", NULL}}, + {"format.err.noorigin", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOORIGIN (409) numeric", NULL}}, + {"format.err.norecipient", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NORECIPIENT (411) numeric", NULL}}, + {"format.err.notexttosend", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOTEXTTOSEND (412) numeric", NULL}}, + {"format.err.notoplevel", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOTOPLEVEL (413) numeric", NULL}}, + {"format.err.wildtoplevel", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_WILDTOPLEVEL (414) numeric", NULL}}, + {"format.err.unknowncommand", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_UNKNOWNCOMMAND (421) numeric", NULL}}, + {"format.err.nomotd", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOMOTD (422) numeric", NULL}}, + {"format.err.noadmininfo", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOADMININFO (423) numeric", NULL}}, + {"format.err.fileerror", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_FILEERROR (424) numeric", NULL}}, + {"format.err.nonicknamegiven", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NONICKNAMEGIVEN (431) numeric", NULL}}, + {"format.err.erroneusnickname", 1, Val_string, + .str = "Erroneous nickname: ${2}", + .strhandle = config_redraws, + .description = { + "Format of ERR_ERRONEUSNICKNAME (432) numeric", NULL}}, + {"format.err.nicknameinuse", 1, Val_string, + .str = "Nickname already in use: ${2}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NICKNAMEINUSE (433) numeric", NULL}}, + {"format.err.nickcollision", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NICKCOLLISION (436) numeric", NULL}}, + {"format.err.usernotinchannel", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_USERNOTINCHANNEL (441) numeric", NULL}}, + {"format.err.notonchannel", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOTONCHANNEL (442) numeric", NULL}}, + {"format.err.useronchannel", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_USERONCHANNEL (443) numeric", NULL}}, + {"format.err.nologin", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOLOGIN (444) numeric", NULL}}, + {"format.err.summondisabled", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_SUMMONDISABLED (445) numeric", NULL}}, + {"format.err.usersdisabled", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_USERSDISABLED (446) numeric", NULL}}, + {"format.err.notregistered", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOTREGISTERED (451) numeric", NULL}}, + {"format.err.needmoreparams", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NEEDMOREPARAMS (461) numeric", NULL}}, + {"format.err.alreadyregistred", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_ALREADYREGISTRED (462) numeric", NULL}}, + {"format.err.nopermforhost", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOPERMFORHOST (463) numeric", NULL}}, + {"format.err.passwdmismatch", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_PASSWDMISMATCH (464) numeric", NULL}}, + {"format.err.yourebannedcreep", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_YOUREBANNEDCREEP (465) numeric", NULL}}, + {"format.err.youwillbebanned", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_YOUWILLBEBANNED (466) numeric", NULL}}, + {"format.err.keyset", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_KEYSET (467) numeric", NULL}}, + {"format.err.channelisfull", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_CHANNELISFULL (471) numeric", NULL}}, + {"format.err.unknownmode", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_UNKNOWNMODE (472) numeric", NULL}}, + {"format.err.inviteonlychan", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_INVITEONLYCHAN (473) numeric", NULL}}, + {"format.err.bannedfromchan", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_BANNEDFROMCHAN (474) numeric", NULL}}, + {"format.err.badchannelkey", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_BADCHANNELKEY (475) numeric", NULL}}, + {"format.err.noprivileges", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOPRIVILEGES (481) numeric", NULL}}, + {"format.err.chanoprivsneeded", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_CHANOPRIVSNEEDED (482) numeric", NULL}}, + {"format.err.cantkillserver", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_CANTKILLSERVER (483) numeric", NULL}}, + {"format.err.nooperhost", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOOPERHOST (491) numeric", NULL}}, + {"format.err.noservicehost", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_NOSERVICEHOST (492) numeric", NULL}}, + {"format.err.umodeunknownflag", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_UMODEUNKNOWNFLAG (501) numeric", NULL}}, + {"format.err.usersdontmatch", 1, Val_string, + .str = "${2-}", + .strhandle = config_redraws, + .description = { + "Format of ERR_USERSDONTMATCH (502) numeric", NULL}}, + /* END: misc/rpl-conf-gen.awk */ + /* Modern numerics */ + {"format.rpl.localusers", 1, Val_string, + .str = "There are ${2} current local users, record of ${3}", + .strhandle = config_redraws, + .description = { + "Format of RPLS_LOCALUSERS (265) numeric", NULL}}, + {"format.rpl.globalusers", 1, Val_string, + .str = "There are ${2} current global users, record of ${3}", + .strhandle = config_redraws, + .description = { + "Format of RPL_GLOBALUSERS (266) numeric", NULL}}, + {"format.rpl.whoisspecial", 1, Val_string, + .str = " %{b}info %{b}: ${3}", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOISSPECIAL (320) numeric", NULL}}, + {"format.rpl.whoisaccount", 1, Val_string, + .str = " %{b}account %{b}: ${3}", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOISACCOUNT (330) numeric", NULL}}, + {"format.rpl.topicwhotime", 1, Val_string, + .str = "set by %{nick:${3}}${3}%{o} at %{time:%Y-%m-%d %H:%M:%S,${4}}", + .strhandle = config_redraws, + .description = { + "Format of RPL_TOPICWHOTIME (333) numeric", NULL}}, + {"format.rpl.whoisactually", 1, Val_string, + .str = " %{b}actually%{b}: ${3-}", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOISACTUALLY (338) numeric", NULL}}, + {"format.rpl.whoishost", 1, Val_string, + .str = " %{b}info %{b}: ${3}", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOISHOST (378) numeric", NULL}}, + {"format.rpl.whoismodes", 1, Val_string, + .str = " %{b}modes %{b}: ${3}", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOISMODES (379) numeric", NULL}}, + {"format.rpl.whoissecure", 1, Val_string, + .str = " %{b}secure %{b}: ${3}", + .strhandle = config_redraws, + .description = { + "Format of RPL_WHOISSECURE (671) numeric", NULL}}, + /* Default formats */ + {"format.rpl.other", 1, Val_string, + .str = "${cmd} ${2-}", + .strhandle = config_redraws, + .description = { + "Format of numerics without formats", NULL}}, + {"format.other", 1, Val_string, + .str = "${raw}", + .strhandle = config_redraws, + .description = { + "Format of other messages without formats", NULL}}, + {NULL}, +}; diff --git a/src/data/formats.h b/src/data/formats.h @@ -0,0 +1,226 @@ +/* + * src/data/format.h from hirc + * + * Copyright (c) 2021-2022 hhvn <dev@hhvn.uk> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +struct { + char *cmd; + char *format; +} formatmap[] = { + /* SELF_ commands from UI */ + {"SELF_ERROR", "format.ui.error"}, + {"SELF_UI", "format.ui.misc"}, + {"SELF_CONNECTLOST", "format.ui.connectlost"}, + {"SELF_CONNECTING", "format.ui.connecting"}, + {"SELF_CONNECTED", "format.ui.connected"}, + {"SELF_LOOKUPFAIL", "format.ui.lookupfail"}, + {"SELF_CONNECTFAIL", "format.ui.connectfail"}, +#ifndef TLS + {"SELF_TLSNOTCOMPILED", "format.ui.tls.notcompiled"}, +#else + {"SELF_TLS_VERSION", "format.ui.tls.version"}, + {"SELF_TLS_SNI", "format.ui.tls.sni"}, + {"SELF_TLS_ISSUER", "format.ui.tls.issuer"}, + {"SELF_TLS_SUBJECT", "format.ui.tls.subject"}, +#endif /* TLS */ + {"SELF_KEYBIND_START", "format.ui.keybind.start"}, + {"SELF_KEYBIND_LIST", "format.ui.keybind"}, + {"SELF_KEYBIND_END", "format.ui.keybind.end"}, + {"SELF_GREP_START", "format.ui.grep.start"}, + {"SELF_GREP_END", "format.ui.grep.end"}, + {"SELF_ALIAS_START", "format.ui.alias.start"}, + {"SELF_ALIAS_LIST", "format.ui.alias"}, + {"SELF_ALIAS_END", "format.ui.alias.end"}, + {"SELF_HELP_START", "format.ui.help.start"}, + {"SELF_HELP", "format.ui.help"}, + {"SELF_HELP_END", "format.ui.help.end"}, + {"SELF_AUTOCMDS_START", "format.ui.autocmds.start"}, + {"SELF_AUTOCMDS_LIST", "format.ui.autocmds"}, + {"SELF_AUTOCMDS_END", "format.ui.autocmds.end"}, + {"SELF_LOG_RESTORE", "format.ui.logrestore"}, + {"SELF_UNREAD", "format.ui.unread"}, + {"SELF_IGNORES_START", "format.ui.ignores.start"}, + {"SELF_IGNORES_LIST", "format.ui.ignores"}, + {"SELF_IGNORES_ADDED", "format.ui.ignores.added"}, + {"SELF_IGNORES_END", "format.ui.ignores.end"}, + /* Real commands/numerics from server */ + {"PRIVMSG", "format.privmsg"}, + {"NOTICE", "format.notice"}, + {"JOIN", "format.join"}, + {"PART", "format.part"}, + {"KICK", "format.kick"}, + {"QUIT", "format.quit"}, + {"NICK", "format.nick"}, + {"TOPIC", "format.topic"}, + {"INVITE", "format.invite"}, + {"PONG", "format.pong"}, + {"ERROR", "format.error"}, + /* START: misc/rpl-ui-gen.awk */ + {"200", "format.rpl.tracelink"}, + {"201", "format.rpl.traceconnecting"}, + {"202", "format.rpl.tracehandshake"}, + {"203", "format.rpl.traceunknown"}, + {"204", "format.rpl.traceoperator"}, + {"205", "format.rpl.traceuser"}, + {"206", "format.rpl.traceserver"}, + {"208", "format.rpl.tracenewtype"}, + {"209", "format.rpl.traceclass"}, + {"211", "format.rpl.statslinkinfo"}, + {"212", "format.rpl.statscommands"}, + {"213", "format.rpl.statscline"}, + {"214", "format.rpl.statsnline"}, + {"215", "format.rpl.statsiline"}, + {"216", "format.rpl.statskline"}, + {"218", "format.rpl.statsyline"}, + {"219", "format.rpl.endofstats"}, + {"221", "format.rpl.umodeis"}, + {"231", "format.rpl.serviceinfo"}, + {"233", "format.rpl.service"}, + {"235", "format.rpl.servlistend"}, + {"241", "format.rpl.statslline"}, + {"242", "format.rpl.statsuptime"}, + {"243", "format.rpl.statsoline"}, + {"244", "format.rpl.statshline"}, + {"251", "format.rpl.luserclient"}, + {"252", "format.rpl.luserop"}, + {"253", "format.rpl.luserunknown"}, + {"254", "format.rpl.luserchannels"}, + {"255", "format.rpl.luserme"}, + {"256", "format.rpl.adminme"}, + {"257", "format.rpl.adminloc1"}, + {"258", "format.rpl.adminloc2"}, + {"259", "format.rpl.adminemail"}, + {"261", "format.rpl.tracelog"}, + {"300", "format.rpl.none"}, + {"301", "format.rpl.away"}, + {"302", "format.rpl.userhost"}, + {"303", "format.rpl.ison"}, + {"305", "format.rpl.unaway"}, + {"306", "format.rpl.nowaway"}, + {"311", "format.rpl.whoisuser"}, + {"312", "format.rpl.whoisserver"}, + {"313", "format.rpl.whoisoperator"}, + {"314", "format.rpl.whowasuser"}, + {"315", "format.rpl.endofwho"}, + {"316", "format.rpl.whoischanop"}, + {"317", "format.rpl.whoisidle"}, + {"318", "format.rpl.endofwhois"}, + {"319", "format.rpl.whoischannels"}, + {"321", "format.rpl.liststart"}, + {"322", "format.rpl.list"}, + {"323", "format.rpl.listend"}, + {"324", "format.rpl.channelmodeis"}, + {"331", "format.rpl.notopic"}, + {"332", "format.rpl.topic"}, + {"341", "format.rpl.inviting"}, + {"342", "format.rpl.summoning"}, + {"351", "format.rpl.version"}, + {"352", "format.rpl.whoreply"}, + {"353", "format.rpl.namreply"}, + {"362", "format.rpl.closing"}, + {"364", "format.rpl.links"}, + {"365", "format.rpl.endoflinks"}, + {"366", "format.rpl.endofnames"}, + {"367", "format.rpl.banlist"}, + {"368", "format.rpl.endofbanlist"}, + {"369", "format.rpl.endofwhowas"}, + {"371", "format.rpl.info"}, + {"372", "format.rpl.motd"}, + {"373", "format.rpl.infostart"}, + {"374", "format.rpl.endofinfo"}, + {"375", "format.rpl.motdstart"}, + {"376", "format.rpl.endofmotd"}, + {"381", "format.rpl.youreoper"}, + {"382", "format.rpl.rehashing"}, + {"391", "format.rpl.time"}, + {"392", "format.rpl.usersstart"}, + {"393", "format.rpl.users"}, + {"394", "format.rpl.endofusers"}, + {"395", "format.rpl.nousers"}, + {"401", "format.err.nosuchnick"}, + {"402", "format.err.nosuchserver"}, + {"403", "format.err.nosuchchannel"}, + {"404", "format.err.cannotsendtochan"}, + {"405", "format.err.toomanychannels"}, + {"406", "format.err.wasnosuchnick"}, + {"407", "format.err.toomanytargets"}, + {"409", "format.err.noorigin"}, + {"411", "format.err.norecipient"}, + {"412", "format.err.notexttosend"}, + {"413", "format.err.notoplevel"}, + {"414", "format.err.wildtoplevel"}, + {"421", "format.err.unknowncommand"}, + {"422", "format.err.nomotd"}, + {"423", "format.err.noadmininfo"}, + {"424", "format.err.fileerror"}, + {"431", "format.err.nonicknamegiven"}, + {"432", "format.err.erroneusnickname"}, + {"433", "format.err.nicknameinuse"}, + {"436", "format.err.nickcollision"}, + {"441", "format.err.usernotinchannel"}, + {"442", "format.err.notonchannel"}, + {"443", "format.err.useronchannel"}, + {"444", "format.err.nologin"}, + {"445", "format.err.summondisabled"}, + {"446", "format.err.usersdisabled"}, + {"451", "format.err.notregistered"}, + {"461", "format.err.needmoreparams"}, + {"462", "format.err.alreadyregistred"}, + {"463", "format.err.nopermforhost"}, + {"464", "format.err.passwdmismatch"}, + {"465", "format.err.yourebannedcreep"}, + {"466", "format.err.youwillbebanned"}, + {"467", "format.err.keyset"}, + {"471", "format.err.channelisfull"}, + {"472", "format.err.unknownmode"}, + {"473", "format.err.inviteonlychan"}, + {"474", "format.err.bannedfromchan"}, + {"475", "format.err.badchannelkey"}, + {"481", "format.err.noprivileges"}, + {"482", "format.err.chanoprivsneeded"}, + {"483", "format.err.cantkillserver"}, + {"491", "format.err.nooperhost"}, + {"492", "format.err.noservicehost"}, + {"501", "format.err.umodeunknownflag"}, + {"502", "format.err.usersdontmatch"}, + /* END: misc/rpl-ui-gen.awk */ + /* Modern stuff */ + {"001", "format.rpl.welcome"}, + {"002", "format.rpl.yourhost"}, + {"003", "format.rpl.created"}, + {"004", "format.rpl.myinfo"}, + {"005", "format.rpl.isupport"}, + {"006", "format.rpl.map"}, /* I'm not so sure if 006 and 007 */ + {"007", "format.rpl.mapend"}, /* are really exclusive to /map */ + {"265", "format.rpl.localusers"}, + {"266", "format.rpl.globalusers"}, + {"320", "format.rpl.whoisspecial"}, + {"330", "format.rpl.whoisaccount"}, + {"333", "format.rpl.topicwhotime"}, + {"338", "format.rpl.whoisactually"}, + {"378", "format.rpl.whoishost"}, + {"379", "format.rpl.whoismodes"}, + {"671", "format.rpl.whoissecure"}, + /* Pseudo commands for specific formatting */ + {"MODE-NICK-SELF", "format.mode.nick.self"}, + {"MODE-NICK", "format.mode.nick"}, + {"MODE-CHANNEL", "format.mode.channel"}, + {"PRIVMSG-ACTION", "format.action"}, + {"PRIVMSG-CTCP", "format.ctcp.request"}, + {"NOTICE-CTCP", "format.ctcp.answer"}, + {NULL, NULL}, +}; diff --git a/src/data/handlers.h b/src/data/handlers.h @@ -0,0 +1,83 @@ +/* + * src/data/handle.h from hirc + * + * Copyright (c) 2021-2022 hhvn <dev@hhvn.uk> + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +#define HANDLER(func) static void func(struct Server *server, struct History *msg) +HANDLER(handle_ERROR); +HANDLER(handle_PING); +HANDLER(handle_PONG); +HANDLER(handle_JOIN); +HANDLER(handle_PART); +HANDLER(handle_KICK); +HANDLER(handle_QUIT); +HANDLER(handle_NICK); +HANDLER(handle_MODE); +HANDLER(handle_TOPIC); +HANDLER(handle_PRIVMSG); +HANDLER(handle_INVITE); +HANDLER(handle_RPL_WELCOME); +HANDLER(handle_RPL_ISUPPORT); +HANDLER(handle_RPL_CHANNELMODEIS); +HANDLER(handle_RPL_NOTOPIC); +HANDLER(handle_RPL_TOPIC); +HANDLER(handle_RPL_TOPICWHOTIME); +HANDLER(handle_RPL_INVITING); +HANDLER(handle_RPL_NAMREPLY); +HANDLER(handle_RPL_ENDOFNAMES); +HANDLER(handle_RPL_MOTD); +HANDLER(handle_RPL_ENDOFMOTD); +HANDLER(handle_ERR_NOSUCHNICK); +HANDLER(handle_ERR_NICKNAMEINUSE); +HANDLER(handle_RPL_AWAY); + +struct Ignore *ignores = NULL; +struct Handler handlers[] = { + { "ERROR", handle_ERROR }, + { "PING", handle_PING }, + { "PONG", handle_PONG }, + { "JOIN", handle_JOIN }, + { "PART", handle_PART }, + { "KICK", handle_KICK }, + { "QUIT", handle_QUIT }, + { "NICK", handle_NICK }, + { "MODE", handle_MODE }, + { "TOPIC", handle_TOPIC }, + { "PRIVMSG", handle_PRIVMSG }, + { "NOTICE", handle_PRIVMSG }, + { "INVITE", handle_INVITE }, + { "001", handle_RPL_WELCOME }, + { "005", handle_RPL_ISUPPORT }, + { "301", handle_RPL_AWAY }, + { "324", handle_RPL_CHANNELMODEIS }, + { "331", handle_RPL_NOTOPIC }, + { "329", NULL }, /* ignore this: + * - it's nonstandard + * - hirc has no use for it currently + * - it's annoyingly sent after MODE */ + { "332", handle_RPL_TOPIC }, + { "333", handle_RPL_TOPICWHOTIME }, + { "341", handle_RPL_INVITING }, + { "353", handle_RPL_NAMREPLY }, + { "366", handle_RPL_ENDOFNAMES }, + { "372", handle_RPL_MOTD }, + { "375", handle_RPL_MOTD }, /* RPL_MOTDSTART, but handle it the same way as RPL_MOTD */ + { "376", handle_RPL_ENDOFMOTD }, + { "401", handle_ERR_NOSUCHNICK }, + { "433", handle_ERR_NICKNAMEINUSE }, + { NULL, NULL }, +}; diff --git a/src/format.c b/src/format.c @@ -21,214 +21,7 @@ #include <stdlib.h> #include <ctype.h> #include "hirc.h" - -struct { - char *cmd; - char *format; -} formatmap[] = { - /* SELF_ commands from UI */ - {"SELF_ERROR", "format.ui.error"}, - {"SELF_UI", "format.ui.misc"}, - {"SELF_CONNECTLOST", "format.ui.connectlost"}, - {"SELF_CONNECTING", "format.ui.connecting"}, - {"SELF_CONNECTED", "format.ui.connected"}, - {"SELF_LOOKUPFAIL", "format.ui.lookupfail"}, - {"SELF_CONNECTFAIL", "format.ui.connectfail"}, -#ifndef TLS - {"SELF_TLSNOTCOMPILED", "format.ui.tls.notcompiled"}, -#else - {"SELF_TLS_VERSION", "format.ui.tls.version"}, - {"SELF_TLS_SNI", "format.ui.tls.sni"}, - {"SELF_TLS_ISSUER", "format.ui.tls.issuer"}, - {"SELF_TLS_SUBJECT", "format.ui.tls.subject"}, -#endif /* TLS */ - {"SELF_KEYBIND_START", "format.ui.keybind.start"}, - {"SELF_KEYBIND_LIST", "format.ui.keybind"}, - {"SELF_KEYBIND_END", "format.ui.keybind.end"}, - {"SELF_GREP_START", "format.ui.grep.start"}, - {"SELF_GREP_END", "format.ui.grep.end"}, - {"SELF_ALIAS_START", "format.ui.alias.start"}, - {"SELF_ALIAS_LIST", "format.ui.alias"}, - {"SELF_ALIAS_END", "format.ui.alias.end"}, - {"SELF_HELP_START", "format.ui.help.start"}, - {"SELF_HELP", "format.ui.help"}, - {"SELF_HELP_END", "format.ui.help.end"}, - {"SELF_AUTOCMDS_START", "format.ui.autocmds.start"}, - {"SELF_AUTOCMDS_LIST", "format.ui.autocmds"}, - {"SELF_AUTOCMDS_END", "format.ui.autocmds.end"}, - {"SELF_LOG_RESTORE", "format.ui.logrestore"}, - {"SELF_UNREAD", "format.ui.unread"}, - {"SELF_IGNORES_START", "format.ui.ignores.start"}, - {"SELF_IGNORES_LIST", "format.ui.ignores"}, - {"SELF_IGNORES_ADDED", "format.ui.ignores.added"}, - {"SELF_IGNORES_END", "format.ui.ignores.end"}, - /* Real commands/numerics from server */ - {"PRIVMSG", "format.privmsg"}, - {"NOTICE", "format.notice"}, - {"JOIN", "format.join"}, - {"PART", "format.part"}, - {"KICK", "format.kick"}, - {"QUIT", "format.quit"}, - {"NICK", "format.nick"}, - {"TOPIC", "format.topic"}, - {"INVITE", "format.invite"}, - {"PONG", "format.pong"}, - {"ERROR", "format.error"}, - /* START: misc/rpl-ui-gen.awk */ - {"200", "format.rpl.tracelink"}, - {"201", "format.rpl.traceconnecting"}, - {"202", "format.rpl.tracehandshake"}, - {"203", "format.rpl.traceunknown"}, - {"204", "format.rpl.traceoperator"}, - {"205", "format.rpl.traceuser"}, - {"206", "format.rpl.traceserver"}, - {"208", "format.rpl.tracenewtype"}, - {"209", "format.rpl.traceclass"}, - {"211", "format.rpl.statslinkinfo"}, - {"212", "format.rpl.statscommands"}, - {"213", "format.rpl.statscline"}, - {"214", "format.rpl.statsnline"}, - {"215", "format.rpl.statsiline"}, - {"216", "format.rpl.statskline"}, - {"218", "format.rpl.statsyline"}, - {"219", "format.rpl.endofstats"}, - {"221", "format.rpl.umodeis"}, - {"231", "format.rpl.serviceinfo"}, - {"233", "format.rpl.service"}, - {"235", "format.rpl.servlistend"}, - {"241", "format.rpl.statslline"}, - {"242", "format.rpl.statsuptime"}, - {"243", "format.rpl.statsoline"}, - {"244", "format.rpl.statshline"}, - {"251", "format.rpl.luserclient"}, - {"252", "format.rpl.luserop"}, - {"253", "format.rpl.luserunknown"}, - {"254", "format.rpl.luserchannels"}, - {"255", "format.rpl.luserme"}, - {"256", "format.rpl.adminme"}, - {"257", "format.rpl.adminloc1"}, - {"258", "format.rpl.adminloc2"}, - {"259", "format.rpl.adminemail"}, - {"261", "format.rpl.tracelog"}, - {"300", "format.rpl.none"}, - {"301", "format.rpl.away"}, - {"302", "format.rpl.userhost"}, - {"303", "format.rpl.ison"}, - {"305", "format.rpl.unaway"}, - {"306", "format.rpl.nowaway"}, - {"311", "format.rpl.whoisuser"}, - {"312", "format.rpl.whoisserver"}, - {"313", "format.rpl.whoisoperator"}, - {"314", "format.rpl.whowasuser"}, - {"315", "format.rpl.endofwho"}, - {"316", "format.rpl.whoischanop"}, - {"317", "format.rpl.whoisidle"}, - {"318", "format.rpl.endofwhois"}, - {"319", "format.rpl.whoischannels"}, - {"321", "format.rpl.liststart"}, - {"322", "format.rpl.list"}, - {"323", "format.rpl.listend"}, - {"324", "format.rpl.channelmodeis"}, - {"331", "format.rpl.notopic"}, - {"332", "format.rpl.topic"}, - {"341", "format.rpl.inviting"}, - {"342", "format.rpl.summoning"}, - {"351", "format.rpl.version"}, - {"352", "format.rpl.whoreply"}, - {"353", "format.rpl.namreply"}, - {"362", "format.rpl.closing"}, - {"364", "format.rpl.links"}, - {"365", "format.rpl.endoflinks"}, - {"366", "format.rpl.endofnames"}, - {"367", "format.rpl.banlist"}, - {"368", "format.rpl.endofbanlist"}, - {"369", "format.rpl.endofwhowas"}, - {"371", "format.rpl.info"}, - {"372", "format.rpl.motd"}, - {"373", "format.rpl.infostart"}, - {"374", "format.rpl.endofinfo"}, - {"375", "format.rpl.motdstart"}, - {"376", "format.rpl.endofmotd"}, - {"381", "format.rpl.youreoper"}, - {"382", "format.rpl.rehashing"}, - {"391", "format.rpl.time"}, - {"392", "format.rpl.usersstart"}, - {"393", "format.rpl.users"}, - {"394", "format.rpl.endofusers"}, - {"395", "format.rpl.nousers"}, - {"401", "format.err.nosuchnick"}, - {"402", "format.err.nosuchserver"}, - {"403", "format.err.nosuchchannel"}, - {"404", "format.err.cannotsendtochan"}, - {"405", "format.err.toomanychannels"}, - {"406", "format.err.wasnosuchnick"}, - {"407", "format.err.toomanytargets"}, - {"409", "format.err.noorigin"}, - {"411", "format.err.norecipient"}, - {"412", "format.err.notexttosend"}, - {"413", "format.err.notoplevel"}, - {"414", "format.err.wildtoplevel"}, - {"421", "format.err.unknowncommand"}, - {"422", "format.err.nomotd"}, - {"423", "format.err.noadmininfo"}, - {"424", "format.err.fileerror"}, - {"431", "format.err.nonicknamegiven"}, - {"432", "format.err.erroneusnickname"}, - {"433", "format.err.nicknameinuse"}, - {"436", "format.err.nickcollision"}, - {"441", "format.err.usernotinchannel"}, - {"442", "format.err.notonchannel"}, - {"443", "format.err.useronchannel"}, - {"444", "format.err.nologin"}, - {"445", "format.err.summondisabled"}, - {"446", "format.err.usersdisabled"}, - {"451", "format.err.notregistered"}, - {"461", "format.err.needmoreparams"}, - {"462", "format.err.alreadyregistred"}, - {"463", "format.err.nopermforhost"}, - {"464", "format.err.passwdmismatch"}, - {"465", "format.err.yourebannedcreep"}, - {"466", "format.err.youwillbebanned"}, - {"467", "format.err.keyset"}, - {"471", "format.err.channelisfull"}, - {"472", "format.err.unknownmode"}, - {"473", "format.err.inviteonlychan"}, - {"474", "format.err.bannedfromchan"}, - {"475", "format.err.badchannelkey"}, - {"481", "format.err.noprivileges"}, - {"482", "format.err.chanoprivsneeded"}, - {"483", "format.err.cantkillserver"}, - {"491", "format.err.nooperhost"}, - {"492", "format.err.noservicehost"}, - {"501", "format.err.umodeunknownflag"}, - {"502", "format.err.usersdontmatch"}, - /* END: misc/rpl-ui-gen.awk */ - /* Modern stuff */ - {"001", "format.rpl.welcome"}, - {"002", "format.rpl.yourhost"}, - {"003", "format.rpl.created"}, - {"004", "format.rpl.myinfo"}, - {"005", "format.rpl.isupport"}, - {"006", "format.rpl.map"}, /* I'm not so sure if 006 and 007 */ - {"007", "format.rpl.mapend"}, /* are really exclusive to /map */ - {"265", "format.rpl.localusers"}, - {"266", "format.rpl.globalusers"}, - {"320", "format.rpl.whoisspecial"}, - {"330", "format.rpl.whoisaccount"}, - {"333", "format.rpl.topicwhotime"}, - {"338", "format.rpl.whoisactually"}, - {"378", "format.rpl.whoishost"}, - {"379", "format.rpl.whoismodes"}, - {"671", "format.rpl.whoissecure"}, - /* Pseudo commands for specific formatting */ - {"MODE-NICK-SELF", "format.mode.nick.self"}, - {"MODE-NICK", "format.mode.nick"}, - {"MODE-CHANNEL", "format.mode.channel"}, - {"PRIVMSG-ACTION", "format.action"}, - {"PRIVMSG-CTCP", "format.ctcp.request"}, - {"NOTICE-CTCP", "format.ctcp.answer"}, - {NULL, NULL}, -}; +#include "data/formats.h" char * format_get_bufact(int activity) { diff --git a/src/handle.c b/src/handle.c @@ -22,71 +22,7 @@ #include <string.h> #include <stdlib.h> #include "hirc.h" - -#define HANDLER(func) static void func(struct Server *server, struct History *msg) -HANDLER(handle_ERROR); -HANDLER(handle_PING); -HANDLER(handle_PONG); -HANDLER(handle_JOIN); -HANDLER(handle_PART); -HANDLER(handle_KICK); -HANDLER(handle_QUIT); -HANDLER(handle_NICK); -HANDLER(handle_MODE); -HANDLER(handle_TOPIC); -HANDLER(handle_PRIVMSG); -HANDLER(handle_INVITE); -HANDLER(handle_RPL_WELCOME); -HANDLER(handle_RPL_ISUPPORT); -HANDLER(handle_RPL_CHANNELMODEIS); -HANDLER(handle_RPL_NOTOPIC); -HANDLER(handle_RPL_TOPIC); -HANDLER(handle_RPL_TOPICWHOTIME); -HANDLER(handle_RPL_INVITING); -HANDLER(handle_RPL_NAMREPLY); -HANDLER(handle_RPL_ENDOFNAMES); -HANDLER(handle_RPL_MOTD); -HANDLER(handle_RPL_ENDOFMOTD); -HANDLER(handle_ERR_NOSUCHNICK); -HANDLER(handle_ERR_NICKNAMEINUSE); -HANDLER(handle_RPL_AWAY); - -struct Ignore *ignores = NULL; -struct Handler handlers[] = { - { "ERROR", handle_ERROR }, - { "PING", handle_PING }, - { "PONG", handle_PONG }, - { "JOIN", handle_JOIN }, - { "PART", handle_PART }, - { "KICK", handle_KICK }, - { "QUIT", handle_QUIT }, - { "NICK", handle_NICK }, - { "MODE", handle_MODE }, - { "TOPIC", handle_TOPIC }, - { "PRIVMSG", handle_PRIVMSG }, - { "NOTICE", handle_PRIVMSG }, - { "INVITE", handle_INVITE }, - { "001", handle_RPL_WELCOME }, - { "005", handle_RPL_ISUPPORT }, - { "301", handle_RPL_AWAY }, - { "324", handle_RPL_CHANNELMODEIS }, - { "331", handle_RPL_NOTOPIC }, - { "329", NULL }, /* ignore this: - * - it's nonstandard - * - hirc has no use for it currently - * - it's annoyingly sent after MODE */ - { "332", handle_RPL_TOPIC }, - { "333", handle_RPL_TOPICWHOTIME }, - { "341", handle_RPL_INVITING }, - { "353", handle_RPL_NAMREPLY }, - { "366", handle_RPL_ENDOFNAMES }, - { "372", handle_RPL_MOTD }, - { "375", handle_RPL_MOTD }, /* RPL_MOTDSTART, but handle it the same way as RPL_MOTD */ - { "376", handle_RPL_ENDOFMOTD }, - { "401", handle_ERR_NOSUCHNICK }, - { "433", handle_ERR_NICKNAMEINUSE }, - { NULL, NULL }, -}; +#include "data/handlers.h" HANDLER( handle_PING) {