toxcore/testing/hstox/util.h
iphydf b782ef5d8e
Fix formatting and spelling in version-sync script.
Also some minor reformatting and fixes to the hstox sut driver.
2017-06-04 12:07:43 +00:00

29 lines
1.5 KiB
C

#pragma once
#include <msgpack.h>
#include <stdarg.h>
#define check_return(err, expr) \
__extension__({ \
__typeof__(expr) _r = (expr); \
if (_r < 0) \
return err | (__LINE__ << 16); \
_r; \
})
#define propagate(expr) \
do { \
__typeof__(expr) _r = (expr); \
if (_r != E_OK) \
return _r; \
} while (0)
char const *type_name(msgpack_object_type type);
// Statically allocated "asprintf".
char const *ssprintf(char const *fmt, ...);
int msgpack_pack_string(msgpack_packer *pk, char const *str);
int msgpack_pack_stringf(msgpack_packer *pk, char const *fmt, ...);
int msgpack_pack_vstringf(msgpack_packer *pk, char const *fmt, va_list ap);