globus_gass_copy  9.16
globus_i_gass_copy.h
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 #ifndef GLOBUS_I_GASS_COPY_H
18 #define GLOBUS_I_GASS_COPY_H
19 
20 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
21 
27 #include "globus_gass_copy.h"
28 #include "globus_common.h"
29 #include "globus_error_string.h"
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
38 typedef enum
39 {
40  GLOBUS_I_GASS_COPY_TARGET_INITIAL,
41  GLOBUS_I_GASS_COPY_TARGET_READY,
42  GLOBUS_I_GASS_COPY_TARGET_DONE,
43  GLOBUS_I_GASS_COPY_TARGET_FAILED
44 } globus_i_gass_copy_target_status_t;
45 
46 typedef enum
47 {
48  GLOBUS_I_GASS_COPY_CANCEL_FALSE,
49  GLOBUS_I_GASS_COPY_CANCEL_TRUE,
50  GLOBUS_I_GASS_COPY_CANCEL_CALLED
51 } globus_i_gass_copy_cancel_status_t;
52 
53 
57 typedef struct
58 {
59  globus_byte_t * bytes;
60  globus_size_t nbytes;
61  globus_off_t offset;
62  globus_bool_t last_data;
63 } globus_i_gass_copy_buffer_t;
64 
68 typedef struct
69 {
70  globus_mutex_t mutex;
71  globus_cond_t cond;
72  volatile globus_bool_t done;
73  globus_bool_t use_err;
74  globus_object_t * err;
75 } globus_i_gass_copy_monitor_t;
76 
80 typedef struct globus_i_gass_copy_cancel_s
81 {
82  /*
83  * the gass copy handle
84  */
86 
87  /*
88  * Indicates which side of the transfer to cancel
89  * If TRUE then cancelling the source otherwise the destination.
90  */
91  globus_bool_t canceling_source;
92 
93 } globus_i_gass_copy_cancel_t;
94 
98 typedef struct globus_i_gass_copy_state_target_s
99 {
103  char * url;
104 
109 
110  /* If the attr was passed as an argument then FALSE
111  * If the attr was created internally then TRUE
112  */
113  globus_bool_t free_attr;
114  globus_bool_t free_ftp_attr;
118  globus_mutex_t mutex;
119 
123  globus_fifo_t queue;
124 
128  int n_pending;
129 
133  int n_simultaneous;
134 
138  int n_complete;
139 
143  globus_i_gass_copy_target_status_t status;
144 
149 
153  union
154  {
159  struct /* GLOBUS_I_GASS_COPY_TARGET_MODE_FTP */
160  {
161  /* FIXX - not sure that any of this is needed
162  * same as n_simultaneous and n_pending, and there's
163  * already an ftp_handle in the copy_handle
164  */
165  globus_ftp_client_handle_t * handle;
166  globus_bool_t completed;
167  int n_channels;
168  int n_reads_posted;
169  globus_object_t * data_err;
170  } ftp;
171 
175  struct /* GLOBUS_I_GASS_COPY_TARGET_MODE_GASS */
176  {
180  globus_gass_transfer_request_t request;
181  } gass;
182 
186  struct /* GLOBUS_I_GASS_COPY_TARGET_MODE_IO */
187  {
188 
189  globus_io_handle_t * handle;
190 
195  globus_bool_t free_handle;
196 
200  globus_bool_t seekable;
201  } io;
202  } data;
203 } globus_i_gass_copy_target_t;
204 
205 
210 struct globus_gass_copy_state_s
211 {
215  globus_i_gass_copy_target_t source;
216 
220  globus_i_gass_copy_target_t dest;
221 
225  globus_i_gass_copy_monitor_t monitor;
226 
227  /*
228  * total number of read/write buffers that can be used at a time
229  */
230  int max_buffers;
231 
232  /*
233  * number of buffers that have been allocated for reading/writing
234  */
235  int n_buffers;
236 
240  globus_mutex_t mutex;
241 
245  globus_i_gass_copy_cancel_status_t cancel;
246 
247 };
248 
249 globus_result_t
250 globus_i_gass_copy_state_new(
251  globus_gass_copy_handle_t *handle);
252 
253 #ifdef __cplusplus
254 }
255 #endif
256 
257 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
258 
259 #endif /* GLOBUS_I_GASS_COPY_H */
Attributes.
Definition: globus_gass_copy.h:295
Copy Handle.
Definition: globus_gass_copy.h:195
GASS Copy Library.
globus_gass_copy_url_mode_t
URL Modes.
Definition: globus_gass_copy.h:183