Blockstructured Adaptive Mesh Refinement in object-oriented C++
00001 #ifndef __SDS_H_ 00002 #define __SDS_H_ 00003 00009 #ifndef ANSI 00010 #if defined(__STDC__) ||defined(__cplusplus)||defined(_LANGUAGE_C_PLUS_PLUS) 00011 #define ANSI 00012 #endif 00013 #endif 00014 00015 #ifdef ANSI 00016 #define CPROTO(x) x 00017 #else 00018 #define CPROTO(x) () 00019 #endif 00020 00021 #include <hdf.h> 00022 /*#include <netcdf.h>*/ 00023 #include <mfhdf.h> 00024 00025 /*@@ 00026 @header sds.h 00027 @date Wed Feb 28 20:30:57 1996 @author John Shalf 00028 @version 0.9a 00029 @@*/ 00030 00031 /**************** FileID juggling Operations ********************/ 00032 /* make file handle inactive (use if shortage of descriptors) */ 00033 void SDSdeactivate CPROTO((char *filename)); 00034 void SDSreactivate CPROTO((char *filename)); 00035 00036 00037 /******************** Explicit file open & close ops ******************/ 00038 /* use to specify file opening and closing, but not 00039 really needed since all routines will do this automatically */ 00040 void SDSopen CPROTO((char *filename,char *access)); 00041 void SDSclose CPROTO((char *filename)); 00042 void SDScloseAll CPROTO((void)); 00043 void SDSflush CPROTO((char *filename)); 00044 void SDSpurge CPROTO((char *filename)); 00045 00046 00047 /******************** Random Access Operations ************************/ 00048 /* need to make sure that seek leaves everything 00049 in the proper state so that a second getDims 00050 after the seek will not advance one more sds */ 00051 void SDSseek CPROTO((char *filename,int setnum)); 00052 int32 SDSseekName CPROTO((char *filename,char *name)); 00053 #define SDSgetLocation(x) SDSgetIndex(x) 00054 int32 SDSgetIndex CPROTO((char *filename)); 00055 int32 SDSisCoord CPROTO((char *filename)); 00056 00057 00058 /********************** File and Dataset Info **********************/ 00059 /* analogue to DFSDgetDims() */ 00060 /* should have set coordinates routine which can also handle coords 00061 that are n-dimensional instead of just edge coords. So it can 00062 handle Uniform/Rectilinear/Irregular dataset types */ 00063 void SDSgetFileInfo CPROTO((char *filename,int32 *nsds, int32 *nattrib)); 00064 int32 SDSgetDataName CPROTO((char *filename,char *name)); 00065 int32 SDSgetNumDatasets CPROTO((char *filename)); 00066 long SDSgetDims CPROTO((char *filename,char *dataname, 00067 int32 *rank,int32 *dims)); 00068 int32 SDSgetNT CPROTO((char *filename)); 00069 void SDSsetNT CPROTO((char *filename,int32 numbertype)); 00070 long SDScomputeSize CPROTO((int32 rank,int32 *dims,int32 numbertype)); 00071 00072 /* seems rank should be a pointer */ 00073 /* SD and DFSD are rather different here. In SD, you are selecting 00074 how much of each dimension to read from the file. In DFSD, you 00075 are requesting that the dims of the dataset you read be returned 00076 to you. */ 00077 int SDSreadData CPROTO((char *filename, 00078 int32 rank,int32 *dims,VOIDP data)); 00079 int SDSreadChunk CPROTO((char *filename,int32 rank,int32 *dims, 00080 int32 *origin,int32 *stride,VOIDP data)); 00081 /* Can simply write data or write the name with the data. 00082 The SD interface kind-of requires that the name for the dataset 00083 be written here, so it would have been inconsistent with the DFSD 00084 interface that this library is attempting to replace. Hence the #defines */ 00085 int32 SDSallocateDataset CPROTO((char *filename,char *dataname, 00086 int32 rank,int32 *dims)); 00087 int SDSwriteData CPROTO((char *filename,char *dataname, 00088 int32 rank,int32 *dims,VOIDP data)); 00089 int SDSwriteChunk CPROTO((char *filename, 00090 int32 rank,int32 *dims, 00091 int32 *origin,int32 *stride,VOIDP data)); 00092 00093 /************ Managing Annotations *******************/ 00094 int32 SDSaddAnnotation CPROTO((char *filename,char *annotation)); 00095 int32 SDSgetAnnotationSize CPROTO((char *filename)); 00096 int32 SDSgetAnnotation CPROTO((char *filename,char *annotation,int32 maxlen)); 00097 00098 00099 /************ Managing Attributes ******************/ 00100 int32 SDSgetNumAttribs CPROTO((char *filename)); 00101 int32 SDSwriteAttrib CPROTO((char *filename,char *attribname, 00102 int32 numbertype,int32 nelements,VOIDP buffer)); 00103 /* 0=Noattrib -1=error +<n>=Number of elements read */ 00104 /* nelements= max number of elements the buffer can hold */ 00105 int32 SDSreadAttrib CPROTO((char *filename,char *attribname, 00106 int32 nelements,VOIDP buffer)); 00107 int32 SDSfindAttribInfo CPROTO((char *filename,char *attribname, 00108 int32 *numbertype, int32 *nelements)); 00109 int32 SDSgetAttribInfo CPROTO((char *filename,int32 index,char *attribname, 00110 int32 *numbertype, int32 *nelements)); 00111 /* ** Standard String Attributes ** */ 00112 int32 SDSgetDataStrs CPROTO((char *filename,char *label,char *units, 00113 char *format, char *coordsys, int len)); 00114 #endif /* __SDS_H_ */
Quickstart Users Guide Programmers Reference Installation Examples Download
AMROC Main Home Contactlast update: 06/01/04