renamed mc_sml_buf_update_read_bytes to
sml_buf_update_bytes_read
This commit is contained in:
parent
f6a9c978ba
commit
19af19ebaa
6 changed files with 9 additions and 9 deletions
|
@ -99,7 +99,7 @@ unsigned char *sml_buf_get_current_buf(sml_buffer *buf);
|
|||
void sml_buf_optional_write(sml_buffer *buf);
|
||||
|
||||
// Sets the number of bytes read (moves the cursor forward)
|
||||
void mc_sml_buf_update_read_bytes(sml_buffer *buf, int bytes);
|
||||
void sml_buf_update_bytes_read(sml_buffer *buf, int bytes);
|
||||
|
||||
// Checks if the next field is a skipped optional field, updates the buffer accordingly
|
||||
int mc_sml_is_optional_skipped(sml_buffer *buf);
|
||||
|
|
|
@ -66,7 +66,7 @@ sml_file *sml_file_parse(unsigned char *buffer, size_t buffer_len) {
|
|||
|
||||
if(sml_buf_get_current_byte(buf) == SML_MESSAGE_END) {
|
||||
// reading trailing zeroed bytes
|
||||
mc_sml_buf_update_read_bytes(buf, 1);
|
||||
sml_buf_update_bytes_read(buf, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ sml_message *sml_message_parse(sml_buffer *buf) {
|
|||
if (sml_buf_has_errors(buf)) goto error;
|
||||
|
||||
if (sml_buf_get_current_byte(buf) == SML_MESSAGE_END) {
|
||||
mc_sml_buf_update_read_bytes(buf, 1);
|
||||
sml_buf_update_bytes_read(buf, 1);
|
||||
}
|
||||
return msg;
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ u64 mc_sml_parse_number(sml_buffer *buf, unsigned char type, int max_size) {
|
|||
for (i = 0; i < l; i++) {
|
||||
n <<= 8;
|
||||
n |= sml_buf_get_current_byte(buf);
|
||||
mc_sml_buf_update_read_bytes(buf, 1);
|
||||
sml_buf_update_bytes_read(buf, 1);
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ octet_string *sml_octet_string_parse(sml_buffer *buf) {
|
|||
}
|
||||
|
||||
octet_string *str = sml_octet_string_init(sml_buf_get_current_buf(buf), l);
|
||||
mc_sml_buf_update_read_bytes(buf, l);
|
||||
sml_buf_update_bytes_read(buf, l);
|
||||
return str;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,12 +34,12 @@ int sml_buf_get_next_length(sml_buffer *buf) {
|
|||
if ((byte & SML_ANOTHER_TL) != SML_ANOTHER_TL) {
|
||||
break;
|
||||
}
|
||||
mc_sml_buf_update_read_bytes(buf, 1);
|
||||
sml_buf_update_bytes_read(buf, 1);
|
||||
if(list) {
|
||||
list += -1;
|
||||
}
|
||||
}
|
||||
mc_sml_buf_update_read_bytes(buf, 1);
|
||||
sml_buf_update_bytes_read(buf, 1);
|
||||
return length + list;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ unsigned char *sml_buf_get_current_buf(sml_buffer *buf) {
|
|||
return &(buf->buffer[buf->cursor]);
|
||||
}
|
||||
|
||||
void mc_sml_buf_update_read_bytes(sml_buffer *buf, int bytes) {
|
||||
void sml_buf_update_bytes_read(sml_buffer *buf, int bytes) {
|
||||
buf->cursor += bytes;
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ void sml_buffer_free(sml_buffer *buf) {
|
|||
|
||||
int mc_sml_is_optional_skipped(sml_buffer *buf) {
|
||||
if (sml_buf_get_current_byte(buf) == SML_OPTIONAL_SKIPPED) {
|
||||
mc_sml_buf_update_read_bytes(buf, 1);
|
||||
sml_buf_update_bytes_read(buf, 1);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue