|
xrootd
|
00001 /******************************************************************************/ 00002 /* */ 00003 /* X r d C l i e n t A d m i n _ c . h h */ 00004 /* */ 00005 /* 2004 Produced by Alvise Dorigo & Fabrizio Furano for INFN padova */ 00006 /* */ 00007 /* This file is part of the XRootD software suite. */ 00008 /* */ 00009 /* XRootD is free software: you can redistribute it and/or modify it under */ 00010 /* the terms of the GNU Lesser General Public License as published by the */ 00011 /* Free Software Foundation, either version 3 of the License, or (at your */ 00012 /* option) any later version. */ 00013 /* */ 00014 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */ 00015 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */ 00016 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */ 00017 /* License for more details. */ 00018 /* */ 00019 /* You should have received a copy of the GNU Lesser General Public License */ 00020 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */ 00021 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */ 00022 /* */ 00023 /* The copyright holder's institutional names and contributor's names may not */ 00024 /* be used to endorse or promote products derived from this software without */ 00025 /* specific prior written permission of the institution or contributor. */ 00026 /******************************************************************************/ 00027 00028 /********************************************************************************/ 00029 /* A C wrapper for XTNetAdmin functionalities */ 00030 /********************************************************************************/ 00031 00032 #ifdef SWIG 00033 %module XrdClientAdmin 00034 %include typemaps.i // Load the typemaps librayr 00035 00036 // This tells SWIG to treat an char * argument with name res as 00037 // an output value. 00038 00039 %typemap(argout) char *OUTPUT { 00040 $result = sv_newmortal(); 00041 sv_setnv($result, arg2); 00042 argvi++; /* Increment return count -- important! */ 00043 } 00044 00045 // We don't care what the input value is. Ignore, but set to a temporary variable 00046 00047 %typemap(in,numinputs=0) char *OUTPUT(char junk) { 00048 $1 = &junk; 00049 } 00050 00051 %apply char *OUTPUT { char *ans }; 00052 00053 // For the stat function to return an array containing the 00054 // various fields of the answer 00055 %apply long *OUTPUT {long *id}; // Make "result" an output parameter 00056 %apply long long *OUTPUT {long long *size}; // Make "result" an output parameter 00057 %apply long *OUTPUT {long *flags}; // Make "result" an output parameter 00058 %apply long *OUTPUT {long *modtime}; // Make "result" an output parameter 00059 00060 %{ 00061 #include "XrdClient/XrdClientAdmin_c.hh" 00062 %} 00063 00064 #endif 00065 00066 extern "C" { 00067 // Some prototypes to wrap ctor and dtor 00068 // In this version we support only one instance to be handled 00069 // by this wrapper. Supporting more than one instance should be no 00070 // problem. 00071 bool XrdInitialize(const char *url, const char *EnvValues); 00072 bool XrdTerminate(); 00073 00074 // The other functions, slightly modified from the originals 00075 char *XrdSysStatX(const char *paths_list); 00076 00077 char *XrdExistFiles(const char *filepaths); 00078 char *XrdExistDirs(const char *filepaths); 00079 char *XrdIsFileOnline(const char *filepaths); 00080 00081 bool XrdMv(const char *fileSrc, const char *fileDest); 00082 bool XrdMkdir(const char *dir, int user, int group, int other); 00083 bool XrdChmod(const char *file, int user, int group, int other); 00084 bool XrdRm(const char *file); 00085 bool XrdRmdir(const char *path); 00086 bool XrdPrepare(const char *filepaths, unsigned char opts, unsigned char prty); 00087 char *XrdDirList(const char *dir); 00088 char *XrdGetChecksum(const char *path); 00089 char *XrdGetCurrentHost(); 00090 00091 bool XrdStat(const char *fname, long *id, long long *size, long *flags, long *modtime); 00092 }
1.7.6.1