ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/branches/8.2.x/src/numeric.c
Revision: 6570
Committed: Tue Oct 13 17:58:46 2015 UTC (8 years, 5 months ago) by michael
Content type: text/x-csrc
File size: 13315 byte(s)
Log Message:
- Add dissect_time() from HOPM and make use of it in some places

File Contents

# User Rev Content
1 adx 30 /*
2 michael 2848 * ircd-hybrid: an advanced, lightweight Internet Relay Chat Daemon (ircd)
3 adx 30 *
4 michael 5346 * Copyright (c) 1997-2015 ircd-hybrid development team
5 adx 30 *
6     * This program is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * This program is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with this program; if not, write to the Free Software
18 michael 4564 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19 adx 30 * USA
20     */
21    
22 michael 2848 /*! \file numeric.c
23     * \brief Declarations of numeric replies.
24     * \version $Id$
25     */
26    
27 adx 30 #include "stdinc.h"
28     #include "numeric.h"
29 michael 1834
30    
31 michael 2848 static const char *const replies[] =
32     {
33 michael 5803 /* 001 */ [RPL_WELCOME] = ":Welcome to the %s Internet Relay Chat Network %s",
34     /* 002 */ [RPL_YOURHOST] = ":Your host is %s, running version %s",
35     /* 003 */ [RPL_CREATED] = ":This server was created %s",
36     /* 004 */ [RPL_MYINFO] = "%s %s %s bchiklmnoprstveCIMORS bkloveIh",
37     /* 005 */ [RPL_ISUPPORT] = "%s :are supported by this server",
38     /* 010 */ [RPL_REDIR] = "%s %u :Please use this Server/Port instead",
39     /* 015 */ [RPL_MAP] = ":%s%s",
40     /* 016 */ [RPL_MAPMORE] = ":%s%s --> *more*",
41     /* 017 */ [RPL_MAPEND] = ":End of /MAP",
42     /* 200 */ [RPL_TRACELINK] = "Link %s %s %s",
43     /* 201 */ [RPL_TRACECONNECTING] = "Try. %s %s",
44     /* 202 */ [RPL_TRACEHANDSHAKE] = "H.S. %s %s",
45     /* 203 */ [RPL_TRACEUNKNOWN] = "???? %s %s (%s) %d",
46     /* 204 */ [RPL_TRACEOPERATOR] = "Oper %s %s (%s) %lu %u",
47     /* 205 */ [RPL_TRACEUSER] = "User %s %s (%s) %lu %u",
48     /* 206 */ [RPL_TRACESERVER] = "Serv %s %uS %uC %s %s!%s@%s %lu",
49     /* 208 */ [RPL_TRACENEWTYPE] = "<newtype> 0 %s",
50     /* 209 */ [RPL_TRACECLASS] = "Class %s %u",
51     /* 211 */ [RPL_STATSLINKINFO] = "%s %u %u %llu %u %llu :%u %u %s",
52     /* 212 */ [RPL_STATSCOMMANDS] = "%s %u %llu :%u",
53     /* 213 */ [RPL_STATSCLINE] = "%c %s %s %s %u %s",
54     /* 215 */ [RPL_STATSILINE] = "%c %s * %s@%s %u %s",
55     /* 216 */ [RPL_STATSKLINE] = "%c %s * %s :%s",
56     /* 217 */ [RPL_STATSQLINE] = "%c %u %s :%s",
57     /* 218 */ [RPL_STATSYLINE] = "%c %s %u %u %u %u %u %u %u/%u %u/%u %s",
58     /* 219 */ [RPL_ENDOFSTATS] = "%c :End of /STATS report",
59     /* 220 */ [RPL_STATSPLINE] = "%c %d %s %d %s :%s",
60     /* 221 */ [RPL_UMODEIS] = "%s",
61     /* 225 */ [RPL_STATSDLINE] = "%c %s :%s",
62     /* 226 */ [RPL_STATSALINE] = "%s",
63     /* 241 */ [RPL_STATSLLINE] = "%c %s * %s %u %s",
64 michael 6570 /* 242 */ [RPL_STATSUPTIME] = ":Server Up %s",
65 michael 5803 /* 243 */ [RPL_STATSOLINE] = "%c %s@%s * %s %s %s",
66     /* 244 */ [RPL_STATSHLINE] = "%c %s * %s %u %s",
67     /* 245 */ [RPL_STATSTLINE] = "T %s %s",
68     /* 246 */ [RPL_STATSSERVICE] = "%c %s * %s %u %u",
69     /* 247 */ [RPL_STATSXLINE] = "%c %u %s :%s",
70     /* 248 */ [RPL_STATSULINE] = "U %s %s@%s %s",
71     /* 250 */ [RPL_STATSCONN] = ":Highest connection count: %u (%u clients) (%llu connections received)",
72     /* 251 */ [RPL_LUSERCLIENT] = ":There are %u users and %u invisible on %u servers",
73     /* 252 */ [RPL_LUSEROP] = "%u :IRC Operators online",
74     /* 253 */ [RPL_LUSERUNKNOWN] = "%u :unknown connection(s)",
75     /* 254 */ [RPL_LUSERCHANNELS] = "%u :channels formed",
76     /* 255 */ [RPL_LUSERME] = ":I have %u clients and %u servers",
77     /* 256 */ [RPL_ADMINME] = ":Administrative info about %s",
78     /* 257 */ [RPL_ADMINLOC1] = ":%s",
79     /* 258 */ [RPL_ADMINLOC2] = ":%s",
80     /* 259 */ [RPL_ADMINEMAIL] = ":%s",
81     /* 262 */ [RPL_ENDOFTRACE] = "%s :End of TRACE",
82     /* 263 */ [RPL_LOAD2HI] = "%s :Server load is temporarily too heavy. Please wait a while and try again.",
83     /* 265 */ [RPL_LOCALUSERS] = ":Current local users: %u Max: %u",
84     /* 266 */ [RPL_GLOBALUSERS] = ":Current global users: %u Max: %u",
85     /* 276 */ [RPL_WHOISCERTFP] = "%s :has client certificate fingerprint %s",
86     /* 281 */ [RPL_ACCEPTLIST] = ":%s",
87     /* 282 */ [RPL_ENDOFACCEPT] = ":End of /ACCEPT list.",
88     /* 301 */ [RPL_AWAY] = "%s :%s",
89     /* 302 */ [RPL_USERHOST] = ":%s 302 %s :%s",
90     /* 303 */ [RPL_ISON] = ":%s 303 %s :",
91     /* 305 */ [RPL_UNAWAY] = ":You are no longer marked as being away",
92     /* 306 */ [RPL_NOWAWAY] = ":You have been marked as being away",
93     /* 307 */ [RPL_WHOISREGNICK] = "%s :has identified for this nick",
94     /* 311 */ [RPL_WHOISUSER] = "%s %s %s * :%s",
95     /* 312 */ [RPL_WHOISSERVER] = "%s %s :%s",
96     /* 313 */ [RPL_WHOISOPERATOR] = "%s :%s",
97     /* 314 */ [RPL_WHOWASUSER] = "%s %s %s * :%s",
98     /* 315 */ [RPL_ENDOFWHO] = "%s :End of /WHO list.",
99     /* 317 */ [RPL_WHOISIDLE] = "%s %u %d :seconds idle, signon time",
100     /* 318 */ [RPL_ENDOFWHOIS] = "%s :End of /WHOIS list.",
101     /* 319 */ [RPL_WHOISCHANNELS] = ":%s 319 %s %s :%s",
102     /* 321 */ [RPL_LISTSTART] = "Channel :Users Name",
103     /* 322 */ [RPL_LIST] = "%s %u :%s%s",
104     /* 323 */ [RPL_LISTEND] = ":End of /LIST",
105     /* 324 */ [RPL_CHANNELMODEIS] = "%s %s %s",
106     /* 329 */ [RPL_CREATIONTIME] = "%s %lu",
107     /* 330 */ [RPL_WHOISACCOUNT] = "%s %s :%s logged in as",
108     /* 331 */ [RPL_NOTOPIC] = "%s :No topic is set.",
109     /* 332 */ [RPL_TOPIC] = "%s :%s",
110     /* 333 */ [RPL_TOPICWHOTIME] = "%s %s %lu",
111     /* 335 */ [RPL_WHOISTEXT] = "%s :%s",
112     /* 336 */ [RPL_INVITELIST] = ":%s",
113     /* 337 */ [RPL_ENDOFINVITELIST] = ":End of /INVITE list.",
114     /* 338 */ [RPL_WHOISACTUALLY] = "%s %s@%s %s :Actual user@host, actual IP",
115     /* 341 */ [RPL_INVITING] = "%s %s",
116     /* 346 */ [RPL_INVEXLIST] = "%s %s!%s@%s %s %lu",
117     /* 347 */ [RPL_ENDOFINVEXLIST] = "%s :End of Channel Invite List",
118     /* 348 */ [RPL_EXCEPTLIST] = "%s %s!%s@%s %s %lu",
119     /* 349 */ [RPL_ENDOFEXCEPTLIST] = "%s :End of Channel Exception List",
120     /* 351 */ [RPL_VERSION] = "%s(%s). %s :%s",
121     /* 352 */ [RPL_WHOREPLY] = "%s %s %s %s %s %s :%u %s",
122     /* 353 */ [RPL_NAMREPLY] = ":%s 353 %s %s %s :",
123     /* 362 */ [RPL_CLOSING] = "%s :Closed. Status = %d",
124     /* 363 */ [RPL_CLOSEEND] = "%u: Connections closed",
125     /* 364 */ [RPL_LINKS] = "%s %s :%u %s",
126     /* 365 */ [RPL_ENDOFLINKS] = "%s :End of /LINKS list.",
127     /* 366 */ [RPL_ENDOFNAMES] = "%s :End of /NAMES list.",
128     /* 367 */ [RPL_BANLIST] = "%s %s!%s@%s %s %lu",
129     /* 368 */ [RPL_ENDOFBANLIST] = "%s :End of Channel Ban List",
130     /* 369 */ [RPL_ENDOFWHOWAS] = "%s :End of WHOWAS",
131     /* 371 */ [RPL_INFO] = ":%s",
132     /* 372 */ [RPL_MOTD] = ":- %s",
133     /* 373 */ [RPL_INFOSTART] = ":Server INFO",
134     /* 374 */ [RPL_ENDOFINFO] = ":End of /INFO list.",
135     /* 375 */ [RPL_MOTDSTART] = ":- %s Message of the Day - ",
136     /* 376 */ [RPL_ENDOFMOTD] = ":End of /MOTD command.",
137     /* 379 */ [RPL_WHOISMODES] = "%s :is using modes %s",
138     /* 381 */ [RPL_YOUREOPER] = ":You have entered... the Twilight Zone!",
139     /* 382 */ [RPL_REHASHING] = "%s :Rehashing",
140     /* 386 */ [RPL_RSACHALLENGE] = ":%s",
141     /* 391 */ [RPL_TIME] = "%s :%s",
142     /* 396 */ [RPL_VISIBLEHOST] = "%s :is now your visible host",
143     /* 401 */ [ERR_NOSUCHNICK] = "%s :No such nick/channel",
144     /* 402 */ [ERR_NOSUCHSERVER] = "%s :No such server",
145     /* 403 */ [ERR_NOSUCHCHANNEL] = "%s :No such channel",
146     /* 404 */ [ERR_CANNOTSENDTOCHAN] = "%s :Cannot send to channel",
147     /* 405 */ [ERR_TOOMANYCHANNELS] = "%s :You have joined too many channels",
148     /* 406 */ [ERR_WASNOSUCHNICK] = "%s :There was no such nickname",
149     /* 407 */ [ERR_TOOMANYTARGETS] = "%s :Too many recipients. Only %u processed",
150     /* 408 */ [ERR_NOCTRLSONCHAN] = "%s :You cannot use control codes on this channel. Not sent: %s",
151     /* 409 */ [ERR_NOORIGIN] = ":No origin specified",
152     /* 410 */ [ERR_INVALIDCAPCMD] = "%s :Invalid CAP subcommand",
153     /* 411 */ [ERR_NORECIPIENT] = ":No recipient given (%s)",
154     /* 412 */ [ERR_NOTEXTTOSEND] = ":No text to send",
155     /* 413 */ [ERR_NOTOPLEVEL] = "%s :No top-level domain specified",
156     /* 414 */ [ERR_WILDTOPLEVEL] = "%s :Wildcard in top-level domain",
157     /* 421 */ [ERR_UNKNOWNCOMMAND] = "%s :Unknown command",
158     /* 422 */ [ERR_NOMOTD] = ":MOTD File is missing",
159     /* 423 */ [ERR_NOADMININFO] = "%s :No administrative info available",
160     /* 429 */ [ERR_TOOMANYAWAY] = ":Too many aways - Flood protection activated",
161     /* 431 */ [ERR_NONICKNAMEGIVEN] = ":No nickname given",
162     /* 432 */ [ERR_ERRONEUSNICKNAME] = "%s :%s",
163     /* 433 */ [ERR_NICKNAMEINUSE] = "%s :Nickname is already in use.",
164     /* 436 */ [ERR_NICKCOLLISION] = "%s :Nickname collision KILL",
165     /* 438 */ [ERR_NICKTOOFAST] = "%s :Nick change too fast. Please wait %u seconds.",
166     /* 440 */ [ERR_SERVICESDOWN] = "%s :Services are currently unavailable.",
167     /* 441 */ [ERR_USERNOTINCHANNEL] = "%s %s :They aren't on that channel",
168     /* 442 */ [ERR_NOTONCHANNEL] = "%s :You are not on that channel",
169     /* 443 */ [ERR_USERONCHANNEL] = "%s %s :is already on channel",
170     /* 451 */ [ERR_NOTREGISTERED] = ":You have not registered",
171     /* 456 */ [ERR_ACCEPTFULL] = ":Accept list is full",
172     /* 457 */ [ERR_ACCEPTEXIST] = "%s!%s@%s :is already on your accept list",
173     /* 458 */ [ERR_ACCEPTNOT] = "%s!%s@%s :is not on your accept list",
174     /* 461 */ [ERR_NEEDMOREPARAMS] = "%s :Not enough parameters",
175     /* 462 */ [ERR_ALREADYREGISTRED] = ":You may not reregister",
176     /* 464 */ [ERR_PASSWDMISMATCH] = ":Password incorrect",
177     /* 465 */ [ERR_YOUREBANNEDCREEP] = ":You are banned from this server- %s",
178     /* 468 */ [ERR_ONLYSERVERSCANCHANGE] = "%s :Only servers can change that mode",
179     /* 471 */ [ERR_CHANNELISFULL] = "%s :Cannot join channel (+l)",
180     /* 472 */ [ERR_UNKNOWNMODE] = "%c :is unknown mode char to me",
181     /* 473 */ [ERR_INVITEONLYCHAN] = "%s :Cannot join channel (+i)",
182     /* 474 */ [ERR_BANNEDFROMCHAN] = "%s :Cannot join channel (+b)",
183     /* 475 */ [ERR_BADCHANNELKEY] = "%s :Cannot join channel (+k)",
184     /* 477 */ [ERR_NEEDREGGEDNICK] = "%s :You need to identify to a registered nick to join or speak in that channel.",
185     /* 478 */ [ERR_BANLISTFULL] = "%s %s :Channel ban list is full",
186     /* 479 */ [ERR_BADCHANNAME] = "%s :Illegal channel name",
187     /* 481 */ [ERR_NOPRIVILEGES] = ":Permission denied - You are not an IRC operator",
188     /* 482 */ [ERR_CHANOPRIVSNEEDED] = "%s :You are not channel operator",
189     /* 483 */ [ERR_CANTKILLSERVER] = ":You cannot kill a server!",
190     /* 485 */ [ERR_CHANBANREASON] = "%s :Cannot join channel (%s)",
191     /* 486 */ [ERR_NONONREG] = "%s :You must identify to a registered nick to private message that person",
192     /* 489 */ [ERR_SSLONLYCHAN] = "%s :Cannot join channel (+S)",
193     /* 491 */ [ERR_NOOPERHOST] = ":Only few of mere mortals may try to enter the twilight zone",
194     /* 492 */ [ERR_NOCTCP] = "%s :You cannot send CTCPs to this channel. Not sent: %s",
195     /* 501 */ [ERR_UMODEUNKNOWNFLAG] = ":Unknown MODE flag",
196     /* 502 */ [ERR_USERSDONTMATCH] = ":Cannot change mode for other users",
197     /* 504 */ [ERR_USERNOTONSERV] = "%s :User is not on this server",
198     /* 512 */ [ERR_TOOMANYWATCH] = "%s :Maximum size for WATCH-list is %u entries",
199     /* 513 */ [ERR_WRONGPONG] = ":To connect type /QUOTE PONG %u",
200     /* 520 */ [ERR_OPERONLYCHAN] = "%s :Cannot join channel (+O)",
201     /* 521 */ [ERR_LISTSYNTAX] = ":Bad list syntax, type /QUOTE HELP LIST",
202     /* 523 */ [ERR_WHOLIMEXCEED] = "%u :%s search limit exceeded.",
203     /* 524 */ [ERR_HELPNOTFOUND] = "%s :Help not found",
204     /* 600 */ [RPL_LOGON] = "%s %s %s %d :logged online",
205     /* 601 */ [RPL_LOGOFF] = "%s %s %s %d :logged offline",
206     /* 602 */ [RPL_WATCHOFF] = "%s %s %s %d :stopped watching",
207     /* 603 */ [RPL_WATCHSTAT] = ":You have %u and are on %u WATCH entries",
208     /* 604 */ [RPL_NOWON] = "%s %s %s %d :is online",
209     /* 605 */ [RPL_NOWOFF] = "%s %s %s %d :is offline",
210     /* 606 */ [RPL_WATCHLIST] = ":%s",
211     /* 607 */ [RPL_ENDOFWATCHLIST] = ":End of WATCH %c",
212     /* 671 */ [RPL_WHOISSECURE] = "%s :is connected via SSL (secure link)",
213     /* 702 */ [RPL_MODLIST] = "%s %p %s %s",
214     /* 703 */ [RPL_ENDOFMODLIST] = ":End of /MODULE LIST.",
215     /* 704 */ [RPL_HELPSTART] = "%s :%s",
216     /* 705 */ [RPL_HELPTXT] = "%s :%s",
217     /* 706 */ [RPL_ENDOFHELP] = "%s :End of /HELP.",
218     /* 709 */ [RPL_ETRACE] = "%s %s %s %s %s %s :%s",
219     /* 710 */ [RPL_KNOCK] = "%s %s!%s@%s :has asked for an invite.",
220     /* 711 */ [RPL_KNOCKDLVR] = "%s :Your KNOCK has been delivered.",
221     /* 712 */ [ERR_TOOMANYKNOCK] = "%s :Too many KNOCKs (%s).",
222     /* 713 */ [ERR_CHANOPEN] = "%s :Channel is open.",
223     /* 714 */ [ERR_KNOCKONCHAN] = "%s :You are already on that channel.",
224     /* 715 */ [ERR_TOOMANYINVITE] = "%s :Too many INVITEs (%s).",
225     /* 716 */ [RPL_TARGUMODEG] = "%s :is in %s mode (%s)",
226     /* 717 */ [RPL_TARGNOTIFY] = "%s :has been informed that you messaged them.",
227 michael 6154 /* 718 */ [RPL_UMODEGMSG] = "%s %s@%s :is messaging you, and you are umode %s.",
228 michael 5803 /* 723 */ [ERR_NOPRIVS] = "%s :Insufficient oper privileges.",
229     /* 999 */ [ERR_LAST_ERR_MSG] = ":Last error message"
230 michael 1837 };
231    
232 michael 1834 /*
233 michael 3109 * numeric_form
234 michael 1834 *
235 michael 1837 * inputs - numeric
236     * output - corresponding string
237     * side effects - NONE
238 michael 1834 */
239 michael 1837 const char *
240 michael 3109 numeric_form(enum irc_numerics numeric)
241 michael 1834 {
242     assert(numeric < ERR_LAST_ERR_MSG);
243    
244     if (numeric > ERR_LAST_ERR_MSG)
245     numeric = ERR_LAST_ERR_MSG;
246    
247 michael 1837 assert(replies[numeric]);
248 michael 1834
249 michael 1837 return replies[numeric];
250 michael 1834 }

Properties

Name Value
svn:eol-style native
svn:keywords Id Revision