libbb: factor out hex2bin() for infiniband address parser

function                                             old     new   delta
hex2bin                                                -     149    +149
in_ib                                                172      27    -145

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2010-04-04 15:29:32 +02:00
parent c03602baa4
commit 4836331924
4 changed files with 46 additions and 49 deletions

View File

@ -734,6 +734,8 @@ const char *make_human_readable_str(unsigned long long size,
unsigned long block_size, unsigned long display_unit) FAST_FUNC;
/* Put a string of hex bytes ("1b2e66fe"...), return advanced pointer */
char *bin2hex(char *buf, const char *cp, int count) FAST_FUNC;
/* Reverse */
char* hex2bin(char *dst, const char *str, int count) FAST_FUNC;
/* Generate a UUID */
void generate_uuid(uint8_t *buf) FAST_FUNC;