From eb76c84331af6949aebcd6a7b2d1b8166d179817 Mon Sep 17 00:00:00 2001 From: Juri Glass Date: Thu, 16 Jun 2011 16:45:36 +0200 Subject: [PATCH] renamed mc_sml_buf_has_errors to sml_buf_has_errors --- sml/include/sml/sml_shared.h | 2 +- sml/src/sml.c | 2 +- sml/src/sml_attention_response.c | 8 ++++---- sml/src/sml_close_request.c | 2 +- sml/src/sml_close_response.c | 2 +- sml/src/sml_get_list_request.c | 10 +++++----- sml/src/sml_get_list_response.c | 14 +++++++------- sml/src/sml_get_profile_pack_request.c | 14 +++++++------- sml/src/sml_list.c | 14 +++++++------- sml/src/sml_message.c | 12 ++++++------ sml/src/sml_open_request.c | 14 +++++++------- sml/src/sml_open_response.c | 12 ++++++------ sml/src/sml_shared.c | 2 +- sml/src/sml_status.c | 2 +- sml/src/sml_time.c | 4 ++-- sml/src/sml_value.c | 2 +- 16 files changed, 58 insertions(+), 58 deletions(-) diff --git a/sml/include/sml/sml_shared.h b/sml/include/sml/sml_shared.h index 9a887e5..dbec18e 100644 --- a/sml/include/sml/sml_shared.h +++ b/sml/include/sml/sml_shared.h @@ -85,7 +85,7 @@ int sml_buf_get_next_length(sml_buffer *buf); void sml_buf_set_type_and_length(sml_buffer *buf, unsigned int type, unsigned int l); // Checks if a error is occured. -int mc_sml_buf_has_errors(sml_buffer *buf); +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); diff --git a/sml/src/sml.c b/sml/src/sml.c index 881fe84..6c012f2 100644 --- a/sml/src/sml.c +++ b/sml/src/sml.c @@ -72,7 +72,7 @@ sml_file *sml_file_parse(unsigned char *buffer, size_t buffer_len) { msg = sml_message_parse(buf); - if (mc_sml_buf_has_errors(buf)) { + if (sml_buf_has_errors(buf)) { printf("warning: could not read the whole file\n"); break; } diff --git a/sml/src/sml_attention_response.c b/sml/src/sml_attention_response.c index 7749c26..0a9618f 100644 --- a/sml/src/sml_attention_response.c +++ b/sml/src/sml_attention_response.c @@ -35,16 +35,16 @@ sml_attention_response *sml_attention_response_parse(sml_buffer *buf){ } msg->server_id = sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->attention_number = sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->attention_message = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->attention_details = SML_SKIP_OPTIONAL sml_tree_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; return msg; diff --git a/sml/src/sml_close_request.c b/sml/src/sml_close_request.c index 6403212..45f3fd7 100644 --- a/sml/src/sml_close_request.c +++ b/sml/src/sml_close_request.c @@ -50,7 +50,7 @@ sml_close_request * sml_close_request_parse(sml_buffer *buf) { } msg->global_signature = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; return msg; diff --git a/sml/src/sml_close_response.c b/sml/src/sml_close_response.c index 0a4778a..aaf264e 100644 --- a/sml/src/sml_close_response.c +++ b/sml/src/sml_close_response.c @@ -36,7 +36,7 @@ sml_close_response *sml_close_response_parse(sml_buffer *buf) { } msg->global_signature = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; return msg; diff --git a/sml/src/sml_get_list_request.c b/sml/src/sml_get_list_request.c index 91cabe0..179567f 100644 --- a/sml/src/sml_get_list_request.c +++ b/sml/src/sml_get_list_request.c @@ -71,19 +71,19 @@ sml_get_list_request *sml_get_list_request_parse(sml_buffer *buf) { } msg->client_id = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->server_id = sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->username = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->password = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->list_name = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; return msg; diff --git a/sml/src/sml_get_list_response.c b/sml/src/sml_get_list_response.c index 1d4d987..579af64 100644 --- a/sml/src/sml_get_list_response.c +++ b/sml/src/sml_get_list_response.c @@ -37,25 +37,25 @@ sml_get_list_response *sml_get_list_response_parse(sml_buffer *buf) { } msg->client_id = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->server_id = sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->list_name = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->act_sensor_time = SML_SKIP_OPTIONAL sml_time_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->val_list = sml_list_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->list_signature = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->act_gateway_time = SML_SKIP_OPTIONAL sml_time_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; return msg; diff --git a/sml/src/sml_get_profile_pack_request.c b/sml/src/sml_get_profile_pack_request.c index e01a968..b892f7f 100644 --- a/sml/src/sml_get_profile_pack_request.c +++ b/sml/src/sml_get_profile_pack_request.c @@ -89,25 +89,25 @@ sml_get_profile_pack_request *sml_get_profile_pack_request_parse(sml_buffer *buf printf("TODO:sml_get_profile_pack_request_parse -> not implemented yet"); /* msg->client_id = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->server_id = sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->list_name = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; */ /*msg->act_sensor_time = SML_SKIP_OPTIONAL sml_time_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->val_list = sml_list_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->list_signature = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->act_gateway_time = SML_SKIP_OPTIONAL sml_time_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; */ return msg; diff --git a/sml/src/sml_list.c b/sml/src/sml_list.c index c4c064c..b7c11e5 100644 --- a/sml/src/sml_list.c +++ b/sml/src/sml_list.c @@ -70,25 +70,25 @@ sml_list *sml_list_parse(sml_buffer *buf) { } cur->obj_name = sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; cur->status = SML_SKIP_OPTIONAL sml_status_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; cur->val_time = SML_SKIP_OPTIONAL sml_time_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; cur->unit = SML_SKIP_OPTIONAL mc_sml_parse_u8(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; cur->scaler = SML_SKIP_OPTIONAL mc_sml_parse_i8(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; cur->value = SML_SKIP_OPTIONAL sml_value_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; cur->value_signature = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; cur->next = 0; } diff --git a/sml/src/sml_message.c b/sml/src/sml_message.c index 75fc088..a84b18a 100644 --- a/sml/src/sml_message.c +++ b/sml/src/sml_message.c @@ -53,19 +53,19 @@ sml_message *sml_message_parse(sml_buffer *buf) { } msg->transaction_id = sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->group_id = mc_sml_parse_u8(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->abort_on_error = mc_sml_parse_u8(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->message_body = sml_message_body_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->crc = mc_sml_parse_u16(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; if (mc_sml_buf_get_current_byte(buf) == SML_MESSAGE_END) { mc_sml_buf_update_read_bytes(buf, 1); @@ -131,7 +131,7 @@ sml_message_body *sml_message_body_parse(sml_buffer *buf) { } msg_body->tag = mc_sml_parse_u16(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; switch (msg_body->tag) { case SML_MESSAGE_OPEN_REQUEST: diff --git a/sml/src/sml_open_request.c b/sml/src/sml_open_request.c index 2f72cd0..048c661 100644 --- a/sml/src/sml_open_request.c +++ b/sml/src/sml_open_request.c @@ -83,25 +83,25 @@ sml_open_request *sml_open_request_parse(sml_buffer *buf) { } msg->codepage = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->client_id = sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->req_file_id = sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->server_id = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->username = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->password = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->sml_version = SML_SKIP_OPTIONAL mc_sml_parse_u8(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; return msg; diff --git a/sml/src/sml_open_response.c b/sml/src/sml_open_response.c index c54d91b..c862cec 100644 --- a/sml/src/sml_open_response.c +++ b/sml/src/sml_open_response.c @@ -36,22 +36,22 @@ sml_open_response *sml_open_response_parse(sml_buffer *buf) { } msg->codepage = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->client_id = SML_SKIP_OPTIONAL sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->req_file_id = sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->server_id = sml_octet_string_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->ref_time = SML_SKIP_OPTIONAL sml_time_parse(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; msg->sml_version = SML_SKIP_OPTIONAL mc_sml_parse_u8(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; return msg; error: diff --git a/sml/src/sml_shared.c b/sml/src/sml_shared.c index bf33c3e..6288572 100644 --- a/sml/src/sml_shared.c +++ b/sml/src/sml_shared.c @@ -77,7 +77,7 @@ void sml_buf_set_type_and_length(sml_buffer *buf, unsigned int type, unsigned in buf->cursor++; } -int mc_sml_buf_has_errors(sml_buffer *buf) { +int sml_buf_has_errors(sml_buffer *buf) { return buf->error != 0; } diff --git a/sml/src/sml_status.c b/sml/src/sml_status.c index 36b0f6e..64b9ede 100644 --- a/sml/src/sml_status.c +++ b/sml/src/sml_status.c @@ -53,7 +53,7 @@ sml_status *sml_status_parse(sml_buffer *buf) { buf->error = 1; break; } - if (mc_sml_buf_has_errors(buf)) { + if (sml_buf_has_errors(buf)) { free(state); return 0; } diff --git a/sml/src/sml_time.c b/sml/src/sml_time.c index 7d782b2..c104dbe 100644 --- a/sml/src/sml_time.c +++ b/sml/src/sml_time.c @@ -36,10 +36,10 @@ sml_time *sml_time_parse(sml_buffer *buf) { } tme->tag = mc_sml_parse_u8(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; tme->data = mc_sml_parse_u32(buf); - if (mc_sml_buf_has_errors(buf)) goto error; + if (sml_buf_has_errors(buf)) goto error; return tme; diff --git a/sml/src/sml_value.c b/sml/src/sml_value.c index 5f46647..c8357fa 100644 --- a/sml/src/sml_value.c +++ b/sml/src/sml_value.c @@ -95,7 +95,7 @@ sml_value *sml_value_parse(sml_buffer *buf) { buf->error = 1; break; } - if (mc_sml_buf_has_errors(buf)) { + if (sml_buf_has_errors(buf)) { free(value); return 0; }