diff options
Diffstat (limited to 'toxav/msi.c')
-rwxr-xr-x | toxav/msi.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/toxav/msi.c b/toxav/msi.c index c2d50302..aab13471 100755 --- a/toxav/msi.c +++ b/toxav/msi.c | |||
@@ -28,8 +28,6 @@ | |||
28 | 28 | ||
29 | #include "../toxcore/logger.h" | 29 | #include "../toxcore/logger.h" |
30 | 30 | ||
31 | /*#define _BSD_SOURCE*/ | ||
32 | |||
33 | #include "msi.h" | 31 | #include "msi.h" |
34 | #include "event.h" | 32 | #include "event.h" |
35 | 33 | ||
@@ -219,7 +217,7 @@ static inline__ const uint8_t *stringify_response ( MSIResponse response ) | |||
219 | * @param msg Container. | 217 | * @param msg Container. |
220 | * @param data The data. | 218 | * @param data The data. |
221 | * @return int | 219 | * @return int |
222 | * @retval -1 Error occured. | 220 | * @retval -1 Error occurred. |
223 | * @retval 0 Success. | 221 | * @retval 0 Success. |
224 | */ | 222 | */ |
225 | int parse_raw_data ( MSIMessage *msg, const uint8_t *data, uint16_t length ) | 223 | int parse_raw_data ( MSIMessage *msg, const uint8_t *data, uint16_t length ) |
@@ -354,7 +352,7 @@ void free_message ( MSIMessage *msg ) | |||
354 | * @param type Request or response. | 352 | * @param type Request or response. |
355 | * @param type_id Type of request/response. | 353 | * @param type_id Type of request/response. |
356 | * @return MSIMessage* Created message. | 354 | * @return MSIMessage* Created message. |
357 | * @retval NULL Error occured. | 355 | * @retval NULL Error occurred. |
358 | */ | 356 | */ |
359 | MSIMessage *msi_new_message ( uint8_t type, const uint8_t *type_id ) | 357 | MSIMessage *msi_new_message ( uint8_t type, const uint8_t *type_id ) |
360 | { | 358 | { |
@@ -387,7 +385,7 @@ MSIMessage *msi_new_message ( uint8_t type, const uint8_t *type_id ) | |||
387 | * | 385 | * |
388 | * @param data The data. | 386 | * @param data The data. |
389 | * @return MSIMessage* Parsed message. | 387 | * @return MSIMessage* Parsed message. |
390 | * @retval NULL Error occured. | 388 | * @retval NULL Error occurred. |
391 | */ | 389 | */ |
392 | MSIMessage *parse_message ( const uint8_t *data, uint16_t length ) | 390 | MSIMessage *parse_message ( const uint8_t *data, uint16_t length ) |
393 | { | 391 | { |
@@ -495,7 +493,7 @@ uint8_t *append_header_to_string ( | |||
495 | 493 | ||
496 | *dest = field_byte; /* Set the first byte */ | 494 | *dest = field_byte; /* Set the first byte */ |
497 | 495 | ||
498 | uint8_t *_getback_byte = dest + 1; /* remeber the byte we were on */ | 496 | uint8_t *_getback_byte = dest + 1; /* remember the byte we were on */ |
499 | dest += 3; /* swith to 4th byte where field value starts */ | 497 | dest += 3; /* swith to 4th byte where field value starts */ |
500 | 498 | ||
501 | /* Now set the field value and calculate it's length */ | 499 | /* Now set the field value and calculate it's length */ |
@@ -685,7 +683,7 @@ static inline__ const uint8_t *stringify_error_code ( MSICallError error_code ) | |||
685 | * @param msg The message. | 683 | * @param msg The message. |
686 | * @param to Where to. | 684 | * @param to Where to. |
687 | * @return int | 685 | * @return int |
688 | * @retval -1 Error occured. | 686 | * @retval -1 Error occurred. |
689 | * @retval 0 Success. | 687 | * @retval 0 Success. |
690 | */ | 688 | */ |
691 | int send_message ( MSISession *session, MSICall* call, MSIMessage *msg, uint32_t to ) | 689 | int send_message ( MSISession *session, MSICall* call, MSIMessage *msg, uint32_t to ) |
@@ -838,7 +836,7 @@ int handle_error ( MSISession *session, MSICall* call, MSICallError errid, uint3 | |||
838 | * @param msg The message. | 836 | * @param msg The message. |
839 | * @return int | 837 | * @return int |
840 | * @retval -1 No error. | 838 | * @retval -1 No error. |
841 | * @retval 0 Error occured and response sent. | 839 | * @retval 0 Error occurred and response sent. |
842 | */ | 840 | */ |
843 | int has_call_error ( MSISession *session, MSICall* call, MSIMessage *msg ) | 841 | int has_call_error ( MSISession *session, MSICall* call, MSIMessage *msg ) |
844 | { | 842 | { |
@@ -951,7 +949,7 @@ MSICall *init_call ( MSISession *session, int peers, int ringing_timeout ) | |||
951 | * | 949 | * |
952 | * @param session Control session. | 950 | * @param session Control session. |
953 | * @return int | 951 | * @return int |
954 | * @retval -1 Error occured. | 952 | * @retval -1 Error occurred. |
955 | * @retval 0 Success. | 953 | * @retval 0 Success. |
956 | */ | 954 | */ |
957 | int terminate_call ( MSISession *session, MSICall *call ) | 955 | int terminate_call ( MSISession *session, MSICall *call ) |
@@ -1031,7 +1029,7 @@ int handle_recv_invite ( MSISession *session, MSICall* call, MSIMessage *msg ) | |||
1031 | * B calls A. Who has advantage is set bey calculating | 1029 | * B calls A. Who has advantage is set bey calculating |
1032 | * 'bigger' Call id and then that call id is being used in | 1030 | * 'bigger' Call id and then that call id is being used in |
1033 | * future. User with 'bigger' Call id has the advantage | 1031 | * future. User with 'bigger' Call id has the advantage |
1034 | * as in he will wait the reponse from the other. | 1032 | * as in he will wait the response from the other. |
1035 | */ | 1033 | */ |
1036 | 1034 | ||
1037 | if ( call_id_bigger (call->id, msg->callid.header_value) == 1 ) { /* Peer has advantage */ | 1035 | if ( call_id_bigger (call->id, msg->callid.header_value) == 1 ) { /* Peer has advantage */ |
@@ -1408,7 +1406,7 @@ void msi_register_callback ( MSICallback callback, MSICallbackID id, void* userd | |||
1408 | * @param messenger Tox* object. | 1406 | * @param messenger Tox* object. |
1409 | * @param max_calls Amount of calls possible | 1407 | * @param max_calls Amount of calls possible |
1410 | * @return MSISession* The created session. | 1408 | * @return MSISession* The created session. |
1411 | * @retval NULL Error occured. | 1409 | * @retval NULL Error occurred. |
1412 | */ | 1410 | */ |
1413 | MSISession *msi_init_session ( Messenger* messenger, int32_t max_calls ) | 1411 | MSISession *msi_init_session ( Messenger* messenger, int32_t max_calls ) |
1414 | { | 1412 | { |
@@ -1530,7 +1528,7 @@ int msi_invite ( MSISession* session, int32_t* call_index, MSICallType call_type | |||
1530 | * @param session Control session. | 1528 | * @param session Control session. |
1531 | * @param call_id To which call is this action handled. | 1529 | * @param call_id To which call is this action handled. |
1532 | * @return int | 1530 | * @return int |
1533 | * @retval -1 Error occured. | 1531 | * @retval -1 Error occurred. |
1534 | * @retval 0 Success. | 1532 | * @retval 0 Success. |
1535 | */ | 1533 | */ |
1536 | int msi_hangup ( MSISession* session, int32_t call_index ) | 1534 | int msi_hangup ( MSISession* session, int32_t call_index ) |