Commit 905fbe94 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

added some HAVE_LIBGRIB_API directives

parent 1cf053d9
#ifdef HAVE_LIBGRIB_API
#include "gribapi_utilities.h"
#include "cdi.h"
......@@ -699,3 +701,4 @@ void gribapiGetGrid(grib_handle *gh, grid_t *grid)
grid->yvals = NULL;
grid->type = gridtype;
}
#endif
#ifndef INCLUDE_GUARD_CDI_GRIBAPI_UTILITIES_H
#define INCLUDE_GUARD_CDI_GRIBAPI_UTILITIES_H
#ifdef HAVE_LIBGRIB_API
#include "grid.h"
#include <grib_api.h>
......@@ -31,3 +33,5 @@ int gribapiGetGridType(grib_handle *gh);
void gribapiGetGrid(grib_handle *gh, grid_t *grid);
#endif
#endif
#ifdef HAVE_LIBGRIB_API
#include "iterator_grib.h"
#include "cdi_int.h"
......@@ -806,3 +808,5 @@ double cdiGribIterator_inqDoubleDefaultValue(CdiGribIterator* me, const char* ke
{
return gribGetDoubleDefault(me->gribHandle, key, defaultValue);
}
#endif
......@@ -10,7 +10,9 @@
#include "iterator.h"
#include "input_file.h"
#ifdef HAVE_LIBGRIB_API
#include <grib_api.h>
#endif
typedef struct recordList recordList;
typedef struct CdiGribIterator {
......@@ -20,7 +22,9 @@ typedef struct CdiGribIterator {
off_t fileOffset;
unsigned char* gribBuffer;
size_t bufferSize, curRecordSize;
#ifdef HAVE_LIBGRIB_API
grib_handle* gribHandle;
#endif
} CdiGribIterator;
CdiIterator* cdiGribIterator_new(const char* path, int filetype);
......
......@@ -714,6 +714,8 @@ static void ensureBufferSize(size_t requiredSize, size_t* curSize, unsigned char
}
}
#if defined (HAVE_LIBGRIB_API)
static
grib_handle* gribapiGetDiskRepresentation(long recsize, size_t* buffersize, unsigned char** gribbuffer, int* outDatatype, int* outCompressionType, long* outUnzipsize)
{
int lieee = FALSE;
......@@ -763,6 +765,7 @@ grib_handle* gribapiGetDiskRepresentation(long recsize, size_t* buffersize, unsi
}
return gh;
}
#endif
typedef enum { CHECKTIME_OK, CHECKTIME_SKIP, CHECKTIME_STOP, CHECKTIME_INCONSISTENT } checkTimeResult;
static checkTimeResult checkTime(stream_t* streamptr, compvar2_t compVar, const DateTime* verificationTime, const DateTime* expectedVTime) {
......
......@@ -3,8 +3,6 @@
#include "cdi_int.h"
#include <grib_api.h>
int gribapiScanTimestep1(stream_t * streamptr);
int gribapiScanTimestep2(stream_t * streamptr);
int gribapiScanTimestep(stream_t * streamptr);
......
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