hirc

[archived] IRC client
git clone https://hhvn.uk/hirc
git clone git://hhvn.uk/hirc
Log | Files | Refs

formats.h (8598B)


      1 /*
      2  * src/data/format.h from hirc
      3  *
      4  * Copyright (c) 2021-2022 hhvn <dev@hhvn.uk>
      5  *
      6  * Permission to use, copy, modify, and distribute this software for any
      7  * purpose with or without fee is hereby granted, provided that the above
      8  * copyright notice and this permission notice appear in all copies.
      9  *
     10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     11  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     12  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     13  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     14  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     15  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     16  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     17  *
     18  */
     19 
     20 struct {
     21 	char *cmd;
     22 	char *format;
     23 } formatmap[] = {
     24 	/* SELF_ commands from UI */
     25 	{"SELF_ERROR",		"format.ui.error"},
     26 	{"SELF_UI",		"format.ui.misc"},
     27 	{"SELF_CONNECTLOST",	"format.ui.connectlost"},
     28 	{"SELF_CONNECTING",	"format.ui.connecting"},
     29 	{"SELF_CONNECTED",	"format.ui.connected"},
     30 	{"SELF_LOOKUPFAIL",	"format.ui.lookupfail"},
     31 	{"SELF_CONNECTFAIL",	"format.ui.connectfail"},
     32 #ifndef TLS
     33 	{"SELF_TLSNOTCOMPILED",	"format.ui.tls.notcompiled"},
     34 #else
     35 	{"SELF_TLS_VERSION",	"format.ui.tls.version"},
     36 	{"SELF_TLS_SNI",	"format.ui.tls.sni"},
     37 	{"SELF_TLS_ISSUER",	"format.ui.tls.issuer"},
     38 	{"SELF_TLS_SUBJECT",	"format.ui.tls.subject"},
     39 #endif /* TLS */
     40 	{"SELF_KEYBIND_START",	"format.ui.keybind.start"},
     41 	{"SELF_KEYBIND_LIST",	"format.ui.keybind"},
     42 	{"SELF_KEYBIND_END",	"format.ui.keybind.end"},
     43 	{"SELF_GREP_START",	"format.ui.grep.start"},
     44 	{"SELF_GREP_END",	"format.ui.grep.end"},
     45 	{"SELF_ALIAS_START",	"format.ui.alias.start"},
     46 	{"SELF_ALIAS_LIST",	"format.ui.alias"},
     47 	{"SELF_ALIAS_END",	"format.ui.alias.end"},
     48 	{"SELF_HELP_START",	"format.ui.help.start"},
     49 	{"SELF_HELP",		"format.ui.help"},
     50 	{"SELF_HELP_END",	"format.ui.help.end"},
     51 	{"SELF_AUTOCMDS_START",	"format.ui.autocmds.start"},
     52 	{"SELF_AUTOCMDS_LIST",	"format.ui.autocmds"},
     53 	{"SELF_AUTOCMDS_END",	"format.ui.autocmds.end"},
     54 	{"SELF_LOG_RESTORE",	"format.ui.logrestore"},
     55 	{"SELF_NEW_DAY",	"format.ui.newday"},
     56 	{"SELF_UNREAD",		"format.ui.unread"},
     57 	{"SELF_IGNORES_START",	"format.ui.ignores.start"},
     58 	{"SELF_IGNORES_LIST",	"format.ui.ignores"},
     59 	{"SELF_IGNORES_ADDED",	"format.ui.ignores.added"},
     60 	{"SELF_IGNORES_END",	"format.ui.ignores.end"},
     61 	/* Real commands/numerics from server */
     62 	{"PRIVMSG", 		"format.privmsg"},
     63 	{"NOTICE",		"format.notice"},
     64 	{"JOIN",		"format.join"},
     65 	{"PART",		"format.part"},
     66 	{"KICK",		"format.kick"},
     67 	{"QUIT",		"format.quit"},
     68 	{"NICK",		"format.nick"},
     69 	{"TOPIC",		"format.topic"},
     70 	{"INVITE",		"format.invite"},
     71 	{"PONG",		"format.pong"},
     72 	{"ERROR",		"format.error"},
     73 	/* START: misc/rpl-ui-gen.awk */
     74 	{"200",			"format.rpl.tracelink"},
     75 	{"201",			"format.rpl.traceconnecting"},
     76 	{"202",			"format.rpl.tracehandshake"},
     77 	{"203",			"format.rpl.traceunknown"},
     78 	{"204",			"format.rpl.traceoperator"},
     79 	{"205",			"format.rpl.traceuser"},
     80 	{"206",			"format.rpl.traceserver"},
     81 	{"208",			"format.rpl.tracenewtype"},
     82 	{"209",			"format.rpl.traceclass"},
     83 	{"211",			"format.rpl.statslinkinfo"},
     84 	{"212",			"format.rpl.statscommands"},
     85 	{"213",			"format.rpl.statscline"},
     86 	{"214",			"format.rpl.statsnline"},
     87 	{"215",			"format.rpl.statsiline"},
     88 	{"216",			"format.rpl.statskline"},
     89 	{"218",			"format.rpl.statsyline"},
     90 	{"219",			"format.rpl.endofstats"},
     91 	{"221",			"format.rpl.umodeis"},
     92 	{"231",			"format.rpl.serviceinfo"},
     93 	{"233",			"format.rpl.service"},
     94 	{"235",			"format.rpl.servlistend"},
     95 	{"241",			"format.rpl.statslline"},
     96 	{"242",			"format.rpl.statsuptime"},
     97 	{"243",			"format.rpl.statsoline"},
     98 	{"244",			"format.rpl.statshline"},
     99 	{"251",			"format.rpl.luserclient"},
    100 	{"252",			"format.rpl.luserop"},
    101 	{"253",			"format.rpl.luserunknown"},
    102 	{"254",			"format.rpl.luserchannels"},
    103 	{"255",			"format.rpl.luserme"},
    104 	{"256",			"format.rpl.adminme"},
    105 	{"257",			"format.rpl.adminloc1"},
    106 	{"258",			"format.rpl.adminloc2"},
    107 	{"259",			"format.rpl.adminemail"},
    108 	{"261",			"format.rpl.tracelog"},
    109 	{"300",			"format.rpl.none"},
    110 	{"301",			"format.rpl.away"},
    111 	{"302",			"format.rpl.userhost"},
    112 	{"303",			"format.rpl.ison"},
    113 	{"305",			"format.rpl.unaway"},
    114 	{"306",			"format.rpl.nowaway"},
    115 	{"311",			"format.rpl.whoisuser"},
    116 	{"312",			"format.rpl.whoisserver"},
    117 	{"313",			"format.rpl.whoisoperator"},
    118 	{"314",			"format.rpl.whowasuser"},
    119 	{"315",			"format.rpl.endofwho"},
    120 	{"316",			"format.rpl.whoischanop"},
    121 	{"317",			"format.rpl.whoisidle"},
    122 	{"318",			"format.rpl.endofwhois"},
    123 	{"319",			"format.rpl.whoischannels"},
    124 	{"321",			"format.rpl.liststart"},
    125 	{"322",			"format.rpl.list"},
    126 	{"323",			"format.rpl.listend"},
    127 	{"324",			"format.rpl.channelmodeis"},
    128 	{"331",			"format.rpl.notopic"},
    129 	{"332",			"format.rpl.topic"},
    130 	{"341",			"format.rpl.inviting"},
    131 	{"342",			"format.rpl.summoning"},
    132 	{"351",			"format.rpl.version"},
    133 	{"352",			"format.rpl.whoreply"},
    134 	{"353",			"format.rpl.namreply"},
    135 	{"362",			"format.rpl.closing"},
    136 	{"364",			"format.rpl.links"},
    137 	{"365",			"format.rpl.endoflinks"},
    138 	{"366",			"format.rpl.endofnames"},
    139 	{"367",			"format.rpl.banlist"},
    140 	{"368",			"format.rpl.endofbanlist"},
    141 	{"369",			"format.rpl.endofwhowas"},
    142 	{"371",			"format.rpl.info"},
    143 	{"372",			"format.rpl.motd"},
    144 	{"373",			"format.rpl.infostart"},
    145 	{"374",			"format.rpl.endofinfo"},
    146 	{"375",			"format.rpl.motdstart"},
    147 	{"376",			"format.rpl.endofmotd"},
    148 	{"381",			"format.rpl.youreoper"},
    149 	{"382",			"format.rpl.rehashing"},
    150 	{"391",			"format.rpl.time"},
    151 	{"392",			"format.rpl.usersstart"},
    152 	{"393",			"format.rpl.users"},
    153 	{"394",			"format.rpl.endofusers"},
    154 	{"395",			"format.rpl.nousers"},
    155 	{"401",			"format.err.nosuchnick"},
    156 	{"402",			"format.err.nosuchserver"},
    157 	{"403",			"format.err.nosuchchannel"},
    158 	{"404",			"format.err.cannotsendtochan"},
    159 	{"405",			"format.err.toomanychannels"},
    160 	{"406",			"format.err.wasnosuchnick"},
    161 	{"407",			"format.err.toomanytargets"},
    162 	{"409",			"format.err.noorigin"},
    163 	{"411",			"format.err.norecipient"},
    164 	{"412",			"format.err.notexttosend"},
    165 	{"413",			"format.err.notoplevel"},
    166 	{"414",			"format.err.wildtoplevel"},
    167 	{"421",			"format.err.unknowncommand"},
    168 	{"422",			"format.err.nomotd"},
    169 	{"423",			"format.err.noadmininfo"},
    170 	{"424",			"format.err.fileerror"},
    171 	{"431",			"format.err.nonicknamegiven"},
    172 	{"432",			"format.err.erroneusnickname"},
    173 	{"433",			"format.err.nicknameinuse"},
    174 	{"436",			"format.err.nickcollision"},
    175 	{"441",			"format.err.usernotinchannel"},
    176 	{"442",			"format.err.notonchannel"},
    177 	{"443",			"format.err.useronchannel"},
    178 	{"444",			"format.err.nologin"},
    179 	{"445",			"format.err.summondisabled"},
    180 	{"446",			"format.err.usersdisabled"},
    181 	{"451",			"format.err.notregistered"},
    182 	{"461",			"format.err.needmoreparams"},
    183 	{"462",			"format.err.alreadyregistred"},
    184 	{"463",			"format.err.nopermforhost"},
    185 	{"464",			"format.err.passwdmismatch"},
    186 	{"465",			"format.err.yourebannedcreep"},
    187 	{"466",			"format.err.youwillbebanned"},
    188 	{"467",			"format.err.keyset"},
    189 	{"471",			"format.err.channelisfull"},
    190 	{"472",			"format.err.unknownmode"},
    191 	{"473",			"format.err.inviteonlychan"},
    192 	{"474",			"format.err.bannedfromchan"},
    193 	{"475",			"format.err.badchannelkey"},
    194 	{"481",			"format.err.noprivileges"},
    195 	{"482",			"format.err.chanoprivsneeded"},
    196 	{"483",			"format.err.cantkillserver"},
    197 	{"491",			"format.err.nooperhost"},
    198 	{"492",			"format.err.noservicehost"},
    199 	{"501",			"format.err.umodeunknownflag"},
    200 	{"502",			"format.err.usersdontmatch"},
    201 	/* END: misc/rpl-ui-gen.awk */
    202 	/* Modern stuff */
    203 	{"001",			"format.rpl.welcome"},
    204 	{"002",			"format.rpl.yourhost"},
    205 	{"003",			"format.rpl.created"},
    206 	{"004",			"format.rpl.myinfo"},
    207 	{"005",			"format.rpl.isupport"},
    208 	{"006",			"format.rpl.map"},    /* I'm not so sure if 006 and 007 */
    209 	{"007",			"format.rpl.mapend"}, /* are really exclusive to /map   */
    210 	{"265",			"format.rpl.localusers"},
    211 	{"266",			"format.rpl.globalusers"},
    212 	{"320",			"format.rpl.whoisspecial"},
    213 	{"330",			"format.rpl.whoisaccount"},
    214 	{"333",			"format.rpl.topicwhotime"},
    215 	{"338",			"format.rpl.whoisactually"},
    216 	{"378",			"format.rpl.whoishost"},
    217 	{"379",			"format.rpl.whoismodes"},
    218 	{"671",			"format.rpl.whoissecure"},
    219 	/* Pseudo commands for specific formatting */
    220 	{"MODE-NICK-SELF",	"format.mode.nick.self"},
    221 	{"MODE-NICK",		"format.mode.nick"},
    222 	{"MODE-CHANNEL",	"format.mode.channel"},
    223 	{"PRIVMSG-ACTION",	"format.action"},
    224 	{"PRIVMSG-CTCP",	"format.ctcp.request"},
    225 	{"NOTICE-CTCP",		"format.ctcp.answer"},
    226 	{NULL,			NULL},
    227 };