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 * Copyright (c) 1987 by the Massachusetts Institute of Technology.
7 * For copying and distribution information, see the file
13 static char *itox_chars
= "0123456789ABCDEF";
15 Code_t
ZMakeAscii(ptr
, len
, field
, num
)
24 /* we need to add "0x" if we are between 4 byte pieces */
28 /* except at the beginning, put a space in before the "0x" */
39 *ptr
++ = itox_chars
[(int) (field
[i
] >> 4)];
40 *ptr
++ = itox_chars
[(int) (field
[i
] & 0xf)];
48 Code_t
ZMakeAscii32(ptr
, len
, value
)
57 *ptr
++ = itox_chars
[(value
>> 28) & 0xf];
58 *ptr
++ = itox_chars
[(value
>> 24) & 0xf];
59 *ptr
++ = itox_chars
[(value
>> 20) & 0xf];
60 *ptr
++ = itox_chars
[(value
>> 16) & 0xf];
61 *ptr
++ = itox_chars
[(value
>> 12) & 0xf];
62 *ptr
++ = itox_chars
[(value
>> 8) & 0xf];
63 *ptr
++ = itox_chars
[(value
>> 4) & 0xf];
64 *ptr
++ = itox_chars
[(value
>> 0) & 0xf];
69 Code_t
ZMakeAscii16(ptr
, len
, value
)
78 *ptr
++ = itox_chars
[(value
>> 12) & 0xf];
79 *ptr
++ = itox_chars
[(value
>> 8) & 0xf];
80 *ptr
++ = itox_chars
[(value
>> 4) & 0xf];
81 *ptr
++ = itox_chars
[(value
>> 0) & 0xf];