Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / s_err.c
1 /*
2  * IRC - Internet Relay Chat, ircd/s_err.c
3  * Copyright (C) 1992 Darren Reed
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 1, or (at your option)
8  * any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  * $Id$
20  */
21 #include "numeric.h"
22 #include "s_debug.h"
23 #include "sprintf_irc.h"
24
25 #include <assert.h>
26
27 static Numeric replyTable[] = {
28 /* 000 */
29   { 0 },
30 /* 001 */
31   { RPL_WELCOME, ":Welcome to the Internet Relay Network %s", "001" },
32 /* 002 */
33   { RPL_YOURHOST, ":Your host is %s, running version %s", "002" },
34 /* 003 */
35   { RPL_CREATED, ":This server was created %s", "003" },
36 /* 004 */
37   { RPL_MYINFO, "%s %s dioswkg biklmnopstv", "004" },
38 /* 005 */
39   { RPL_ISUPPORT, "%s :are supported by this server", "005" },
40 /* 006 */
41   { 0 },
42 /* 007 */
43   { 0 },
44 /* 008 */
45   { RPL_SNOMASK, "%d :: Server notice mask (%#x)", "008" },
46 /* 009 */
47   { RPL_STATMEMTOT, "%u %u :Bytes Blocks", "009" },
48 /* 010 */
49 #ifdef MEMSIZESTATS
50   { RPL_STATMEM, "%u %u %s %u", "010" },
51 #else
52   { RPL_STATMEM, "%u %u %s", "010" },
53 #endif
54 /* 011 */
55   { 0 },
56 /* 012 */
57   { 0 },
58 /* 013 */
59   { 0 },
60 /* 014 */
61   { 0 },
62 /* 015 */
63   { RPL_MAP, ":%s%s%s %s [%i clients]", "015" },
64 /* 016 */
65   { RPL_MAPMORE, ":%s%s --> *more*", "016" },
66 /* 017 */
67   { RPL_MAPEND, ":End of /MAP", "017" },
68 /* 018 */
69   { 0 },
70 /* 019 */
71   { 0 },
72 /* 020 */
73   { 0 },
74 /* 021 */
75   { 0 },
76 /* 022 */
77   { 0 },
78 /* 023 */
79   { 0 },
80 /* 024 */
81   { 0 },
82 /* 025 */
83   { 0 },
84 /* 026 */
85   { 0 },
86 /* 027 */
87   { 0 },
88 /* 028 */
89   { 0 },
90 /* 029 */
91   { 0 },
92 /* 030 */
93   { 0 },
94 /* 031 */
95   { 0 },
96 /* 032 */
97   { 0 },
98 /* 033 */
99   { 0 },
100 /* 034 */
101   { 0 },
102 /* 035 */
103   { 0 },
104 /* 036 */
105   { 0 },
106 /* 037 */
107   { 0 },
108 /* 038 */
109   { 0 },
110 /* 039 */
111   { 0 },
112 /* 040 */
113   { 0 },
114 /* 041 */
115   { 0 },
116 /* 042 */
117   { 0 },
118 /* 043 */
119   { 0 },
120 /* 044 */
121   { 0 },
122 /* 045 */
123   { 0 },
124 /* 046 */
125   { 0 },
126 /* 047 */
127   { 0 },
128 /* 048 */
129   { 0 },
130 /* 049 */
131   { 0 },
132 /* 050 */
133   { 0 },
134 /* 051 */
135   { 0 },
136 /* 052 */
137   { 0 },
138 /* 053 */
139   { 0 },
140 /* 054 */
141   { 0 },
142 /* 055 */
143   { 0 },
144 /* 056 */
145   { 0 },
146 /* 057 */
147   { 0 },
148 /* 058 */
149   { 0 },
150 /* 059 */
151   { 0 },
152 /* 060 */
153   { 0 },
154 /* 061 */
155   { 0 },
156 /* 062 */
157   { 0 },
158 /* 063 */
159   { 0 },
160 /* 064 */
161   { 0 },
162 /* 065 */
163   { 0 },
164 /* 066 */
165   { 0 },
166 /* 067 */
167   { 0 },
168 /* 068 */
169   { 0 },
170 /* 069 */
171   { 0 },
172 /* 070 */
173   { 0 },
174 /* 071 */
175   { 0 },
176 /* 072 */
177   { 0 },
178 /* 073 */
179   { 0 },
180 /* 074 */
181   { 0 },
182 /* 075 */
183   { 0 },
184 /* 076 */
185   { 0 },
186 /* 077 */
187   { 0 },
188 /* 078 */
189   { 0 },
190 /* 079 */
191   { 0 },
192 /* 080 */
193   { 0 },
194 /* 081 */
195   { 0 },
196 /* 082 */
197   { 0 },
198 /* 083 */
199   { 0 },
200 /* 084 */
201   { 0 },
202 /* 085 */
203   { 0 },
204 /* 086 */
205   { 0 },
206 /* 087 */
207   { 0 },
208 /* 088 */
209   { 0 },
210 /* 089 */
211   { 0 },
212 /* 090 */
213   { 0 },
214 /* 091 */
215   { 0 },
216 /* 092 */
217   { 0 },
218 /* 093 */
219   { 0 },
220 /* 094 */
221   { 0 },
222 /* 095 */
223   { 0 },
224 /* 096 */
225   { 0 },
226 /* 097 */
227   { 0 },
228 /* 098 */
229   { 0 },
230 /* 099 */
231   { 0 },
232 /* 100 */
233   { 0 },
234 /* 101 */
235   { 0 },
236 /* 102 */
237   { 0 },
238 /* 103 */
239   { 0 },
240 /* 104 */
241   { 0 },
242 /* 105 */
243   { 0 },
244 /* 106 */
245   { 0 },
246 /* 107 */
247   { 0 },
248 /* 108 */
249   { 0 },
250 /* 109 */
251   { 0 },
252 /* 110 */
253   { 0 },
254 /* 111 */
255   { 0 },
256 /* 112 */
257   { 0 },
258 /* 113 */
259   { 0 },
260 /* 114 */
261   { 0 },
262 /* 115 */
263   { 0 },
264 /* 116 */
265   { 0 },
266 /* 117 */
267   { 0 },
268 /* 118 */
269   { 0 },
270 /* 119 */
271   { 0 },
272 /* 120 */
273   { 0 },
274 /* 121 */
275   { 0 },
276 /* 122 */
277   { 0 },
278 /* 123 */
279   { 0 },
280 /* 124 */
281   { 0 },
282 /* 125 */
283   { 0 },
284 /* 126 */
285   { 0 },
286 /* 127 */
287   { 0 },
288 /* 128 */
289   { 0 },
290 /* 129 */
291   { 0 },
292 /* 130 */
293   { 0 },
294 /* 131 */
295   { 0 },
296 /* 132 */
297   { 0 },
298 /* 133 */
299   { 0 },
300 /* 134 */
301   { 0 },
302 /* 135 */
303   { 0 },
304 /* 136 */
305   { 0 },
306 /* 137 */
307   { 0 },
308 /* 138 */
309   { 0 },
310 /* 139 */
311   { 0 },
312 /* 140 */
313   { 0 },
314 /* 141 */
315   { 0 },
316 /* 142 */
317   { 0 },
318 /* 143 */
319   { 0 },
320 /* 144 */
321   { 0 },
322 /* 145 */
323   { 0 },
324 /* 146 */
325   { 0 },
326 /* 147 */
327   { 0 },
328 /* 148 */
329   { 0 },
330 /* 149 */
331   { 0 },
332 /* 150 */
333   { 0 },
334 /* 151 */
335   { 0 },
336 /* 152 */
337   { 0 },
338 /* 153 */
339   { 0 },
340 /* 154 */
341   { 0 },
342 /* 155 */
343   { 0 },
344 /* 156 */
345   { 0 },
346 /* 157 */
347   { 0 },
348 /* 158 */
349   { 0 },
350 /* 159 */
351   { 0 },
352 /* 160 */
353   { 0 },
354 /* 161 */
355   { 0 },
356 /* 162 */
357   { 0 },
358 /* 163 */
359   { 0 },
360 /* 164 */
361   { 0 },
362 /* 165 */
363   { 0 },
364 /* 166 */
365   { 0 },
366 /* 167 */
367   { 0 },
368 /* 168 */
369   { 0 },
370 /* 169 */
371   { 0 },
372 /* 170 */
373   { 0 },
374 /* 171 */
375   { 0 },
376 /* 172 */
377   { 0 },
378 /* 173 */
379   { 0 },
380 /* 174 */
381   { 0 },
382 /* 175 */
383   { 0 },
384 /* 176 */
385   { 0 },
386 /* 177 */
387   { 0 },
388 /* 178 */
389   { 0 },
390 /* 179 */
391   { 0 },
392 /* 180 */
393   { 0 },
394 /* 181 */
395   { 0 },
396 /* 182 */
397   { 0 },
398 /* 183 */
399   { 0 },
400 /* 184 */
401   { 0 },
402 /* 185 */
403   { 0 },
404 /* 186 */
405   { 0 },
406 /* 187 */
407   { 0 },
408 /* 188 */
409   { 0 },
410 /* 189 */
411   { 0 },
412 /* 190 */
413   { 0 },
414 /* 191 */
415   { 0 },
416 /* 192 */
417   { 0 },
418 /* 193 */
419   { 0 },
420 /* 194 */
421   { 0 },
422 /* 195 */
423   { 0 },
424 /* 196 */
425   { 0 },
426 /* 197 */
427   { 0 },
428 /* 198 */
429   { 0 },
430 /* 199 */
431   { 0 },
432 /* 200 */
433 #ifndef GODMODE
434   { RPL_TRACELINK, "Link %s%s %s %s", "200" },
435 #else /* GODMODE */
436   { RPL_TRACELINK, "Link %s%s %s %s " TIME_T_FMT, "200" },
437 #endif /* GODMODE */
438 /* 201 */
439   { RPL_TRACECONNECTING, "Try. %d %s", "201" },
440 /* 202 */
441   { RPL_TRACEHANDSHAKE, "H.S. %d %s", "202" },
442 /* 203 */
443   { RPL_TRACEUNKNOWN, "???? %d %s", "203" },
444 /* 204 */
445   { RPL_TRACEOPERATOR, "Oper %d %s %ld", "204" },
446 /* 205 */
447   { RPL_TRACEUSER, "User %d %s %ld", "205" },
448 /* 206 */
449   { RPL_TRACESERVER, "Serv %d %dS %dC %s %s!%s@%s %ld %ld", "206" },
450 /* 207 */
451   { 0 },
452 /* 208 */
453   { RPL_TRACENEWTYPE, "<newtype> 0 %s", "208" },
454 /* 209 */
455   { RPL_TRACECLASS, "Class %d %d", "209" },
456 /* 210 */
457   { 0 },
458 /* 211 */
459   { RPL_STATSLINKINFO, 0, "211" },
460 /* 212 */
461   { RPL_STATSCOMMANDS, "%s %u %u", "212" },
462 /* 213 */
463   { RPL_STATSCLINE, "%c %s * %s %d %d", "213" },
464 /* 214 */
465   { RPL_STATSNLINE, "%c %s * %s %d %d", "214" },
466 /* 215 */
467   { RPL_STATSILINE, "%c %s * %s %d %d", "215" },
468 /* 216 */
469   { RPL_STATSKLINE, "%c %s %s %s %d %d", "216" },
470 /* 217 */
471   { RPL_STATSPLINE, "P %d %d %s %s", "217" },
472 /* 218 */
473   { RPL_STATSYLINE, "%c %d %d %d %d %ld", "218" },
474 /* 219 */
475   { RPL_ENDOFSTATS, "%c :End of /STATS report", "219" },
476 /* 220 */
477   { 0 },
478 /* 221 */
479   { RPL_UMODEIS, "%s", "221" },
480 /* 222 */
481   { 0 },
482 /* 223 */
483   { 0 },
484 /* 224 */
485   { 0 },
486 /* 225 */
487   { 0 },
488 /* 226 */
489   { 0 },
490 /* 227 */
491   { 0 },
492 /* 228 */
493   { 0 },
494 /* 229 */
495   { 0 },
496 /* 230 */
497   { 0 },
498 /* 231 */
499   { RPL_SERVICEINFO, 0, "231" },
500 /* 232 */
501   { RPL_ENDOFSERVICES, 0, "232" },
502 /* 233 */
503   { RPL_SERVICE, 0, "233" },
504 /* 234 */
505   { RPL_SERVLIST, 0, "234" },
506 /* 235 */
507   { RPL_SERVLISTEND, 0, "235" },
508 /* 236 */
509   { 0 },
510 /* 237 */
511   { 0 },
512 /* 238 */
513   { 0 },
514 /* 239 */
515   { 0 },
516 /* 240 */
517   { 0 },
518 /* 241 */
519   { RPL_STATSLLINE, "%c %s * %s %d %d", "241" },
520 /* 242 */
521   { RPL_STATSUPTIME, ":Server Up %d days, %d:%02d:%02d", "242" },
522 /* 243 */
523   { RPL_STATSOLINE, "%c %s * %s %d %d", "243" },
524 /* 244 */
525   { RPL_STATSHLINE, "%c %s * %s %d %d", "244" },
526 /* 245 */
527   { 0 },
528 /* 246 */
529   { RPL_STATSTLINE, "%c %s %s", "246" },
530 /* 247 */
531   { RPL_STATSGLINE, "%c %s@%s " TIME_T_FMT " :%s", "247" },
532 /* 248 */
533   { RPL_STATSULINE, "%c %s %s %s %d %d", "248" },
534 /* 249 */
535   { RPL_STATSDEBUG, 0, "249" },
536 /* 250 */
537   { RPL_STATSCONN, ":Highest connection count: %d (%d clients)", "250" },
538 /* 251 */
539   { RPL_LUSERCLIENT, ":There are %d users and %d invisible on %d servers", "251" },
540 /* 252 */
541   { RPL_LUSEROP, "%d :operator(s) online", "252" },
542 /* 253 */
543   { RPL_LUSERUNKNOWN, "%d :unknown connection(s)", "253" },
544 /* 254 */
545   { RPL_LUSERCHANNELS, "%d :channels formed", "254" },
546 /* 255 */
547   { RPL_LUSERME, ":I have %d clients and %d servers", "255" },
548 /* 256 */
549   { RPL_ADMINME, ":Administrative info about %s", "256" },
550 /* 257 */
551   { RPL_ADMINLOC1, ":%s", "257" },
552 /* 258 */
553   { RPL_ADMINLOC2, ":%s", "258" },
554 /* 259 */
555   { RPL_ADMINEMAIL, ":%s", "259" },
556 /* 260 */
557   { 0 },
558 /* 261 */
559   { RPL_TRACELOG, "File %s %d", "261" },
560 /* 262 */
561   { RPL_TRACEPING, "Ping %s %s", "262" },
562 /* 263 */
563   { 0 },
564 /* 264 */
565   { 0 },
566 /* 265 */
567   { 0 },
568 /* 266 */
569   { 0 },
570 /* 267 */
571   { 0 },
572 /* 268 */
573   { 0 },
574 /* 269 */
575   { 0 },
576 /* 270 */
577   { 0 },
578 /* 271 */
579   { RPL_SILELIST, "%s %s", "271" },
580 /* 272 */
581   { RPL_ENDOFSILELIST, "%s :End of Silence List", "272" },
582 /* 273 */
583   { 0 },
584 /* 274 */
585   { 0 },
586 /* 275 */
587   { RPL_STATSDLINE, "%c %s %s", "275" },
588 /* 276 */
589   { 0 },
590 /* 277 */
591   { 0 },
592 /* 278 */
593   { 0 },
594 /* 279 */
595   { 0 },
596 /* 280 */
597   { RPL_GLIST, "%s%s%s " TIME_T_FMT " %s %c :%s", "280" },
598 /* 281 */
599   { RPL_ENDOFGLIST, ":End of G-line List", "281" },
600 /* 282 */
601   { RPL_JUPELIST, "%s " TIME_T_FMT " %s %c :%s", "282" },
602 /* 283 */
603   { RPL_ENDOFJUPELIST, ":End of Jupe List", "283" },
604 /* 284 */
605   { 0 },
606 /* 285 */
607   { 0 },
608 /* 286 */
609   { 0 },
610 /* 287 */
611   { 0 },
612 /* 288 */
613   { 0 },
614 /* 289 */
615   { 0 },
616 /* 290 */
617   { 0 },
618 /* 291 */
619   { 0 },
620 /* 292 */
621   { 0 },
622 /* 293 */
623   { 0 },
624 /* 294 */
625   { 0 },
626 /* 295 */
627   { 0 },
628 /* 296 */
629   { 0 },
630 /* 297 */
631   { 0 },
632 /* 298 */
633   { 0 },
634 /* 299 */
635   { 0 },
636 /* 300 */
637   { RPL_NONE, 0, "300" },
638 /* 301 */
639   { RPL_AWAY, "%s :%s", "301" },
640 /* 302 */
641   { RPL_USERHOST, ":", "302" },
642 /* 303 */
643   { RPL_ISON, ":", "303" },
644 /* 304 */
645   { RPL_TEXT, 0, "304" },
646 /* 305 */
647   { RPL_UNAWAY, ":You are no longer marked as being away", "305" },
648 /* 306 */
649   { RPL_NOWAWAY, ":You have been marked as being away", "306" },
650 /* 307 */
651   { RPL_USERIP, ":", "307" },
652 /* 308 */
653   { 0 },
654 /* 309 */
655   { 0 },
656 /* 310 */
657   { 0 },
658 /* 311 */
659   { RPL_WHOISUSER, "%s %s %s * :%s", "311" },
660 /* 312 */
661   { RPL_WHOISSERVER, "%s %s :%s", "312" },
662 /* 313 */
663   { RPL_WHOISOPERATOR, "%s :is an IRC Operator", "313" },
664 /* 314 */
665   { RPL_WHOWASUSER, "%s %s %s * :%s", "314" },
666 /* 315 */
667   { RPL_ENDOFWHO, "%s :End of /WHO list.", "315" },
668 /* 316 */
669   { 0 },
670 /* 317 */
671   { RPL_WHOISIDLE, "%s %ld %ld :seconds idle, signon time", "317" },
672 /* 318 */
673   { RPL_ENDOFWHOIS, "%s :End of /WHOIS list.", "318" },
674 /* 319 */
675   { RPL_WHOISCHANNELS, "%s :%s", "319" },
676 /* 320 */
677   { 0 },
678 /* 321 */
679   { RPL_LISTSTART, "Channel :Users  Name", "321" },
680 /* 322 */
681   { RPL_LIST, "%s %d :%s", "322" },
682 /* 323 */
683   { RPL_LISTEND, ":End of /LIST", "323" },
684 /* 324 */
685   { RPL_CHANNELMODEIS, "%s %s %s", "324" },
686 /* 325 */
687   { 0 },
688 /* 326 */
689   { 0 },
690 /* 327 */
691   { 0 },
692 /* 328 */
693   { 0 },
694 /* 329 */
695   { RPL_CREATIONTIME, "%s " TIME_T_FMT, "329" },
696 /* 330 */
697   { 0 },
698 /* 331 */
699   { RPL_NOTOPIC, "%s :No topic is set.", "331" },
700 /* 332 */
701   { RPL_TOPIC, "%s :%s", "332" },
702 /* 333 */
703   { RPL_TOPICWHOTIME, "%s %s " TIME_T_FMT, "333" },
704 /* 334 */
705   { RPL_LISTUSAGE, ":%s", "334" },
706 /* 335 */
707   { 0 },
708 /* 336 */
709   { 0 },
710 /* 337 */
711   { 0 },
712 /* 338 */
713   { 0 },
714 /* 339 */
715   { 0 },
716 /* 340 */
717   { 0 },
718 /* 341 */
719   { RPL_INVITING, "%s %s", "341" },
720 /* 342 */
721   { 0 },
722 /* 343 */
723   { 0 },
724 /* 344 */
725   { 0 },
726 /* 345 */
727   { 0 },
728 /* 346 */
729   { RPL_INVITELIST, ":%s", "346" },
730 /* 347 */
731   { RPL_ENDOFINVITELIST, ":End of Invite List", "347" },
732 /* 348 */
733   { 0 },
734 /* 349 */
735   { 0 },
736 /* 350 */
737   { 0 },
738 /* 351 */
739   { RPL_VERSION, "%s.%s %s :%s", "351" },
740 /* 352 */
741   { RPL_WHOREPLY, "%s", "352" },
742 /* 353 */
743   { RPL_NAMREPLY, "%s", "353" },
744 /* 354 */
745   { RPL_WHOSPCRPL, "%s", "354" },
746 /* 355 */
747   { 0 },
748 /* 356 */
749   { 0 },
750 /* 357 */
751   { 0 },
752 /* 358 */
753   { 0 },
754 /* 359 */
755   { 0 },
756 /* 360 */
757   { 0 },
758 /* 361 */
759   { RPL_KILLDONE, 0, "361" }, /* Not used */
760 /* 362 */
761   { RPL_CLOSING, "%s :Operator enforced Close", "362" },
762 /* 363 */
763   { RPL_CLOSEEND, "%d :Connections Closed", "363" },
764 /* 364 */
765 #ifndef GODMODE
766   { RPL_LINKS, "%s %s :%d P%u %s", "364" },
767 #else /* GODMODE */
768   { RPL_LINKS, "%s %s :%d P%u " TIME_T_FMT " (%s) %s", "364" },
769 #endif /* GODMODE */
770 /* 365 */
771   { RPL_ENDOFLINKS, "%s :End of /LINKS list.", "365" },
772 /* 366 */
773   { RPL_ENDOFNAMES, "%s :End of /NAMES list.", "366" },
774 /* 367 */
775   { RPL_BANLIST, "%s %s %s " TIME_T_FMT, "367" },
776 /* 368 */
777   { RPL_ENDOFBANLIST, "%s :End of Channel Ban List", "368" },
778 /* 369 */
779   { RPL_ENDOFWHOWAS, "%s :End of WHOWAS", "369" },
780 /* 370 */
781   { 0 },
782 /* 371 */
783   { RPL_INFO, ":%s", "371" },
784 /* 372 */
785   { RPL_MOTD, ":- %s", "372" },
786 /* 373 */
787   { RPL_INFOSTART, ":Server INFO", "373" },
788 /* 374 */
789   { RPL_ENDOFINFO, ":End of /INFO list.", "374" },
790 /* 375 */
791   { RPL_MOTDSTART, ":- %s Message of the Day - ", "375" },
792 /* 376 */
793   { RPL_ENDOFMOTD, ":End of /MOTD command.", "376" },
794 /* 377 */
795   { 0 },
796 /* 378 */
797   { 0 },
798 /* 379 */
799   { 0 },
800 /* 380 */
801   { 0 },
802 /* 381 */
803   { RPL_YOUREOPER, ":You are now an IRC Operator", "381" },
804 /* 382 */
805   { RPL_REHASHING, "%s :Rehashing", "382" },
806 /* 383 */
807   { 0 },
808 /* 384 */
809   { RPL_MYPORTIS, "%d :Port to local server is", "384" }, /* not used */
810 /* 385 */
811   { RPL_NOTOPERANYMORE, 0, "385" }, /* not used */
812 /* 386 */
813   { 0 },
814 /* 387 */
815   { 0 },
816 /* 388 */
817   { 0 },
818 /* 389 */
819   { 0 },
820 /* 390 */
821   { 0 },
822 /* 391 */
823   { RPL_TIME, "%s " TIME_T_FMT " %ld :%s", "391" },
824 /* 392 */
825   { 0 },
826 /* 393 */
827   { 0 },
828 /* 394 */
829   { 0 },
830 /* 395 */
831   { 0 },
832 /* 396 */
833   { 0 },
834 /* 397 */
835   { 0 },
836 /* 398 */
837   { 0 },
838 /* 399 */
839   { 0 },
840 /* 400 */
841   { ERR_FIRSTERROR, "", "400" },
842 /* 401 */
843   { ERR_NOSUCHNICK, "%s :No such nick", "401" },
844 /* 402 */
845   { ERR_NOSUCHSERVER, "%s :No such server", "402" },
846 /* 403 */
847   { ERR_NOSUCHCHANNEL, "%s :No such channel", "403" },
848 /* 404 */
849   { ERR_CANNOTSENDTOCHAN, "%s :Cannot send to channel", "404" },
850 /* 405 */
851   { ERR_TOOMANYCHANNELS, "%s :You have joined too many channels", "405" },
852 /* 406 */
853   { ERR_WASNOSUCHNICK, "%s :There was no such nickname", "406" },
854 /* 407 */
855   { ERR_TOOMANYTARGETS, "%s :Duplicate recipients. No message delivered", "407" },
856 /* 408 */
857   { 0 },
858 /* 409 */
859   { ERR_NOORIGIN, ":No origin specified", "409" },
860 /* 410 */
861   { 0 },
862 /* 411 */
863   { ERR_NORECIPIENT, ":No recipient given (%s)", "411" },
864 /* 412 */
865   { ERR_NOTEXTTOSEND, ":No text to send", "412" },
866 /* 413 */
867   { ERR_NOTOPLEVEL, "%s :No toplevel domain specified", "413" },
868 /* 414 */
869   { ERR_WILDTOPLEVEL, "%s :Wildcard in toplevel Domain", "414" },
870 /* 415 */
871   { 0 },
872 /* 416 */
873   { ERR_QUERYTOOLONG, "%s :Too many lines in the output, restrict your query", "416" },
874 /* 417 */
875   { 0 },
876 /* 418 */
877   { 0 },
878 /* 419 */
879   { 0 },
880 /* 420 */
881   { 0 },
882 /* 421 */
883   { ERR_UNKNOWNCOMMAND, "%s :Unknown command", "421" },
884 /* 422 */
885   { ERR_NOMOTD, ":MOTD File is missing", "422" },
886 /* 423 */
887   { ERR_NOADMININFO, "%s :No administrative info available", "423" },
888 /* 424 */
889   { 0 },
890 /* 425 */
891   { 0 },
892 /* 426 */
893   { 0 },
894 /* 427 */
895   { 0 },
896 /* 428 */
897   { 0 },
898 /* 429 */
899   { 0 },
900 /* 430 */
901   { 0 },
902 /* 431 */
903   { ERR_NONICKNAMEGIVEN, ":No nickname given", "431" },
904 /* 432 */
905   { ERR_ERRONEUSNICKNAME, "%s :Erroneous Nickname", "432" },
906 /* 433 */
907   { ERR_NICKNAMEINUSE, "%s :Nickname is already in use.", "433" },
908 /* 434 */
909   { 0 },
910 /* 435 */
911   { 0 },
912 /* 436 */
913   { ERR_NICKCOLLISION, "%s :Nickname collision KILL", "436" },
914 /* 437 */
915   { ERR_BANNICKCHANGE, "%s :Cannot change nickname while banned on channel", "437" },
916 /* 438 */
917   { ERR_NICKTOOFAST, "%s :Nick change too fast. Please wait %d seconds.", "438" },
918 /* 439 */
919   { ERR_TARGETTOOFAST, "%s :Target change too fast. Please wait %d seconds.", "439" },
920 /* 440 */
921   { 0 },
922 /* 441 */
923   { ERR_USERNOTINCHANNEL, "%s %s :They aren't on that channel", "441" },
924 /* 442 */
925   { ERR_NOTONCHANNEL, "%s :You're not on that channel", "442" },
926 /* 443 */
927   { ERR_USERONCHANNEL, "%s %s :is already on channel", "443" },
928 /* 444 */
929   { 0 },
930 /* 445 */
931   { 0 },
932 /* 446 */
933   { 0 },
934 /* 447 */
935   { 0 },
936 /* 448 */
937   { 0 },
938 /* 449 */
939   { 0 },
940 /* 450 */
941   { 0 },
942 /* 451 */
943   { ERR_NOTREGISTERED, ":You have not registered", "451" },
944 /* 452 */
945   { 0 },
946 /* 453 */
947   { 0 },
948 /* 454 */
949   { 0 },
950 /* 455 */
951   { 0 },
952 /* 456 */
953   { 0 },
954 /* 457 */
955   { 0 },
956 /* 458 */
957   { 0 },
958 /* 459 */
959   { 0 },
960 /* 460 */
961   { 0 },
962 /* 461 */
963   { ERR_NEEDMOREPARAMS, "%s :Not enough parameters", "461" },
964 /* 462 */
965   { ERR_ALREADYREGISTRED, ":You may not reregister", "462" },
966 /* 463 */
967   { ERR_NOPERMFORHOST, ":Your host isn't among the privileged", "463" },
968 /* 464 */
969   { ERR_PASSWDMISMATCH, ":Password Incorrect", "464" },
970 /* 465 */
971   { ERR_YOUREBANNEDCREEP, ":You are banned from this server", "465" },
972 /* 466 */
973   { ERR_YOUWILLBEBANNED, "", "466" },
974 /* 467 */
975   { ERR_KEYSET, "%s :Channel key already set", "467" },
976 /* 468 */
977   { ERR_INVALIDUSERNAME, 0, "468" },
978 /* 469 */
979   { 0 },
980 /* 470 */
981   { 0 },
982 /* 471 */
983   { ERR_CHANNELISFULL, "%s :Cannot join channel (+l)", "471" },
984 /* 472 */
985   { ERR_UNKNOWNMODE, "%c :is unknown mode char to me", "472" },
986 /* 473 */
987   { ERR_INVITEONLYCHAN, "%s :Cannot join channel (+i)", "473" },
988 /* 474 */
989   { ERR_BANNEDFROMCHAN, "%s :Cannot join channel (+b)", "474" },
990 /* 475 */
991   { ERR_BADCHANNELKEY, "%s :Cannot join channel (+k)", "475" },
992 /* 476 */
993   { ERR_BADCHANMASK, "%s :Bad Channel Mask", "476" },
994 /* 477 */
995   { 0 },
996 /* 478 */
997   { ERR_BANLISTFULL, "%s %s :Channel ban/ignore list is full", "478" },
998 /* 479 */
999   { ERR_BADCHANNAME, "%s :Cannot join channel (access denied on this server)", "479" },
1000 /* 480 */
1001   { 0 },
1002 /* 481 */
1003   { ERR_NOPRIVILEGES, ":Permission Denied: You're not an IRC operator", "481" },
1004 /* 482 */
1005   { ERR_CHANOPRIVSNEEDED, "%s :You're not channel operator", "482" },
1006 /* 483 */
1007   { ERR_CANTKILLSERVER, ":You cant kill a server!", "483" },
1008 /* 484 */
1009   { ERR_ISCHANSERVICE, "%s %s :Cannot kill, kick or deop channel service", "484" },
1010 /* 485 */
1011   { 0 },
1012 /* 486 */
1013   { 0 },
1014 /* 487 */
1015   { 0 },
1016 /* 488 */
1017   { 0 },
1018 /* 489 */
1019   { ERR_VOICENEEDED, "%s :You're neither voiced nor channel operator", "489" },
1020 /* 490 */
1021   { 0 },
1022 /* 491 */
1023   { ERR_NOOPERHOST, ":No O-lines for your host", "491" },
1024 /* 492 */
1025   { 0 },
1026 /* 493 */
1027   { 0 },
1028 /* 494 */
1029   { 0 },
1030 /* 495 */
1031   { 0 },
1032 /* 496 */
1033   { 0 },
1034 /* 497 */
1035   { 0 },
1036 /* 498 */
1037   { ERR_ISOPERLCHAN, "%s %s :Cannot kick or deop an IRC Operator on a local channel", "498" },
1038 /* 499 */
1039   { 0 },
1040 /* 500 */
1041   { 0 },
1042 /* 501 */
1043   { ERR_UMODEUNKNOWNFLAG, ":Unknown MODE flag", "501" },
1044 /* 502 */
1045   { ERR_USERSDONTMATCH, ":Cant change mode for other users", "502" },
1046 /* 503 */
1047   { 0 },
1048 /* 504 */
1049   { 0 },
1050 /* 505 */
1051   { 0 },
1052 /* 506 */
1053   { 0 },
1054 /* 507 */
1055   { 0 },
1056 /* 508 */
1057   { 0 },
1058 /* 509 */
1059   { 0 },
1060 /* 510 */
1061   { 0 },
1062 /* 511 */
1063   { ERR_SILELISTFULL, "%s :Your silence list is full", "511" },
1064 /* 512 */
1065   { ERR_NOSUCHGLINE, "%s :No such gline", "512" },
1066 /* 513 */
1067   { ERR_BADPING, 0, "513" },
1068 /* 514 */
1069   { ERR_NOSUCHJUPE, "%s :No such jupe", "514" },
1070 /* 515 */
1071   { ERR_BADEXPIRE, TIME_T_FMT " :Bad expire time", "515" },
1072 /* 516 */
1073   { ERR_DONTCHEAT, " :Don't Cheat.", "516" },
1074 /* 517 */
1075   { ERR_DISABLED, "%s :Command disabled.", "517" },
1076 /* 518 */
1077   { 0 },
1078 /* 519 */
1079   { 0 },
1080 /* 520 */
1081   { 0 },
1082 /* 521 */
1083   { 0 },
1084 /* 522 */
1085   { 0 },
1086 /* 523 */
1087   { 0 },
1088 /* 524 */
1089   { 0 },
1090 /* 525 */
1091   { 0 },
1092 /* 526 */
1093   { 0 },
1094 /* 527 */
1095   { 0 },
1096 /* 528 */
1097   { 0 },
1098 /* 529 */
1099   { 0 },
1100 /* 530 */
1101   { 0 },
1102 /* 531 */
1103   { 0 },
1104 /* 532 */
1105   { 0 },
1106 /* 533 */
1107   { 0 },
1108 /* 534 */
1109   { 0 },
1110 /* 535 */
1111   { 0 },
1112 /* 536 */
1113   { 0 },
1114 /* 537 */
1115   { 0 },
1116 /* 538 */
1117   { 0 },
1118 /* 539 */
1119   { 0 },
1120 /* 540 */
1121   { 0 },
1122 /* 541 */
1123   { 0 },
1124 /* 542 */
1125   { 0 },
1126 /* 543 */
1127   { 0 },
1128 /* 544 */
1129   { 0 },
1130 /* 545 */
1131   { 0 },
1132 /* 546 */
1133   { 0 },
1134 /* 547 */
1135   { 0 },
1136 /* 548 */
1137   { 0 },
1138 /* 549 */
1139   { 0 },
1140 /* 550 */
1141   { 0 },
1142 /* 551 */
1143   { 0 },
1144 /* 552 */
1145   { 0 },
1146 /* 553 */
1147   { 0 },
1148 /* 554 */
1149   { 0 },
1150 /* 555 */
1151   { 0 },
1152 /* 556 */
1153   { 0 },
1154 /* 557 */
1155   { 0 },
1156 /* 558 */
1157   { 0 },
1158 /* 559 */
1159   { 0 },
1160 /* 560 */
1161   { 0 },
1162 /* 561 */
1163   { 0 },
1164 /* 562 */
1165   { 0 },
1166 /* 563 */
1167   { 0 },
1168 /* 564 */
1169   { 0 },
1170 /* 565 */
1171   { 0 },
1172 /* 566 */
1173   { 0 },
1174 /* 567 */
1175   { 0 },
1176 /* 568 */
1177   { 0 },
1178 /* 569 */
1179   { 0 },
1180 /* 570 */
1181   { 0 },
1182 /* 571 */
1183   { 0 },
1184 /* 572 */
1185   { 0 },
1186 /* 573 */
1187   { 0 },
1188 /* 574 */
1189   { 0 },
1190 /* 575 */
1191   { 0 },
1192 /* 576 */
1193   { 0 },
1194 /* 577 */
1195   { 0 },
1196 /* 578 */
1197   { 0 },
1198 /* 579 */
1199   { 0 },
1200 /* 580 */
1201   { 0 },
1202 /* 581 */
1203   { 0 },
1204 /* 582 */
1205   { 0 },
1206 /* 583 */
1207   { 0 },
1208 /* 584 */
1209   { 0 },
1210 /* 585 */
1211   { 0 },
1212 /* 586 */
1213   { 0 },
1214 /* 587 */
1215   { 0 },
1216 /* 588 */
1217   { 0 },
1218 /* 589 */
1219   { 0 },
1220 /* 590 */
1221   { 0 },
1222 /* 591 */
1223   { 0 },
1224 /* 592 */
1225   { 0 },
1226 /* 593 */
1227   { 0 },
1228 /* 594 */
1229   { 0 },
1230 /* 595 */
1231   { 0 },
1232 /* 596 */
1233   { 0 },
1234 /* 597 */
1235   { 0 },
1236 /* 598 */
1237   { 0 },
1238 /* 599 */
1239   { 0 }
1240 };
1241
1242 const struct Numeric* get_error_numeric(int n)
1243 {
1244   assert(0 < n);
1245   assert(n < ERR_LASTERROR);
1246   assert(0 != replyTable[n].value);
1247
1248   return &replyTable[n];
1249 }
1250
1251 static char numbuff[512];
1252
1253 /* "inline" */
1254 #define prepbuf(buffer, num, tail)                      \
1255 {                                                       \
1256   char *s = buffer + 4;                 \
1257   const char *ap = atoi_tab + (num << 2);       \
1258                                                         \
1259   strcpy(buffer, ":%s 000 %s ");                        \
1260   *s++ = *ap++;                                         \
1261   *s++ = *ap++;                                         \
1262   *s = *ap;                                             \
1263   strcpy(s + 5, tail);                                  \
1264 }
1265
1266 char* err_str(int n)
1267 {
1268   Numeric* p;
1269
1270   assert(0 < n);
1271   assert(n < ERR_LASTERROR);
1272   assert(0 != replyTable[n].value);
1273
1274   p = &replyTable[n];
1275   prepbuf(numbuff, p->value, p->format);
1276
1277   return numbuff;
1278 }
1279
1280 char* rpl_str(int n)
1281 {
1282   Numeric* p;
1283
1284   assert(0 < n);
1285   assert(n < ERR_LASTERROR);
1286   assert(0 != replyTable[n].value);
1287
1288   p = &replyTable[n];
1289   prepbuf(numbuff, p->value, p->format);
1290
1291   return numbuff;
1292 }
1293