CERN org.glite.Gfal
2.0.1
|
00001 #pragma once 00002 #ifndef _GFAL2_TRANSFER_ 00003 #define _GFAL2_TRANSFER_ 00004 00005 /* 00006 * Copyright (c) Members of the EGEE Collaboration. 2004. 00007 * See http://www.eu-egee.org/partners/ for details on the copyright holders. 00008 * 00009 * Licensed under the Apache License, Version 2.0 (the "License"); 00010 * you may not use this file except in compliance with the License. 00011 * You may obtain a copy of the License at 00012 * 00013 * http://www.apache.org/licenses/LICENSE-2.0 00014 * 00015 * Unless required by applicable law or agreed to in writing, software 00016 * distributed under the License is distributed on an "AS IS" BASIS, 00017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00018 * See the License for the specific language governing permissions and 00019 * limitations under the License. 00020 */ 00021 00032 #include <transfer/gfal_transfer_types.h> 00033 #include <global/gfal_global.h> 00034 #include <common/gfal_constants.h> 00035 00036 00037 #ifdef __cplusplus 00038 extern "C" 00039 { 00040 #endif // __cplusplus 00041 00042 00046 gfalt_params_t gfalt_params_handle_new(GError ** err); 00047 00051 void gfalt_params_handle_delete(gfalt_params_t params, GError ** err); 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 // 00062 // parameters management functions 00063 // these functions provide a way to configure a context for a transfer 00064 // they must be called before starting the transfer 00065 // 00066 00070 int gfalt_set_timeout(gfalt_params_t, unsigned long timeout, GError** err); 00071 00075 int gfalt_set_nbstreams(gfalt_params_t, unsigned long nbstreams, GError** err); 00080 int gfalt_set_replace_existing_file(gfalt_params_t, gboolean replace, GError** err); 00085 int gfalt_set_offset_from_source(gfalt_params_t, off_t offset, GError** err); 00089 int gfalt_set_user_data(gfalt_params_t, gpointer user_data, GError** err); 00093 int gfalt_set_uuid(gfalt_params_t, uuid_t uuid, GError** err); 00098 int gfalt_set_callback_mperiod(gfalt_params_t, unsigned int mtime, GError** err); // time in ms between two callback calls. 00099 // etc ...... 00100 00105 void gfalt_set_monitor_tfr(gfalt_params_t params, gfalt_monitor_tfr callback); 00106 00107 00108 00109 // 00110 // Main function for transfer launch 00111 // 00112 00121 int gfalt_copy_file(gfal_context_t context, gfalt_params_t ph, const char* src, const char* dst, GError** err); 00122 00123 00124 // 00125 // Monitoring and flow control functions 00126 // 00127 00131 int gfalt_copy_cancel(gfalt_transfer_status_t, GError** err); 00135 int gfalt_copy_pause(gfalt_transfer_status_t, GError ** err ); 00139 int gfalt_copy_resume(gfalt_transfer_status_t, GError ** err); 00140 00144 int gfalt_copy_get_status(gfalt_transfer_status_t, GError ** err); 00148 int gfalt_copy_get_baudrate(gfalt_transfer_status_t, GError ** err); 00152 size_t gfalt_copy_get_bytes_transfered(gfalt_transfer_status_t, GError ** err); 00156 time_t gfalt_copy_get_elapsed_time(gfalt_transfer_status_t, GError ** err); 00157 00158 00159 00160 #ifdef __cplusplus 00161 } 00162 #endif // __cplusplus 00163 00164 #endif //_GFAL2_TRANSFER_ 00165