* of the GNU Lesser General Public License.
*/
-#include "ucw/lib.h"
-#include "ucw/string.h"
-#include "ucw/chartype.h"
+#include <ucw/lib.h>
+#include <ucw/string.h>
+#include <ucw/chartype.h>
-static uns
-hex_make(uns x)
+static uint
+hex_make(uint x)
{
return (x < 10) ? (x + '0') : (x - 10 + 'a');
}
void
-mem_to_hex(char *dest, const byte *src, uns bytes, uns flags)
+mem_to_hex(char *dest, const byte *src, size_t bytes, uint flags)
{
- uns sep = flags & 0xff;
+ uint sep = flags & 0xff;
while (bytes--)
{
*dest = 0;
}
-static uns
-hex_parse(uns c)
+static uint
+hex_parse(uint c)
{
c = Cupcase(c);
c -= '0';
}
const char *
-hex_to_mem(byte *dest, const char *src, uns max_bytes, uns flags)
+hex_to_mem(byte *dest, const char *src, size_t max_bytes, uint flags)
{
- uns sep = flags & 0xff;
+ uint sep = flags & 0xff;
while (max_bytes-- && Cxdigit(src[0]) && Cxdigit(src[1]))
{
*dest++ = (hex_parse(src[0]) << 4) | hex_parse(src[1]);