Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
ncio.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #ifndef _NCIO_H_
00007 #define _NCIO_H_
00008
00009 #include <stddef.h>
00010 #include <sys/types.h>
00011 #include "netcdf.h"
00012
00013 typedef struct ncio ncio;
00014
00015
00016
00017
00018 #define OFF_NONE ((off_t)(-1))
00019
00020
00021
00022
00023
00024 #define RGN_NOLOCK 0x1
00025
00026
00027
00028 #define RGN_NOWAIT 0x2
00029
00030 #define RGN_WRITE 0x4
00031
00032 #define RGN_MODIFIED 0x8
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 typedef int ncio_relfunc(ncio *const nciop,
00046 off_t offset, int rflags);
00047
00048
00049
00050
00051
00052 typedef int ncio_getfunc(ncio *const nciop,
00053 off_t offset, size_t extent,
00054 int rflags,
00055 void **const vpp);
00056
00057
00058
00059
00060
00061 typedef int ncio_movefunc(ncio *const nciop, off_t to, off_t from,
00062 size_t nbytes, int rflags);
00063
00064
00065
00066
00067
00068 typedef int ncio_syncfunc(ncio *const nciop);
00069
00070
00071
00072
00073
00074
00075 typedef void ncio_freefunc(void *const pvt);
00076
00077
00078 #if defined(__cplusplus)
00079 #define NCIO_CONST
00080 #else
00081 #define NCIO_CONST const
00082 #endif
00083
00084
00085
00086
00087 struct ncio {
00088
00089
00090
00091
00092 int ioflags;
00093
00094
00095
00096
00097
00098 NCIO_CONST int fd;
00099
00100
00101
00102 ncio_relfunc *NCIO_CONST rel;
00103
00104 ncio_getfunc *NCIO_CONST get;
00105
00106 ncio_movefunc *NCIO_CONST move;
00107
00108 ncio_syncfunc *NCIO_CONST sync;
00109
00110 ncio_freefunc *NCIO_CONST free;
00111
00112
00113
00114
00115
00116
00117 const char *path;
00118
00119
00120 void *NCIO_CONST pvt;
00121 };
00122
00123 #undef NCIO_CONST
00124
00125 extern int
00126 ncio_create(const char *path, int ioflags,
00127 size_t initialsz,
00128 off_t igeto, size_t igetsz, size_t *sizehintp,
00129 ncio **nciopp, void **const igetvpp);
00130
00131 extern int
00132 ncio_open(const char *path,
00133 int ioflags,
00134 off_t igeto, size_t igetsz, size_t *sizehintp,
00135 ncio **nciopp, void **const igetvpp);
00136
00137 extern int
00138 ncio_close(ncio *nciop, int doUnlink);
00139
00140 #endif