DABC (Data Acquisition Backbone Core)  2.9.9
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  * 18. 2.2015, H.G.: new entry rfio_ffileid
39  *********************************************************************
40  */
41 
42 #ifndef RAWAPI__H
43 #define RAWAPI__H
44 
45 #ifdef Lynx
46 
47 #ifndef USER_API
48 #define USER_API
49 FILE *fLogFile; /* external in some C functions */
50 #endif
51 
52 #else /* not Lynx */
53 
54 #ifndef __cplusplus
55 FILE *fLogFile; /* external in some C functions */
56 #endif
57 
58 #ifndef _STDINT_H
59 #include <stdint.h>
60 #endif
61 
62 #ifndef _UNISTD_H
63 #include <unistd.h>
64 #endif
65 
66 #endif /* not Lynx */
67 
68 #include "rawcommn.h"
69 #include "rawclin.h"
70 
71 #define RFILE srawAPIFile
72 
73 /****************** entries using 64 bit functions *******************/
74 
75 #ifdef __USE_LARGEFILE64
76 
77 #ifdef __cplusplus
78 extern "C" {
79 #endif
80 int rfio_open64(const char *, int, int);
81  /* open connection to server and file */
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #ifdef __cplusplus
87 extern "C" {
88 #endif
89 int64_t rfio_lseek64(int, int64_t, int);
90  /* move read/write pointer */
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #ifdef __cplusplus
96 extern "C" {
97 #endif
98 int rfio_stat64(const char *, struct stat64 *);
99  /* get large file status */
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #ifdef __cplusplus
105 extern "C" {
106 #endif
107 int rfio_fstat64(int, struct stat64 *);
108  /* get large file status */
109 #ifdef __cplusplus
110 }
111 #endif
112 
113 #ifdef __cplusplus
114 extern "C" {
115 #endif
116 int rfio_preseek64(int, const struct iovec64 *, int);
117  /* move read/write pointer */
118 #ifdef __cplusplus
119 }
120 #endif
121 
122 #endif /* __USE_LARGEFILE64 */
123 
124 /********************* entries using file ptr ************************/
125 
126 #ifdef __cplusplus
127 extern "C" {
128 #endif
130  char *, char *, char *, int *, int, char *, int, int, int);
131  /* open connection to gStore server and file and prepare copy
132  to lustre or read cache before migration to tape,
133  provide data mover name and running no. */
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #ifdef __cplusplus
139 extern "C" {
140 #endif
141 RFILE *rfio_fopen_gsidaq(char *, char *, int, char *, int, int, int);
142  /* open connection to gStore server and file and prepare copy
143  to lustre or read cache before migration to tape */
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #ifdef __cplusplus
149 extern "C" {
150 #endif
151 RFILE *rfio_fopen(char *, char *);
152  /* open connection to gStore server and file */
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #ifdef __cplusplus
158 extern "C" {
159 #endif
160 size_t rfio_fread(char *, size_t, size_t, RFILE *);
161  /* read file buffer */
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 #ifdef __cplusplus
167 extern "C" {
168 #endif
169 size_t rfio_fwrite(const char *, size_t, size_t, RFILE *);
170  /* write file buffer */
171 #ifdef __cplusplus
172 }
173 #endif
174 
175 #ifdef __cplusplus
176 extern "C" {
177 #endif
178 int rfio_fclose(RFILE *);
179  /* close connection to server and file */
180 #ifdef __cplusplus
181 }
182 #endif
183 
184 #ifdef __cplusplus
185 extern "C" {
186 #endif
187 int rfio_fendfile(RFILE *);
188  /* close file, keep connection to server */
189 #ifdef __cplusplus
190 }
191 #endif
192 
193 #ifdef __cplusplus
194 extern "C" {
195 #endif
196 int rfio_fnewfile(RFILE *, char *);
197  /* open new file on already connected server */
198 #ifdef __cplusplus
199 }
200 #endif
201 
202 #ifdef __cplusplus
203 extern "C" {
204 #endif
205 int rfio_mkdir(const char *, int);
206  /* open new file on already connected server */
207 #ifdef __cplusplus
208 }
209 #endif
210 
211 #ifdef __cplusplus
212 extern "C" {
213 #endif
214 int rfio_ffileid(RFILE *);
215  /* get file id from file ptr */
216 #ifdef __cplusplus
217 }
218 #endif
219 
220 /********************** entries using file id ********************************/
221 
222 #ifdef __cplusplus
223 extern "C" {
224 #endif
225 int rfio_open_gsidaq(const char *, int, int, int, char *, int, int, int);
226  /* open connection to gStore server and file and prepare copy
227  to lustre or read cache before migration to tape */
228 #ifdef __cplusplus
229 }
230 #endif
231 
232 #ifdef __cplusplus
233 extern "C" {
234 #endif
235 int rfio_open(const char *, int, int);
236  /* open connection to gStore server and file */
237 #ifdef __cplusplus
238 }
239 #endif
240 
241 #ifdef __cplusplus
242 extern "C" {
243 #endif
244 ssize_t rfio_read(int, char *, size_t);
245  /* read file buffer */
246 #ifdef __cplusplus
247 }
248 #endif
249 
250 #ifdef __cplusplus
251 extern "C" {
252 #endif
253 ssize_t rfio_write(int, const char *, size_t);
254  /* write file buffer */
255 #ifdef __cplusplus
256 }
257 #endif
258 
259 #ifdef __cplusplus
260 extern "C" {
261 #endif
262 int rfio_close(int);
263  /* close connection to server and file */
264 #ifdef __cplusplus
265 }
266 #endif
267 
268 #ifdef __cplusplus
269 extern "C" {
270 #endif
271 int rfio_endfile(int);
272  /* close file, keep connection to server */
273 #ifdef __cplusplus
274 }
275 #endif
276 
277 #ifdef __cplusplus
278 extern "C" {
279 #endif
280 int rfio_newfile(int, char *);
281  /* open new file on already connected server */
282 #ifdef __cplusplus
283 }
284 #endif
285 
286 #ifdef __cplusplus
287 extern "C" {
288 #endif
289 int rfio_lseek(int, int, int);
290  /* move read/write pointer */
291 #ifdef __cplusplus
292 }
293 #endif
294 
295 #ifdef __cplusplus
296 extern "C" {
297 #endif
298 int rfio_fstat(int, struct stat *);
299  /* get file status (still dummy) */
300 #ifdef __cplusplus
301 }
302 #endif
303 
304 #ifdef __cplusplus
305 extern "C" {
306 #endif
307 void rfio_perror(const char *);
308  /* print error message */
309 #ifdef __cplusplus
310 }
311 #endif
312 
313 #ifdef __cplusplus
314 extern "C" {
315 #endif
316 char *rfio_serror();
317  /* get error message */
318 #ifdef __cplusplus
319 }
320 #endif
321 
322 /**************************** other entries **********************************/
323 
324 #ifdef __cplusplus
325 extern "C" {
326 #endif
327 int rfio_cache_stat(const char *);
328  /* get query info for remote file already opened */
329 #ifdef __cplusplus
330 }
331 #endif
332 
333 #ifdef __cplusplus
334 extern "C" {
335 #endif
336 int rfio_gsi_query(int, int, int, char *);
337  /* get query info for remote file already opened */
338 #ifdef __cplusplus
339 }
340 #endif
341 
342 /********************** (still) dummy entries ********************************/
343 
344 #ifdef __cplusplus
345 extern "C" {
346 #endif
347 int rfio_access(const char *, int);
348  /* get access status (still dummy) */
349 #ifdef __cplusplus
350 }
351 #endif
352 
353 #ifdef __cplusplus
354 extern "C" {
355 #endif
356 int rfio_stat(const char *, struct stat *);
357  /* get file status (still dummy) */
358 #ifdef __cplusplus
359 }
360 #endif
361 
362 #ifdef __cplusplus
363 extern "C" {
364 #endif
365 int rfio_parse(char *, char **, char **);
366  /* parse name to host and path (still dummy) */
367 #ifdef __cplusplus
368 }
369 #endif
370 
371 #ifdef __cplusplus
372 extern "C" {
373 #endif
374 int rfio_unlink(const char *);
375  /* (still dummy) */
376 #ifdef __cplusplus
377 }
378 #endif
379 
380 #ifdef __cplusplus
381 extern "C" {
382 #endif
383 int rfio_closedir(void *);
384  /* (still dummy) */
385 #ifdef __cplusplus
386 }
387 #endif
388 
389 #endif /* RAWAPI__H */
int rfio_closedir(void *)
Definition: rawapin.c:5682
int rfio_newfile(int, char *)
Definition: rawapin.c:3459
int rfio_open(const char *, int, int)
Definition: rawapin.c:307
int rfio_fendfile(RFILE *)
Definition: rawapin.c:5006
char * rfio_serror()
Definition: rawapin.c:5400
int rfio_mkdir(const char *, int)
Definition: rawapin.c:5607
int rfio_lseek(int, int, int)
Definition: rawapin.c:4519
size_t rfio_fread(char *, size_t, size_t, RFILE *)
Definition: rawapin.c:4928
int rfio_ffileid(RFILE *)
Definition: rawapin.c:4583
int rfio_gsi_query(int, int, int, char *)
Definition: rawapin.c:6062
ssize_t rfio_read(int, char *, size_t)
Definition: rawapin.c:2967
FILE * fLogFile
Definition: rawapin.h:55
int rfio_endfile(int)
Definition: rawapin.c:2836
RFILE * rfio_fopen_gsidaq_dm(char *, char *, char *, int *, int, char *, int, int, int)
Definition: rawapin.c:4663
int rfio_parse(char *, char **, char **)
Definition: rawapin.c:5347
int rfio_fstat(int, struct stat *)
Definition: rawapin.c:5266
ssize_t rfio_write(int, const char *, size_t)
Definition: rawapin.c:3285
int rfio_unlink(const char *)
Definition: rawapin.c:5429
int rfio_close(int)
Definition: rawapin.c:4299
RFILE * rfio_fopen(char *, char *)
Definition: rawapin.c:4623
int rfio_access(const char *, int)
Definition: rawapin.c:5063
int rfio_open_gsidaq(const char *, int, int, int, char *, int, int, int)
Definition: rawapin.c:346
int rfio_fclose(RFILE *)
Definition: rawapin.c:5035
int rfio_cache_stat(const char *)
Definition: rawapin.c:5934
int rfio_stat(const char *, struct stat *)
Definition: rawapin.c:5825
void rfio_perror(const char *)
Definition: rawapin.c:5372
int rfio_fnewfile(RFILE *, char *)
Definition: rawapin.c:4859
size_t rfio_fwrite(const char *, size_t, size_t, RFILE *)
Definition: rawapin.c:4966
#define RFILE
Definition: rawapin.h:71
RFILE * rfio_fopen_gsidaq(char *, char *, int, char *, int, int, int)
Definition: rawapin.c:4772