diff --git a/src/eccodes.c b/src/eccodes.c index fb56decc3..a7d351f0b 100644 --- a/src/eccodes.c +++ b/src/eccodes.c @@ -96,7 +96,7 @@ int codes_fieldset_count(grib_fieldset* set) /* Indexing */ /******************************************************************************/ -grib_index* codes_index_new_from_file(grib_context* c, char* filename, const char* keys, int* err) +grib_index* codes_index_new_from_file(grib_context* c, const char* filename, const char* keys, int* err) { return grib_index_new_from_file(c, filename, keys, err); } @@ -140,7 +140,7 @@ int codes_index_select_double(grib_index* index, const char* key, double value) { return grib_index_select_double(index, key, value); } -int codes_index_select_string(grib_index* index, const char* key, char* value) +int codes_index_select_string(grib_index* index, const char* key, const char* value) { return grib_index_select_string(index, key, value); } diff --git a/src/eccodes.h b/src/eccodes.h index a310dbbfb..1c0958490 100644 --- a/src/eccodes.h +++ b/src/eccodes.h @@ -214,7 +214,7 @@ typedef struct grib_index codes_index; * @param err : 0 if OK, integer value on error * @return the newly created index */ -codes_index* codes_index_new_from_file(codes_context* c, char* filename, const char* keys, int* err); +codes_index* codes_index_new_from_file(codes_context* c, const char* filename, const char* keys, int* err); /** * Create a new index based on a set of keys. @@ -320,7 +320,7 @@ int codes_index_select_double(codes_index* index, const char* key, double value) * @param value : value of the key to select * @return 0 if OK, integer value on error */ -int codes_index_select_string(codes_index* index, const char* key, char* value); +int codes_index_select_string(codes_index* index, const char* key, const char* value); /** * Create a new handle from an index after having selected the key values. diff --git a/src/grib_api.h b/src/grib_api.h index 44b0e7ebd..34e3a49fb 100644 --- a/src/grib_api.h +++ b/src/grib_api.h @@ -266,7 +266,7 @@ typedef struct grib_index grib_index; * @return the newly created index */ grib_index* grib_index_new_from_file(grib_context* c, - char* filename, const char* keys, int* err); + const char* filename, const char* keys, int* err); /** * Create a new index based on a set of keys. * @@ -374,7 +374,7 @@ int grib_index_select_double(grib_index* index, const char* key, double value); * @param value : value of the key to select * @return 0 if OK, integer value on error */ -int grib_index_select_string(grib_index* index, const char* key, char* value); +int grib_index_select_string(grib_index* index, const char* key, const char* value); /** * Create a new handle from an index after having selected the key values. diff --git a/src/grib_api_prototypes.h b/src/grib_api_prototypes.h index 12ce195ee..871e6201e 100644 --- a/src/grib_api_prototypes.h +++ b/src/grib_api_prototypes.h @@ -731,14 +731,14 @@ int grib_index_add_file(grib_index* index, const char* filename); grib_handle* new_message_from_file(int message_type, grib_context* c, FILE* f, int* error); int _codes_index_add_file(grib_index* index, const char* filename, int message_type); int grib_index_add_file(grib_index* index, const char* filename); -grib_index* grib_index_new_from_file(grib_context* c, char* filename, const char* keys, int* err); +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); int grib_index_get_long(const grib_index* index, const char* key, long* values, size_t* size); int grib_index_get_double(const grib_index* index, const char* key, double* values, size_t* size); int grib_index_select_long(grib_index* index, const char* skey, long value); int grib_index_select_double(grib_index* index, const char* skey, double value); -int grib_index_select_string(grib_index* index, const char* skey, char* value); +int grib_index_select_string(grib_index* index, const char* skey, const char* value); grib_handle* grib_index_get_handle(grib_field* field, int* err); grib_handle* codes_index_get_handle(grib_field* field, int message_type, int* err); int grib_index_dump_file(FILE* fout, const char* filename); diff --git a/src/grib_index.c b/src/grib_index.c index 4fd0cb2cc..09e138666 100644 --- a/src/grib_index.c +++ b/src/grib_index.c @@ -1400,7 +1400,7 @@ int grib_index_add_file(grib_index* index, const char* filename) } #endif -grib_index* grib_index_new_from_file(grib_context* c, char* filename, const char* keys, int* err) +grib_index* grib_index_new_from_file(grib_context* c, const char* filename, const char* keys, int* err) { grib_index* index = NULL; @@ -1576,7 +1576,7 @@ int grib_index_select_double(grib_index* index, const char* skey, double value) return 0; } -int grib_index_select_string(grib_index* index, const char* skey, char* value) +int grib_index_select_string(grib_index* index, const char* skey, const char* value) { grib_index_key* key = NULL; int err = GRIB_NOT_FOUND;