1*ac898a26Skleink /* $NetBSD: hd_init.c,v 1.2 2006/01/25 15:27:42 kleink Exp $ */
27684d5e0Skleink
37684d5e0Skleink /****************************************************************
47684d5e0Skleink
57684d5e0Skleink The author of this software is David M. Gay.
67684d5e0Skleink
77684d5e0Skleink Copyright (C) 2000 by Lucent Technologies
87684d5e0Skleink All Rights Reserved
97684d5e0Skleink
107684d5e0Skleink Permission to use, copy, modify, and distribute this software and
117684d5e0Skleink its documentation for any purpose and without fee is hereby
127684d5e0Skleink granted, provided that the above copyright notice appear in all
137684d5e0Skleink copies and that both that the copyright notice and this
147684d5e0Skleink permission notice and warranty disclaimer appear in supporting
157684d5e0Skleink documentation, and that the name of Lucent or any of its entities
167684d5e0Skleink not be used in advertising or publicity pertaining to
177684d5e0Skleink distribution of the software without specific, written prior
187684d5e0Skleink permission.
197684d5e0Skleink
207684d5e0Skleink LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
217684d5e0Skleink INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
227684d5e0Skleink IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
237684d5e0Skleink SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
247684d5e0Skleink WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
257684d5e0Skleink IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
267684d5e0Skleink ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
277684d5e0Skleink THIS SOFTWARE.
287684d5e0Skleink
297684d5e0Skleink ****************************************************************/
307684d5e0Skleink
317684d5e0Skleink /* Please send bug reports to David M. Gay (dmg at acm dot org,
327684d5e0Skleink * with " at " changed at "@" and " dot " changed to "."). */
337684d5e0Skleink
347684d5e0Skleink #include "gdtoaimp.h"
357684d5e0Skleink
367684d5e0Skleink unsigned char hexdig[256];
377684d5e0Skleink
387684d5e0Skleink static void
397684d5e0Skleink #ifdef KR_headers
htinit(h,s,inc)40*ac898a26Skleink htinit(h, s, inc) unsigned char *h; CONST unsigned char *s; int inc;
417684d5e0Skleink #else
42*ac898a26Skleink htinit(unsigned char *h, CONST unsigned char *s, int inc)
437684d5e0Skleink #endif
447684d5e0Skleink {
457684d5e0Skleink int i, j;
467684d5e0Skleink for(i = 0; (j = s[i]) !=0; i++)
477684d5e0Skleink h[j] = i + inc;
487684d5e0Skleink }
497684d5e0Skleink
507684d5e0Skleink void
hexdig_init_D2A(Void)517684d5e0Skleink hexdig_init_D2A(Void)
527684d5e0Skleink {
53*ac898a26Skleink #define USC (CONST unsigned char *)
547684d5e0Skleink htinit(hexdig, USC "0123456789", 0x10);
557684d5e0Skleink htinit(hexdig, USC "abcdef", 0x10 + 10);
567684d5e0Skleink htinit(hexdig, USC "ABCDEF", 0x10 + 10);
577684d5e0Skleink }
58