150 XrdOucStream Config(gcP->eDest, getenv(
"XRDINSTANCE"), &myEnv,
"=====> ");
153 char *var, drctv[64], body[4096];
155 bool trim =
false, addKey =
true;
159 if (!(gcP->Match))
return 0;
166 gcP->Tokenizer.Attach(0);
171 if ( (cfgFD =
open(cfname, O_RDONLY, 0)) < 0)
173 if (gcP->eDest) gcP->eDest->Emsg(
"Gcf", rc,
"open config file", cfname);
179 Config.Attach(cfgFD, 4096);
181 if (parms && *parms) theGrab = parms;
186 {
case full_lines: *drctv =
'\n';
trim =
false; addKey =
true;
break;
187 case trim_lines: *drctv =
'\n';
trim =
true; addKey =
true;
break;
188 case only_body: *drctv =
' ';
trim =
false; addKey =
false;
break;
189 case trim_body: *drctv =
' ';
trim =
true; addKey =
true;
break;
190 default:
break;
return 0;
196 while((var = Config.GetMyFirstWord()))
198 while(tP && ((tP->val && strncmp(var, tP->
text, tP->val)) ||
199 (!tP->val && strcmp( var, tP->
text)))) tP = tP->
next;
204 {
char *dot = index(var,
'.');
205 if (dot && *(dot+1)) var = dot+1;
207 int n = snprintf(drctv+1,
sizeof(drctv)-1,
"%s ", var);
208 if (n >= (
int)
sizeof(drctv)-1)
209 {
if (gcP->eDest) gcP->eDest->Emsg(
"Gcf", E2BIG,
"handle", var);
214 if (!Config.GetRest(body,
sizeof(body)))
215 {
if (gcP->eDest) gcP->eDest->Emsg(
"Gcf", E2BIG,
"handle arguments");
228 if ((rc = Config.LastError()))
229 {
if (gcP->eDest) gcP->eDest->Emsg(
"Gcf", rc,
"read config file", cfname);
230 return (rc < 0 ? rc : -rc);
236 if ((n = theGrab.
length()) <= 1) n = 0;
237 else {gcP->gBuff = (
char *)malloc(n);
238 strcpy(gcP->gBuff, theGrab.
c_str()+1);
239 gcP->Tokenizer.Attach(gcP->gBuff);
void MsgW(const char *txt1, const char *txt2=0, const char *txt3=0, const char *txt4=0, const char *txt5=0, const char *txt6=0)
void MsgE(const char *txt1, const char *txt2=0, const char *txt3=0, const char *txt4=0, const char *txt5=0, const char *txt6=0)
void Say(const char *text1, const char *text2=0, const char *txt3=0, const char *text4=0, const char *text5=0, const char *txt6=0)