274{
275
276#ifdef RESOURCE_DEBUG
277 printf(
"feInitResource(config->key: '%s', warn: '%d') : entering ...\n",
config->key, warn);
278#endif
279
281
282
284 {
287 {
288#ifdef RESOURCE_DEBUG
289 printf("feInitResource(config,warn): Found value from env:%s\n", evalue);
290#endif
291 strcpy(value, evalue);
293 ||
296 {
297#ifdef RESOURCE_DEBUG
298 printf(
"feInitResource(config,warn): Set value of config (with key: '%s') to '%s'\n",
config->key, value);
299#endif
302 }
303 }
304 }
305
306 *value = '\0';
307
309 {
311 if (executable !=
NULL)
312 {
313#ifdef RESOURCE_DEBUG
314 printf("exec:%s\n", executable);
315#endif
316 strcpy(value, executable);
317#ifdef RESOURCE_DEBUG
318 printf("value:%s\n", value);
319#endif
321 }
322 }
323
324 else if (
config->id ==
'b')
325 {
327#ifdef RESOURCE_DEBUG
328 printf(
"feInitResource(config,warn): Get '%s' from \"%s\"\n",
config->key, executable);
329#endif
330 if (executable !=
NULL)
331 {
332 strcpy(value, executable);
333 executable = strrchr(value,
DIR_SEP);
334 if (executable !=
NULL) *executable =
'\0';
335 }
336 }
337
338#ifdef RESOURCE_DEBUG
339 printf("value:%s\n", value);
340#endif
341
343 {
345 }
347 {
348 printf(
"Bug >>Wrong Resource Specification of '%s'<< at \"%s:%d\"\n",
config->key,__FILE__,__LINE__);
349
351 }
352
353
356 {
357#ifdef RESOURCE_DEBUG
358 printf(
"feInitResource(config,warn): Set value of '%s' to \"%s\"\n",
config->key, value);
359#endif
362 }
364 {
365
367 if (executable !=
NULL)
368 {
371 {
373#ifdef RESOURCE_DEBUG
374 printf(
"feInitResource(config,warn): Set value of '%s' to \"%s\"\n",
config->key,
config->value);
375#endif
377 }
378 }
379 }
380
381
382
383 if (warn > 0 || (warn < 0 && config->value !=
NULL))
384 {
385 printf(
"// ** Could not get '%s'.\n",
config->key);
386 printf("// ** Either set environment variable '%s' to '%s',\n",
389 printf(
"// ** or make sure that '%s' is at \"%s\"\n",
config->key, value);
390 }
391#ifdef RESOURCE_DEBUG
392 printf(
"feInitResource(config,warn): Set value of '%s' to NULL",
config->key);
393#endif
396}
static char * feSprintf(char *s, const char *fmt, int warn=-1)
static char * feGetExpandedExecutable()
static char * feCleanResourceValue(feResourceType type, char *value)
static int feVerifyResourceValue(feResourceType type, char *value)