globus_gass_copy  9.33
 All Data Structures Files Functions Variables Typedefs Enumerations Groups Pages
globus_i_gass_copy.h
1 
2 #ifndef GLOBUS_I_GASS_COPY_H
3 #define GLOBUS_I_GASS_COPY_H
4 
5 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
6 
12 #include "globus_gass_copy.h"
13 #include "globus_common.h"
14 #include "globus_error_string.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19 
23 typedef enum
24 {
25  GLOBUS_I_GASS_COPY_TARGET_INITIAL,
26  GLOBUS_I_GASS_COPY_TARGET_READY,
27  GLOBUS_I_GASS_COPY_TARGET_DONE,
28  GLOBUS_I_GASS_COPY_TARGET_FAILED
29 } globus_i_gass_copy_target_status_t;
30 
31 typedef enum
32 {
33  GLOBUS_I_GASS_COPY_CANCEL_FALSE,
34  GLOBUS_I_GASS_COPY_CANCEL_TRUE,
35  GLOBUS_I_GASS_COPY_CANCEL_CALLED
36 } globus_i_gass_copy_cancel_status_t;
37 
38 
42 typedef struct
43 {
44  globus_byte_t * bytes;
45  globus_size_t nbytes;
46  globus_off_t offset;
47  globus_bool_t last_data;
48 } globus_i_gass_copy_buffer_t;
49 
53 typedef struct
54 {
55  globus_mutex_t mutex;
56  globus_cond_t cond;
57  volatile globus_bool_t done;
58  globus_bool_t use_err;
59  globus_object_t * err;
60 } globus_i_gass_copy_monitor_t;
61 
65 typedef struct globus_i_gass_copy_cancel_s
66 {
67  /*
68  * the gass copy handle
69  */
71 
72  /*
73  * Indicates which side of the transfer to cancel
74  * If TRUE then cancelling the source otherwise the destination.
75  */
76  globus_bool_t canceling_source;
77 
78 } globus_i_gass_copy_cancel_t;
79 
83 typedef struct globus_i_gass_copy_state_target_s
84 {
88  char * url;
89 
94 
95  /* If the attr was passed as an argument then FALSE
96  * If the attr was created internally then TRUE
97  */
98  globus_bool_t free_attr;
99  globus_bool_t free_ftp_attr;
103  globus_mutex_t mutex;
104 
108  globus_fifo_t queue;
109 
113  int n_pending;
114 
118  int n_simultaneous;
119 
123  int n_complete;
124 
128  globus_i_gass_copy_target_status_t status;
129 
134 
138  union
139  {
144  struct /* GLOBUS_I_GASS_COPY_TARGET_MODE_FTP */
145  {
146  /* FIXX - not sure that any of this is needed
147  * same as n_simultaneous and n_pending, and there's
148  * already an ftp_handle in the copy_handle
149  */
150  globus_ftp_client_handle_t * handle;
151  globus_bool_t completed;
152  int n_channels;
153  int n_reads_posted;
154  globus_object_t * data_err;
155  } ftp;
156 
160  struct /* GLOBUS_I_GASS_COPY_TARGET_MODE_GASS */
161  {
165  globus_gass_transfer_request_t request;
166  } gass;
167 
171  struct /* GLOBUS_I_GASS_COPY_TARGET_MODE_IO */
172  {
173 
174  globus_io_handle_t * handle;
175 
180  globus_bool_t free_handle;
181 
185  globus_bool_t seekable;
186  } io;
187  } data;
188 } globus_i_gass_copy_target_t;
189 
190 
195 struct globus_gass_copy_state_s
196 {
200  globus_i_gass_copy_target_t source;
201 
205  globus_i_gass_copy_target_t dest;
206 
210  globus_bool_t active;
211 
215  globus_i_gass_copy_monitor_t monitor;
216 
217  /*
218  * total number of read/write buffers that can be used at a time
219  */
220  int max_buffers;
221 
222  /*
223  * number of buffers that have been allocated for reading/writing
224  */
225  int n_buffers;
226 
230  globus_mutex_t mutex;
231 
235  globus_i_gass_copy_cancel_status_t cancel;
236 
240  struct globus_gass_copy_handle_s *cksm_handle;
241 
245  char *checksum;
246 
250  char *algorithm;
251 };
252 
253 globus_result_t
254 globus_i_gass_copy_state_new(
255  globus_gass_copy_handle_t *handle);
256 
257 #ifdef __cplusplus
258 }
259 #endif
260 
261 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
262 
263 #endif /* GLOBUS_I_GASS_COPY_H */
Attributes.
Definition: globus_gass_copy.h:283
Copy Handle.
Definition: globus_gass_copy.h:183
GASS Copy Library.
globus_gass_copy_url_mode_t
URL Modes.
Definition: globus_gass_copy.h:171