Back to home page

EIC code displayed by LXR

 
 

    


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

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_COMMON_PLUGIN_H
0023 #define GFAL_COMMON_PLUGIN_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_handle.h"
0030 #include "gfal_plugin_interface.h"
0031 #include <transfer/gfal_transfer.h>
0032 
0033 #include <stdarg.h>
0034 #include <glib.h>
0035 #include <errno.h>
0036 #include <string.h>
0037 #include <dirent.h>
0038 #include <sys/stat.h>
0039 
0040 
0041 #define GFAL2_PLUGIN_SCOPE "GFAL2::PLUGIN"
0042 
0043 
0044 #ifdef __cplusplus
0045 extern "C"
0046 {
0047 #endif  // __cplusplus
0048 
0049 typedef struct _plugin_pointer_handle {
0050     gfal_plugin_interface* plugin_api;                  /**< plugin official API */
0051     void* dlhandle;                                     /**< dlhandle of the plugin */
0052     void* plugin_data;                                  /**< plugin internal data */
0053     char plugin_name[GFAL_URL_MAX_LEN];                 /**< plugin name */
0054     char plugin_lib[GFAL_URL_MAX_LEN];                  /**< plugin library path */
0055 }*plugin_pointer_handle;
0056 
0057 
0058 /**
0059  * This API is a plugin reserved API and should be used by GFAL2's plugins only
0060  * Backward compatibility of this API is not guaranteed
0061  */
0062 
0063 plugin_handle gfal_get_plugin_handle(gfal_plugin_interface* p_interface);
0064 
0065 int gfal_plugins_instance(gfal2_context_t, GError** err);
0066 
0067 char** gfal_plugins_get_list(gfal2_context_t, GError** err);
0068 
0069 int gfal_plugins_delete(gfal2_context_t, GError** err);
0070 
0071 gboolean gfal_feature_is_supported(void *ptr, GQuark scope, const char *func_name, const char *surl, GError **err);
0072 
0073 /**
0074  * Find a compatible catalog or return NULL + error
0075  */
0076 gfal_plugin_interface* gfal_find_plugin(gfal2_context_t handle,
0077                                          const char * url,
0078                                          plugin_mode acc_mode, GError** err);
0079 
0080 
0081 
0082 gfal_plugin_interface* gfal_plugin_map_file_handle(gfal2_context_t handle, gfal_file_handle fh, GError** err);
0083 
0084 #ifdef __cplusplus
0085 }
0086 #endif // __cplusplus
0087 
0088 #endif /* GFAL_COMMON_PLUGIN_H */
0089