• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

XrdOucMsubs.hh

Go to the documentation of this file.
00001 #ifndef __XRDOUCMSUBS_H__
00002 #define __XRDOUCMSUBS_H__
00003 /******************************************************************************/
00004 /*                                                                            */
00005 /*                        X r d O u c M S u b s . h h                         */
00006 /*                                                                            */
00007 /* (c) 2006 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 
00013 //         $Id: XrdOucMsubs.hh,v 1.7 2009/01/16 02:49:54 abh Exp $
00014 
00015 #include <stdlib.h>
00016 
00017 #include "XrdSys/XrdSysError.hh"
00018 #include "XrdOuc/XrdOucEnv.hh"
00019 #include "XrdOuc/XrdOucName2Name.hh"
00020 
00021 /******************************************************************************/
00022 /*      P r e d e f i n e d   E n v i r o n m e n t   V a r i a b l e s       */
00023 /******************************************************************************/
00024 
00025 #define SEC_USER            "sec&user"
00026 #define SEC_HOST            "sec&host"
00027 #define SEC_POLICY          "sec&policy"
00028   
00029 /******************************************************************************/
00030 /*                           X r d O u c M s u b s                            */
00031 /******************************************************************************/
00032   
00033 struct XrdOucMsubsInfo
00034 {
00035 const char      *Tid;       // $TID   or $RID  unless Rid is defined.
00036 XrdOucEnv       *Env;
00037 XrdOucName2Name *N2N;
00038 const char      *lfn;       // $LFN
00039 const char      *lfn2;      // $LFN2  or $NOTIFY
00040 const char      *pfn;       // $PFN
00041 const char      *pfn2;      // $PFN2
00042 const char      *misc;      // $OPTS
00043 const char      *Rid;       // $RID for real
00044 char            *pfnbuff;
00045 char            *rfnbuff;
00046 char            *pfn2buff;
00047 char            *rfn2buff;
00048 mode_t           Mode;      // $FMODE or $PRTY
00049 int              Oflag;     // $OFLAG
00050 char             mbuff[12];
00051 char             obuff[4];
00052 
00053              XrdOucMsubsInfo(const char *tid, XrdOucEnv *envP, 
00054                              XrdOucName2Name *n2np,
00055                              const char *lfnP, const char *lfn2P,
00056                              mode_t mode=0,    int ofl=0,
00057                              const char *Opts=0, const char *ridP=0,
00058                              const char *pfnP=0, const char *pfn2P=0)
00059                             : Tid(tid), Env(envP), N2N(n2np),
00060                               lfn(lfnP), lfn2(lfn2P), pfn(pfnP), pfn2(pfn2P),
00061                               misc(Opts), Rid(ridP), Mode(mode), Oflag(ofl)
00062                               {pfnbuff = rfnbuff = pfn2buff = rfn2buff = 0;}
00063             ~XrdOucMsubsInfo(){if (pfnbuff ) free(pfnbuff);
00064                                if (rfnbuff ) free(rfnbuff);
00065                                if (pfn2buff) free(pfn2buff);
00066                                if (rfn2buff) free(rfn2buff);
00067                               }
00068 };
00069   
00070 class XrdOucMsubs
00071 {
00072 public:
00073 
00074 static const int maxElem = 32;
00075 
00076 int   Parse(const char *oname, char *msg);
00077 
00078 int   Subs(XrdOucMsubsInfo &Info, char **Data, int *Dlen);
00079 
00080       XrdOucMsubs(XrdSysError *errp);
00081      ~XrdOucMsubs();
00082 
00083 private:
00084 char *getVal(XrdOucMsubsInfo &Info, int vNum);
00085 
00086 enum vNum {vLFN =  1, vPFN =  2, vRFN =  3, vLFN2 =  4, vPFN2 =  5, vRFN2 =  6,
00087            vFM  =  7, vOFL =  8, vUSR =  9, vHST  = 10, vTID  = 11,
00088            vNFY = 12, vOPT = 13, vPTY = 14, vRID  = 15, vCGI  = 16};
00089 
00090 static const int   vMax = 17;
00091 static const char *vName[vMax];
00092 
00093 XrdSysError *eDest;
00094 char        *mText;
00095 char        *mData[maxElem+1];
00096 int          mDlen[maxElem+1];
00097 int          numElem;
00098 };
00099 #endif

Generated on Wed Sep 1 2010 for xrootd by  doxygen 1.7.1