148 XrdOucStream Config(gcP->eDest, getenv(
"XRDINSTANCE"), &myEnv,
"=====> ");
151 char *var, drctv[64], body[4096];
153 bool trim =
false, addKey =
true;
157 if (!(gcP->Match))
return 0;
164 gcP->Tokenizer.Attach(0);
169 if ( (cfgFD =
open(cfname, O_RDONLY, 0)) < 0)
171 if (gcP->eDest) gcP->eDest->Emsg(
"Gcf", rc,
"open config file", cfname);
177 Config.Attach(cfgFD, 4096);
179 if (parms && *parms) theGrab = parms;
184 {
case full_lines: *drctv =
'\n';
trim =
false; addKey =
true;
break;
185 case trim_lines: *drctv =
'\n';
trim =
true; addKey =
true;
break;
186 case only_body: *drctv =
' ';
trim =
false; addKey =
false;
break;
187 case trim_body: *drctv =
' ';
trim =
true; addKey =
true;
break;
188 default:
break;
return 0;
194 while((var = Config.GetMyFirstWord()))
196 while(tP && ((tP->val && strncmp(var, tP->
text, tP->val)) ||
197 (!tP->val && strcmp( var, tP->
text)))) tP = tP->
next;
202 {
char *dot = index(var,
'.');
203 if (dot && *(dot+1)) var = dot+1;
205 int n = snprintf(drctv+1,
sizeof(drctv)-1,
"%s ", var);
206 if (n >= (
int)
sizeof(drctv)-1)
207 {
if (gcP->eDest) gcP->eDest->Emsg(
"Gcf", E2BIG,
"handle", var);
212 if (!Config.GetRest(body,
sizeof(body)))
213 {
if (gcP->eDest) gcP->eDest->Emsg(
"Gcf", E2BIG,
"handle arguments");
226 if ((rc = Config.LastError()))
227 {
if (gcP->eDest) gcP->eDest->Emsg(
"Gcf", rc,
"read config file", cfname);
228 return (rc < 0 ? rc : -rc);
234 if ((n = theGrab.
length()) <= 1) n = 0;
235 else {gcP->gBuff = (
char *)malloc(n);
236 strcpy(gcP->gBuff, theGrab.
c_str()+1);
237 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)