renamed mc_sml_get_length to
sml_buf_get_next_lenght
This commit is contained in:
parent
1e11af2b41
commit
b1e7570641
15 changed files with 17 additions and 17 deletions
|
@ -80,7 +80,7 @@ void sml_buffer_free(sml_buffer *buf);
|
|||
|
||||
// Returns the length of the following data structure. Sets the cursor position to
|
||||
// the value field.
|
||||
int mc_sml_get_length(sml_buffer *buf);
|
||||
int sml_buf_get_next_length(sml_buffer *buf);
|
||||
|
||||
void mc_sml_set_type_and_length(sml_buffer *buf, unsigned int type, unsigned int l);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ sml_attention_response *sml_attention_response_parse(sml_buffer *buf){
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 4) {
|
||||
if (sml_buf_get_next_length(buf) != 4) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ sml_close_request * sml_close_request_parse(sml_buffer *buf) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 1) {
|
||||
if (sml_buf_get_next_length(buf) != 1) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ sml_close_response *sml_close_response_parse(sml_buffer *buf) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 1) {
|
||||
if (sml_buf_get_next_length(buf) != 1) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ sml_get_list_request *sml_get_list_request_parse(sml_buffer *buf) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 5) {
|
||||
if (sml_buf_get_next_length(buf) != 5) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ sml_get_list_response *sml_get_list_response_parse(sml_buffer *buf) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 7) {
|
||||
if (sml_buf_get_next_length(buf) != 7) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ sml_get_profile_pack_request *sml_get_profile_pack_request_parse(sml_buffer *buf
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 9) {
|
||||
if (sml_buf_get_next_length(buf) != 9) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ sml_list *sml_list_parse(sml_buffer *buf) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
elems = mc_sml_get_length(buf);
|
||||
elems = sml_buf_get_next_length(buf);
|
||||
sml_list *start = 0;
|
||||
sml_list *cur = 0;
|
||||
sml_list *tmp;
|
||||
|
@ -54,7 +54,7 @@ sml_list *sml_list_parse(sml_buffer *buf) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 7) {
|
||||
if (sml_buf_get_next_length(buf) != 7) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ sml_message *sml_message_parse(sml_buffer *buf) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 6) {
|
||||
if (sml_buf_get_next_length(buf) != 6) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ sml_message_body *sml_message_body_parse(sml_buffer *buf) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 2) {
|
||||
if (sml_buf_get_next_length(buf) != 2) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ u64 mc_sml_parse_number(sml_buffer *buf, unsigned char type, int max_size) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
l = mc_sml_get_length(buf);
|
||||
l = sml_buf_get_next_length(buf);
|
||||
if (l < 0 || l > max_size) {
|
||||
buf->error = 1;
|
||||
return 0;
|
||||
|
|
|
@ -87,7 +87,7 @@ octet_string *sml_octet_string_parse(sml_buffer *buf) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
l = mc_sml_get_length(buf);
|
||||
l = sml_buf_get_next_length(buf);
|
||||
if (l < 0) {
|
||||
buf->error = 1;
|
||||
return 0;
|
||||
|
|
|
@ -77,7 +77,7 @@ sml_open_request *sml_open_request_parse(sml_buffer *buf) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 7) {
|
||||
if (sml_buf_get_next_length(buf) != 7) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ sml_open_response *sml_open_response_parse(sml_buffer *buf) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 6) {
|
||||
if (sml_buf_get_next_length(buf) != 6) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <sml/sml_shared.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int mc_sml_get_length(sml_buffer *buf) {
|
||||
int sml_buf_get_next_length(sml_buffer *buf) {
|
||||
int length = 0;
|
||||
unsigned char byte = mc_sml_buf_get_current_byte(buf);
|
||||
int list = ((byte & SML_TYPE_FIELD) == SML_TYPE_LIST) ? 0 : -1;
|
||||
|
|
|
@ -30,7 +30,7 @@ sml_time *sml_time_parse(sml_buffer *buf) {
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (mc_sml_get_length(buf) != 2) {
|
||||
if (sml_buf_get_next_length(buf) != 2) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue