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,v 1.13 1999/01/22 23:19:16 ghudson Exp $
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,v 1.13 1999/01/22 23:19:16 ghudson Exp $";
20 static char *itox_chars = "0123456789ABCDEF";
22 Code_t ZMakeAscii(ptr, len, field, num)
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)];
55 Code_t ZMakeAscii32(ptr, len, value)
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];
76 Code_t ZMakeAscii16(ptr, len, value)
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];