]>
Commit | Line | Data |
---|---|---|
1 | /* $NetBSD: hd_init.c,v 1.2 2006/01/25 15:27:42 kleink Exp $ */\r | |
2 | \r | |
3 | /****************************************************************\r | |
4 | \r | |
5 | The author of this software is David M. Gay.\r | |
6 | \r | |
7 | Copyright (C) 2000 by Lucent Technologies\r | |
8 | All Rights Reserved\r | |
9 | \r | |
10 | Permission to use, copy, modify, and distribute this software and\r | |
11 | its documentation for any purpose and without fee is hereby\r | |
12 | granted, provided that the above copyright notice appear in all\r | |
13 | copies and that both that the copyright notice and this\r | |
14 | permission notice and warranty disclaimer appear in supporting\r | |
15 | documentation, and that the name of Lucent or any of its entities\r | |
16 | not be used in advertising or publicity pertaining to\r | |
17 | distribution of the software without specific, written prior\r | |
18 | permission.\r | |
19 | \r | |
20 | LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,\r | |
21 | INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.\r | |
22 | IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY\r | |
23 | SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\r | |
24 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER\r | |
25 | IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,\r | |
26 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF\r | |
27 | THIS SOFTWARE.\r | |
28 | \r | |
29 | ****************************************************************/\r | |
30 | \r | |
31 | /* Please send bug reports to David M. Gay (dmg at acm dot org,\r | |
32 | * with " at " changed at "@" and " dot " changed to "."). */\r | |
33 | #include <LibConfig.h>\r | |
34 | \r | |
35 | #include "gdtoaimp.h"\r | |
36 | \r | |
37 | unsigned char hexdig[256];\r | |
38 | \r | |
39 | static void\r | |
40 | #ifdef KR_headers\r | |
41 | htinit(h, s, inc) unsigned char *h; CONST unsigned char *s; int inc;\r | |
42 | #else\r | |
43 | htinit(unsigned char *h, CONST unsigned char *s, int inc)\r | |
44 | #endif\r | |
45 | {\r | |
46 | int i, j;\r | |
47 | for(i = 0; (j = s[i]) !=0; i++)\r | |
48 | h[j] = (unsigned char)(i + inc);\r | |
49 | }\r | |
50 | \r | |
51 | void\r | |
52 | hexdig_init_D2A(Void)\r | |
53 | {\r | |
54 | #define USC (CONST unsigned char *)\r | |
55 | htinit(hexdig, USC "0123456789", 0x10);\r | |
56 | htinit(hexdig, USC "abcdef", 0x10 + 10);\r | |
57 | htinit(hexdig, USC "ABCDEF", 0x10 + 10);\r | |
58 | }\r |