source: SH_SHM/trunk/source/newgraph/mfusrdef.h @ 16

Revision 16, 5.5 KB checked in by marcus, 11 years ago (diff)

r1 | svn | 2007-12-13 11:10:29 +0100 (Do, 13 Dez 2007) | 2 lines

Initial import

Line 
1
2/* file MFUSRDEF.H
3 *      ==========
4 *
5 * version 3, 24-May-92
6 *
7 * user interface of module MEMFILE
8 * K. Stammler, 31-AUG-91
9 */
10
11#ifndef __MFUSRDEF
12#define __MFUSRDEF
13
14#define MFC_MAXMF 8
15        /* maximum number of memory files */
16#define MFC_REAL float
17
18
19/*-------------------------------------------------------------------------*/
20
21
22void mf_open( unsigned id, BOOLEAN mem, char *access, int *status );
23
24/* open file number "id"
25 *
26 * parameters of routine
27 * unsigned   id;        input; file number
28 * BOOLEAN    mem;       input; memory file (TRUE) or disk file (FALSE)
29 * char       *access;   input; read/write access;
30 * int        *status;   output; return status
31 */
32
33
34/*-------------------------------------------------------------------------*/
35
36
37void mf_close( unsigned id, int *status );
38
39/* closes memory file
40 *
41 * parameters of routine
42 * unsigned     id;      input; file ID
43 * int          *status; output; return status
44 */
45
46
47/*-------------------------------------------------------------------------*/
48
49
50void mf_rewind( unsigned id, int *status );
51
52/* rewinds file
53 *
54 * parameters of routine
55 * unsigned   id;         input; file ID
56 * int        *status;    output; return status
57 */
58
59
60/*-------------------------------------------------------------------------*/
61
62
63void mf_delete( unsigned id, int *status );
64
65/* deletes file
66 *
67 * parameters of routine
68 * unsigned   id;        input;  file ID
69 * int        *status;   output; return status
70 */
71
72
73/*-------------------------------------------------------------------------*/
74
75
76BOOLEAN mf_isopen( unsigned id );
77
78/* returns whther or not file "id" is opened
79 *
80 * parameter of routine
81 * unsigned  id;       input; file ID
82 *                     returns TRUE if file is opened
83 */
84
85
86/*-------------------------------------------------------------------------*/
87
88
89void mf_writereal( unsigned id, MFC_REAL r, int *status );
90
91/* write real number to file
92 *
93 * parameter of routine
94 * unsigned  id;       input; file ID
95 * MFC_REAL  r;        input; number
96 * int       *status;  output; return status
97 */
98
99
100/*-------------------------------------------------------------------------*/
101
102
103void mf_writeint( unsigned id, int i, int *status );
104
105/* write integer number to file
106 *
107 * parameter of routine
108 * unsigned  id;       input; file ID
109 * int       i;        input; number
110 * int       *status;  output; return status
111 */
112
113
114/*-------------------------------------------------------------------------*/
115
116
117void mf_writelong( unsigned id, long l, int *status );
118
119/* write long integer number to file
120 *
121 * parameter of routine
122 * unsigned  id;       input; file ID
123 * long      l;        input; number
124 * int       *status;  output; return status
125 */
126
127
128/*-------------------------------------------------------------------------*/
129
130
131void mf_writechar( unsigned id, char c, int *status );
132
133/* write integer number to file
134 *
135 * parameter of routine
136 * unsigned  id;       input; file ID
137 * char      c;        input; character
138 * int       *status;  output; return status
139 */
140
141
142/*-------------------------------------------------------------------------*/
143
144
145void mf_writestr( unsigned id, char *str, int *status );
146
147/* writes string to file
148 *
149 * parameters of routine
150 * unsigned   id;        input; file ID
151 * char       *str;      input; sring to be written
152 * int        *status;   output; return status
153 */
154
155
156/*-------------------------------------------------------------------------*/
157
158
159MFC_REAL mf_readreal( unsigned id, int *status );
160
161/* read real number from file
162 *
163 * parameter of routine
164 * unsigned  id;       input; file ID
165 * int       *status;  output; return status
166 *                     returns read value
167 */
168
169
170/*-------------------------------------------------------------------------*/
171
172
173int mf_readint( unsigned id, int *status );
174
175/* read integer number from file
176 *
177 * parameter of routine
178 * unsigned  id;       input; file ID
179 * int       *status;  output; return status
180 *                     returns read value
181 */
182
183
184/*-------------------------------------------------------------------------*/
185
186
187long mf_readlong( unsigned id, int *status );
188
189/* read long integer number from file
190 *
191 * parameter of routine
192 * unsigned  id;       input; file ID
193 * int       *status;  output; return status
194 *                     returns read value
195 */
196
197
198/*-------------------------------------------------------------------------*/
199
200
201char mf_readchar( unsigned id, int *status );
202
203/* read character from file
204 *
205 * parameter of routine
206 * unsigned  id;       input; file ID
207 * int       *status;  output; return status
208 *                     returns read value
209 */
210
211
212/*-------------------------------------------------------------------------*/
213
214
215void mf_readstr( unsigned id, char *str, int *status );
216
217/* reads string from file
218 *
219 * parameters of routine
220 * unsigned   id;        input; file ID
221 * char       *str;      output; read string
222 * int        *status;   output; return status
223 */
224
225
226/*-------------------------------------------------------------------------*/
227
228
229/* errors */
230#define MFE_NOERROR  0
231#define MFE_OFFSET   3900
232#define MFE_ILID     (MFE_OFFSET+1)   /* illegal file ID */
233#define MFE_OVWR     (MFE_OFFSET+2)   /* file ID already used */
234#define MFE_STROVFL  (MFE_OFFSET+3)   /* string overflow */
235#define MFE_OPNWR    (MFE_OFFSET+4)   /* error opening output file */
236#define MFE_DELOPN   (MFE_OFFSET+5)   /* attempt to delete open file */
237#define MFE_BUFOVFL  (MFE_OFFSET+6)   /* buffer overflow */
238#define MFE_NOTOPEN  (MFE_OFFSET+7)   /* file not opened */
239#define MFE_ENDMEM   (MFE_OFFSET+8)   /* end of memfile found during read */
240
241#endif
Note: See TracBrowser for help on using the repository browser.