ECC-995: C API: Review const-ness of arguments (part 3)

This commit is contained in:
Shahram Najm 2019-10-03 17:33:12 +01:00
parent 06c22655cf
commit 3c68d3acf2
5 changed files with 21 additions and 21 deletions

View File

@ -116,19 +116,19 @@ grib_index* codes_index_read(grib_context* c,const char* filename,int *err)
{
return grib_index_read(c,filename,err);
}
int codes_index_get_size(grib_index* index,const char* key,size_t* size)
int codes_index_get_size(const grib_index* index,const char* key,size_t* size)
{
return grib_index_get_size(index,key,size);
}
int codes_index_get_long(grib_index* index,const char* key,long* values,size_t *size)
int codes_index_get_long(const grib_index* index,const char* key,long* values,size_t *size)
{
return grib_index_get_long(index,key,values,size);
}
int codes_index_get_double(grib_index* index,const char* key, double* values,size_t *size)
int codes_index_get_double(const grib_index* index,const char* key, double* values,size_t *size)
{
return grib_index_get_double(index,key,values,size);
}
int codes_index_get_string(grib_index* index,const char* key,char** values,size_t *size)
int codes_index_get_string(const grib_index* index,const char* key,char** values,size_t *size)
{
return grib_index_get_string(index,key,values,size);
}

View File

@ -250,7 +250,7 @@ codes_index* codes_index_read(codes_context* c, const char* filename, int *err);
* @param size : number of distinct values of the key in the index
* @return 0 if OK, integer value on error
*/
int codes_index_get_size(codes_index* index, const char* key, size_t* size);
int codes_index_get_size(const codes_index* index, const char* key, size_t* size);
/**
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as long or when the native type of the key is long.
@ -262,7 +262,7 @@ int codes_index_get_size(codes_index* index, const char* key, size_t* size);
* @param size : size of the values array
* @return 0 if OK, integer value on error
*/
int codes_index_get_long(codes_index* index, const char* key, long* values, size_t *size);
int codes_index_get_long(const codes_index* index, const char* key, long* values, size_t *size);
/**
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as double or when the native type of the key is double.
@ -274,7 +274,7 @@ int codes_index_get_long(codes_index* index, const char* key, long* values, size
* @param size : size of the values array
* @return 0 if OK, integer value on error
*/
int codes_index_get_double(codes_index* index, const char* key, double* values, size_t *size);
int codes_index_get_double(const codes_index* index, const char* key, double* values, size_t *size);
/**
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as string or when the native type of the key is string.
@ -286,7 +286,7 @@ int codes_index_get_double(codes_index* index, const char* key, double* values,
* @param size : size of the values array
* @return 0 if OK, integer value on error
*/
int codes_index_get_string(codes_index* index, const char* key, char** values, size_t *size);
int codes_index_get_string(const codes_index* index, const char* key, char** values, size_t *size);
/**

View File

@ -292,7 +292,7 @@ grib_index* grib_index_read(grib_context* c,const char* filename,int *err);
* @param size : number of distinct values of the key in the index
* @return 0 if OK, integer value on error
*/
int grib_index_get_size(grib_index* index,const char* key,size_t* size);
int grib_index_get_size(const grib_index* index,const char* key,size_t* size);
/**
* Get the distinct values of the key in argument contained in the index. The key must belong to the index. This function is used when the type of the key was explicitly defined as long or when the native type of the key is long.
@ -304,7 +304,7 @@ int grib_index_get_size(grib_index* index,const char* key,size_t* size);
* @param size : size of the values array
* @return 0 if OK, integer value on error
*/
int grib_index_get_long(grib_index* index,const char* key,
int grib_index_get_long(const grib_index* index,const char* key,
long* values,size_t *size);
/**
@ -317,7 +317,7 @@ int grib_index_get_long(grib_index* index,const char* key,
* @param size : size of the values array
* @return 0 if OK, integer value on error
*/
int grib_index_get_double(grib_index* index,const char* key,
int grib_index_get_double(const grib_index* index,const char* key,
double* values,size_t *size);
/**
@ -330,7 +330,7 @@ int grib_index_get_double(grib_index* index,const char* key,
* @param size : size of the values array
* @return 0 if OK, integer value on error
*/
int grib_index_get_string(grib_index* index,const char* key,
int grib_index_get_string(const grib_index* index,const char* key,
char** values,size_t *size);
@ -373,7 +373,7 @@ int grib_index_select_string(grib_index* index,const char* key,char* value);
* When no more handles are available from the index a NULL pointer is returned and the err variable is set to GRIB_END_OF_INDEX.
*
* @param index : an index created from a file.
* @param err : 0 if OK, integer value on error. GRIB_END_OF_INDEX when no more handles are contained in the index.
* @param err : 0 if OK, integer value on error. GRIB_END_OF_INDEX when no more handles are contained in the index.
* @return grib handle.
*/
grib_handle* grib_handle_new_from_index(grib_index* index,int *err);

View File

@ -744,10 +744,10 @@ grib_handle *new_message_from_file(int message_type, grib_context *c, FILE *f, i
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);
int grib_index_get_size(grib_index *index, const char *key, size_t *size);
int grib_index_get_string(grib_index *index, const char *key, char **values, size_t *size);
int grib_index_get_long(grib_index *index, const char *key, long *values, size_t *size);
int grib_index_get_double(grib_index *index, const char *key, double *values, size_t *size);
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);

View File

@ -1278,7 +1278,7 @@ grib_index* grib_index_new_from_file(grib_context* c, char* filename, const char
return index;
}
int grib_index_get_size(grib_index* index,const char* key,size_t* size)
int grib_index_get_size(const grib_index* index,const char* key,size_t* size)
{
grib_index_key* k=index->keys;
while (k && strcmp(k->name,key)) k=k->next;
@ -1287,7 +1287,7 @@ int grib_index_get_size(grib_index* index,const char* key,size_t* size)
return 0;
}
int grib_index_get_string(grib_index* index, const char* key, char** values, size_t *size)
int grib_index_get_string(const grib_index* index, const char* key, char** values, size_t *size)
{
grib_index_key* k=index->keys;
grib_string_list* kv;
@ -1308,7 +1308,7 @@ int grib_index_get_string(grib_index* index, const char* key, char** values, siz
return GRIB_SUCCESS;
}
int grib_index_get_long(grib_index* index, const char* key, long* values, size_t *size)
int grib_index_get_long(const grib_index* index, const char* key, long* values, size_t *size)
{
grib_index_key* k=index->keys;
grib_string_list* kv;
@ -1334,7 +1334,7 @@ int grib_index_get_long(grib_index* index, const char* key, long* values, size_t
return GRIB_SUCCESS;
}
int grib_index_get_double(grib_index* index,const char* key, double* values,size_t *size)
int grib_index_get_double(const grib_index* index,const char* key, double* values,size_t *size)
{
grib_index_key* k=index->keys;
grib_string_list* kv;