#include <XrdOucVerName.hh>
|
static int | hasVersion (const char *piPath, char **piNoVN=0) |
|
static int | Version (const char *piVers, const char *piPath, bool &noFBK, char *buff, int blen) |
|
XrdOucVerName
This class performs name versioning for shared library plug-ins.
Definition at line 38 of file XrdOucVerName.hh.
◆ hasVersion()
int XrdOucVerName::hasVersion |
( |
const char * |
piPath, |
|
|
char ** |
piNoVN = 0 |
|
) |
| |
|
static |
Test if plugin path contains a version number.
- Parameters
-
piPath | Pointer to the original path to the plug-in. |
piNoVN | != 0: If piPath has a version, an strdup'd path without a version is returned. Otherwise, nil is returned. == 0: Does not return an alternate path. |
- Returns
- >0 the version number if path contains a version.
-
=0 the path does not contain a version number.
Definition at line 52 of file XrdOucVerName.cc.
60 if ((Dash = rindex(piPath,
'-')))
62 int vn = strtol(Dash+1, &endP, 10);
63 if (vn && !strcmp(endP,
".so"))
66 snprintf(buff,
sizeof(buff),
"%.*s%s",
int(Dash-piPath),piPath,endP);
67 if (isOurs(buff)) *piNoVN = strdup(buff);
73 if (piNoVN) *piNoVN = 0;
◆ Version()
int XrdOucVerName::Version |
( |
const char * |
piVers, |
|
|
const char * |
piPath, |
|
|
bool & |
noFBK, |
|
|
char * |
buff, |
|
|
int |
blen |
|
) |
| |
|
static |
Version a plug-in library path.
- Parameters
-
piVers | Pointer to the version string to be used. |
piPath | Pointer to the original path to the plug-in. |
noFBK | Upon return is set to true if the versioned name has no fallback name and must be loaded with the resulting path. |
buff | Pointer to abuffer that will hold the resulting path. |
blen | The size of the buffer. |
- Returns
- success The length of the reulting path in buff withe eqName set.
-
failure Zero (buffer is too small) but eqName is still set.
Definition at line 96 of file XrdOucVerName.cc.
99 const char *Dot, *Slash, *fName;
104 if ((Slash = rindex(piPath,
'/')))
105 {pLen = Slash-piPath+1; Dot = rindex(Slash+1,
'.'); fName = Slash+1;}
106 else {pLen = 0; Dot = rindex(piPath,
'.'); fName = piPath;}
107 if (Dot) pLen += Dot-fName;
108 else {pLen += strlen(fName); Dot =
"";}
113 while(StrictName[n] && strcmp(fName, StrictName[n])) n++;
114 noFBK = (StrictName[n] != 0);
118 n = snprintf(buff, blen-1,
"%.*s-%s%s", pLen, piPath, piVers, Dot);
122 return (n < blen ? n : 0);
Referenced by XrdOucPinPath(), and XrdOucPreload().
The documentation for this class was generated from the following files: