Commit 48788038 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Add missing prototype.

* Also add missing preprocessor conditional.
* This way gribapiGetScanningMode, gribapiSetScanningMode, and
  gribapiChangeParameterIdentification could be declared in a
  type-safe fashion.
parent b2197d00
......@@ -7,6 +7,7 @@
#include "dmemory.h"
#include "cdi.h"
#include "cdi_int.h"
#include "gribapi.h"
#include "stream_cgribex.h"
#include "stream_grb.h"
#include "stream_gribapi.h"
......
......@@ -7,6 +7,7 @@
#include "stream_cgribex.h"
#include "stream_grb.h"
#include "stream_gribapi.h"
#include "gribapi.h"
#include "file.h"
#include "cgribex.h" /* gribZip gribGetZip gribGinfo */
......
......@@ -2,7 +2,7 @@
# include "config.h"
#endif
#if defined (HAVE_LIBGRIB_API)
#ifdef HAVE_LIBGRIB_API
#include <limits.h>
#include <stdio.h>
......@@ -3133,16 +3133,16 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
}
void gribapiChangeParameterIdentification(void *gh, int code, int ltype, int lev)
void gribapiChangeParameterIdentification(grib_handle *gh, int code, int ltype, int lev)
{
long indicatorOfParameter, indicatorOfTypeOfLevel, level; // timeRangeIndicator: could be included later
indicatorOfParameter = code;
indicatorOfTypeOfLevel = ltype;
level = lev;
if (indicatorOfParameter!=-1) GRIB_CHECK(my_grib_set_long((grib_handle*)gh, "indicatorOfParameter", indicatorOfParameter), 0);
if (indicatorOfTypeOfLevel!=-1) GRIB_CHECK(my_grib_set_long((grib_handle*)gh, "indicatorOfTypeOfLevel", indicatorOfTypeOfLevel), 0);
if (level!=-1) GRIB_CHECK(my_grib_set_long((grib_handle*)gh, "level", level), 0);
if (indicatorOfParameter!=-1) GRIB_CHECK(my_grib_set_long(gh, "indicatorOfParameter", indicatorOfParameter), 0);
if (indicatorOfTypeOfLevel!=-1) GRIB_CHECK(my_grib_set_long(gh, "indicatorOfTypeOfLevel", indicatorOfTypeOfLevel), 0);
if (level!=-1) GRIB_CHECK(my_grib_set_long(gh, "level", level), 0);
}
#endif
......
#ifndef _STREAM_GRIBAPI_H
#define _STREAM_GRIBAPI_H
#ifdef HAVE_LIBGRIB_API
#include "gribapi.h"
int gribapiScanTimestep1(stream_t * streamptr);
......@@ -15,7 +17,12 @@ size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisI
long datasize, const double *data, int nmiss, void **gribbuffer, size_t *gribbuffersize,
int ljpeg, void *gribContainer);
void gribapiChangeParameterIdentification(void *gh, int code, int ltype, int lev);
int gribapiGetScanningMode(grib_handle *gh);
void gribapiSetScanningMode(grib_handle *gh, int scanningMode);
void gribapiChangeParameterIdentification(grib_handle *gh, int code, int ltype, int lev);
#endif
#endif /* _STREAM_GRIBAPI_H */
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment