~ubuntu-branches/ubuntu/saucy/globus-gass-copy/saucy

« back to all changes in this revision

Viewing changes to .pc/globus-gass-copy-doxygen.patch/globus_gass_copy.h

  • Committer: Package Import Robot
  • Author(s): Mattias Ellert
  • Date: 2012-04-29 14:12:26 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20120429141226-fyrqg9mwmtmx2sb7
Tags: 8.4-1
* Update to Globus Toolkit 5.2.1
* Drop patches globus-gass-copy-deps.patch, globus-gass-copy-format.patch
  and globus-gass-copy-doxygen.patch (fixed upstream)
* Drop manpage from packaging, now available in upstream source

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 1999-2006 University of Chicago
3
 
 * 
4
 
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 
 * you may not use this file except in compliance with the License.
6
 
 * You may obtain a copy of the License at
7
 
 * 
8
 
 * http://www.apache.org/licenses/LICENSE-2.0
9
 
 * 
10
 
 * Unless required by applicable law or agreed to in writing, software
11
 
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 
 * See the License for the specific language governing permissions and
14
 
 * limitations under the License.
15
 
 */
16
 
 
17
 
 /** 
18
 
 * @file
19
 
 *  Header file for the gass copy library 
20
 
 */
21
 
 
22
 
 /**
23
 
 * @mainpage
24
 
 *
25
 
 * The Globus GASS Copy library is motivated by the desire to provide a
26
 
 * uniform interface to transfer files specified by different protocols.
27
 
 *
28
 
 * The goals in doing this are to:
29
 
 
30
 
 *   - Provide a robust way to describe and apply file transfer properties
31
 
 * for a variety of protocols. These include the standard HTTP, FTP and
32
 
 * GSIFTP options.  Some of the new file transfer capabilities in GSIFTP are
33
 
 * parallel, striping, authentication and TCP buffer sizing.
34
 
 *   - Provide a service to support nonblocking file transfer and handle
35
 
 * asynchronous file and network events.
36
 
 *   - Provide a simple and portable way to implement file transfers.
37
 
 *
38
 
 * Any program that uses Globus GASS Copy functions must include
39
 
 * "globus_gass_copy.h".
40
 
 *
41
 
 * @htmlonly
42
 
 * <a href="main.html" target="_top">View documentation without frames</a><br>
43
 
 * <a href="index.html" target="_top">View documentation with frames</a><br>
44
 
 * @endhtmlonly
45
 
 */
46
 
 
47
 
#include "globus_gass_transfer.h"
48
 
#include "globus_ftp_client.h"
49
 
#include "globus_io.h"
50
 
 
51
 
#ifndef GLOBUS_INCLUDE_GLOBUS_GASS_COPY_H
52
 
#define GLOBUS_INCLUDE_GLOBUS_GASS_COPY_H
53
 
 
54
 
#ifndef EXTERN_C_BEGIN
55
 
#ifdef __cplusplus
56
 
#define EXTERN_C_BEGIN extern "C" {
57
 
#define EXTERN_C_END }
58
 
#else
59
 
#define EXTERN_C_BEGIN
60
 
#define EXTERN_C_END
61
 
#endif
62
 
#endif
63
 
 
64
 
 
65
 
 
66
 
 
67
 
EXTERN_C_BEGIN
68
 
 
69
 
/** Module descriptor
70
 
 *
71
 
 * Globus GASS Copy uses standard Globus module activation and deactivation.
72
 
 * Before any Globus GASS Copy functions are called, the following function
73
 
 * must be called:
74
 
 *
75
 
 * @code
76
 
 *      globus_module_activate(GLOBUS_GASS_COPY_MODULE)
77
 
 * @endcode
78
 
 *
79
 
 *
80
 
 * This function returns GLOBUS_SUCCESS if Globus GASS Copy was successfully
81
 
 * initialized, and you are therefore allowed to subsequently call
82
 
 * Globus GASS Copy functions.  Otherwise, an error code is returned, and
83
 
 * Globus GASS Copy functions should not be subsequently called. This
84
 
 * function may be called multiple times.
85
 
 *
86
 
 * To deactivate Globus GASS Copy, the following function must be called:
87
 
 *
88
 
 * @code
89
 
 *    globus_module_deactivate(GLOBUS_GASS_COPY_MODULE)
90
 
 * @endcode
91
 
 *
92
 
 * This function should be called once for each time Globus GASS Copy was
93
 
 * activated.
94
 
 *
95
 
 */
96
 
#define GLOBUS_GASS_COPY_MODULE (&globus_i_gass_copy_module)
97
 
 
98
 
extern
99
 
globus_module_descriptor_t        globus_i_gass_copy_module;
100
 
 
101
 
#define _GASCSL(s) globus_common_i18n_get_string( \
102
 
                     GLOBUS_GASS_COPY_MODULE, \
103
 
                     s)
104
 
 
105
 
 
106
 
typedef struct globus_gass_copy_state_s globus_gass_copy_state_t;
107
 
typedef struct globus_gass_copy_handle_s globus_gass_copy_handle_t;
108
 
typedef struct globus_gass_copy_perf_info_s globus_gass_copy_perf_info_t;
109
 
 
110
 
/**
111
 
 * Gass copy transfer performance callback
112
 
 *
113
 
 * This callback is registered with 'globus_gass_copy_register_performance_cb'
114
 
 * It will be called during a transfer to supply performance information on
115
 
 * current transfer.  Its frequency will be at most one per second, but
116
 
 * it is possible to receive no callbacks. This is possible in very short
117
 
 * transfers and in ftp transfers in which the server does not provide
118
 
 * performance information.
119
 
 *
120
 
 * @param handle
121
 
 *        the gass copy handle this transfer is occurring on
122
 
 *
123
 
 * @param user_arg
124
 
 *        a user pointer registered with
125
 
 *        'globus_gass_copy_register_performance_cb'
126
 
 *
127
 
 * @param total_bytes
128
 
 *        the total number of bytes transfer so far
129
 
 *
130
 
 * @param instantaneous_throughput
131
 
 *        instantaneous rate of transfer (since last callback or start)
132
 
 *        (bytes / sec)
133
 
 *
134
 
 * @param avg_throughput
135
 
 *        the avg thoughput calculated since the start of the transfer
136
 
 *        (bytes / sec)
137
 
 *
138
 
 * @return
139
 
 *        - n/a
140
 
 */
141
 
typedef void (*globus_gass_copy_performance_cb_t)(
142
 
    void *                                          user_arg,
143
 
    globus_gass_copy_handle_t *                     handle,
144
 
    globus_off_t                                    total_bytes,
145
 
    float                                           instantaneous_throughput,
146
 
    float                                           avg_throughput);
147
 
 
148
 
#ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
149
 
 
150
 
/**
151
 
 * Signature of a callback from globus_gass_copy_register_*() functions.
152
 
 * (asynchronous transfer functions)
153
 
 */
154
 
typedef void (*globus_gass_copy_callback_t)(
155
 
    void * callback_arg,
156
 
    globus_gass_copy_handle_t * handle,
157
 
    globus_object_t * error);
158
 
 
159
 
/**
160
 
 * valid state status (aka states)
161
 
 */
162
 
typedef enum
163
 
{
164
 
    GLOBUS_GASS_COPY_STATUS_NONE,
165
 
    GLOBUS_GASS_COPY_STATUS_PENDING,
166
 
    GLOBUS_GASS_COPY_STATUS_INITIAL,
167
 
    GLOBUS_GASS_COPY_STATUS_SOURCE_READY,
168
 
    GLOBUS_GASS_COPY_STATUS_TRANSFER_IN_PROGRESS,
169
 
    GLOBUS_GASS_COPY_STATUS_READ_COMPLETE,
170
 
    GLOBUS_GASS_COPY_STATUS_WRITE_COMPLETE,
171
 
    GLOBUS_GASS_COPY_STATUS_DONE,
172
 
    GLOBUS_GASS_COPY_STATUS_FAILURE,
173
 
    GLOBUS_GASS_COPY_STATUS_CANCEL,
174
 
    GLOBUS_GASS_COPY_STATUS_DONE_SUCCESS,
175
 
    GLOBUS_GASS_COPY_STATUS_DONE_FAILURE,
176
 
    GLOBUS_GASS_COPY_STATUS_DONE_CANCELLED
177
 
} globus_gass_copy_status_t;
178
 
 
179
 
/**
180
 
 * valid url modes
181
 
 */
182
 
typedef enum
183
 
{
184
 
    GLOBUS_GASS_COPY_URL_MODE_UNSUPPORTED,
185
 
    GLOBUS_GASS_COPY_URL_MODE_FTP,
186
 
    GLOBUS_GASS_COPY_URL_MODE_GASS,
187
 
    GLOBUS_GASS_COPY_URL_MODE_IO
188
 
} globus_gass_copy_url_mode_t;
189
 
 
190
 
/**
191
 
 * gass copy handle
192
 
 */
193
 
struct globus_gass_copy_handle_s
194
 
{
195
 
  /*
196
 
   * the status of the current transfer
197
 
   */
198
 
  globus_gass_copy_status_t  status;
199
 
 
200
 
  /*
201
 
   * pointer to the state structure which contains internal info related to a
202
 
   * transfer
203
 
   */
204
 
  globus_gass_copy_state_t * state;
205
 
 
206
 
  /*
207
 
   * pointer to user data
208
 
   */
209
 
  void *                     user_pointer;
210
 
 
211
 
  /* pointer to perf_info structure used to provide the user transfer
212
 
   * performance information
213
 
   */
214
 
  globus_gass_copy_perf_info_t * performance;
215
 
 
216
 
  /*
217
 
   * indicates if the 3rd party transfer is done by this library or externally
218
 
   * to this library.
219
 
   */
220
 
  globus_bool_t         external_third_party;
221
 
 
222
 
  /*
223
 
   * pointer to user callback function
224
 
   */
225
 
  globus_gass_copy_callback_t         user_callback;
226
 
 
227
 
  /*
228
 
   * pointer to user argument to user callback function
229
 
   */
230
 
  void *                              callback_arg;
231
 
 
232
 
  /*
233
 
   * pointer to user cancel callback function
234
 
   */
235
 
  globus_gass_copy_callback_t         user_cancel_callback;
236
 
 
237
 
  /*
238
 
   * pointer to user argument to user cancel callback function
239
 
   */
240
 
  void *                              cancel_callback_arg;
241
 
 
242
 
  /*
243
 
   * Error object to pass to the callback function
244
 
   */
245
 
  globus_object_t *                   err;
246
 
 
247
 
  /*
248
 
   * size of the buffers to be used in the transfers
249
 
   */
250
 
  int                                 buffer_length;
251
 
 
252
 
  /*
253
 
   * says whether third_party transfers should be used (for ftp to
254
 
   * ftp transfers).  if set to FALSE, the default,
255
 
   * globus_ftp_client_third_party_transfer() will be used.  if set to
256
 
   * TRUE, gass_copy will manage the transfer
257
 
   */
258
 
  globus_bool_t                       no_third_party_transfers;
259
 
 
260
 
  globus_ftp_client_handle_t          ftp_handle;
261
 
  /* this handle only used when no_third_party_transfers is true (for 3pt) */
262
 
  globus_ftp_client_handle_t          ftp_handle_2;
263
 
  
264
 
  /* offsets for partial file transfers */
265
 
  globus_off_t                        partial_offset;
266
 
  globus_off_t                        partial_end_offset;
267
 
  globus_off_t                        partial_bytes_remaining; 
268
 
  
269
 
  /* says whether or not to send ALLO for ftp destinations */
270
 
  globus_bool_t                       send_allo;
271
 
 
272
 
  /* run a stat check on all urls passed to globus_gass_copy_glob_expand_url */
273
 
  globus_bool_t                       always_stat_on_expand;
274
 
};
275
 
 
276
 
/**
277
 
 * GASS Copy attribute structure.  Contains any/all attributes that are
278
 
 * required to perform the supported transfer methods (ftp, gass, io).
279
 
 */
280
 
typedef struct globus_gass_copy_attr_s
281
 
{
282
 
  globus_ftp_client_operationattr_t * ftp_attr;
283
 
  globus_io_attr_t * io;
284
 
  globus_gass_transfer_requestattr_t * gass_requestattr;
285
 
} globus_gass_copy_attr_t;
286
 
 
287
 
/**
288
 
 * GASS Copy Handle attribute structure. Contains any/all attributes that
289
 
 * are required to create lower-level handles (ftp, gass, io).
290
 
 */
291
 
typedef struct globus_gass_copy_handleattr_s
292
 
{
293
 
  globus_ftp_client_handleattr_t *      ftp_attr;
294
 
} globus_gass_copy_handleattr_t;
295
 
 
296
 
/** initialization and destruction of GASS Copy handle */
297
 
globus_result_t
298
 
globus_gass_copy_handle_init(
299
 
    globus_gass_copy_handle_t * handle,
300
 
    globus_gass_copy_handleattr_t * handle_attr);
