Remove unused struct member. Add grib_arguments_get_count

This commit is contained in:
Shahram Najm 2022-08-11 12:23:49 +01:00
parent 8900e12429
commit de976ac0c2
3 changed files with 11 additions and 1 deletions

View File

@ -1418,6 +1418,7 @@ const char* grib_arguments_get_string(grib_handle* h, grib_arguments* args, int
long grib_arguments_get_long(grib_handle* h, grib_arguments* args, int n);
double grib_arguments_get_double(grib_handle* h, grib_arguments* args, int n);
grib_expression* grib_arguments_get_expression(grib_handle* h, grib_arguments* args, int n);
int grib_arguments_get_count(grib_arguments* args);
/* codes_util.c */
double normalise_longitude_in_degrees(double lon);

View File

@ -1170,7 +1170,6 @@ struct grib_arguments
{
struct grib_arguments* next;
grib_expression* expression;
char value[80];
};

View File

@ -255,3 +255,13 @@ grib_expression* grib_arguments_get_expression(grib_handle* h, grib_arguments* a
return args->expression;
}
int grib_arguments_get_count(grib_arguments* args)
{
int n = 0;
while (args) {
args = args->next;
n++;
}
return n;
}