XRootD
Loading...
Searching...
No Matches
XrdPinls.cc File Reference
#include <cctype>
#include <iostream>
#include <map>
#include <cstdio>
#include <cstring>
#include "XrdVersionPlugin.hh"
Include dependency graph for XrdPinls.cc:

Go to the source code of this file.

Functions

void Display (const char *drctv, XrdVersionPlugin *vP)
int main (int argc, char *argv[])

Function Documentation

◆ Display()

void Display ( const char * drctv,
XrdVersionPlugin * vP )

Definition at line 67 of file XrdPinls.cc.

68{
69 const char *vType = "Unknown";
70 char buff[80];
71
72// First determine what kind of rule this is
73//
74 if (vP->vProcess == XrdVERSIONPLUGIN_DoNotChk) vType = "Untested";
75 else if (vP->vProcess == XrdVERSIONPLUGIN_Optional) vType = "Optional";
76 else if (vP->vProcess == XrdVERSIONPLUGIN_Required) vType = "Required";
77
78// Establish minimum version
79//
80 if (vP->vMinLow < 0) snprintf(buff, sizeof(buff), "%2d.x ", vP->vMajLow);
81 else snprintf(buff, sizeof(buff), "%2d.%-2d", vP->vMajLow, vP->vMinLow);
82
83// Output the line
84//
85 std::cout <<vType <<" >= "<<buff <<' ' <<drctv <<std::endl;
86}
#define XrdVERSIONPLUGIN_Optional
int vProcess
version: <0 skip, =0 optional, >0 required
#define XrdVERSIONPLUGIN_DoNotChk
#define XrdVERSIONPLUGIN_Required
short vMajLow
Lowest compatible major version number.
short vMinLow
Lowest compatible minor (< 0 don't check).

References XrdVersionPlugin::vMajLow, XrdVersionPlugin::vMinLow, XrdVersionPlugin::vProcess, XrdVERSIONPLUGIN_DoNotChk, XrdVERSIONPLUGIN_Optional, and XrdVERSIONPLUGIN_Required.

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 92 of file XrdPinls.cc.

93{
96 std::map<const char *, XrdVersionPlugin*, cmp_str> vRules;
97 std::map<const char *, XrdVersionPlugin*, cmp_str> dRules;
98 std::map<const char *, XrdVersionPlugin*, cmp_str>::iterator itD, itV;
99 int i;
100
101// Map all of plugin rules by plugin object creator
102//
103 i = 0;
104 while(vInfo[i].pName)
105 {vRules[vInfo[i].pName] = &vInfo[i];
106 i++;
107 }
108
109// Now for each directive, find the matching rule
110//
111 i = 0;
112 while(dInfo[i].dName)
113 {itV = vRules.find(dInfo[i].pName);
114 dRules[dInfo[i].dName] = (itV != dRules.end() ? itV->second : 0);
115 i++;
116 }
117
118// Now display the results
119//
120 for (itD = dRules.begin(); itD != dRules.end(); itD++)
121 {if (itD->second) Display(itD->first, itD->second);
122 else std::cout <<"No version rule present for " <<itD->first
123 <<std::endl;
124 }
125
126// All done
127//
128 return(0);
129}
void Display()
Definition XrdCks.cc:56
#define XrdVERSIONPLUGINRULES
const char * dName
-> plugin directive name
const char * pName
-> plugin object creator function name
#define XrdVERSIONPLUGINMAPD2P

References Display(), XrdVersionMapD2P::dName, XrdVersionPlugin::pName, XrdVERSIONPLUGINMAPD2P, and XrdVERSIONPLUGINRULES.

Here is the call graph for this function: