File indexing completed on 2025-02-22 10:38:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #pragma once
0022 #ifndef GFAL_CANCEL_H_
0023 #define GFAL_CANCEL_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 "gfal_common.h"
0030 #include "gfal_constants.h"
0031
0032
0033 #ifdef __cplusplus
0034 extern "C"
0035 {
0036 #endif
0037
0038 typedef struct gfal_cancel_token_s* gfal_cancel_token_t;
0039 typedef void (*gfal_cancel_hook_cb)(gfal2_context_t context, void* userdata);
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 int gfal2_cancel(gfal2_context_t context);
0052
0053
0054
0055
0056
0057
0058
0059
0060 gboolean gfal2_is_canceled(gfal2_context_t context);
0061
0062
0063
0064
0065
0066 gfal_cancel_token_t gfal2_register_cancel_callback(gfal2_context_t context,
0067 gfal_cancel_hook_cb cb, void* userdata);
0068
0069
0070
0071
0072
0073 void gfal2_remove_cancel_callback(gfal2_context_t context, gfal_cancel_token_t token);
0074
0075
0076
0077
0078 int gfal2_start_scope_cancel(gfal2_context_t context, GError** err);
0079
0080
0081
0082
0083 int gfal2_end_scope_cancel(gfal2_context_t context);
0084
0085
0086
0087
0088 GQuark gfal_cancel_quark();
0089
0090
0091 #define GFAL2_BEGIN_SCOPE_CANCEL(context, ret_err_value, err) \
0092 do{ \
0093 if(gfal2_start_scope_cancel(context, err) < 0){ \
0094 return ret_err_value; \
0095 } \
0096 }while(0)
0097
0098
0099 #define GFAL2_END_SCOPE_CANCEL(context) \
0100 gfal2_end_scope_cancel(context)
0101
0102 #ifdef __cplusplus
0103 }
0104 #endif
0105
0106
0107 #endif