Loading...
Searching...
No Matches
netcdf_mem.h
Go to the documentation of this file.
/*
* In order to use any of the netcdf_XXX.h files, it is necessary
* to include netcdf.h followed by any netcdf_XXX.h files.
* Various things (like EXTERNL) are defined in netcdf.h
* to make them available for use by the netcdf_XXX.h files.
*/
#ifndef NETCDF_MEM_H
#define NETCDF_MEM_H 1
typedef struct NC_memio {
size_t size;
void* memory;
int flags;
#define NC_MEMIO_LOCKED 1 /* Do not try to realloc or free provided memory */
} NC_memio;
#if defined(__cplusplus)
extern "C" {
#endif
/* Treat a memory block as a file; read-only */
EXTERNL int nc_open_mem(const char* path, int mode, size_t size, void* memory, int* ncidp);
EXTERNL int nc_create_mem(const char* path, int mode, size_t initialsize, int* ncidp);
/* Alternative to nc_open_mem with extended capabilities
See docs/inmemory.md
*/
EXTERNL int nc_open_memio(const char* path, int mode, NC_memio* info, int* ncidp);
/* Close memory file and return the final memory state */
EXTERNL int nc_close_memio(int ncid, NC_memio* info);
#if defined(__cplusplus)
}
#endif
#endif /* NETCDF_MEM_H */
nc_close_memio
EXTERNL int nc_close_memio(int ncid, NC_memio *info)
Do a normal close (see nc_close()) on an in-memory dataset, then return a copy of the final memory co...
Definition dfile.c:1359
nc_create_mem
EXTERNL int nc_create_mem(const char *path, int mode, size_t initialsize, int *ncidp)
Create a netCDF file with the contents stored in memory.
Definition dfile.c:516
nc_open_mem
EXTERNL int nc_open_mem(const char *path, int mode, size_t size, void *memory, int *ncidp)
Open a netCDF file with the contents taken from a block of memory.
Definition dfile.c:776
nc_open_memio
EXTERNL int nc_open_memio(const char *path, int mode, NC_memio *info, int *ncidp)
Open a netCDF file with the contents taken from a block of memory.
Definition dfile.c:841
EXTERNL
#define EXTERNL
Needed for DLL build.
Definition netcdf.h:571
NC_memio
Definition netcdf_mem.h:22