diff --git a/examples/C/grib_get_keys.c b/examples/C/grib_get_keys.c index 9123729a3..346d2d4ce 100644 --- a/examples/C/grib_get_keys.c +++ b/examples/C/grib_get_keys.c @@ -135,9 +135,9 @@ int main(int argc, char** argv) char* name = "reservedNeedNotBePresent"; unsigned char* byte_val = NULL ; size_t keySize = 0; - CODES_CHECK(grib_get_size(h, name, &keySize), 0); + CODES_CHECK(codes_get_size(h, name, &keySize), 0); byte_val = malloc(keySize*sizeof(char)); - GRIB_CHECK(grib_get_bytes(h, name, byte_val, &keySize), name); + GRIB_CHECK(codes_get_bytes(h, name, byte_val, &keySize), name); } codes_handle_delete(h); diff --git a/examples/C/grib_index.c b/examples/C/grib_index.c index f818c441f..69b480866 100644 --- a/examples/C/grib_index.c +++ b/examples/C/grib_index.c @@ -15,7 +15,7 @@ * */ -#include "grib_api.h" +#include "eccodes.h" void usage(char* prog) { printf("usage: %s infile\n",prog); @@ -24,8 +24,8 @@ void usage(char* prog) { int main(int argc,char* argv[]) { - grib_index* index=NULL; - grib_handle* h=NULL; + codes_index* index=NULL; + codes_handle* h=NULL; char* infile=NULL; long *steps,*levels,*numbers; /* arrays */ char** shortName=NULL; @@ -42,51 +42,51 @@ int main(int argc,char* argv[]) printf("indexing...\n"); /* Create an index given set of keys*/ - index=grib_index_new(0,"shortName,level,number,step",&ret); - if (ret) {printf("error: %s\n",grib_get_error_message(ret)); exit(ret);} + index=codes_index_new(0,"shortName,level,number,step",&ret); + if (ret) {printf("error: %s\n",codes_get_error_message(ret)); exit(ret);} /* Indexes a file */ - ret=grib_index_add_file(index,infile); - if (ret) {printf("error: %s\n",grib_get_error_message(ret)); exit(ret);} + ret=codes_index_add_file(index,infile); + if (ret) {printf("error: %s\n",codes_get_error_message(ret)); exit(ret);} printf("end indexing...\n"); /* get the number of distinct values of "step" in the index */ - GRIB_CHECK(grib_index_get_size(index,"step",&stepSize),0); + CODES_CHECK(codes_index_get_size(index,"step",&stepSize),0); steps=(long*)malloc(sizeof(long)*stepSize); if (!steps) exit(1); /* get the list of distinct steps from the index */ /* the list is in ascending order */ - GRIB_CHECK(grib_index_get_long(index,"step",steps,&stepSize),0); + CODES_CHECK(codes_index_get_long(index,"step",steps,&stepSize),0); printf("stepSize=%ld\n",(long)stepSize); for (i=0;i