diff --git a/src/deprecated/grib_accessor_class_bufr_data.c b/src/deprecated/grib_accessor_class_bufr_data.c index 093ad5fdb..2f13922a7 100644 --- a/src/deprecated/grib_accessor_class_bufr_data.c +++ b/src/deprecated/grib_accessor_class_bufr_data.c @@ -395,7 +395,7 @@ static int get_descriptors(grib_accessor* a) } if (self->numberOfDescriptors) self_clear(c,self); - err=_grib_get_size(grib_handle_of_accessor(a),expandedDescriptors,&(self->numberOfDescriptors)); + err=ecc__grib_get_size(grib_handle_of_accessor(a),expandedDescriptors,&(self->numberOfDescriptors)); if (err) return err; self->expandedDescriptors=(long*)grib_context_malloc_clear(a->context,sizeof(long)*self->numberOfDescriptors); diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index 08403f572..d35454489 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -153,7 +153,7 @@ int grib_accessor_replace_attribute(grib_accessor* a, grib_accessor* attr); int grib_accessor_delete_attribute(grib_accessor* a, const char* name); grib_accessor* grib_accessor_get_attribute_by_index(grib_accessor* a, int index); const char* grib_accessor_get_name(grib_accessor* a); -grib_accessor* _grib_accessor_get_attribute(grib_accessor* a, const char* name, int* index); +grib_accessor* ecc__grib_accessor_get_attribute(grib_accessor* a, const char* name, int* index); int grib_accessor_has_attributes(grib_accessor* a); grib_accessor* grib_accessor_get_attribute(grib_accessor* a, const char* name); grib_accessors_list* grib_accessors_list_create(grib_context* c); @@ -712,7 +712,7 @@ int grib_index_write(grib_index* index, const char* filename); grib_index* grib_index_read(grib_context* c, const char* filename, int* err); int grib_index_search_same(grib_index* index, grib_handle* h); int grib_index_add_file(grib_index* index, const char* filename); -int _codes_index_add_file(grib_index* index, const char* filename, int message_type); +int ecc__codes_index_add_file(grib_index* index, const char* filename, int message_type); grib_index* grib_index_new_from_file(grib_context* c, const char* filename, const char* keys, int* err); int grib_index_get_size(const grib_index* index, const char* key, size_t* size); int grib_index_get_string(const grib_index* index, const char* key, char** values, size_t* size); @@ -1197,7 +1197,7 @@ char* get_external_template_path(grib_context* c, const char* name); grib_handle* grib_handle_of_accessor(const grib_accessor* a); void grib_dependency_add(grib_accessor* observer, grib_accessor* observed); void grib_dependency_remove_observed(grib_accessor* observed); -int _grib_dependency_notify_change(grib_handle* h, grib_accessor* observed); +int ecc__grib_dependency_notify_change(grib_handle* h, grib_accessor* observed); int grib_dependency_notify_change(grib_accessor* observed); void grib_dependency_remove_observer(grib_accessor* observer); void grib_dependency_observe_expression(grib_accessor* observer, grib_expression* e); @@ -1249,19 +1249,19 @@ int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned cha int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, size_t* length); int grib_get_native_type(const grib_handle* h, const char* name, int* type); const char* grib_get_accessor_class_name(grib_handle* h, const char* name); -int _grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length); +int ecc__grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length); int grib_get_double_array_internal(const grib_handle* h, const char* name, double* val, size_t* length); int grib_get_double_array(const grib_handle* h, const char* name, double* val, size_t* length); -int _grib_get_string_length(grib_accessor* a, size_t* size); +int ecc__grib_get_string_length(grib_accessor* a, size_t* size); int grib_get_string_length(const grib_handle* h, const char* name, size_t* size); -int _grib_get_size(const grib_handle* h, grib_accessor* a, size_t* size); +int ecc__grib_get_size(const grib_handle* h, grib_accessor* a, size_t* size); int grib_get_size(const grib_handle* h, const char* name, size_t* size); int grib_get_length(const grib_handle* h, const char* name, size_t* length); int grib_get_count(grib_handle* h, const char* name, size_t* size); int grib_get_offset(const grib_handle* h, const char* key, size_t* val); -int _grib_get_string_array_internal(const grib_handle* h, grib_accessor* a, char** val, size_t buffer_len, size_t* decoded_length); +int ecc__grib_get_string_array_internal(const grib_handle* h, grib_accessor* a, char** val, size_t buffer_len, size_t* decoded_length); int grib_get_string_array(const grib_handle* h, const char* name, char** val, size_t* length); -int _grib_get_long_array_internal(const grib_handle* h, grib_accessor* a, long* val, size_t buffer_len, size_t* decoded_length); +int ecc__grib_get_long_array_internal(const grib_handle* h, grib_accessor* a, long* val, size_t buffer_len, size_t* decoded_length); int grib_get_long_array_internal(grib_handle* h, const char* name, long* val, size_t* length); int grib_get_long_array(const grib_handle* h, const char* name, long* val, size_t* length); grib_key_value_list* grib_key_value_list_clone(grib_context* c, grib_key_value_list* list); diff --git a/src/grib_accessor.c b/src/grib_accessor.c index 4b1783b77..148005780 100644 --- a/src/grib_accessor.c +++ b/src/grib_accessor.c @@ -635,7 +635,7 @@ int grib_accessor_add_attribute(grib_accessor* a, grib_accessor* attr, int nest_ grib_accessor* aloc = a; if (grib_accessor_has_attributes(a)) { - same = _grib_accessor_get_attribute(a, attr->name, &id); + same = ecc__grib_accessor_get_attribute(a, attr->name, &id); } if (same) { @@ -650,7 +650,7 @@ int grib_accessor_add_attribute(grib_accessor* a, grib_accessor* attr, int nest_ aloc->attributes[id] = attr; attr->parent_as_attribute = aloc; if (aloc->same) - attr->same = _grib_accessor_get_attribute(aloc->same, attr->name, &idx); + attr->same = ecc__grib_accessor_get_attribute(aloc->same, attr->name, &idx); grib_context_log(a->context, GRIB_LOG_DEBUG, "added attribute %s->%s", a->name, attr->name); return GRIB_SUCCESS; @@ -663,12 +663,12 @@ int grib_accessor_replace_attribute(grib_accessor* a, grib_accessor* attr) { int id = 0; int idx = 0; - if (_grib_accessor_get_attribute(a, attr->name, &id) != NULL) { + if (ecc__grib_accessor_get_attribute(a, attr->name, &id) != NULL) { grib_accessor_delete(a->context, a->attributes[id]); a->attributes[id] = attr; attr->parent_as_attribute = a; if (a->same) - attr->same = _grib_accessor_get_attribute(a->same, attr->name, &idx); + attr->same = ecc__grib_accessor_get_attribute(a->same, attr->name, &idx); } else { grib_accessor_add_attribute(a, attr, 0); @@ -679,7 +679,7 @@ int grib_accessor_replace_attribute(grib_accessor* a, grib_accessor* attr) int grib_accessor_delete_attribute(grib_accessor* a, const char* name) { int id = 0; - if (_grib_accessor_get_attribute(a, name, &id) != NULL) { + if (ecc__grib_accessor_get_attribute(a, name, &id) != NULL) { grib_accessor_delete(a->context, a->attributes[id]); a->attributes[id] = NULL; return GRIB_SUCCESS; @@ -702,7 +702,7 @@ const char* grib_accessor_get_name(grib_accessor* a) return a->name; } -grib_accessor* _grib_accessor_get_attribute(grib_accessor* a, const char* name, int* index) +grib_accessor* ecc__grib_accessor_get_attribute(grib_accessor* a, const char* name, int* index) { int i = 0; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { @@ -731,14 +731,14 @@ grib_accessor* grib_accessor_get_attribute(grib_accessor* a, const char* name) while (*(p + 1) != '\0' && (*p != '-' || *(p + 1) != '>')) p++; if (*(p + 1) == '\0') { - return _grib_accessor_get_attribute(a, name, &index); + return ecc__grib_accessor_get_attribute(a, name, &index); } else { size_t size = p - name; attribute_name = p + 2; basename = (char*)grib_context_malloc_clear(a->context, size + 1); basename = (char*)memcpy(basename, name, size); - acc = _grib_accessor_get_attribute(a, basename, &index); + acc = ecc__grib_accessor_get_attribute(a, basename, &index); grib_context_free(a->context, basename); if (acc) return grib_accessor_get_attribute(acc, attribute_name); diff --git a/src/grib_accessor_class.c b/src/grib_accessor_class.c index 52419470a..af55037b9 100644 --- a/src/grib_accessor_class.c +++ b/src/grib_accessor_class.c @@ -228,7 +228,7 @@ static void link_same_attributes(grib_accessor* a, grib_accessor* b) if (!grib_accessor_has_attributes(b)) return; while (i < MAX_ACCESSOR_ATTRIBUTES && a->attributes[i]) { - bAttribute = _grib_accessor_get_attribute(b, a->attributes[i]->name, &idx); + bAttribute = ecc__grib_accessor_get_attribute(b, a->attributes[i]->name, &idx); if (bAttribute) a->attributes[i]->same = bAttribute; i++; diff --git a/src/grib_accessor_class_gen.c b/src/grib_accessor_class_gen.c index ffecc95e5..627dcddd3 100644 --- a/src/grib_accessor_class_gen.c +++ b/src/grib_accessor_class_gen.c @@ -367,7 +367,7 @@ static int unpack_string_array(grib_accessor* a, char** v, size_t* len) int err = 0; size_t length = 0; - err = _grib_get_string_length(a, &length); + err = ecc__grib_get_string_length(a, &length); if (err) return err; v[0] = (char*)grib_context_malloc_clear(a->context, length); diff --git a/src/grib_accessor_class_smart_table_column.c b/src/grib_accessor_class_smart_table_column.c index 66ad1f060..cf3996c81 100644 --- a/src/grib_accessor_class_smart_table_column.c +++ b/src/grib_accessor_class_smart_table_column.c @@ -203,7 +203,7 @@ static int unpack_string_array(grib_accessor* a, char** buffer, size_t* len) return GRIB_NOT_FOUND; } - err = _grib_get_size(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size); + err = ecc__grib_get_size(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size); if (err) return err; if (*len < size) { @@ -261,7 +261,7 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len) return GRIB_NOT_FOUND; } - err = _grib_get_size(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size); + err = ecc__grib_get_size(grib_handle_of_accessor(a), (grib_accessor*)tableAccessor, &size); if (err) return err; if (*len < size) { diff --git a/src/grib_accessor_class_to_double.c b/src/grib_accessor_class_to_double.c index 2b4c75946..5f2df9b00 100644 --- a/src/grib_accessor_class_to_double.c +++ b/src/grib_accessor_class_to_double.c @@ -187,7 +187,7 @@ static size_t string_length(grib_accessor* a) if (self->length) return self->length; - _grib_get_string_length(a, &size); + ecc__grib_get_string_length(a, &size); return size; } diff --git a/src/grib_dependency.c b/src/grib_dependency.c index 5f25460d6..9d6bab0f7 100644 --- a/src/grib_dependency.c +++ b/src/grib_dependency.c @@ -141,7 +141,7 @@ int grib_dependency_notify_change(grib_accessor* observed) /* This version takes in the handle so does not need to work it out from the 'observed' */ /* See ECC-778 */ -int _grib_dependency_notify_change(grib_handle* h, grib_accessor* observed) +int ecc__grib_dependency_notify_change(grib_handle* h, grib_accessor* observed) { grib_dependency* d = h->dependencies; int ret = GRIB_SUCCESS; diff --git a/src/grib_dumper_class_bufr_encode_C.c b/src/grib_dumper_class_bufr_encode_C.c index 4fd46f1de..c7b0a4ac3 100644 --- a/src/grib_dumper_class_bufr_encode_C.c +++ b/src/grib_dumper_class_bufr_encode_C.c @@ -686,7 +686,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) grib_handle* h = grib_handle_of_accessor(a); const char* acc_name = a->name; - _grib_get_string_length(a, &size); + ecc__grib_get_string_length(a, &size); if (size == 0) return; diff --git a/src/grib_dumper_class_bufr_encode_filter.c b/src/grib_dumper_class_bufr_encode_filter.c index 5fe267f8f..3690ea9ec 100644 --- a/src/grib_dumper_class_bufr_encode_filter.c +++ b/src/grib_dumper_class_bufr_encode_filter.c @@ -622,7 +622,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) if ((a->flags & GRIB_ACCESSOR_FLAG_DUMP) == 0 || (a->flags & GRIB_ACCESSOR_FLAG_READ_ONLY) != 0) return; - _grib_get_string_length(a, &size); + ecc__grib_get_string_length(a, &size); if (size == 0) return; diff --git a/src/grib_dumper_class_bufr_encode_fortran.c b/src/grib_dumper_class_bufr_encode_fortran.c index 2336c74f0..770b8f2a4 100644 --- a/src/grib_dumper_class_bufr_encode_fortran.c +++ b/src/grib_dumper_class_bufr_encode_fortran.c @@ -735,7 +735,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) grib_handle* h = grib_handle_of_accessor(a); const char* acc_name = a->name; - _grib_get_string_length(a, &size); + ecc__grib_get_string_length(a, &size); if (size == 0) return; diff --git a/src/grib_dumper_class_bufr_encode_python.c b/src/grib_dumper_class_bufr_encode_python.c index 9b35018b3..64996b261 100644 --- a/src/grib_dumper_class_bufr_encode_python.c +++ b/src/grib_dumper_class_bufr_encode_python.c @@ -676,7 +676,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) grib_handle* h = grib_handle_of_accessor(a); const char* acc_name = a->name; - _grib_get_string_length(a, &size); + ecc__grib_get_string_length(a, &size); if (size == 0) return; diff --git a/src/grib_dumper_class_debug.c b/src/grib_dumper_class_debug.c index 7ffc94cad..123a99601 100644 --- a/src/grib_dumper_class_debug.c +++ b/src/grib_dumper_class_debug.c @@ -285,7 +285,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) if (a->length == 0 && (d->option_flags & GRIB_DUMP_FLAG_CODED) != 0) return; - _grib_get_string_length(a, &size); + ecc__grib_get_string_length(a, &size); if ((size < 2) && grib_is_missing_internal(a)) { /* GRIB-302: transients and missing keys. Need to re-adjust the size */ size = 10; /* big enough to hold the string "missing" */ diff --git a/src/grib_dumper_class_default.c b/src/grib_dumper_class_default.c index ab08d535f..f1f82e1f4 100644 --- a/src/grib_dumper_class_default.c +++ b/src/grib_dumper_class_default.c @@ -411,7 +411,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) return; } - _grib_get_string_length(a, &size); + ecc__grib_get_string_length(a, &size); if (size == 0) return; diff --git a/src/grib_dumper_class_json.c b/src/grib_dumper_class_json.c index 2b233ca82..c1b9805ca 100644 --- a/src/grib_dumper_class_json.c +++ b/src/grib_dumper_class_json.c @@ -467,7 +467,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) /* ECC-710: It is MUCH slower determining the string length here * than using a maximum size (and no need for malloc). * Specially for BUFR elements */ - /*err = _grib_get_string_length(a,&size); + /*err = ecc__grib_get_string_length(a,&size); if (size==0) return; value=(char*)grib_context_malloc_clear(a->context,size); if (!value) { diff --git a/src/grib_dumper_class_wmo.c b/src/grib_dumper_class_wmo.c index efabfd2a2..ba5bebbb0 100644 --- a/src/grib_dumper_class_wmo.c +++ b/src/grib_dumper_class_wmo.c @@ -305,7 +305,7 @@ static void dump_string(grib_dumper* d, grib_accessor* a, const char* comment) return; } - _grib_get_string_length(a, &size); + ecc__grib_get_string_length(a, &size); value = (char*)grib_context_malloc_clear(a->context, size); if (!value) { grib_context_log(a->context, GRIB_LOG_FATAL, "unable to allocate %d bytes", (int)size); diff --git a/src/grib_index.c b/src/grib_index.c index 983162b66..a31435424 100644 --- a/src/grib_index.c +++ b/src/grib_index.c @@ -1052,7 +1052,7 @@ int grib_index_add_file(grib_index* index, const char* filename) else if (index->product_kind == PRODUCT_BUFR) message_type = CODES_BUFR; else return GRIB_INVALID_ARGUMENT; - return _codes_index_add_file(index, filename, message_type); + return ecc__codes_index_add_file(index, filename, message_type); } static grib_handle* new_message_from_file(int message_type, grib_context* c, FILE* f, int* error) @@ -1067,7 +1067,7 @@ static grib_handle* new_message_from_file(int message_type, grib_context* c, FIL #define MAX_NUM_KEYS 40 -int _codes_index_add_file(grib_index* index, const char* filename, int message_type) +int ecc__codes_index_add_file(grib_index* index, const char* filename, int message_type) { double dval; size_t svallen; diff --git a/src/grib_loader_from_handle.c b/src/grib_loader_from_handle.c index a9242584d..4f481d10a 100644 --- a/src/grib_loader_from_handle.c +++ b/src/grib_loader_from_handle.c @@ -165,7 +165,7 @@ int grib_init_accessor_from_handle(grib_loader* loader, grib_accessor* ga, grib_ switch (grib_accessor_get_native_type(ga)) { case GRIB_TYPE_STRING: - /*_grib_get_string_length(ga,&len); See ECC-490 */ + /*ecc__grib_get_string_length(ga,&len); See ECC-490 */ grib_get_string_length(h, name, &len); sval = (char*)grib_context_malloc(h->context, len); ret = grib_get_string_internal(h, name, sval, &len); diff --git a/src/grib_parse_utils.c b/src/grib_parse_utils.c index 9a7b6cc34..11c5aabf8 100644 --- a/src/grib_parse_utils.c +++ b/src/grib_parse_utils.c @@ -209,7 +209,7 @@ int grib_accessor_print(grib_accessor* a, const char* name, int type, const char size = count; } else { - ret = _grib_get_size(h, a, &size); + ret = ecc__grib_get_size(h, a, &size); } if (ret) return ret; dval = (double*)grib_context_malloc_clear(h->context, sizeof(double) * size); @@ -219,7 +219,7 @@ int grib_accessor_print(grib_accessor* a, const char* name, int type, const char } else { replen = 0; - ret = _grib_get_double_array_internal(h, a, dval, size, &replen); + ret = ecc__grib_get_double_array_internal(h, a, dval, size, &replen); } if (replen == 1) fprintf(out, myformat, dval[0]); @@ -250,7 +250,7 @@ int grib_accessor_print(grib_accessor* a, const char* name, int type, const char size = count; } else { - ret = _grib_get_size(h, a, &size); + ret = ecc__grib_get_size(h, a, &size); } if (ret) return ret; lval = (long*)grib_context_malloc_clear(h->context, sizeof(long) * size); @@ -260,7 +260,7 @@ int grib_accessor_print(grib_accessor* a, const char* name, int type, const char } else { replen = 0; - ret = _grib_get_long_array_internal(h, a, lval, size, &replen); + ret = ecc__grib_get_long_array_internal(h, a, lval, size, &replen); } if (replen == 1) fprintf(out, myformat, lval[0]); diff --git a/src/grib_value.c b/src/grib_value.c index 5ddb7040c..f83eef956 100644 --- a/src/grib_value.c +++ b/src/grib_value.c @@ -714,7 +714,7 @@ static int _grib_set_double_array_internal(grib_handle* h, grib_accessor* a, *encoded_length += len; if (err == GRIB_SUCCESS) { /* See ECC-778 */ - return _grib_dependency_notify_change(h, a); + return ecc__grib_dependency_notify_change(h, a); } } else { @@ -752,7 +752,7 @@ static int _grib_set_double_array(grib_handle* h, const char* name, err = GRIB_ARRAY_TOO_SMALL; if (err == GRIB_SUCCESS) - return _grib_dependency_notify_change(h, a); /* See ECC-778 */ + return ecc__grib_dependency_notify_change(h, a); /* See ECC-778 */ return err; } @@ -1106,7 +1106,7 @@ int grib_get_double_elements(const grib_handle* h, const char* name, const int* if (!act) return GRIB_NOT_FOUND; - err = _grib_get_size(h, act, &size); + err = ecc__grib_get_size(h, act, &size); if (err != GRIB_SUCCESS) { grib_context_log(h->context, GRIB_LOG_ERROR, "grib_get_double_elements: cannot get size of %s\n", name); @@ -1289,7 +1289,7 @@ int grib_get_double_array(const grib_handle* h, const char* name, double* val, s } } -int _grib_get_string_length(grib_accessor* a, size_t* size) +int ecc__grib_get_string_length(grib_accessor* a, size_t* size) { size_t s = 0; @@ -1315,7 +1315,7 @@ int grib_get_string_length(const grib_handle* h, const char* name, size_t* size) al = grib_find_accessors_list(h, name); if (!al) return GRIB_NOT_FOUND; - ret = _grib_get_string_length(al->accessor, size); + ret = ecc__grib_get_string_length(al->accessor, size); grib_context_free(h->context, al); return ret; } @@ -1323,11 +1323,11 @@ int grib_get_string_length(const grib_handle* h, const char* name, size_t* size) a = grib_find_accessor(h, name); if (!a) return GRIB_NOT_FOUND; - return _grib_get_string_length(a, size); + return ecc__grib_get_string_length(a, size); } } -int _grib_get_size(const grib_handle* h, grib_accessor* a, size_t* size) +int ecc__grib_get_size(const grib_handle* h, grib_accessor* a, size_t* size) { long count = 0; int err = 0; @@ -1375,7 +1375,7 @@ int grib_get_size(const grib_handle* ch, const char* name, size_t* size) return ret; } else - return _grib_get_size(h, a, size); + return ecc__grib_get_size(h, a, size); } } @@ -1409,10 +1409,10 @@ int grib_get_offset(const grib_handle* ch, const char* key, size_t* val) return GRIB_NOT_FOUND; } -int _grib_get_string_array_internal(const grib_handle* h, grib_accessor* a, char** val, size_t buffer_len, size_t* decoded_length) +int ecc__grib_get_string_array_internal(const grib_handle* h, grib_accessor* a, char** val, size_t buffer_len, size_t* decoded_length) { if (a) { - int err = _grib_get_string_array_internal(h, a->same, val, buffer_len, decoded_length); + int err = ecc__grib_get_string_array_internal(h, a->same, val, buffer_len, decoded_length); if (err == GRIB_SUCCESS) { size_t len = buffer_len - *decoded_length; @@ -1451,7 +1451,7 @@ int grib_get_string_array(const grib_handle* h, const char* name, char** val, si } else { *length = 0; - return _grib_get_string_array_internal(h, a, val, len, length); + return ecc__grib_get_string_array_internal(h, a, val, len, length); } } }