xref: /phasta/phSolver/common/phIO.h (revision d7abaf6c7709145d1e6e6b7740bd56c3f238d064)
1d1293ce9SCameron Smith #ifndef PHSOLVER_PHIO_H
2d1293ce9SCameron Smith #define PHSOLVER_PHIO_H
3d1293ce9SCameron Smith 
4d1293ce9SCameron Smith #ifdef __cplusplus
5d1293ce9SCameron Smith extern "C" {
6d1293ce9SCameron Smith #endif
7064bab1dSCameron Smith   typedef struct phio_file* phio_fp;
8ab645d52SCameron Smith   void phio_openfile(
9ab645d52SCameron Smith       const char filename[],
10ab645d52SCameron Smith       phio_fp fileDescriptor);
11ab645d52SCameron Smith   void phio_closefile(phio_fp fileDescriptor);
12d1293ce9SCameron Smith   void phio_readheader(
13064bab1dSCameron Smith       phio_fp fileDescriptor,
14d1293ce9SCameron Smith       const  char keyphrase[],
15d1293ce9SCameron Smith       void* valueArray,
16d1293ce9SCameron Smith       int*  nItems,
17d1293ce9SCameron Smith       const char  datatype[],
18d1293ce9SCameron Smith       const char  iotype[] );
19fa18c524SCameron Smith   void phio_writeheader(
2057517afcSCameron Smith       phio_fp fileDescriptor,
21fa18c524SCameron Smith       const char keyphrase[],
22fa18c524SCameron Smith       const void* valueArray,
23fa18c524SCameron Smith       const int* nItems,
24fa18c524SCameron Smith       const int* ndataItems,
25fa18c524SCameron Smith       const char datatype[],
26fa18c524SCameron Smith       const char iotype[] );
27f262839cSCameron Smith   void phio_readdatablock(
28064bab1dSCameron Smith       phio_fp fileDescriptor,
29f262839cSCameron Smith       const  char keyphrase[],
30f262839cSCameron Smith       void* valueArray,
31f262839cSCameron Smith       int*  nItems,
32f262839cSCameron Smith       const char  datatype[],
33f262839cSCameron Smith       const char  iotype[] );
3466a3fa2cSCameron Smith   void phio_writedatablock(
359ec3dd51SCameron Smith       phio_fp fileDescriptor,
3666a3fa2cSCameron Smith       const char keyphrase[],
3766a3fa2cSCameron Smith       const void* valueArray,
3866a3fa2cSCameron Smith       const int* nItems,
3966a3fa2cSCameron Smith       const char datatype[],
4066a3fa2cSCameron Smith       const char iotype[]);
41ab645d52SCameron Smith   typedef enum {PHIO_SYNC,PHIO_POSIX,PHIO_STREAM} phio_format;
42ab645d52SCameron Smith   void phio_constructName(
43ab645d52SCameron Smith       phio_format format,
44ab645d52SCameron Smith       const char* inName,
45*d7abaf6cSCameron Smith       char* outName);
4636adee64SCameron Smith   void phio_appendStep(char* dest, int v);
47d1293ce9SCameron Smith #ifdef __cplusplus
48d1293ce9SCameron Smith }
49d1293ce9SCameron Smith #endif
50d1293ce9SCameron Smith 
51d1293ce9SCameron Smith #endif
52d1293ce9SCameron Smith 
53