diff --git a/src/sys/include/misc/misc_string_conv.h b/src/sys/include/misc/misc_string_conv.h new file mode 100755 index 0000000..7cd39a7 --- /dev/null +++ b/src/sys/include/misc/misc_string_conv.h @@ -0,0 +1,29 @@ +/* + "misc_string_conv.h" + + created by: grayspace aka J. Leveille + for: UbixOS Project + date: July 7, 2002 + + purpose: functions/macro for dealing with misc string conversion + + $Id$ +*/ + +#ifndef _MISC_STRING_CONV_H +#define _MISC_STRING_CONV_H + +extern const char a_hexvals[]; + +/* gets a hex value specified by a byte into a string + but does *not* null terminate */ +#define HEX_GETSTRING_BYTE_NONULL( p_dst_str, hexval_byte )\ + (p_dst_str)[0] = a_hexvals[((hexval_byte)>>4)];\ + (p_dst_str)[1] = a_hexvals[((hexval_byte)&0x0F)] + +/* gets a hex value specified by a byte into a string */ +#define HEX_GETSTRING_BYTE( p_dst_str, hexval_byte )\ + HEX_GETSTRING_BYTE_NONULL( p_dst_str, hexval_byte );\ + (p_dst_str)[2] = 0 + +#endif // _MISC_STRING_CONV_H \ No newline at end of file