xrootd
XrdOucTList.hh
Go to the documentation of this file.
1 #ifndef __OUC_TLIST__
2 #define __OUC_TLIST__
3 /******************************************************************************/
4 /* */
5 /* X r d O u c T L i s t . h h */
6 /* */
7 /* (c) 2003 by the Board of Trustees of the Leland Stanford, Jr., University */
8 /* All Rights Reserved */
9 /* Produced by Andrew Hanushevsky for Stanford University under contract */
10 /* DE-AC03-76-SFO0515 with the Department of Energy */
11 /******************************************************************************/
12 
13 // $Id$
14 
15 #include <stdlib.h>
16 #include <string.h>
17 #include <strings.h>
18 
20 {
21 public:
22 
24 char *text;
25 union
26 {
27 long long dval;
28 int ival[2];
29 short sval[4];
30 char cval[8];
31 int val;
32 };
33 
34  XrdOucTList(const char *tval, long long *dv,XrdOucTList *np=0)
35  {next=np; text = (tval ? strdup(tval) : 0); dval=*dv;}
36 
37  XrdOucTList(const char *tval=0, int num=0, XrdOucTList *np=0)
38  {next=np; text = (tval ? strdup(tval) : 0); val=num;}
39 
40  XrdOucTList(const char *tval, int iv[2], XrdOucTList *np=0)
41  {next=np; text = (tval ? strdup(tval) : 0);
42  memcpy(sval, iv, sizeof(ival));}
43 
44  XrdOucTList(const char *tval, short sv[4], XrdOucTList *np=0)
45  {next=np; text = (tval ? strdup(tval) : 0);
46  memcpy(sval, sv, sizeof(sval));}
47 
48  XrdOucTList(const char *tval, char cv[8], XrdOucTList *np=0)
49  {text = (tval ? strdup(tval) : 0); next=np;
50  memcpy(cval, cv, sizeof(cval));}
51 
52  ~XrdOucTList() {if (text) free(text);}
53 };
54 
56 {
57 public:
58 
60 
63  while((tp = *Anchor))
64  {*Anchor = tp->next; delete tp;}
65  }
66 };
67 #endif