UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
stnd_sps_io.h
1 /* stnd_sps_io.h */
2 /* $Id: stnd_sps_io.h,v 1.2 2001/04/18 14:32:04 vlad Exp $ */
3 #ifndef __stnd_sps_io_h
4 #define __stnd_sps_io_h
5 
6 #include <mix/ErrCodes.h>
7 #include <mix/trans.h>
8 #include <mix/stnd_sps.h>
9 
10 
11 /***********************************************************************
12  * Input/output of VSP-PC SPS 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  SPS_Dir sps_dir; /* description part */
21  Char *sps_comment; /* comments or NULL */
22  SPS_Dir2 sps_dir2; /* additional parameters (type V) */
23  union {
24  char *buf;
25  Int2 *i2;
26  Int4 *i4;
27  Real4 *r4;
28  } sps_arg, /* arguments (short or list format) */
29  sps_par; /* parameters: p1[0],p2[0],p1[1],p2[1],p1[2] */
30 
31  AtomType arg_at, par_at; /* format of argument and parameters */
32  int arg_n; /* arguments number (sps_dir.key sensitive) */
33 
34 } sps_io_t;
35 
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40 
41 
42 /******************************
43  * Input/output *
44  ******************************/
45 
46 /* Open VSP-PC SPS file for writing. */
47 ErrCode sps_open_file_write (sps_io_t* io,
48  const char* szFilePath);
49 
50 /* Open VSP-PC SPS file for reading. */
51 ErrCode sps_open_file_read (sps_io_t* io,
52  const char* szFilePath);
53 
54 /* Close VSP-PC SPS file. */
55 ErrCode sps_close (sps_io_t* io);
56 
57 /* Read SPS data from file. */
58 ErrCode sps_read_file (sps_io_t* io);
59 
60 /* Write SPS data to file. */
61 ErrCode sps_write_file (sps_io_t* io);
62 
63 /* Prepare short argument format for given number of lines. */
64 ErrCode sps_short_arg_prepare (sps_io_t* io, int lines_n);
65 
66 /* Prepare list argument format for given number of lines. */
67 ErrCode sps_list_arg_prepare (sps_io_t* io, int lines_n);
68 
69 /* Setup names and parameters number for given kind of SPS */
70 ErrCode sps_setup_kind (sps_io_t* io, char sps_kind);
71 
72 
73 /******************************
74  * Input/Ouput buffer to *
75  * C structure conversion. *
76  ******************************/
77 
78 /* Copy SPS directory from structure to file I/O buffer. */
79 ErrCode sps_copy_dir2io (void* buf, const SPS_Dir* dir);
80 
81 /* Copy SPS directory from file I/O buffer to structure. */
82 ErrCode sps_copy_io2dir (void* buf, SPS_Dir* dir);
83 
84 /* Format convertor from I/O to AtomType. */
85 AtomType sps_copy_io2f (const char* f);
86 
87 /* Format convertor from AtomType to I/O. */
88 void sps_copy_f2io (AtomType at, char* f);
89 
90 
91 #ifdef __cplusplus
92 };
93 #endif /* __cplusplus */
94 
95 
96 
97 #endif /* stnd_sps_io.h */
Definition: stnd_sps_io.h:14
Definition: stnd_sps.h:61
Definition: stnd_sps.h:81