RZ

01: // ExtractIntermediate.hh # rz wrapper
02:
03: #ifndef _ExtractIntermediate_HH
04: #define _ExtractIntermediate_HH 1
05:
06: #include "RZError.hh"
07: #include "RZIO.hh"
08: #include "RZNetOrder.hh"
09:
10: /****** rz header and sig table passing between processes via tempfile ******/
11:
12: namespace RZ {
13:     struct IntermediateWrapper {
14:         std::FILE *RZ_WRAPPER;
15:         char rz_header[ 64 ];
16:         unsigned int n_blks;
17:
18:         IntermediateWrapper(int const rzwrapperfd)
19:         {
20:             RZ_WRAPPER = fdopen_in(rzwrapperfd); // C-style buffered input
21:             
22:             int n = std::fread(rz_header, 1, 64, RZ_WRAPPER);
23:             ScanError::what_if("Can't read rz file header!", n != 64);
24:
25:             n_blks = net_in(rz_header + 32);
26:         }
27:
28:         ~IntermediateWrapper(void)
29:         {
30:             std::fclose(RZ_WRAPPER);
31:         }
32:     };
33: }
34:
35: // ExtractIntermediate.hh # rz wrapper
36:
37: #endif