#include <algorithm>
#include <cerrno>
#include <cstdio>
#include <string>
#include <cstring>
#include <unistd.h>
#include "XrdVersion.hh"
#include "XrdOuc/XrdOucName2Name.hh"
#include "XrdOuc/XrdOucTokenizer.hh"
#include "XrdSys/XrdSysError.hh"
Go to the source code of this file.
◆ XrdOucgetName2Name()
Definition at line 197 of file XrdOucN2No2p.cc.
199 struct bHelper {
char *p; bHelper(
const char *bP) : p(bP ? strdup(bP) : 0) {}
200 ~bHelper() {
if (p) free(p);}
213 while((val = toks.GetToken()) && *val)
214 {
if (!strcmp(val,
"-slash"))
215 {
if (!(val = toks.GetToken()) || !(*val))
216 {
eDest->
Emsg(
"N2No2p",
"-slash argument not specified.");
219 if (strlen(val) == 1) {sChar = *val;
continue;}
220 n = strtol(val, &eP, 16);
222 {
eDest->
Emsg(
"N2No2p",
"Invalid -slash argument -",val);
225 sChar =
static_cast<char>(n);
227 else if (!strcmp(val,
"-maxfnlen"))
228 {
if (!(val = toks.GetToken()) || !(*val))
229 {
eDest->
Emsg(
"N2No2p",
"-maxfnlen argument not specified.");
232 fnMax = strtol(val, &eP, 16);
233 if (fnMax <= 0 || *eP)
234 {
eDest->
Emsg(
"N2No2p",
"Invalid -maxfnlen argument -",val);
243 if (!val || !(*val)) oPfx =
"/";
244 else {
if (*val !=
'/')
245 {
eDest->
Emsg(
"N2No2p",
"Invalid object ID path prefix -", val);
250 if (val[n-1] !=
'/') {ostr = val; ostr +=
'/'; oPfx = ostr.c_str();}
256 if ((fnMax =
pathconf(
"/", _PC_NAME_MAX)) < 0)
257 {
eDest->
Emsg(
"N2No2p", errno,
"determine -fnmaxlen for '/'; using 255.");
static XrdSysError eDest(0,"crypto_")
long pathconf(const char *path, int name)
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)
References eDest, XrdSysError::Emsg(), XrdOucTokenizer::GetLine(), XrdOucTokenizer::GetToken(), and pathconf().
Referenced by XrdOucN2NLoader::Load().
◆ XrdOucHashVal2()
unsigned long XrdOucHashVal2 |
( |
const char * |
KeyVal, |
|
|
int |
KeyLen |
|
) |
| |
Definition at line 40 of file XrdOucHashVal.cc.
42 unsigned long *lp, lword, hval = 0;
43 int hl =
sizeof(hval);
48 {memcpy(&hval, KeyVal, (
size_t)KeyLen);
55 j = KeyLen % hl; KeyLen /= hl;
57 {memcpy(&lword, KeyVal, (
size_t)hl);
60 lp = (
unsigned long *)&KeyVal[j];
65 {memcpy(&lword, lp++, (
size_t)hl);
68 return (hval ? hval : 1);
Referenced by XrdOucN2No2p::pfn2lfn(), and XrdOucHashVal().
◆ XrdVERSIONINFO()