GSI Object Oriented Online Offline (Go4)  GO4-6.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
rawapin.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Copyright:
3  * GSI, Gesellschaft fuer Schwerionenforschung mbH
4  * Planckstr. 1
5  * D-64291 Darmstadt
6  * Germany
7  * created 1.12.2000 by Horst Goeringer
8  *********************************************************************
9  * rawapin.h
10  * entry definitions for client API
11  * new version
12  *********************************************************************
13  * 7. 2.2001, H.G.: rfio_gsi_query added
14  * 26. 2.2001, H.G.: rfio_fstat, rfio_perror, rfio_serror added
15  * for ROOT version 300-05
16  * 15.10.2002, H.G.: remove declaration of fLogFile
17  * 13. 1.2003, H.G.: remove definition PORT_MOVER (in rawcommn.h)
18  * 12. 6.2003, H.G.: add externals fLogFile, piFilelist
19  * 4. 8.2004, H.G.: new entries rfio_[f]endfile, rfio_[f]newfile
20  * 17. 2.2005, H.G.: add C++ binding
21  * 20. 4.2005, H.G.: mod C++ binding for rootcint
22  * 22. 5.2007, H.G.: new entries rfio_open64, rfio_lseek64
23  * 29. 5.2007, H.G.: new entries rfio_stat64, rfio_fstat64
24  * 14.11.2008, H.G.: new entry rfio_cache_stat
25  * 17.11.2008, H.G.: new entr. rfio_preseek64, rfio_mkdir, rfio_closedir
26  * mod file args from 'char *' to 'const char *' in:
27  * rfio_access, rfio_fwrite, rfio_open, rfio_open64,
28  * rfio_unlink, rfio_write
29  * 11. 2.2009, H.G.: new entries rfio_open_gsidaq, rfio_fopen_gsidaq
30  * 26. 6.2009, H.G.: for 64 bit client: replace int args:
31  * rfio_fread: return, args 2, 3 by size_t
32  * rfio_fwrite: return, args 2, 3 by size_t
33  * rfio_read: arg 3 by size_t, return by ssize_t
34  * rfio_write: arg 3 by size_t, return by ssize_t
35  * 26. 2.2010, H.G.: rfio_gsi_query: add parameter (len output string)
36  * include unistd.h, if not yet done
37  * 23. 4.2010, H.G.: new entry rfio_fopen_gsidaq_dm
38  *********************************************************************
39  */
40 
41 #ifndef RAWAPI__H
42 #define RAWAPI__H
43 
44 #ifdef Lynx
45 
46 #ifndef USER_API
47 #define USER_API
48 FILE *fLogFile; /* external in some C functions */
49 #endif
50 
51 #else /* not Lynx */
52 
53 
54 // Sergey Linev: no need here, declared external in each source where used
55 //#ifndef __cplusplus
56 //FILE *fLogFile; /* external in some C functions */
57 //#endif
58 
59 #ifndef _STDINT_H
60 #include <stdint.h>
61 #endif
62 
63 #ifndef _UNISTD_H
64 #include <unistd.h>
65 #endif
66 
67 #endif /* not Lynx */
68 
69 #include "rawcommn.h"
70 #include "rawclin.h"
71 
72 #define RFILE srawAPIFile
73 
74 /****************** entries using 64 bit functions *******************/
75 
76 #ifdef __USE_LARGEFILE64
77 
78 #ifdef __cplusplus
79 extern "C" {
80 #endif
81 int rfio_open64(const char *, int, int);
82  /* open connection to server and file */
83 #ifdef __cplusplus
84 }
85 #endif
86 
87 #ifdef __cplusplus
88 extern "C" {
89 #endif
90 int64_t rfio_lseek64(int, int64_t, int);
91  /* move read/write pointer */
92 #ifdef __cplusplus
93 }
94 #endif
95 
96 #ifdef __cplusplus
97 extern "C" {
98 #endif
99 int rfio_stat64(const char *, struct stat64 *);
100  /* get large file status */
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #ifdef __cplusplus
106 extern "C" {
107 #endif
108 int rfio_fstat64(int, struct stat64 *);
109  /* get large file status */
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #ifdef __cplusplus
115 extern "C" {
116 #endif
117 int rfio_preseek64(int, const void *, int);
118  /* move read/write pointer */
119 #ifdef __cplusplus
120 }
121 #endif
122 
123 #endif /* __USE_LARGEFILE64 */
124 
125 /********************* entries using file ptr ************************/
126 
127 #ifdef __cplusplus
128 extern "C" {
129 #endif
131  char *, char *, char *, int *, int, char *, int, int, int);
132  /* open connection to gStore server and file and prepare copy
133  to lustre or read cache before migration to tape,
134  provide data mover name and running no. */
135 #ifdef __cplusplus
136 }
137 #endif
138 
139 #ifdef __cplusplus
140 extern "C" {
141 #endif
142 RFILE *rfio_fopen_gsidaq(char *, char *, int, char *, int, int, int);
143  /* open connection to gStore server and file and prepare copy
144  to lustre or read cache before migration to tape */
145 #ifdef __cplusplus
146 }
147 #endif
148 
149 #ifdef __cplusplus
150 extern "C" {
151 #endif
152 RFILE *rfio_fopen(char *, char *);
153  /* open connection to gStore server and file */
154 #ifdef __cplusplus
155 }
156 #endif
157 
158 #ifdef __cplusplus
159 extern "C" {
160 #endif
161 size_t rfio_fread(char *, size_t, size_t, RFILE *);
162  /* read file buffer */
163 #ifdef __cplusplus
164 }
165 #endif
166 
167 #ifdef __cplusplus
168 extern "C" {
169 #endif
170 size_t rfio_fwrite(const char *, size_t, size_t, RFILE *);
171  /* write file buffer */
172 #ifdef __cplusplus
173 }
174 #endif
175 
176 #ifdef __cplusplus
177 extern "C" {
178 #endif
179 int rfio_fclose(RFILE *);
180  /* close connection to server and file */
181 #ifdef __cplusplus
182 }
183 #endif
184 
185 #ifdef __cplusplus
186 extern "C" {
187 #endif
188 int rfio_fendfile(RFILE *);
189  /* close file, keep connection to server */
190 #ifdef __cplusplus
191 }
192 #endif
193 
194 #ifdef __cplusplus
195 extern "C" {
196 #endif
197 int rfio_fnewfile(RFILE *, char *);
198  /* open new file on already connected server */
199 #ifdef __cplusplus
200 }
201 #endif
202 
203 #ifdef __cplusplus
204 extern "C" {
205 #endif
206 int rfio_mkdir(const char *, int);
207  /* open new file on already connected server */
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 /********************** entries using file id ********************************/
213 
214 #ifdef __cplusplus
215 extern "C" {
216 #endif
217 int rfio_open_gsidaq(const char *, int, int, int, char *, int, int, int);
218  /* open connection to gStore server and file and prepare copy
219  to lustre or read cache before migration to tape */
220 #ifdef __cplusplus
221 }
222 #endif
223 
224 #ifdef __cplusplus
225 extern "C" {
226 #endif
227 int rfio_open(const char *, int, int);
228  /* open connection to gStore server and file */
229 #ifdef __cplusplus
230 }
231 #endif
232 
233 #ifdef __cplusplus
234 extern "C" {
235 #endif
236 ssize_t rfio_read(int, char *, size_t);
237  /* read file buffer */
238 #ifdef __cplusplus
239 }
240 #endif
241 
242 #ifdef __cplusplus
243 extern "C" {
244 #endif
245 ssize_t rfio_write(int, const char *, size_t);
246  /* write file buffer */
247 #ifdef __cplusplus
248 }
249 #endif
250 
251 #ifdef __cplusplus
252 extern "C" {
253 #endif
254 int rfio_close(int);
255  /* close connection to server and file */
256 #ifdef __cplusplus
257 }
258 #endif
259 
260 #ifdef __cplusplus
261 extern "C" {
262 #endif
263 int rfio_endfile(int);
264  /* close file, keep connection to server */
265 #ifdef __cplusplus
266 }
267 #endif
268 
269 #ifdef __cplusplus
270 extern "C" {
271 #endif
272 int rfio_newfile(int, char *);
273  /* open new file on already connected server */
274 #ifdef __cplusplus
275 }
276 #endif
277 
278 #ifdef __cplusplus
279 extern "C" {
280 #endif
281 int rfio_lseek(int, int, int);
282  /* move read/write pointer */
283 #ifdef __cplusplus
284 }
285 #endif
286 
287 #ifdef __cplusplus
288 extern "C" {
289 #endif
290 int rfio_fstat(int, struct stat *);
291  /* get file status (still dummy) */
292 #ifdef __cplusplus
293 }
294 #endif
295 
296 #ifdef __cplusplus
297 extern "C" {
298 #endif
299 void rfio_perror(const char *);
300  /* print error message */
301 #ifdef __cplusplus
302 }
303 #endif
304 
305 #ifdef __cplusplus
306 extern "C" {
307 #endif
308 char *rfio_serror();
309  /* get error message */
310 #ifdef __cplusplus
311 }
312 #endif
313 
314 /**************************** other entries **********************************/
315 
316 #ifdef __cplusplus
317 extern "C" {
318 #endif
319 int rfio_cache_stat(const char *);
320  /* get query info for remote file already opened */
321 #ifdef __cplusplus
322 }
323 #endif
324 
325 #ifdef __cplusplus
326 extern "C" {
327 #endif
328 int rfio_gsi_query(int, int, int, char *);
329  /* get query info for remote file already opened */
330 #ifdef __cplusplus
331 }
332 #endif
333 
334 /********************** (still) dummy entries ********************************/
335 
336 #ifdef __cplusplus
337 extern "C" {
338 #endif
339 int rfio_access(const char *, int);
340  /* get access status (still dummy) */
341 #ifdef __cplusplus
342 }
343 #endif
344 
345 #ifdef __cplusplus
346 extern "C" {
347 #endif
348 int rfio_stat(const char *, struct stat *);
349  /* get file status (still dummy) */
350 #ifdef __cplusplus
351 }
352 #endif
353 
354 #ifdef __cplusplus
355 extern "C" {
356 #endif
357 int rfio_parse(char *, char **, char **);
358  /* parse name to host and path (still dummy) */
359 #ifdef __cplusplus
360 }
361 #endif
362 
363 #ifdef __cplusplus
364 extern "C" {
365 #endif
366 int rfio_unlink(const char *);
367  /* (still dummy) */
368 #ifdef __cplusplus
369 }
370 #endif
371 
372 #ifdef __cplusplus
373 extern "C" {
374 #endif
375 int rfio_closedir(void *);
376  /* (still dummy) */
377 #ifdef __cplusplus
378 }
379 #endif
380 
381 #endif /* RAWAPI__H */
int rfio_fendfile(RFILE *)
Definition: rawapin.c:4385
RFILE * rfio_fopen_gsidaq_dm(char *, char *, char *, int *, int, char *, int, int, int)
Definition: rawapin.c:4042
int rfio_endfile(int)
Definition: rawapin.c:2395
size_t rfio_fread(char *, size_t, size_t, RFILE *)
Definition: rawapin.c:4307
int rfio_access(const char *, int)
Definition: rawapin.c:4442
void rfio_perror(const char *)
Definition: rawapin.c:4751
int rfio_gsi_query(int, int, int, char *)
Definition: rawapin.c:5309
int rfio_open_gsidaq(const char *, int, int, int, char *, int, int, int)
Definition: rawapin.c:314
int rfio_unlink(const char *)
Definition: rawapin.c:4808
int rfio_closedir(void *)
Definition: rawapin.c:4930
int rfio_fclose(RFILE *)
Definition: rawapin.c:4414
int rfio_cache_stat(const char *)
Definition: rawapin.c:5181
int rfio_stat(const char *, struct stat *)
Definition: rawapin.c:5072
size_t rfio_fwrite(const char *, size_t, size_t, RFILE *)
Definition: rawapin.c:4345
int rfio_fnewfile(RFILE *, char *)
Definition: rawapin.c:4238
int rfio_newfile(int, char *)
Definition: rawapin.c:3016
int rfio_open(const char *, int, int)
Definition: rawapin.c:275
int rfio_fstat(int, struct stat *)
Definition: rawapin.c:4645
RFILE * rfio_fopen_gsidaq(char *, char *, int, char *, int, int, int)
Definition: rawapin.c:4151
char * rfio_serror()
Definition: rawapin.c:4779
#define RFILE
Definition: rawapin.h:72
int rfio_mkdir(const char *, int)
Definition: rawapin.c:4855
ssize_t rfio_read(int, char *, size_t)
Definition: rawapin.c:2529
int rfio_lseek(int, int, int)
Definition: rawapin.c:3939
RFILE * rfio_fopen(char *, char *)
Definition: rawapin.c:4002
int rfio_close(int)
Definition: rawapin.c:3716
ssize_t rfio_write(int, const char *, size_t)
Definition: rawapin.c:2842
int rfio_parse(char *, char **, char **)
Definition: rawapin.c:4726
FILE * fLogFile
Definition: rawapin.c:185