301
 
 
302
 
globus_result_t
303
 
globus_gass_copy_handle_destroy(
304
 
    globus_gass_copy_handle_t * handle);
305
 
 
306
 
globus_result_t
307
 
globus_gass_copy_handleattr_init(
308
 
    globus_gass_copy_handleattr_t * handle_attr);
309
 
 
310
 
globus_result_t
311
 
globus_gass_copy_handleattr_destroy(
312
 
    globus_gass_copy_handleattr_t * handle_attr);
313
 
 
314
 
globus_result_t
315
 
globus_gass_copy_handleattr_set_ftp_attr(
316
 
    globus_gass_copy_handleattr_t * handle_attr,
317
 
    globus_ftp_client_handleattr_t * ftp_attr);
318
 
 
319
 
/** set the size of the buffer to be used for the transfers */
320
 
globus_result_t
321
 
globus_gass_copy_set_buffer_length(
322
 
    globus_gass_copy_handle_t * handle,
323
 
    int length);
324
 
 
325
 
/** get the size of the buffer being used for the transfers */
326
 
globus_result_t
327
 
globus_gass_copy_get_buffer_length(
328
 
    globus_gass_copy_handle_t * handle,
329
 
    int * length);
330
 
 
331
 
/** sets whether third_party transfers should be used for ftp to
332
 
  * ftp transfers */
333
 
globus_result_t
334
 
globus_gass_copy_set_no_third_party_transfers(
335
 
    globus_gass_copy_handle_t * handle,
336
 
    globus_bool_t no_third_party_transfers);
337
 
 
338
 
/** get the size of the buffer being used for the transfers */
339
 
globus_result_t
340
 
globus_gass_copy_get_no_third_party_transfers(
341
 
    globus_gass_copy_handle_t * handle,
342
 
    globus_bool_t * no_third_party_transfers);
343
 
    
344
 
/** get offsets for partial file transfer */
345
 
globus_result_t
346
 
globus_gass_copy_get_partial_offsets(
347
 
    globus_gass_copy_handle_t * handle,
348
 
    globus_off_t * offset,
349
 
    globus_off_t * end_offset);
350
 
    
351
 
/** set offsets for partial file transfer */
352
 
globus_result_t
353
 
globus_gass_copy_set_partial_offsets(
354
 
    globus_gass_copy_handle_t * handle,
355
 
    globus_off_t offset,
356
 
    globus_off_t end_offset);
357
 
 
358
 
/* send ALLO to ftp destinations */
359
 
globus_result_t
360
 
globus_gass_copy_set_allocate(
361
 
    globus_gass_copy_handle_t *         handle,
362
 
    globus_bool_t                       send_allo);
363
 
 
364
 
 
365
 
/* run a stat check on all urls passed to globus_gass_copy_glob_expand_url 
366
 
    FALSE by default 
367
 
 */
368
 
 
369
 
globus_result_t
370
 
globus_gass_copy_set_stat_on_expand(
371
 
    globus_gass_copy_handle_t *         handle,
372
 
    globus_bool_t                       always_stat);
373
 
 
374
 
 
375
 
/* find out what transfer mode will be used for a given url, so that the proper attributes may be passed to one of the copy function */
376
 
globus_result_t
377
 
globus_gass_copy_get_url_mode(
378
 
    char * url,
379
 
    globus_gass_copy_url_mode_t * mode);
380
 
 
381
 
/* get current ftp client handle -- use with care if modifying the handle */
382
 
globus_result_t
383
 
globus_gass_copy_get_ftp_handle(
384
 
    globus_gass_copy_handle_t *         handle,
385
 
    globus_ftp_client_handle_t *        ftp_handle);
386
 
 
387
 
/** initialize the attr structure */
388
 
globus_result_t
389
 
globus_gass_copy_attr_init(
390
 
    globus_gass_copy_attr_t * attr);
391
 
 
392
 
/** functions for setting attributes for specific protocols */
393
 
globus_result_t
394
 
globus_gass_copy_attr_set_ftp(
395
 
    globus_gass_copy_attr_t * attr,
396
 
    globus_ftp_client_operationattr_t * ftp_attr);
397
 
 
398
 
globus_result_t
399
 
globus_gass_copy_attr_set_io(
400
 
    globus_gass_copy_attr_t * attr,
401
 
    globus_io_attr_t * io_attr);
402
 
 
403
 
globus_result_t
404
 
globus_gass_copy_attr_set_gass(
405
 
    globus_gass_copy_attr_t * attr,
406
 
    globus_gass_transfer_requestattr_t * gass_attr);
407
 
 
408
 
/**
409
 
 * copy functions (blocking)
410
 
 */
411
 
globus_result_t
412
 
globus_gass_copy_url_to_url(
413
 
    globus_gass_copy_handle_t * handle,
414
 
    char * source_url,
415
 
    globus_gass_copy_attr_t * source_attr,
416
 
    char * dest_url,
417
 
    globus_gass_copy_attr_t * dest_attr);
418
 
 
419
 
globus_result_t
420
 
globus_gass_copy_url_to_handle(
421
 
    globus_gass_copy_handle_t * handle,
422
 
    char * source_url,
423
 
    globus_gass_copy_attr_t * source_attr,
424
 
    globus_io_handle_t * dest_handle);
425
 
 
426
 
globus_result_t
427
 
globus_gass_copy_handle_to_url(
428
 
    globus_gass_copy_handle_t * handle,
429
 
    globus_io_handle_t * source_handle,
430
 
    char * dest_url,
431
 
    globus_gass_copy_attr_t * dest_attr);
432
 
 
433
 
/**
434
 
 * copy functions (asyncronous)
435
 
 */
436
 
globus_result_t
437
 
globus_gass_copy_register_url_to_url(
438
 
    globus_gass_copy_handle_t * handle,
439
 
    char * source_url,
440
 
    globus_gass_copy_attr_t * dest_attr,
441
 
    char * dest_url,
442
 
    globus_gass_copy_attr_t * source_attr,
443
 
    globus_gass_copy_callback_t callback_func,
444
 
    void * callback_arg);
445
 
 
446
 
globus_result_t
447
 
globus_gass_copy_register_url_to_handle(
448
 
    globus_gass_copy_handle_t * handle,
449
 
    char * source_url,
450
 
    globus_gass_copy_attr_t * source_attr,
451
 
    globus_io_handle_t * dest_handle,
452
 
    globus_gass_copy_callback_t callback_func,
453
 
    void * callback_arg);
454
 
 
455
 
globus_result_t
456
 
globus_gass_copy_register_handle_to_url(
457
 
    globus_gass_copy_handle_t * handle,
458
 
    globus_io_handle_t * source_handle,
459
 
    char * dest_url,
460
 
    globus_gass_copy_attr_t * dest_attr,
461
 
    globus_gass_copy_callback_t callback_func,
462
 
    void * callback_arg);
463
 
 
464
 
/**
465
 
 * get the status code of the current transfer
466
 
 */
467
 
globus_result_t
468
 
globus_gass_copy_get_status(
469
 
    globus_gass_copy_handle_t * handle,
470
 
    globus_gass_copy_status_t *status);
471
 
 
472
 
/**
473
 
 * get the status string of the current transfer
474
 
 */
475
 
 
476
 
const char *
477
 
globus_gass_copy_get_status_string(
478
 
    globus_gass_copy_handle_t * handle);
479
 
 
480
 
/**
481
 
 * cancel the current transfer
482
 
 */
483
 
globus_result_t
484
 
globus_gass_copy_cancel(
485
 
     globus_gass_copy_handle_t * handle,
486
 
     globus_gass_copy_callback_t cancel_callback,
487
 
     void * cancel_callback_arg);
488
 
 
489
 
/**
490
 
 * cache handles functions
491
 
 *
492
 
 * Use this when transferring mulitple files from or to the same host
493
 
 */
494
 
globus_result_t
495
 
globus_gass_copy_cache_url_state(
496
 
    globus_gass_copy_handle_t * handle,
497
 
    char * url);
498
 
 
499
 
globus_result_t
500
 
globus_gass_copy_flush_url_state(
501
 
    globus_gass_copy_handle_t * handle,
502
 
    char * url);
503
 
 
504
 
/**
505
 
 *  get/set user pointers from/to GASS Copy handles
506
 
 */
507
 
globus_result_t
508
 
globus_gass_copy_set_user_pointer(
509
 
    globus_gass_copy_handle_t * handle,
510
 
    void * user_data);
511
 
 
512
 
globus_result_t
513
 
globus_gass_copy_get_user_pointer(
514
 
    globus_gass_copy_handle_t * handle,
515
 
    void ** user_data);
