CERN org.glite.Gfal
2.0.1
|
00001 #pragma once 00002 #ifndef _GFAL_PLUGIN_INTERFACE_ 00003 #define _GFAL_PLUGIN_INTERFACE_ 00004 /* 00005 * Copyright (c) Members of the EGEE Collaboration. 2004. 00006 * See http://www.eu-egee.org/partners/ for details on the copyright holders. 00007 * 00008 * Licensed under the Apache License, Version 2.0 (the "License"); 00009 * you may not use this file except in compliance with the License. 00010 * You may obtain a copy of the License at 00011 * 00012 * http://www.apache.org/licenses/LICENSE-2.0 00013 * 00014 * Unless required by applicable law or agreed to in writing, software 00015 * distributed under the License is distributed on an "AS IS" BASIS, 00016 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00017 * See the License for the specific language governing permissions and 00018 * limitations under the License. 00019 */ 00020 00021 00030 #include <glib.h> 00031 #include <common/gfal_types.h> 00032 #include <common/gfal_constants.h> 00033 00034 #ifdef __cplusplus 00035 extern "C" 00036 { 00037 #endif 00038 00039 00040 00048 struct _gfal_plugin_interface{ 00049 // internal datas* 00050 void * gfal_data; 00051 00052 // handle 00053 plugin_handle handle; 00054 // to have name/id of the plugin MUST be IMPLEMENTED 00055 const char* (*getName)(); 00059 void (*plugin_delete)(plugin_handle); 00065 gboolean (*check_plugin_url)(plugin_handle, const char* url, plugin_mode mode, GError** err); 00066 00070 int (*accessG)(plugin_handle, const char* path, int mode, GError** err); 00074 int (*chmodG)(plugin_handle, const char *, mode_t, GError** err); 00075 int (*renameG)(plugin_handle, const char *, const char *, GError** err); 00076 int (*symlinkG)(plugin_handle, const char*, const char*, GError** err); 00077 int (*statG)(plugin_handle, const char*, struct stat *buf, GError** err); 00078 int (*lstatG)(plugin_handle, const char*, struct stat *buf, GError** err); 00079 ssize_t (*readlinkG)(plugin_handle, const char*, char* buff, size_t buffsiz, GError** ); 00080 00081 // directory management 00082 gfal_file_handle (*opendirG)(plugin_handle, const char*, GError**); 00083 int (*closedirG)(plugin_handle, gfal_file_handle, GError**); 00084 struct dirent* (*readdirG)(plugin_handle, gfal_file_handle, GError**); 00085 int (*mkdirpG)(plugin_handle, const char*, mode_t, gboolean pflag, GError**); //function pointer for the mkdir call, if pflag is set, the call is considered like a recursive call for a full path creation 00086 int (*rmdirG )(plugin_handle, const char*, GError**); 00087 00088 // basic file operation, 00089 gfal_file_handle (*openG)(plugin_handle, const char* path, int flag, mode_t mode, GError**); 00090 int (*readG)(plugin_handle, gfal_file_handle fd, void* buff, size_t count, GError**); 00091 int (*writeG)(plugin_handle, gfal_file_handle fd, void* buff, size_t count, GError**); 00092 int (*closeG)(plugin_handle, gfal_file_handle fd, GError **); 00093 int (*lseekG)(plugin_handle, gfal_file_handle fd, off_t offset, int whence, GError** err); 00094 00095 // vector operations 00101 ssize_t (*preadG)(plugin_handle, gfal_file_handle fd, void* buff, size_t count, off_t offset, GError**); 00102 ssize_t (*pwriteG)(plugin_handle, gfal_file_handle fd, const void* buff, size_t count, off_t offset, GError**); 00103 00104 00105 // remove operations 00109 int (*unlinkG)(plugin_handle, const char* path, GError**); 00110 00111 // advanced attributes management 00115 ssize_t (*getxattrG)(plugin_handle, const char*, const char*, void* buff, size_t s_buff, GError** err); 00119 ssize_t (*listxattrG)(plugin_handle, const char*, char* list, size_t s_list, GError** err); 00123 int (*setxattrG)(plugin_handle, const char*, const char*, const void*, size_t , int, GError** ); 00124 00125 00132 int (*is_used_parameter)(plugin_handle, const char* namespacep, const char* key); 00133 00141 void (*notify_change_parameter)(plugin_handle, const char* namespacep, const char* key); 00142 }; 00143 00147 struct _plugin_opts{ 00148 gfal_plugin_interface plugin_list[MAX_PLUGIN_LIST]; 00149 int plugin_number; 00150 }; 00151 00152 00153 #ifdef __cplusplus 00154 } 00155 #endif 00156 00157 00158 #endif 00159 00160