Commit 51828325 authored by hpi1's avatar hpi1

Move print_hex to strutl.c

parent 6f554657
......@@ -80,10 +80,10 @@ static BDID_DATA *_bdid_parse(const char *file_name)
bs_seek_byte(&bs, 40);
bs_read_bytes(&bs, tmp, 4);
print_hex(bdid->org_id, tmp, 4);
str_print_hex(bdid->org_id, tmp, 4);
bs_read_bytes(&bs, tmp, 16);
print_hex(bdid->disc_id, tmp, 16);
str_print_hex(bdid->disc_id, tmp, 16);
file_close(fp);
return bdid;
......
......@@ -45,16 +45,6 @@ uint32_t bd_get_debug_mask(void)
return debug_mask;
}
char *print_hex(char *out, const uint8_t *buf, int count)
{
int zz;
for(zz = 0; zz < count; zz++) {
sprintf(out + (zz * 2), "%02x", buf[zz]);
}
return out;
}
void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...)
{
static int debug_init = 0;
......
......@@ -36,7 +36,6 @@ BD_PRIVATE extern uint32_t debug_mask;
} \
} while (0)
BD_PRIVATE char *print_hex(char *out, const uint8_t *str, int count);
BD_PRIVATE void bd_debug(const char *file, int line, uint32_t mask, const char *format, ...) BD_ATTR_FORMAT_PRINTF(4,5);
......
......@@ -95,3 +95,13 @@ void str_tolower(char *s)
s++;
}
}
char *str_print_hex(char *out, const uint8_t *buf, int count)
{
int zz;
for (zz = 0; zz < count; zz++) {
sprintf(out + (zz * 2), "%02x", buf[zz]);
}
return out;
}
......@@ -30,4 +30,6 @@ BD_PRIVATE char * str_printf(const char *fmt, ...) BD_ATTR_FORMAT_PRINTF(1,2) BD
BD_PRIVATE uint32_t str_to_uint32(const char *s, int n);
BD_PRIVATE void str_tolower(char *s);
BD_PRIVATE char * str_print_hex(char *out, const uint8_t *str, int count);
#endif // STRUTL_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment