00001 #ifndef __XRDSYSXATTR_HH__ 00002 #define __XRDSYSXATTR_HH__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d S y s X A t t r . h h */ 00006 /* */ 00007 /* (c) 2014 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* All Rights Reserved */ 00009 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00010 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00011 /* */ 00012 /* This file is part of the XRootD software suite. */ 00013 /* */ 00014 /* XRootD is free software: you can redistribute it and/or modify it under */ 00015 /* the terms of the GNU Lesser General Public License as published by the */ 00016 /* Free Software Foundation, either version 3 of the License, or (at your */ 00017 /* option) any later version. */ 00018 /* */ 00019 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00020 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00021 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00022 /* License for more details. */ 00023 /* */ 00024 /* You should have received a copy of the GNU Lesser General Public License */ 00025 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00026 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00027 /* */ 00028 /* The copyright holder's institutional names and contributor's names may not */ 00029 /* be used to endorse or promote products derived from this software without */ 00030 /* specific prior written permission of the institution or contributor. */ 00031 /******************************************************************************/ 00032 00033 //------------------------------------------------------------------------------ 00037 //------------------------------------------------------------------------------ 00038 00039 class XrdOucEnv; 00040 class XrdSysError; 00041 00042 class XrdSysXAttr 00043 { 00044 public: 00045 //------------------------------------------------------------------------------ 00050 //------------------------------------------------------------------------------ 00051 00052 struct AList 00053 {AList *Next; 00054 int Vlen; 00055 int Nlen; 00056 char Name[1]; 00057 }; 00058 00059 //------------------------------------------------------------------------------ 00078 //------------------------------------------------------------------------------ 00079 00080 virtual int Copy(const char *iPath, int iFD, const char *oPath, int oFD, 00081 const char *Aname=0); 00082 00083 //------------------------------------------------------------------------------ 00093 //------------------------------------------------------------------------------ 00094 00095 virtual int Del(const char *Aname, const char *Path, int fd=-1) = 0; 00096 00097 //------------------------------------------------------------------------------ 00101 //------------------------------------------------------------------------------ 00102 00103 virtual void Free(AList *aPL) = 0; 00104 00105 //------------------------------------------------------------------------------ 00122 //------------------------------------------------------------------------------ 00123 00124 virtual int Get(const char *Aname, void *Aval, int Avsz, 00125 const char *Path, int fd=-1) = 0; 00126 00127 //------------------------------------------------------------------------------ 00145 //------------------------------------------------------------------------------ 00146 00147 virtual int List(AList **aPL, const char *Path, int fd=-1, int getSz=0) = 0; 00148 00149 //------------------------------------------------------------------------------ 00165 //------------------------------------------------------------------------------ 00166 00167 virtual int Set(const char *Aname, const void *Aval, int Avsz, 00168 const char *Path, int fd=-1, int isNew=0) = 0; 00169 00170 //------------------------------------------------------------------------------ 00178 //------------------------------------------------------------------------------ 00179 00180 virtual XrdSysError *SetMsgRoute(XrdSysError *errP); 00181 00182 //------------------------------------------------------------------------------ 00184 //------------------------------------------------------------------------------ 00185 00186 XrdSysXAttr() : Say(0) {} 00187 virtual ~XrdSysXAttr() {} 00188 00189 protected: 00190 00191 XrdSysError *Say; 00192 }; 00193 00194 /******************************************************************************/ 00195 /* X r d S y s X A t t r O b j e c t I n s t a n t i a t o r */ 00196 /******************************************************************************/ 00197 00198 //------------------------------------------------------------------------------ 00211 //------------------------------------------------------------------------------ 00212 00213 typedef XrdSysXAttr *(*XrdSysGetXAttrObject_t)(XrdSysError *errP, 00214 const char *config_fn, 00215 const char *parms); 00222 //------------------------------------------------------------------------------ 00238 //------------------------------------------------------------------------------ 00239 00240 typedef XrdSysXAttr *(*XrdSysAddXAttrObject_t)(XrdSysError *errP, 00241 const char *config_fn, 00242 const char *parms, 00243 XrdOucEnv *envP, 00244 XrdSysXAttr *attrP); 00252 //------------------------------------------------------------------------------ 00257 //------------------------------------------------------------------------------ 00258 00265 /******************************************************************************/ 00266 /* X r d S y s X A t t r I m p l e m e n t a t i o n s */ 00267 /******************************************************************************/ 00268 00269 //------------------------------------------------------------------------------ 00273 //------------------------------------------------------------------------------ 00274 00275 //------------------------------------------------------------------------------ 00282 //------------------------------------------------------------------------------ 00283 #endif