diff options
author | aunsane <aunsane@gmail.com> | 2018-10-08 20:45:34 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2018-10-08 20:45:34 +0300 |
commit | b8ad6c3cc2edef99dc2a416667c3933c1061994c (patch) | |
tree | 040c82bc03349628c9937215562ee93935672366 /protocols/Tox/libtox/src/toxcore/state.c | |
parent | 0c470817d4d49a872bd068e717c6439f2b6cd5c0 (diff) |
Tox: toxcore updated to v0.2.8
Diffstat (limited to 'protocols/Tox/libtox/src/toxcore/state.c')
-rw-r--r-- | protocols/Tox/libtox/src/toxcore/state.c | 15 |
1 files changed, 15 insertions, 0 deletions
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 |