NeXus  4.4.3
 All Data Structures Files Functions Variables Typedefs Macros Pages
nxdataset.h
Go to the documentation of this file.
1 /*
2  This is a module which implements the notion of a dataset. Its is
3  designed for the use with scripting languages.
4 
5  copyright: GPL
6 
7  Mark Koennecke, October 2002
8 */
9 #ifndef NXDATASET
10 #define NXDATASET
11 
12 
13 #define MAGIC 7776622
14 
15 #include "napiconfig.h"
16 
17 typedef struct {
18  int magic;
19  int rank;
20  int type;
21  int64_t *dim;
22  char *format;
23  union {
24  void *ptr;
25  float *fPtr;
26  double *dPtr;
27  int *iPtr;
28  short int *sPtr;
29  char *cPtr;
30  int64_t *lPtr;
31  } u;
32 }*pNXDS, NXDS;
33 
34 /*
35  include NeXus type codes if not already defined
36 */
37 #ifndef NX_FLOAT32
38 
39 #define NX_FLOAT32 5
40 #define NX_FLOAT64 6
41 #define NX_INT8 20
42 #define NX_UINT8 21
43 #define NX_INT16 22
44 #define NX_UINT16 23
45 #define NX_INT32 24
46 #define NX_UINT32 25
47 #define NX_INT64 26
48 #define NX_UINT64 27
49 #define NX_CHAR 4
50 
51 #define NX_MAXRANK 32
52 
53 #endif
54 
55 
56 pNXDS createNXDataset(int rank, int typecode, int64_t dim[]);
57 pNXDS createTextNXDataset(char *name);
58 
59 void dropNXDataset(pNXDS dataset);
60 
61 int getNXDatasetRank(pNXDS dataset);
62 int getNXDatasetDim(pNXDS dataset, int which);
63 int getNXDatasetType(pNXDS dataset);
64 int getNXDatasetLength(pNXDS dataset);
65 int getNXDatasetByteLength(pNXDS dataset);
66 
67 double getNXDatasetValue(pNXDS dataset, int64_t pos[]);
68 double getNXDatasetValueAt(pNXDS dataset, int64_t address);
69 char *getNXDatasetText(pNXDS dataset);
70 
71 int putNXDatasetValue(pNXDS dataset, int64_t pos[], double value);
72 int putNXDatasetValueAt(pNXDS dataset, int64_t address, double value);
73 
74 #endif
float * fPtr
Definition: nxdataset.h:25
struct pNXDS NXDS
int getNXDatasetRank(pNXDS dataset)
Definition: nxdataset.c:108
int rank
Definition: nxdataset.h:19
int putNXDatasetValueAt(pNXDS dataset, int64_t address, double value)
Definition: nxdataset.c:281
int64_t * dim
Definition: nxdataset.h:21
int getNXDatasetType(pNXDS dataset)
Definition: nxdataset.c:131
void dropNXDataset(pNXDS dataset)
Definition: nxdataset.c:89
pNXDS createNXDataset(int rank, int typecode, int64_t dim[])
Definition: nxdataset.c:36
int getNXDatasetDim(pNXDS dataset, int which)
Definition: nxdataset.c:118
int * iPtr
Definition: nxdataset.h:27
char * format
Definition: nxdataset.h:22
pNXDS createTextNXDataset(char *name)
Definition: nxdataset.c:69
void * ptr
Definition: nxdataset.h:24
double getNXDatasetValue(pNXDS dataset, int64_t pos[])
Definition: nxdataset.c:180
double getNXDatasetValueAt(pNXDS dataset, int64_t address)
Definition: nxdataset.c:194
int magic
Definition: nxdataset.h:18
int getNXDatasetByteLength(pNXDS dataset)
Definition: nxdataset.c:157
double * dPtr
Definition: nxdataset.h:26
short int * sPtr
Definition: nxdataset.h:28
char * cPtr
Definition: nxdataset.h:29
char * getNXDatasetText(pNXDS dataset)
Definition: nxdataset.c:230
int putNXDatasetValue(pNXDS dataset, int64_t pos[], double value)
Definition: nxdataset.c:267
int type
Definition: nxdataset.h:20
int getNXDatasetLength(pNXDS dataset)
Definition: nxdataset.c:141
int64_t * lPtr
Definition: nxdataset.h:30