diff --git a/examples/C/bufr_subset.c b/examples/C/bufr_subset.c index 66bf695b4..e1676188f 100644 --- a/examples/C/bufr_subset.c +++ b/examples/C/bufr_subset.c @@ -32,7 +32,7 @@ int main(int argc, char* argv[]) size_t stringLen; char stringVal[100] = {0,}; int i, err = 0; - int cnt = 0; + int cnt = 0, ktype = 0; const char* infile = "../../data/bufr/synop_multi_subset.bufr"; in = fopen(infile, "rb"); @@ -62,6 +62,9 @@ int main(int argc, char* argv[]) for (i = 1; i <= numberOfSubsets; i++) { snprintf(key, sizeof(key), "/subsetNumber=%d/blockNumber", i); + CODES_CHECK(codes_get_native_type(h, key, &ktype), 0); + //printf("Type = %d\n", ktype); + printf(" subsetNumber=%d", i); /* read and print some data values */ CODES_CHECK(codes_get_long(h, key, &longVal), 0); diff --git a/src/eccodes_prototypes.h b/src/eccodes_prototypes.h index e74a94f19..5080843d7 100644 --- a/src/eccodes_prototypes.h +++ b/src/eccodes_prototypes.h @@ -1162,7 +1162,6 @@ int grib_get_double_elements(const grib_handle* h, const char* name, const int* int grib_get_float_elements(const grib_handle* h, const char* name, const int* index_array, long len, float* val_array); int grib_get_string_internal(grib_handle* h, const char* name, char* val, size_t* length); int grib_get_string(const grib_handle* h, const char* name, char* val, size_t* length); -int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned char* val, size_t* length); 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); int ecc__grib_get_double_array_internal(const grib_handle* h, grib_accessor* a, double* val, size_t buffer_len, size_t* decoded_length); diff --git a/src/grib_value.cc b/src/grib_value.cc index c6ec63369..e6c382626 100644 --- a/src/grib_value.cc +++ b/src/grib_value.cc @@ -1218,17 +1218,15 @@ int grib_get_string(const grib_handle* h, const char* name, char* val, size_t* l } } -int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned char* val, size_t* length) -{ - int ret = grib_get_bytes(h, name, val, length); - - if (ret != GRIB_SUCCESS) - grib_context_log(h->context, GRIB_LOG_ERROR, - "Unable to get %s as bytes (%s)", - name, grib_get_error_message(ret)); - - return ret; -} +// int grib_get_bytes_internal(const grib_handle* h, const char* name, unsigned char* val, size_t* length) +// { +// int ret = grib_get_bytes(h, name, val, length); +// if (ret != GRIB_SUCCESS) +// grib_context_log(h->context, GRIB_LOG_ERROR, +// "Unable to get %s as bytes (%s)", +// name, grib_get_error_message(ret)); +// return ret; +// } int grib_get_bytes(const grib_handle* h, const char* name, unsigned char* val, size_t* length) {