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