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