- Switched to NAPI-3.0 with XML support
- Fixed exeman to write files by default into the first directory in batchpath - Fixed a bug in nxdict which prevented it from handling attributes containing :/ properly - Removed junk files - Fixed a bug in hklscan.c which made it dump core - Added XML support to nxscript.c - Added support for writing NeXus-XML data files to tasub
This commit is contained in:
86
napi.h
86
napi.h
@@ -21,7 +21,7 @@
|
||||
|
||||
For further information, see <http://www.neutron.anl.gov/NeXus/>
|
||||
|
||||
$Id: napi.h,v 1.7 2004/11/17 10:50:16 cvs Exp $
|
||||
$Id: napi.h,v 1.8 2005/05/27 11:58:05 koennecke Exp $
|
||||
|
||||
----------------------------------------------------------------------------*/
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#define NEXUSAPI
|
||||
|
||||
/* NeXus HDF45 */
|
||||
#define NEXUS_VERSION "2.1.0" /* major.minor.patch */
|
||||
#define NEXUS_VERSION "3.0.0" /* major.minor.patch */
|
||||
|
||||
#define CONSTCHAR const char
|
||||
|
||||
@@ -43,11 +43,18 @@
|
||||
# define NX_EXTERNAL
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define snprintf nxisnprintf
|
||||
|
||||
extern int nxisnprintf(char* buffer, int len, const char* format, ... );
|
||||
|
||||
#endif
|
||||
|
||||
typedef void* NXhandle; /* really a pointer to a NexusFile structure */
|
||||
typedef int NXstatus;
|
||||
typedef char NXname[128];
|
||||
|
||||
typedef enum {NXACC_READ=1, NXACC_RDWR=2, NXACC_CREATE=3, NXACC_CREATE4=4, NXACC_CREATE5=5} NXaccess;
|
||||
typedef enum {NXACC_READ=1, NXACC_RDWR=2, NXACC_CREATE=3, NXACC_CREATE4=4, NXACC_CREATE5=5, NXACC_CREATEXML=6} NXaccess;
|
||||
|
||||
typedef struct {
|
||||
char *iname;
|
||||
@@ -90,6 +97,7 @@ typedef struct {
|
||||
#define NX_FLOAT64 6
|
||||
#define NX_INT8 20
|
||||
#define NX_UINT8 21
|
||||
#define NX_BOOLEAN NX_UINT
|
||||
#define NX_INT16 22
|
||||
#define NX_UINT16 23
|
||||
#define NX_INT32 24
|
||||
@@ -112,17 +120,19 @@ typedef struct {
|
||||
#include <hdf5.h>
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
#ifdef HDF4
|
||||
int32 iTag; /* HDF4 variable */
|
||||
int32 iRef; /* HDF4 variable */
|
||||
#ifndef HDF4
|
||||
typedef int int32;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int32 iTag; /* HDF4 variable */
|
||||
int32 iRef; /* HDF4 variable */
|
||||
#ifdef HDF5
|
||||
char iTag5[1024]; /* HDF5 variable */
|
||||
char iRef5[1024]; /* HDF5 variable */
|
||||
char iRefd[1024]; /* HDF5 variable */
|
||||
#endif
|
||||
#endif
|
||||
char targetPath[1024]; /* XML path */
|
||||
} NXlink;
|
||||
|
||||
|
||||
@@ -146,6 +156,7 @@ typedef struct {
|
||||
# define NXmakegroup MANGLE(nximakegroup)
|
||||
# define NXopengroup MANGLE(nxiopengroup)
|
||||
# define NXopenpath MANGLE(nxiopenpath)
|
||||
# define NXopengrouppath MANGLE(nxiopengrouppath)
|
||||
# define NXclosegroup MANGLE(nxiclosegroup)
|
||||
# define NXmakedata MANGLE(nximakedata)
|
||||
# define NXcompmakedata MANGLE(nxicompmakedata)
|
||||
@@ -157,6 +168,7 @@ typedef struct {
|
||||
# define NXputattr MANGLE(nxiputattr)
|
||||
# define NXgetdataID MANGLE(nxigetdataid)
|
||||
# define NXmakelink MANGLE(nximakelink)
|
||||
# define NXopensourcegroup MANGLE(nxiopensourcegroup)
|
||||
# define NXmalloc MANGLE(nximalloc)
|
||||
# define NXfree MANGLE(nxifree)
|
||||
# define NXflush MANGLE(nxiflush)
|
||||
@@ -174,6 +186,7 @@ typedef struct {
|
||||
# define NXsameID MANGLE(nxisameid)
|
||||
# define NXinitgroupdir MANGLE(nxiinitgroupdir)
|
||||
# define NXinitattrdir MANGLE(nxiinitattrdir)
|
||||
# define NXsetnumberformat MANGLE(nxisetnumberformat)
|
||||
# define NXsetcache MANGLE(nxisetcache)
|
||||
/* FORTRAN helpers - for NeXus internal use only */
|
||||
# define NXfopen MANGLE(nxifopen)
|
||||
@@ -217,6 +230,7 @@ typedef struct {
|
||||
# define NXmakegroup MANGLE(NXIMAKEGROUP)
|
||||
# define NXopengroup MANGLE(NXIOPENGROUP)
|
||||
# define NXopenpath MANGLE(NXIOPENPATH)
|
||||
# define NXopengrouppath MANGLE(NXIOPENGROUPPATH)
|
||||
# define NXclosegroup MANGLE(NXICLOSEGROUP)
|
||||
# define NXmakedata MANGLE(NXIMAKEDATA)
|
||||
# define NXcompress MANGLE(NXICOMPRESS)
|
||||
@@ -237,10 +251,12 @@ typedef struct {
|
||||
# define NXgetnextentry MANGLE(NXIGETNEXTENTRY)
|
||||
# define NXgetattrinfo MANGLE(NXIGETATTRINFO)
|
||||
# define NXinitattrdir MANGLE(NXIINITATTRDIR)
|
||||
# define NXsetnumberformat MANGLE(NXISETNUMBERFORMAT)
|
||||
# define NXgetnextattr MANGLE(NXIGETNEXTATTR)
|
||||
# define NXgetgroupID MANGLE(NXIGETGROUPID)
|
||||
# define NXgetdataID MANGLE(NXIGETDATAID)
|
||||
# define NXmakelink MANGLE(NXIMAKELINK)
|
||||
# define NXopensourcegroup MANGLE(NXIOPENSOURCEGROUP)
|
||||
# define NXmalloc MANGLE(NXIMALLOC)
|
||||
# define NXfree MANGLE(NXIFREE)
|
||||
/* FORTRAN helpers - for NeXus internal use only */
|
||||
@@ -267,9 +283,10 @@ NX_EXTERNAL NXstatus CALLING_STYLE NXopen(CONSTCHAR * filename, NXaccess access
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXclose(NXhandle* pHandle);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXflush(NXhandle* pHandle);
|
||||
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXmakegroup (NXhandle handle, CONSTCHAR *name, char* NXclass);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXopengroup (NXhandle handle, CONSTCHAR *name, char* NXclass);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXmakegroup (NXhandle handle, CONSTCHAR *name, CONSTCHAR* NXclass);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXopengroup (NXhandle handle, CONSTCHAR *name, CONSTCHAR* NXclass);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXopenpath (NXhandle handle, CONSTCHAR *path);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXopengrouppath (NXhandle handle, CONSTCHAR *path);
|
||||
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXclosegroup(NXhandle handle);
|
||||
|
||||
@@ -285,6 +302,7 @@ NX_EXTERNAL NXstatus CALLING_STYLE NXputslab(NXhandle handle, void* data, int s
|
||||
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXgetdataID(NXhandle handle, NXlink* pLink);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXmakelink(NXhandle handle, NXlink* pLink);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXopensourcegroup(NXhandle handle);
|
||||
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXgetdata(NXhandle handle, void* data);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXgetinfo(NXhandle handle, int* rank, int dimension[], int* datatype);
|
||||
@@ -300,22 +318,64 @@ NX_EXTERNAL NXstatus CALLING_STYLE NXsameID(NXhandle handle, NXlink* pFirstID,
|
||||
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXinitgroupdir(NXhandle handle);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXinitattrdir(NXhandle handle);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXsetnumberformat(NXhandle handle,
|
||||
int type, char *format);
|
||||
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXmalloc(void** data, int rank, int dimensions[], int datatype);
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXfree(void** data);
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
A non Nexus standard function to set an error handler
|
||||
*/
|
||||
NAPI internals
|
||||
------------------------------------------------------------------------*/
|
||||
NX_EXTERNAL void CALLING_STYLE NXMSetError(void *pData, void (*ErrFunc)(void *pD, char *text));
|
||||
NX_EXTERNAL void CALLING_STYLE NXNXNXReportError(void *pData,char *text);
|
||||
extern void (*NXIReportError)(void *pData,char *text);
|
||||
extern void *NXpData;
|
||||
|
||||
|
||||
/*
|
||||
another special function for setting the default cache size for HDF-5
|
||||
*/
|
||||
NX_EXTERNAL NXstatus CALLING_STYLE NXsetcache(long newVal);
|
||||
|
||||
/*
|
||||
* We need to include CALLING_STYLE in the function pointer definition
|
||||
* or else we get a type mismatch on Win32
|
||||
*/
|
||||
typedef struct {
|
||||
NXhandle *pNexusData;
|
||||
NXstatus (CALLING_STYLE *nxclose)(NXhandle* pHandle);
|
||||
NXstatus (CALLING_STYLE *nxflush)(NXhandle* pHandle);
|
||||
NXstatus (CALLING_STYLE *nxmakegroup) (NXhandle handle, CONSTCHAR *name, CONSTCHAR* NXclass);
|
||||
NXstatus (CALLING_STYLE *nxopengroup) (NXhandle handle, CONSTCHAR *name, CONSTCHAR* NXclass);
|
||||
NXstatus (CALLING_STYLE *nxclosegroup)(NXhandle handle);
|
||||
NXstatus (CALLING_STYLE *nxmakedata) (NXhandle handle, CONSTCHAR* label, int datatype, int rank, int dim[]);
|
||||
NXstatus (CALLING_STYLE *nxcompmakedata) (NXhandle handle, CONSTCHAR* label, int datatype, int rank, int dim[], int comp_typ, int bufsize[]);
|
||||
NXstatus (CALLING_STYLE *nxcompress) (NXhandle handle, int compr_type);
|
||||
NXstatus (CALLING_STYLE *nxopendata) (NXhandle handle, CONSTCHAR* label);
|
||||
NXstatus (CALLING_STYLE *nxclosedata)(NXhandle handle);
|
||||
NXstatus (CALLING_STYLE *nxputdata)(NXhandle handle, void* data);
|
||||
NXstatus (CALLING_STYLE *nxputattr)(NXhandle handle, CONSTCHAR* name, void* data, int iDataLen, int iType);
|
||||
NXstatus (CALLING_STYLE *nxputslab)(NXhandle handle, void* data, int start[], int size[]);
|
||||
NXstatus (CALLING_STYLE *nxgetdataID)(NXhandle handle, NXlink* pLink);
|
||||
NXstatus (CALLING_STYLE *nxmakelink)(NXhandle handle, NXlink* pLink);
|
||||
NXstatus (CALLING_STYLE *nxgetdata)(NXhandle handle, void* data);
|
||||
NXstatus (CALLING_STYLE *nxgetinfo)(NXhandle handle, int* rank, int dimension[], int* datatype);
|
||||
NXstatus (CALLING_STYLE *nxgetnextentry)(NXhandle handle, NXname name, NXname nxclass, int* datatype);
|
||||
NXstatus (CALLING_STYLE *nxgetslab)(NXhandle handle, void* data, int start[], int size[]);
|
||||
NXstatus (CALLING_STYLE *nxgetnextattr)(NXhandle handle, NXname pName, int *iLength, int *iType);
|
||||
NXstatus (CALLING_STYLE *nxgetattr)(NXhandle handle, char* name, void* data, int* iDataLen, int* iType);
|
||||
NXstatus (CALLING_STYLE *nxgetattrinfo)(NXhandle handle, int* no_items);
|
||||
NXstatus (CALLING_STYLE *nxgetgroupID)(NXhandle handle, NXlink* pLink);
|
||||
NXstatus (CALLING_STYLE *nxgetgroupinfo)(NXhandle handle, int* no_items, NXname name, NXname nxclass);
|
||||
NXstatus (CALLING_STYLE *nxsameID)(NXhandle handle, NXlink* pFirstID, NXlink* pSecondID);
|
||||
NXstatus (CALLING_STYLE *nxinitgroupdir)(NXhandle handle);
|
||||
NXstatus (CALLING_STYLE *nxinitattrdir)(NXhandle handle);
|
||||
NXstatus (CALLING_STYLE *nxsetnumberformat)(NXhandle handle,
|
||||
int type,char *format);
|
||||
} NexusFunction, *pNexusFunction;
|
||||
/*---------------------*/
|
||||
extern long nx_cacheSize;
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Reference in New Issue
Block a user