source: thirdparty/SZ/sz/include/rw.h @ 2c47b73

Revision 2c47b73, 4.4 KB checked in by Hal Finkel <hfinkel@…>, 6 years ago (diff)

more work on adding SZ (latest version)

  • Property mode set to 100644
Line 
1/**
2 *  @file io.h
3 *  @author Sheng Di
4 *  @date April, 2015
5 *  @brief Header file for the whole io interface.
6 *  (C) 2015 by Mathematics and Computer Science (MCS), Argonne National Laboratory.
7 *      See COPYRIGHT in top-level directory.
8 */
9
10#ifndef _IO_H
11#define _IO_H
12
13#include <stdio.h>
14#include <stdint.h>
15
16#ifdef _WIN32
17#define PATH_SEPARATOR ';'
18#else
19#define PATH_SEPARATOR ':'
20#endif
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26int checkFileExistance(char* filePath);
27
28float** create2DArray_float(size_t m, size_t n);
29void free2DArray_float(float** data, size_t m);
30float*** create3DArray_float(size_t p, size_t m, size_t n);
31void free3DArray_float(float*** data, size_t p, size_t m);
32double** create2DArray_double(size_t m, size_t n);
33void free2DArray_double(double** data, size_t m);
34double*** create3DArray_double(size_t p, size_t m, size_t n);
35void free3DArray_double(double*** data, size_t p, size_t m);
36size_t checkFileSize(char *srcFilePath, int *status);
37
38unsigned char *readByteData(char *srcFilePath, size_t *byteLength, int *status);
39double *readDoubleData(char *srcFilePath, size_t *nbEle, int *status);
40int8_t *readInt8Data(char *srcFilePath, size_t *nbEle, int *status);
41int16_t *readInt16Data(char *srcFilePath, size_t *nbEle, int *status);
42uint16_t *readUInt16Data(char *srcFilePath, size_t *nbEle, int *status);
43int32_t *readInt32Data(char *srcFilePath, size_t *nbEle, int *status);
44uint32_t *readUInt32Data(char *srcFilePath, size_t *nbEle, int *status);
45int64_t *readInt64Data(char *srcFilePath, size_t *nbEle, int *status);
46uint64_t *readUInt64Data(char *srcFilePath, size_t *nbEle, int *status);
47float *readFloatData(char *srcFilePath, size_t *nbEle, int *status);
48unsigned short* readShortData(char *srcFilePath, size_t *dataLength, int *status);
49
50double *readDoubleData_systemEndian(char *srcFilePath, size_t *nbEle, int *status);
51int8_t *readInt8Data_systemEndian(char *srcFilePath, size_t *nbEle, int *status);
52int16_t *readInt16Data_systemEndian(char *srcFilePath, size_t *nbEle, int *status);
53uint16_t *readUInt16Data_systemEndian(char *srcFilePath, size_t *nbEle, int *status);
54int32_t *readInt32Data_systemEndian(char *srcFilePath, size_t *nbEle, int *status);
55uint32_t *readUInt32Data_systemEndian(char *srcFilePath, size_t *nbEle, int *status);
56int64_t *readInt64Data_systemEndian(char *srcFilePath, size_t *nbEle, int *status);
57uint64_t *readUInt64Data_systemEndian(char *srcFilePath, size_t *nbEle, int *status);
58float *readFloatData_systemEndian(char *srcFilePath, size_t *nbEle, int *status);
59
60void writeByteData(unsigned char *bytes, size_t byteLength, char *tgtFilePath, int *status);
61void writeDoubleData(double *data, size_t nbEle, char *tgtFilePath, int *status);
62void writeFloatData(float *data, size_t nbEle, char *tgtFilePath, int *status);
63void writeData(void *data, int dataType, size_t nbEle, char *tgtFilePath, int *status);
64void writeFloatData_inBytes(float *data, size_t nbEle, char* tgtFilePath, int *status);
65void writeDoubleData_inBytes(double *data, size_t nbEle, char* tgtFilePath, int *status);
66void writeShortData_inBytes(short *states, size_t stateLength, char *tgtFilePath, int *status);
67void writeUShortData_inBytes(unsigned short *states, size_t stateLength, char *tgtFilePath, int *status);
68void writeIntData_inBytes(int *states, size_t stateLength, char *tgtFilePath, int *status);
69void writeUIntData_inBytes(unsigned int *states, size_t stateLength, char *tgtFilePath, int *status);
70void writeLongData_inBytes(int64_t *states, size_t stateLength, char *tgtFilePath, int *status);
71void writeULongData_inBytes(uint64_t *states, size_t stateLength, char *tgtFilePath, int *status);
72
73void writeStrings(int nbStr, char *str[], char *tgtFilePath, int *status);
74
75//void convertToPFM_float(float *data, size_t r5, size_t r4, size_t r3, size_t r2, size_t r1, int endianType, char *tgtFilePath, int *status);
76
77void checkfilesizec_(char *srcFilePath, int *len, size_t *filesize);
78void readbytefile_(char *srcFilePath, int *len, unsigned char *bytes, size_t *byteLength);
79void readdoublefile_(char *srcFilePath, int *len, double *data, size_t *nbEle);
80void readfloatfile_(char *srcFilePath, int *len, float *data, size_t *nbEle);
81void writebytefile_(unsigned char *bytes, size_t *byteLength, char *tgtFilePath, int *len);
82void writedoublefile_(double *data, size_t *nbEle, char *tgtFilePath, int *len);
83void writefloatfile_(float *data, size_t *nbEle, char *tgtFilePath, int *len);
84
85#ifdef __cplusplus
86}
87#endif
88
89#endif /* ----- #ifndef _IO_H  ----- */
Note: See TracBrowser for help on using the repository browser.