view src/lib/hex-binary.h @ 183:4a7ab9e94f25 HEAD

size_t fixes for lib/. Changed OFF_T_FORMAT to PRIuOFF_T which is more C99-like.
author Timo Sirainen <tss@iki.fi>
date Sun, 08 Sep 2002 16:20:28 +0300
parents a766fb2132de
children f3ab97771ed8
line wrap: on
line source

#ifndef __HEX_BINARY_H
#define __HEX_BINARY_H

/* Convert binary to lowercased hex digits allocating return value from
   temporary memory pool */
const char *binary_to_hex(const unsigned char *data, size_t size);

/* Convert hex to binary. data and dest may point to same value.
   Returns TRUE if successful. Returns number of bytes written to dest,
   or -1 if error occured. Make sure dest is at least half the size of
   strlen(data). */
ssize_t hex_to_binary(const char *data, unsigned char *dest);

#endif