diff options
Diffstat (limited to 'toxav/msi.c')
-rwxr-xr-x | toxav/msi.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/toxav/msi.c b/toxav/msi.c index 26e301d3..3ffb44b2 100755 --- a/toxav/msi.c +++ b/toxav/msi.c | |||
@@ -206,7 +206,7 @@ static inline__ const uint8_t *stringify_response ( MSIResponse response ) | |||
206 | 206 | ||
207 | #define ON_HEADER(iterator, header, descriptor, size_const) \ | 207 | #define ON_HEADER(iterator, header, descriptor, size_const) \ |
208 | ( memcmp(iterator, descriptor, size_const) == 0){ /* Okay */ \ | 208 | ( memcmp(iterator, descriptor, size_const) == 0){ /* Okay */ \ |
209 | iterator += size_const; /* Set iterator at begining of value part */ \ | 209 | iterator += size_const; /* Set iterator at beginning of value part */ \ |
210 | if ( *iterator != value_byte ) { assert(0); return -1; }\ | 210 | if ( *iterator != value_byte ) { assert(0); return -1; }\ |
211 | iterator ++;\ | 211 | iterator ++;\ |
212 | uint16_t _value_size = (uint16_t) *(iterator ) << 8 | \ | 212 | uint16_t _value_size = (uint16_t) *(iterator ) << 8 | \ |
@@ -225,7 +225,7 @@ static inline__ const uint8_t *stringify_response ( MSIResponse response ) | |||
225 | * @param msg Container. | 225 | * @param msg Container. |
226 | * @param data The data. | 226 | * @param data The data. |
227 | * @return int | 227 | * @return int |
228 | * @retval -1 Error occured. | 228 | * @retval -1 Error occurred. |
229 | * @retval 0 Success. | 229 | * @retval 0 Success. |
230 | */ | 230 | */ |
231 | int parse_raw_data ( MSIMessage *msg, const uint8_t *data, uint16_t length ) | 231 | int parse_raw_data ( MSIMessage *msg, const uint8_t *data, uint16_t length ) |
@@ -338,7 +338,7 @@ void free_message ( MSIMessage *msg ) | |||
338 | * @param type Request or response. | 338 | * @param type Request or response. |
339 | * @param type_id Type of request/response. | 339 | * @param type_id Type of request/response. |
340 | * @return MSIMessage* Created message. | 340 | * @return MSIMessage* Created message. |
341 | * @retval NULL Error occured. | 341 | * @retval NULL Error occurred. |
342 | */ | 342 | */ |
343 | MSIMessage *msi_new_message ( uint8_t type, const uint8_t *type_id ) | 343 | MSIMessage *msi_new_message ( uint8_t type, const uint8_t *type_id ) |
344 | { | 344 | { |
@@ -367,7 +367,7 @@ MSIMessage *msi_new_message ( uint8_t type, const uint8_t *type_id ) | |||
367 | * | 367 | * |
368 | * @param data The data. | 368 | * @param data The data. |
369 | * @return MSIMessage* Parsed message. | 369 | * @return MSIMessage* Parsed message. |
370 | * @retval NULL Error occured. | 370 | * @retval NULL Error occurred. |
371 | */ | 371 | */ |
372 | MSIMessage *parse_message ( const uint8_t *data, uint16_t length ) | 372 | MSIMessage *parse_message ( const uint8_t *data, uint16_t length ) |
373 | { | 373 | { |
@@ -422,7 +422,7 @@ uint8_t *append_header_to_string ( | |||
422 | 422 | ||
423 | *dest = field_byte; /* Set the first byte */ | 423 | *dest = field_byte; /* Set the first byte */ |
424 | 424 | ||
425 | uint8_t *_getback_byte = dest + 1; /* remeber the byte we were on */ | 425 | uint8_t *_getback_byte = dest + 1; /* remember the byte we were on */ |
426 | dest += 3; /* swith to 4th byte where field value starts */ | 426 | dest += 3; /* swith to 4th byte where field value starts */ |
427 | 427 | ||
428 | /* Now set the field value and calculate it's length */ | 428 | /* Now set the field value and calculate it's length */ |
@@ -604,7 +604,7 @@ static inline__ const uint8_t *stringify_error_code ( MSICallError error_code ) | |||
604 | * @param msg The message. | 604 | * @param msg The message. |
605 | * @param to Where to. | 605 | * @param to Where to. |
606 | * @return int | 606 | * @return int |
607 | * @retval -1 Error occured. | 607 | * @retval -1 Error occurred. |
608 | * @retval 0 Success. | 608 | * @retval 0 Success. |
609 | */ | 609 | */ |
610 | int send_message ( MSISession *session, MSIMessage *msg, uint32_t to ) | 610 | int send_message ( MSISession *session, MSIMessage *msg, uint32_t to ) |
@@ -721,7 +721,7 @@ int handle_error ( MSISession *session, MSICallError errid, uint32_t to ) | |||
721 | * @param msg The message. | 721 | * @param msg The message. |
722 | * @return int | 722 | * @return int |
723 | * @retval -1 No error. | 723 | * @retval -1 No error. |
724 | * @retval 0 Error occured and response sent. | 724 | * @retval 0 Error occurred and response sent. |
725 | */ | 725 | */ |
726 | int has_call_error ( MSISession *session, MSIMessage *msg ) | 726 | int has_call_error ( MSISession *session, MSIMessage *msg ) |
727 | { | 727 | { |
@@ -830,7 +830,7 @@ MSICall *init_call ( MSISession *session, int peers, int ringing_timeout ) | |||
830 | * | 830 | * |
831 | * @param session Control session. | 831 | * @param session Control session. |
832 | * @return int | 832 | * @return int |
833 | * @retval -1 Error occured. | 833 | * @retval -1 Error occurred. |
834 | * @retval 0 Success. | 834 | * @retval 0 Success. |
835 | */ | 835 | */ |
836 | int terminate_call ( MSISession *session ) | 836 | int terminate_call ( MSISession *session ) |
@@ -882,7 +882,7 @@ int handle_recv_invite ( MSISession *session, MSIMessage *msg ) | |||
882 | * B calls A. Who has advantage is set bey calculating | 882 | * B calls A. Who has advantage is set bey calculating |
883 | * 'bigger' Call id and then that call id is being used in | 883 | * 'bigger' Call id and then that call id is being used in |
884 | * future. User with 'bigger' Call id has the advantage | 884 | * future. User with 'bigger' Call id has the advantage |
885 | * as in he will wait the reponse from the other. | 885 | * as in he will wait the response from the other. |
886 | */ | 886 | */ |
887 | 887 | ||
888 | if ( call_id_bigger (session->call->id, msg->callid.header_value) == 1 ) { /* Peer has advantage */ | 888 | if ( call_id_bigger (session->call->id, msg->callid.header_value) == 1 ) { /* Peer has advantage */ |
@@ -1250,7 +1250,7 @@ void msi_register_callback ( MSICallback callback, MSICallbackID id, void* userd | |||
1250 | * @param messenger Tox* object. | 1250 | * @param messenger Tox* object. |
1251 | * @param user_agent User agent, i.e. 'Venom'; 'QT-gui' | 1251 | * @param user_agent User agent, i.e. 'Venom'; 'QT-gui' |
1252 | * @return MSISession* The created session. | 1252 | * @return MSISession* The created session. |
1253 | * @retval NULL Error occured. | 1253 | * @retval NULL Error occurred. |
1254 | */ | 1254 | */ |
1255 | MSISession *msi_init_session ( Messenger* messenger ) | 1255 | MSISession *msi_init_session ( Messenger* messenger ) |
1256 | { | 1256 | { |
@@ -1351,7 +1351,7 @@ int msi_invite ( MSISession *session, MSICallType call_type, uint32_t rngsec, ui | |||
1351 | * | 1351 | * |
1352 | * @param session Control session. | 1352 | * @param session Control session. |
1353 | * @return int | 1353 | * @return int |
1354 | * @retval -1 Error occured. | 1354 | * @retval -1 Error occurred. |
1355 | * @retval 0 Success. | 1355 | * @retval 0 Success. |
1356 | */ | 1356 | */ |
1357 | int msi_hangup ( MSISession *session ) | 1357 | int msi_hangup ( MSISession *session ) |
@@ -1485,4 +1485,4 @@ int msi_stopcall ( MSISession *session ) | |||
1485 | terminate_call ( session ); | 1485 | terminate_call ( session ); |
1486 | 1486 | ||
1487 | return 0; | 1487 | return 0; |
1488 | } \ No newline at end of file | 1488 | } |