CERN org.glite.Gfal  2.0.1
/builddir/build/BUILD/gfal2-2.0.0/src/common/gridftp/grid_ftp_ifce_include.h
00001 #pragma once
00002 #ifndef _GRIDFTP_IFCE_INCLUDE_h
00003 #define _GRIDFTP_IFCE_INCLUDE_h
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 
00022 // #include <gridftp-ifce.h> temporary disable because of the header bugs ...
00023 
00024 
00025 
00026 #include <globus_gass_copy.h>
00027 #include <globus_ftp_client.h>
00028 #include <globus_ftp_client_restart_marker_plugin.h>
00029 #include <globus_ftp_client_restart_plugin.h>
00030 #include <globus_ftp_client_debug_plugin.h>
00031 
00032 
00033 #ifdef __cplusplus
00034 extern "C"
00035 {
00036 #endif  // __cplusplus
00037 
00038 #ifndef LONG64LONG64
00039 #if defined(__ia64__) || defined(__x86_64)
00040 #define LONG64 long
00041 #elif defined(_WIN32)
00042 #define LONG64 __i64
00043 #else
00044 #define LONG64 long long
00045 #endif
00046 #endif
00047 
00048 #define ERROR_BUFFER_SIZE 1024
00049 
00050     /*
00051     GridFTP Operation supported:
00052             -Make directory
00053             -Delete file
00054             -Get file size
00055             -Checksum
00056             -Third-party tranfer
00057             -Url-to-Url copy
00058      */
00059 
00068     inline int dmutils_gridftp_check_gsi_url(const char* url) {
00069         return strncmp(url, "gsiftp:", 7) == 0 ? 0 : -1;
00070     }
00071 
00079     globus_result_t dmutils_gridftp_delete(
00080             const char* file,
00081             char* errbuf,
00082             int errbufsz,
00083             int timeout);
00084 
00092     globus_result_t dmutils_gridftp_make_dir(
00093             char* dir,
00094             char *errbuf,
00095             int errbufsz,
00096             int timeout);
00097 
00098 
00106     globus_result_t dmutils_gridftp_get_filesize(
00107             char const* file,
00108             globus_off_t* size,
00109             char* errbuf,
00110             int errbufsz,
00111             int timeout);
00112 
00120     globus_result_t dmutils_gridftp_checksum(
00121             char const* file,
00122             char* cksm,
00123             char const* cksm_alg,
00124             char* errbuf,
00125             int errbufsz,
00126             int timeout);
00127 
00135     globus_result_t dmutils_gridftp_copy(
00136             const char* source_url,
00137             const char* dest_url,
00138             char *errbuf,
00139             int errbufsz,
00140             int timeout,
00141             int const nbstreams,
00142             int const tcp_bs,
00143             int const block_size,
00144             int verbose,
00145             globus_gass_copy_handle_t *ggc_handle,
00146             void (*ggc_callback)(void *callback_arg, globus_gass_copy_handle_t *handle, globus_object_t *error),
00147             void * monitor_external,
00148             void (*globus_gass_copy_performance_cb_t_etx)(void *user_arg,
00149             globus_gass_copy_handle_t *handle,
00150             globus_off_t total_bytes,
00151             float instantaneous_throughput,
00152             float avg_throughput),
00153             void * check_external,
00154             int (*gridftp_copy_wait)(void * monitor, void * check, globus_gass_copy_handle_t *gfhp, int const timeout, void * iupdater),
00155             void * iupdater);
00156 
00157 
00165     char* dmutils_gridftp_error_to_string(
00166             globus_object_t* errobj);
00167 
00168 
00169 
00170 
00171 
00172 #ifdef __cplusplus
00173 }
00174 #endif // __cplusplus
00175 
00176 
00177 
00178 
00179 
00180 #endif //_GRIDFTP_IFCE_INCLUDE_h
00181