From b8ad6c3cc2edef99dc2a416667c3933c1061994c Mon Sep 17 00:00:00 2001 From: aunsane Date: Mon, 8 Oct 2018 20:45:34 +0300 Subject: Tox: toxcore updated to v0.2.8 --- protocols/Tox/libtox/src/toxcore/state.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'protocols/Tox/libtox/src/toxcore/state.c') diff --git a/protocols/Tox/libtox/src/toxcore/state.c b/protocols/Tox/libtox/src/toxcore/state.c index 8da061f4a6..29b4af88a3 100644 --- a/protocols/Tox/libtox/src/toxcore/state.c +++ b/protocols/Tox/libtox/src/toxcore/state.c @@ -45,6 +45,7 @@ int state_load(const Logger *log, state_load_cb *state_load_callback, void *oute break; case STATE_LOAD_STATUS_ERROR: + LOGGER_ERROR(log, "Error occcured in state file (type: %u).", type); return -1; case STATE_LOAD_STATUS_END: @@ -60,6 +61,15 @@ int state_load(const Logger *log, state_load_cb *state_load_callback, void *oute return 0; } +uint8_t *state_write_section_header(uint8_t *data, uint16_t cookie_type, uint32_t len, uint32_t section_type) +{ + host_to_lendian32(data, len); + data += sizeof(uint32_t); + host_to_lendian32(data, (host_tolendian16(cookie_type) << 16) | host_tolendian16(section_type)); + data += sizeof(uint32_t); + return data; +} + uint16_t lendian_to_host16(uint16_t lendian) { #ifdef WORDS_BIGENDIAN @@ -69,6 +79,11 @@ uint16_t lendian_to_host16(uint16_t lendian) #endif } +uint16_t host_tolendian16(uint16_t host) +{ + return lendian_to_host16(host); +} + void host_to_lendian32(uint8_t *dest, uint32_t num) { #ifdef WORDS_BIGENDIAN -- cgit v1.2.3