summaryrefslogtreecommitdiff
path: root/toxcore/state.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxcore/state.c')
-rw-r--r--toxcore/state.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/toxcore/state.c b/toxcore/state.c
index 8da061f4..aa01b32a 100644
--- a/toxcore/state.c
+++ b/toxcore/state.c
@@ -45,6 +45,7 @@ int state_load(const Logger *log, state_load_cb *state_load_callback, void *oute
45 break; 45 break;
46 46
47 case STATE_LOAD_STATUS_ERROR: 47 case STATE_LOAD_STATUS_ERROR:
48 LOGGER_ERROR(log, "Error occcured in state file (type: %u).", type);
48 return -1; 49 return -1;
49 50
50 case STATE_LOAD_STATUS_END: 51 case STATE_LOAD_STATUS_END:
@@ -60,6 +61,15 @@ int state_load(const Logger *log, state_load_cb *state_load_callback, void *oute
60 return 0; 61 return 0;
61} 62}
62 63
64uint8_t *state_write_section_header(uint8_t *data, uint16_t cookie_type, uint32_t len, uint32_t section_type)
65{
66 host_to_lendian32(data, len);
67 data += sizeof(uint32_t);
68 host_to_lendian32(data, (host_tolendian16(cookie_type) << 16) | host_tolendian16(section_type));
69 data += sizeof(uint32_t);
70 return data;
71}
72
63uint16_t lendian_to_host16(uint16_t lendian) 73uint16_t lendian_to_host16(uint16_t lendian)
64{ 74{
65#ifdef WORDS_BIGENDIAN 75#ifdef WORDS_BIGENDIAN