Grid Community Toolkit  6.2.1705709074 (tag: v6.2.20240202)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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  */
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  {
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_bool_t active;
226 
230  globus_i_gass_copy_monitor_t monitor;
231 
232  /*
233  * total number of read/write buffers that can be used at a time
234  */
235  int max_buffers;
236 
237  /*
238  * number of buffers that have been allocated for reading/writing
239  */
240  int n_buffers;
241 
245  globus_mutex_t mutex;
246 
250  globus_i_gass_copy_cancel_status_t cancel;
251 
255  struct globus_gass_copy_handle_s *cksm_handle;
256 
260  char *checksum;
261 
265  char *algorithm;
266 };
267 
269 globus_i_gass_copy_state_new(
270  globus_gass_copy_handle_t *handle);
271 
272 #ifdef __cplusplus
273 }
274 #endif
275 
276 #endif /* GLOBUS_DONT_DOCUMENT_INTERNAL */
277 
278 #endif /* GLOBUS_I_GASS_COPY_H */
FTP Client handle implementation.
Definition: globus_i_ftp_client.h:522
Error Object Containing a String.
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
struct globus_fifo_s * globus_fifo_t
Definition: globus_fifo.h:48
Attributes.
Definition: globus_gass_copy.h:299
Copy Handle.
Definition: globus_gass_copy.h:199
Mutex.
Definition: globus_thread.h:107
GASS Copy Library.
Condition variable.
Definition: globus_thread.h:124
size_t globus_size_t
Standard size of memory objectThe globus_size_t is the size of a memory object. It is identical to si...
Definition: globus_types.h:48
globus_gass_copy_url_mode_t
URL Modes.
Definition: globus_gass_copy.h:187
unsigned char globus_byte_t
Unsigned byte datatypeThis is used for byte-addressable arrays of arbitrary data which is not subject...
Definition: globus_types.h:85
Headers common to all of Globus.
uint32_t globus_result_t
Definition: globus_types.h:99