516
 
 
517
 
globus_result_t
518
 
globus_gass_copy_register_performance_cb(
519
 
    globus_gass_copy_handle_t *         handle,
520
 
    globus_gass_copy_performance_cb_t   callback,
521
 
    void *                              user_arg);
522
 
 
523
 
/**
524
 
 * Set Attribute functions
525
 
 */
526
 
 
527
 
#ifdef USE_FTP
528
 
/* TCP buffer/window size */
529
 
globus_result_t
530
 
globus_gass_copy_attr_set_tcpbuffer(
531
 
    globus_gass_copy_attr_t * attr,
532
 
    globus_ftp_control_tcpbuffer_t * tcpbuffer_info);
533
 
 
534
 
/* parallel transfer options */
535
 
globus_result_t
536
 
globus_gass_copy_attr_set_parallelism(
537
 
    globus_gass_copy_attr_t * attr,
538
 
    globus_ftp_control_parallelism_t * parallelism_info);
539
 
 
540
 
/* striping options */
541
 
globus_result_t
542
 
globus_gass_copy_attr_set_striping(
543
 
    globus_gass_copy_attr_t * attr,
544
 
    globus_ftp_control_striping_t * striping_info);
545
 
 
546
 
/* authorization options */
547
 
globus_result_t
548
 
globus_gass_copy_attr_set_authorization(
549
 
    globus_gass_copy_attr_t * attr,
550
 
    globus_io_authorization_t * authorization_info);
551
 
 
552
 
/* secure channel options */
553
 
globus_result_t
554
 
globus_gass_copy_attr_set_secure_channel(
555
 
    globus_gass_copy_attr_t * attr,
556
 
    globus_io_secure_channel_t * secure_channel_info);
557
 
#endif
558
 
 
559
 
#endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
560
 
 
561
 
/**
562
 
 * globbed entry types
563
 
 */ 
564
 
typedef enum {
565
 
    GLOBUS_GASS_COPY_GLOB_ENTRY_UNKNOWN,
566
 
    GLOBUS_GASS_COPY_GLOB_ENTRY_FILE,
567
 
    GLOBUS_GASS_COPY_GLOB_ENTRY_DIR,
568
 
    GLOBUS_GASS_COPY_GLOB_ENTRY_OTHER
569
 
} globus_gass_copy_glob_entry_t;
570
 
 
571
 
/**
572
 
 * Glob expanded entry information
573
 
 */
574
 
typedef struct 
575
 
{
576
 
    /** The file type of the entry
577
 
     */
578
 
    globus_gass_copy_glob_entry_t       type;
579
 
    
580
 
    /** A string that uniquely identifies the data that the entry 
581
 
     *  refers to.  A file and a symlink to that file will have the 
582
 
     *  same unique_id.  
583
 
     *  It is NULL for when not available.
584
 
     */
585
 
    char *                              unique_id;
586
 
 
587
 
    /** This points to the full path of the target of a symlink.  
588
 
     *  It is NULL for non-symlinks or when not available.
589
 
     */
590
 
    char *                              symlink_target;
591
 
    
592
 
    /** An integer specifying the mode of the file.  
593
 
     *  It is set to -1 when not available.
594
 
     */
595
 
    int                                 mode;
596
 
     
597
 
    /** An integer specifying the modification time of the file.
598
 
     *  It is set to -1 when not available.
599
 
     */
600
 
    int                                 mdtm;
601
 
     
602
 
    /** A globus_off_t specifying the size of the file.  
603
 
     *  It is set to -1 when not available.
604
 
     */
605
 
    globus_off_t                        size;
606
 
} globus_gass_copy_glob_stat_t;
607
 
 
608
 
/**
609
 
 * Gass copy glob entry callback
610
 
 *
611
 
 * This callback is passed as a parameter to globus_gass_copy_glob_expand_url().
612
 
 * It is called once for each entry that the original expands to.
613
 
 * 
614
 
 * @param url
615
 
 *        The full url to the expanded entry.  A directory entry will end
616
 
 *        in a forward slash '/'.
617
 
 * 
618
 
 * @param stat
619
 
 *        A pointer to a globus_gass_copy_glob_stat_t containing information
620
 
 *        about the entry. 
621
 
 *
622
 
 * @param user_arg
623
 
 *        The user_arg passed to globus_gass_copy_glob_expand()
624
 
 * 
625
 
 * @see globus_gass_copy_glob_stat_t,
626
 
 *      globus_gass_copy_glob_expand_url
627
 
 */
