00001 #ifndef __XRDOUCPINLOADER_HH__ 00002 #define __XRDOUCPINLOADER_HH__ 00003 /******************************************************************************/ 00004 /* */ 00005 /* X r d O u c P i n L o a d e r . h h */ 00006 /* */ 00007 /* (c) 2014 by the Board of Trustees of the Leland Stanford, Jr., University */ 00008 /* Produced by Andrew Hanushevsky for Stanford University under contract */ 00009 /* DE-AC02-76-SFO0515 with the Department of Energy */ 00010 /* */ 00011 /* This file is part of the XRootD software suite. */ 00012 /* */ 00013 /* XRootD is free software: you can redistribute it and/or modify it under */ 00014 /* the terms of the GNU Lesser General Public License as published by the */ 00015 /* Free Software Foundation, either version 3 of the License, or (at your */ 00016 /* option) any later version. */ 00017 /* */ 00018 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00019 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00020 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00021 /* License for more details. */ 00022 /* */ 00023 /* You should have received a copy of the GNU Lesser General Public License */ 00024 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00025 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00026 /* */ 00027 /* The copyright holder's institutional names and contributor's names may not */ 00028 /* be used to endorse or promote products derived from this software without */ 00029 /* specific prior written permission of the institution or contributor. */ 00030 /******************************************************************************/ 00031 00032 //------------------------------------------------------------------------------ 00034 //------------------------------------------------------------------------------ 00035 00036 //------------------------------------------------------------------------------ 00043 //------------------------------------------------------------------------------ 00044 00045 class XrdSysError; 00046 class XrdSysPlugin; 00047 struct XrdVersionInfo; 00048 00049 class XrdOucPinLoader 00050 { 00051 public: 00052 00053 //------------------------------------------------------------------------------ 00060 //------------------------------------------------------------------------------ 00061 00062 XrdSysPlugin *Export() {XrdSysPlugin *tmp = piP; piP = 0; return tmp;} 00063 00064 //------------------------------------------------------------------------------ 00070 //------------------------------------------------------------------------------ 00071 00072 void Global(bool glbl) {global = glbl;} 00073 00074 //------------------------------------------------------------------------------ 00079 //------------------------------------------------------------------------------ 00080 00081 const char *LastMsg() {return (errBP ? errBP : "");} 00082 00083 //------------------------------------------------------------------------------ 00089 //------------------------------------------------------------------------------ 00090 00091 const char *Path() {return theLib;} 00092 00093 //------------------------------------------------------------------------------ 00101 //------------------------------------------------------------------------------ 00102 00103 void *Resolve(const char *symbl, int mcnt=1); 00104 00105 //------------------------------------------------------------------------------ 00111 //------------------------------------------------------------------------------ 00112 00113 void Unload(bool dodel=false); 00114 00115 //------------------------------------------------------------------------------ 00125 //------------------------------------------------------------------------------ 00126 00127 XrdOucPinLoader(XrdSysError *errP, 00128 XrdVersionInfo *vInfo, 00129 const char *drctv, 00130 const char *plib); 00131 00132 //------------------------------------------------------------------------------ 00141 //------------------------------------------------------------------------------ 00142 00143 XrdOucPinLoader(char *eBuff, 00144 int eBlen, 00145 XrdVersionInfo *vInfo, 00146 const char *drctv, 00147 const char *plib); 00148 00149 //------------------------------------------------------------------------------ 00157 //------------------------------------------------------------------------------ 00158 00159 XrdOucPinLoader(XrdVersionInfo *vInfo, 00160 const char *drctv, 00161 const char *plib); 00162 00163 //------------------------------------------------------------------------------ 00167 //------------------------------------------------------------------------------ 00168 00169 ~XrdOucPinLoader(); 00170 00171 private: 00172 void Inform(const char *txt1, const char *txt2=0, 00173 const char *txt3=0, const char *txt4=0, 00174 const char *txt5=0); 00175 void Init(const char *drctv, const char *plib); 00176 bool LoadLib(int mcnt); 00177 00178 XrdSysError *eDest; 00179 XrdSysPlugin *piP; 00180 XrdVersionInfo *viP; 00181 const char *dName; 00182 char *theLib; 00183 char *altLib; 00184 char *errBP; 00185 int errBL; 00186 bool global; 00187 bool frBuff; 00188 bool badLib; 00189 }; 00190 #endif