1 /* This file is part of the Project Athena Zephyr Notification System.
2 * It contains source for the ZMakeAscii function.
4 * Created by: Robert French
6 * $Id: ZMakeAscii.c 2123 2008-01-20 19:40:42Z kcr $
8 * Copyright (c) 1987 by the Massachusetts Institute of Technology.
9 * For copying and distribution information, see the file
17 static const char rcsid_ZMakeAscii_c[] = "$Id: ZMakeAscii.c 2123 2008-01-20 19:40:42Z kcr $";
20 static char *itox_chars = "0123456789ABCDEF";
23 ZMakeAscii(register char *ptr,
31 /* we need to add "0x" if we are between 4 byte pieces */
35 /* except at the beginning, put a space in before the "0x" */
46 *ptr++ = itox_chars[(int) (field[i] >> 4)];
47 *ptr++ = itox_chars[(int) (field[i] & 0xf)];
56 ZMakeAscii32(register char *ptr,
64 *ptr++ = itox_chars[(value >> 28) & 0xf];
65 *ptr++ = itox_chars[(value >> 24) & 0xf];
66 *ptr++ = itox_chars[(value >> 20) & 0xf];
67 *ptr++ = itox_chars[(value >> 16) & 0xf];
68 *ptr++ = itox_chars[(value >> 12) & 0xf];
69 *ptr++ = itox_chars[(value >> 8) & 0xf];
70 *ptr++ = itox_chars[(value >> 4) & 0xf];
71 *ptr++ = itox_chars[(value >> 0) & 0xf];
77 ZMakeAscii16(register char *ptr,
85 *ptr++ = itox_chars[(value >> 12) & 0xf];
86 *ptr++ = itox_chars[(value >> 8) & 0xf];
87 *ptr++ = itox_chars[(value >> 4) & 0xf];
88 *ptr++ = itox_chars[(value >> 0) & 0xf];