UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
stnd_io.h
1 /* stnd_io.h */
2 /* $Id: stnd_io.h,v 1.2 2001/04/02 13:34:24 vlad Exp $ */
3 #ifndef __stnd_io_h
4 #define __stnd_io_h
5 
6 #include <mix/ErrCodes.h>
7 #include <mix/trans.h>
8 #include <mix/stnd_file.h>
9 
10 
11 /***********************************************************************
12  * Input/output of VSP-PC file is controlled by this structure:
13  ***********************************************************************/
14 typedef struct
15 {
16  char *fpath; /* file path or device name */
17  int fildes; /* file handle */
18  char omode; /* operating mode: 'r' - read, 'w' - write */
19 
20  /* read operating mode only */
21  int filesize; /* size of file */
22  int fhsize; /* size of file header (bytes) */
23  int thsize; /* size of trace header (bytes) */
24  int trsize; /* size of trace body (bytes) */
25  int nsamples; /* number of sample in trace */
26  AtomType format; /* sample's format */
27  void *trconv; /* trace body conversion buffer */
28 
29 } stnd_io_t;
30 
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif /* __cplusplus */
35 
36 
37 /******************************
38  * Input/output *
39  ******************************/
40 
41 /* Open VSP-PC file for writing. */
42 ErrCode stnd_open_file_write (stnd_io_t* io,
43  const char* szFilePath);
44 
45 /* Open VSP-PC file for reading. */
46 ErrCode stnd_open_file_read (stnd_io_t* io,
47  const char* szFilePath);
48 
49 /* Close VSP-PC file. */
50 ErrCode stnd_close (stnd_io_t* io);
51 
52 /* Write trace file header. */
53 ErrCode stnd_write_file_hdr (stnd_io_t* io,
54  const STND_FileHeader* hdr);
55 
56 /* Write trace header. */
57 ErrCode stnd_write_trace_hdr (stnd_io_t* io,
58  const STND_TraceHeader* hdr);
59 
60 /* Write trace body. */
61 ErrCode stnd_write_trace_body (stnd_io_t* io,
62  Real4* body,
63  int nsamples);
64 
65 /* Read trace file header. */
66 ErrCode stnd_read_file_hdr (stnd_io_t* io,
67  STND_FileHeader* hdr);
68 
69 /* Read trace header. */
70 ErrCode stnd_read_trace_hdr (stnd_io_t* io,
71  STND_TraceHeader* hdr);
72 
73 /* Read trace body. */
74 ErrCode stnd_read_trace_body (stnd_io_t* io,
75  Real4* body);
76 
77 
78 /******************************
79  * Input/Ouput buffer to *
80  * C structure conversion. *
81  ******************************/
82 
83 /* Copy trace header from structure to file I/O buffer. */
84 ErrCode stnd_copy_th2io (void* buf,
85  const STND_TraceHeader_blocks* th);
86 
87 /* Copy file header from structure to file I/O buffer. */
88 ErrCode stnd_copy_fh2io (void* buf,
89  const STND_FileHeader_blocks* fh);
90 
91 /* Copy trace header from file I/O buffer to structure. */
92 ErrCode stnd_copy_io2th (const void* buf,
94 
95 /* Copy file header from file I/O buffer to structure. */
96 ErrCode stnd_copy_io2fh (const void* buf,
98 
99 
100 /******************************
101  * ASCII supposed operations *
102  ******************************/
103 
104 /* Initialize file header header by template. */
105 ErrCode stnd_fh_template (STND_FileHeader* hdr);
106 
107 /* Print to log file header. */
108 ErrCode stnd_fh_put_log (const STND_FileHeader* hdr,
109  Logic bImportant);
110 
111 /* Print to log trace header. */
112 ErrCode stnd_th_put_log (const STND_TraceHeader* hdr,
113  Logic bImportant);
114 
115 #ifdef __cplusplus
116 };
117 #endif /* __cplusplus */
118 
119 
120 #endif /* stnd_io.h */
Definition: stnd_file.h:223
Definition: stnd_file.h:161
Definition: stnd_file.h:186
Definition: stnd_file.h:176
Definition: stnd_io.h:14