renamed mc_sml_buf_get_current_type to
sml_buf_get_next_type
This commit is contained in:
parent
eb76c84331
commit
92820c83b8
17 changed files with 19 additions and 19 deletions
|
@ -88,7 +88,7 @@ void sml_buf_set_type_and_length(sml_buffer *buf, unsigned int type, unsigned in
|
|||
int sml_buf_has_errors(sml_buffer *buf);
|
||||
|
||||
// Returns the type field of the current byte.
|
||||
int mc_sml_buf_get_current_type(sml_buffer *buf);
|
||||
int sml_buf_get_next_type(sml_buffer *buf);
|
||||
|
||||
// Returns the current byte.
|
||||
unsigned char mc_sml_buf_get_current_byte(sml_buffer *buf);
|
||||
|
|
|
@ -24,7 +24,7 @@ sml_attention_response *sml_attention_response_parse(sml_buffer *buf){
|
|||
sml_attention_response *msg = (sml_attention_response *) malloc(sizeof(sml_attention_response));
|
||||
memset(msg, 0, sizeof(sml_attention_response));
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ sml_close_request * sml_close_request_parse(sml_buffer *buf) {
|
|||
sml_close_request *msg = (sml_close_request *) malloc(sizeof(sml_close_request));
|
||||
memset(msg, 0, sizeof(sml_close_request));
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ sml_close_response *sml_close_response_parse(sml_buffer *buf) {
|
|||
sml_close_response *msg = (sml_close_response *) malloc(sizeof(sml_close_response));
|
||||
memset(msg, 0, sizeof(sml_close_response));
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ sml_get_list_request *sml_get_list_request_parse(sml_buffer *buf) {
|
|||
sml_get_list_request *msg = (sml_get_list_request *) malloc(sizeof(sml_get_list_request));
|
||||
memset(msg, 0, sizeof(sml_get_list_request));
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ sml_get_list_response *sml_get_list_response_parse(sml_buffer *buf) {
|
|||
sml_get_list_response *msg = (sml_get_list_response *) malloc(sizeof(sml_get_list_response));
|
||||
memset(msg, 0, sizeof(sml_get_list_response));
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ sml_get_profile_pack_request *sml_get_profile_pack_request_parse(sml_buffer *buf
|
|||
sml_get_profile_pack_request *msg = (sml_get_profile_pack_request *) malloc(sizeof(sml_get_profile_pack_request));
|
||||
memset(msg, 0, sizeof(sml_get_profile_pack_request));
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ sml_list *sml_list_init(){
|
|||
|
||||
sml_list *sml_list_parse(sml_buffer *buf) {
|
||||
int elems, i;
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ sml_list *sml_list_parse(sml_buffer *buf) {
|
|||
|
||||
for (i = 0; i < elems; i++) {
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ sml_message *sml_message_parse(sml_buffer *buf) {
|
|||
sml_message *msg = (sml_message *) malloc(sizeof(sml_message));
|
||||
memset(msg, 0, sizeof(sml_message));
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ sml_message_body *sml_message_body_parse(sml_buffer *buf) {
|
|||
sml_message_body *msg_body = (sml_message_body *) malloc(sizeof(sml_message_body));
|
||||
memset(msg_body, 0, sizeof(sml_message_body));
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ u64 mc_sml_parse_number(sml_buffer *buf, unsigned char type, int max_size) {
|
|||
|
||||
int l, i;
|
||||
u64 n = 0;
|
||||
if (mc_sml_buf_get_current_type(buf) != type) {
|
||||
if (sml_buf_get_next_type(buf) != type) {
|
||||
buf->error = 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ void sml_octet_string_free(octet_string *str) {
|
|||
|
||||
octet_string *sml_octet_string_parse(sml_buffer *buf) {
|
||||
int l;
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_OCTET_STRING) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_OCTET_STRING) {
|
||||
buf->error = 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ sml_open_request *sml_open_request_parse(sml_buffer *buf) {
|
|||
sml_open_request *msg = (sml_open_request *) malloc(sizeof(sml_open_request));
|
||||
memset(msg, 0, sizeof(sml_open_request));
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ sml_open_response *sml_open_response_parse(sml_buffer *buf) {
|
|||
sml_open_response *msg = (sml_open_response *) malloc(sizeof(sml_open_response));
|
||||
memset(msg, 0, sizeof(sml_open_response));
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ int sml_buf_has_errors(sml_buffer *buf) {
|
|||
return buf->error != 0;
|
||||
}
|
||||
|
||||
int mc_sml_buf_get_current_type(sml_buffer *buf) {
|
||||
int sml_buf_get_next_type(sml_buffer *buf) {
|
||||
return (buf->buffer[buf->cursor] & SML_TYPE_FIELD);
|
||||
}
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include <sml/sml_shared.h>
|
||||
|
||||
sml_status *sml_status_parse(sml_buffer *buf) {
|
||||
int type = mc_sml_buf_get_current_type(buf);
|
||||
int type = sml_buf_get_next_type(buf);
|
||||
unsigned char byte = mc_sml_buf_get_current_byte(buf);
|
||||
|
||||
sml_status *state = (sml_status *) malloc(sizeof(sml_status));
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
sml_time *sml_time_parse(sml_buffer *buf) {
|
||||
sml_time *tme = (sml_time *) malloc(sizeof(sml_time));
|
||||
|
||||
if (mc_sml_buf_get_current_type(buf) != SML_TYPE_LIST) {
|
||||
if (sml_buf_get_next_type(buf) != SML_TYPE_LIST) {
|
||||
buf->error = 1;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
sml_value *sml_value_parse(sml_buffer *buf) {
|
||||
int type = mc_sml_buf_get_current_type(buf);
|
||||
int type = sml_buf_get_next_type(buf);
|
||||
unsigned char byte = mc_sml_buf_get_current_byte(buf);
|
||||
|
||||
sml_value *value = (sml_value *) malloc(sizeof(sml_value));
|
||||
|
|
Loading…
Add table
Reference in a new issue