00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef GLOBUS_I_GASS_COPY_H
00018 #define GLOBUS_I_GASS_COPY_H
00019
00020 #ifndef GLOBUS_DONT_DOCUMENT_INTERNAL
00021
00027 #include "globus_gass_copy.h"
00028 #include "globus_common.h"
00029 #include "globus_error_string.h"
00030
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00038 typedef enum
00039 {
00040 GLOBUS_I_GASS_COPY_TARGET_INITIAL,
00041 GLOBUS_I_GASS_COPY_TARGET_READY,
00042 GLOBUS_I_GASS_COPY_TARGET_DONE,
00043 GLOBUS_I_GASS_COPY_TARGET_FAILED
00044 } globus_i_gass_copy_target_status_t;
00045
00046 typedef enum
00047 {
00048 GLOBUS_I_GASS_COPY_CANCEL_FALSE,
00049 GLOBUS_I_GASS_COPY_CANCEL_TRUE,
00050 GLOBUS_I_GASS_COPY_CANCEL_CALLED
00051 } globus_i_gass_copy_cancel_status_t;
00052
00053
00057 typedef struct
00058 {
00059 globus_byte_t * bytes;
00060 globus_size_t nbytes;
00061 globus_off_t offset;
00062 globus_bool_t last_data;
00063 } globus_i_gass_copy_buffer_t;
00064
00068 typedef struct
00069 {
00070 globus_mutex_t mutex;
00071 globus_cond_t cond;
00072 volatile globus_bool_t done;
00073 globus_bool_t use_err;
00074 globus_object_t * err;
00075 } globus_i_gass_copy_monitor_t;
00076
00080 typedef struct globus_i_gass_copy_cancel_s
00081 {
00082
00083
00084
00085 globus_gass_copy_handle_t * handle;
00086
00087
00088
00089
00090
00091 globus_bool_t canceling_source;
00092
00093 } globus_i_gass_copy_cancel_t;
00094
00098 typedef struct globus_i_gass_copy_state_target_s
00099 {
00103 char * url;
00104
00108 globus_gass_copy_attr_t * attr;
00109
00110
00111
00112
00113 globus_bool_t free_attr;
00114 globus_bool_t free_ftp_attr;
00118 globus_mutex_t mutex;
00119
00123 globus_fifo_t queue;
00124
00128 int n_pending;
00129
00133 int n_simultaneous;
00134
00138 int n_complete;
00139
00143 globus_i_gass_copy_target_status_t status;
00144
00148 globus_gass_copy_url_mode_t mode;
00149
00153 union
00154 {
00159 struct
00160 {
00161
00162
00163
00164
00165 globus_ftp_client_handle_t * handle;
00166 globus_bool_t completed;
00167 int n_channels;
00168 int n_reads_posted;
00169 globus_object_t * data_err;
00170 } ftp;
00171
00175 struct
00176 {
00180 globus_gass_transfer_request_t request;
00181 } gass;
00182
00186 struct
00187 {
00188
00189 globus_io_handle_t * handle;
00190
00195 globus_bool_t free_handle;
00196
00200 globus_bool_t seekable;
00201 } io;
00202 } data;
00203 } globus_i_gass_copy_target_t;
00204
00205
00210 struct globus_gass_copy_state_s
00211 {
00215 globus_i_gass_copy_target_t source;
00216
00220 globus_i_gass_copy_target_t dest;
00221
00225 globus_bool_t active;
00226
00230 globus_i_gass_copy_monitor_t monitor;
00231
00232
00233
00234
00235 int max_buffers;
00236
00237
00238
00239
00240 int n_buffers;
00241
00245 globus_mutex_t mutex;
00246
00250 globus_i_gass_copy_cancel_status_t cancel;
00251
00255 struct globus_gass_copy_handle_s *cksm_handle;
00256
00260 char *checksum;
00261
00265 char *algorithm;
00266 };
00267
00268 globus_result_t
00269 globus_i_gass_copy_state_new(
00270 globus_gass_copy_handle_t *handle);
00271
00272 #ifdef __cplusplus
00273 }
00274 #endif
00275
00276 #endif
00277
00278 #endif