628
 
typedef void (*globus_gass_copy_glob_entry_cb_t)(
629
 
    const char *                         url,
630
 
    const globus_gass_copy_glob_stat_t * info_stat,
631
 
    void *                               user_arg);
632
 
    
633
 
/**
634
 
 * Expand globbed url
635
 
 *
636
 
 * This function expands wildcards in a globbed url, and calls
637
 
 * entry_cb() on each one.
638
 
 * 
639
 
 * @param handle
640
 
 *        A gass copy handle to use for the operation.
641
 
 * 
642
 
 * @param url
643
 
 *        The URL to expand. The URL may be an ftp, gsiftp or file URL.
644
 
 *        Wildcard characters supported are '?' '*' '[ ]' in the filename
645
 
 *        portion of the url.
646
 
 * 
647
 
 * @param attr
648
 
 *        Gass copy attributes for this operation.
649
 
 * 
650
 
 * @param entry_cb
651
 
 *        Function to call with information about each entry
652
 
 * 
653
 
 * @param user_arg
654
 
 *        An argument to pass to entry_cb()
655
 
 *
656
 
 * @return
657
 
 *        This function returns an error when any of these conditions are
658
 
 *        true:
659
 
 *        - handle is GLOBUS_NULL
660
 
 *        - url is GLOBUS_NULL
661
 
 *        - url cannot be parsed
662
 
 *        - url is not a ftp, gsiftp or file url
663
 
 */     
664
 
globus_result_t 
665
 
globus_gass_copy_glob_expand_url( 
666
 
     globus_gass_copy_handle_t *        handle, 
667
 
     const char *                       url, 
668
 
     globus_gass_copy_attr_t *          attr,
669
 
     globus_gass_copy_glob_entry_cb_t   entry_cb,
670
 
     void *                             user_arg);
671
 
     
672
 
/**
673
 
 * Make directory
674
 
 *
675
 
 * This function creates a directory given a ftp or file url.
676
 
 * 
677
 
 * @param handle
678
 
 *        A gass copy handle to use for the mkdir operation.
679
 
 * @param url
680
 
 *        The URL for the directory to create. The URL may be an ftp,
681
 
 *        gsiftp or file URL.
682
 
 * @param attr
683
 
 *        Gass copy attributes for this operation.
684
 
 *
685
 
 * @return
686
 
 *        This function returns an error when any of these conditions are
687
 
 *        true:
688
 
 *        - handle is GLOBUS_NULL
689
 
 *        - url is GLOBUS_NULL
690
 
 *        - url cannot be parsed
691
 
 *        - url is not a ftp, gsiftp or file url
692
 
 *        - the directory could not be created
693
 
 */     
694
 
globus_result_t
695
 
globus_gass_copy_mkdir(
696
 
    globus_gass_copy_handle_t *         handle,
697
 
    char *                              url,
698
 
    globus_gass_copy_attr_t *           attr);
699
 
 
700
 
globus_result_t
701
 
globus_gass_copy_cksm(
702
 
    globus_gass_copy_handle_t *         handle,
703
 
    char *                              url,
704
 
    globus_gass_copy_attr_t *           attr,
705
 
    globus_off_t                        offset,
706
 
    globus_off_t                        length,
707
 
    const char *                        algorithm,
708
 
    char *                              cksm);
709
 
 
710
 
globus_result_t
711
 
globus_gass_copy_cksm_async(
712
 
    globus_gass_copy_handle_t *         handle,
713
 
    char *                              url,
714
 
    globus_gass_copy_attr_t *           attr,
715
 
    globus_off_t                        offset,
716
 
    globus_off_t                        length,
717
 
    const char *                        algorithm,
718
 
    char *                              cksm,
719
 
    globus_gass_copy_callback_t         callback,
720
 
    void *                              callback_arg);
721
 
 
722
 
globus_result_t
723
 
globus_gass_copy_stat(
724
 
    globus_gass_copy_handle_t *         handle,
725
 
    char *                              url,
726
 
    globus_gass_copy_attr_t *           attr,
727
 
    globus_gass_copy_glob_stat_t *      stat_info);
728
 
 
729
 
 
730
 
EXTERN_C_END
731
 
 
732
 
#endif /* GLOBUS_INCLUDE_GLOBUS_GASS_COPY_H */