NetCDF  4.6.3
 All Data Structures Files Functions Variables Typedefs Macros Modules Pages
netcdf_mem.h
Go to the documentation of this file.
1 
12 #ifndef NETCDF_MEM_H
13 #define NETCDF_MEM_H 1
14 
15 /* Declaration modifiers for DLL support (MSC et al) */
16 #if defined(DLL_NETCDF) /* define when library is a DLL */
17 # if defined(DLL_EXPORT) /* define when building the library */
18 # define MSC_EXTRA __declspec(dllexport)
19 # else
20 # define MSC_EXTRA __declspec(dllimport)
21 # endif
22 # include <io.h>
23 #else
24 #define MSC_EXTRA
25 #endif /* defined(DLL_NETCDF) */
26 
27 #define EXTERNL MSC_EXTRA extern
29 typedef struct NC_memio {
30  size_t size;
31  void* memory;
32  int flags;
33 #define NC_MEMIO_LOCKED 1 /* Do not try to realloc or free provided memory */
34 } NC_memio;
35 
36 #if defined(__cplusplus)
37 extern "C" {
38 #endif
39 
40 /* Treate a memory block as a file; read-only */
41 EXTERNL int nc_open_mem(const char* path, int mode, size_t size, void* memory, int* ncidp);
42 
43 EXTERNL int nc_create_mem(const char* path, int mode, size_t initialsize, int* ncidp);
44 
45 /* Alternative to nc_open_mem with extended capabilites
46  See docs/inmemory.md
47  */
48 EXTERNL int nc_open_memio(const char* path, int mode, NC_memio* info, int* ncidp);
49 
50 /* Close memory file and return the final memory state */
51 EXTERNL int nc_close_memio(int ncid, NC_memio* info);
52 
53 #if defined(__cplusplus)
54 }
55 #endif
56 
57 #endif /* NETCDF_MEM_H */
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:1535
#define EXTERNL
Needed for DLL build.
Definition: netcdf_mem.h:27
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:1005
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:940
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:680

Return to the Main Unidata NetCDF page.
Generated on Sat Apr 6 2019 08:19:00 for NetCDF. NetCDF is a Unidata library.