Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:38:44

0001 /*
0002  * Copyright (c) CERN 2013-2017
0003  *
0004  * Copyright (c) Members of the EMI Collaboration. 2010-2013
0005  *  See  http://www.eu-emi.eu/partners for details on the copyright
0006  *  holders.
0007  *
0008  * Licensed under the Apache License, Version 2.0 (the "License");
0009  * you may not use this file except in compliance with the License.
0010  * You may obtain a copy of the License at
0011  *
0012  *    http://www.apache.org/licenses/LICENSE-2.0
0013  *
0014  * Unless required by applicable law or agreed to in writing, software
0015  * distributed under the License is distributed on an "AS IS" BASIS,
0016  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
0017  * See the License for the specific language governing permissions and
0018  * limitations under the License.
0019  */
0020 
0021 #pragma once
0022 #ifndef GFAL_TRANSFER_PLUGINS_H_
0023 #define GFAL_TRANSFER_PLUGINS_H_
0024 
0025 #if !defined(__GFAL2_H_INSIDE__) && !defined(__GFAL2_BUILD__)
0026 #   warning "Direct inclusion of gfal2 headers is deprecated. Please, include only gfal_api.h or gfal_plugins_api.h"
0027 #endif
0028 
0029 #include <transfer/gfal_transfer.h>
0030 
0031 #ifdef __cplusplus
0032 extern "C"
0033 {
0034 #endif  // __cplusplus
0035 
0036 struct _gfalt_transfer_status {
0037     gpointer plugin_transfer_data;
0038     int status;
0039     size_t average_baudrate;
0040     size_t instant_baudrate;
0041     time_t transfer_time;
0042     size_t bytes_transfered;
0043 };
0044 
0045 /**
0046  * Convenience method for event callback
0047  * @param params The transfer parameters.
0048  * @param domain The plugin domain.
0049  * @param side   The side that triggered the change, if any.
0050  * @param stage  The new stage.
0051  * @param fmt    A format string for a message
0052  */
0053 int plugin_trigger_event(gfalt_params_t params, GQuark domain,
0054                          gfal_event_side_t side, GQuark stage,
0055                          const char* fmt, ...);
0056 
0057 /**
0058  * Convenience method for monitoring callbacks
0059  * @param params The transfer parameters.
0060  * @param status The transfer status.
0061  * @param src    Source surl.
0062  * @param dst    Destination surl.
0063  */
0064 int plugin_trigger_monitor(gfalt_params_t params, gfalt_transfer_status_t status,
0065         const char* src, const char* dst);
0066 
0067 /**
0068  * Convenience error methods for copy implementations
0069  */
0070 void gfalt_propagate_prefixed_error(GError **dest, GError *src, const gchar *function, const gchar *side, const gchar *note);
0071 
0072 void gfalt_set_error(GError **err, GQuark domain, gint code, const gchar *function,
0073         const char *side, const gchar *note, const gchar *format, ...) G_GNUC_PRINTF (7, 8);
0074 
0075 #define GFALT_ERROR_SOURCE      "SOURCE"
0076 #define GFALT_ERROR_DESTINATION "DESTINATION"
0077 #define GFALT_ERROR_TRANSFER    "TRANSFER"
0078 #define GFALT_ERROR_CHECKSUM    "CHECKSUM"
0079 #define GFALT_ERROR_EXISTS      "EXISTS"
0080 #define GFALT_ERROR_OVERWRITE   "OVERWRITE"
0081 #define GFALT_ERROR_PARENT      "MAKE_PARENT"
0082 
0083 /**
0084  * GFALT_ERROR_CHECKSUM occurs during the retrieval of the checksum
0085  * GFALT_ERROR_CHECKSUM_MISMATCH means the checksum was successfully retrieved,
0086  * but the comparison failed
0087  */
0088 #define GFALT_ERROR_CHECKSUM_MISMATCH "CHECKSUM MISMATCH"
0089 /**
0090  * Size verification failed
0091  */
0092 #define GFALT_ERROR_SIZE_MISMATCH     "SIZE MISMATCH"
0093 
0094 #ifdef __cplusplus
0095 }
0096 #endif // __cplusplus
0097 
0098 #endif /* GFAL_TRANSFER_PLUGINS_H_ */