Browse Source

Add function to extract bkey length

master
Con Kolivas 9 years ago
parent
commit
dc8da6a91c
  1. 7
      src/libckpool.c
  2. 1
      src/libckpool.h

7
src/libckpool.c

@ -1280,6 +1280,13 @@ char *bkey_object(void)
return bkey;
}
/* Extract bkey length */
uint32_t bkey_len(char *bkey)
{
uint32_t *lenptr = bkey_lenptr(bkey);
return le32toh(*lenptr);
}
/* Add binary from hex to a bkey message */
void _bkey_add_hex(char **bkey, const char *key, const char *hex, const char *file, const char *func, const int line)
{

1
src/libckpool.h

@ -320,6 +320,7 @@ typedef struct unixsock unixsock_t;
char *bkey_object(void);
uint32_t bkey_len(char *bkey);
void _bkey_add_hex(char **bkey, const char *key, const char *hex, const char *file, const char *func, const int line);
#define bkey_add_hex(bkey, key, hex) _bkey_add_hex(&(bkey), key, hex, __FILE__, __func__, __LINE__)
void _bkey_add_bin(char **bkey, const char *key, const char *bin, const int blen, const char *file, const char *func, const int line);

Loading…
Cancel
Save