260{
261
262#ifdef RESOURCE_DEBUG
263 printf(
"feInitResource(config->key: '%s', warn: '%d') : entering ...\n",
config->key, warn);
264#endif
265
267
268
270 {
273 {
274#ifdef RESOURCE_DEBUG
275 printf("feInitResource(config,warn): Found value from env:%s\n", evalue);
276#endif
277 strcpy(value, evalue);
279 ||
282 {
283#ifdef RESOURCE_DEBUG
284 printf(
"feInitResource(config,warn): Set value of config (with key: '%s') to '%s'\n",
config->key, value);
285#endif
288 }
289 }
290 }
291
292 *value = '\0';
293
295 {
297 if (executable !=
NULL)
298 {
299#ifdef RESOURCE_DEBUG
300 printf("exec:%s\n", executable);
301#endif
302 strcpy(value, executable);
303#ifdef RESOURCE_DEBUG
304 printf("value:%s\n", value);
305#endif
307 }
308 }
309
310 else if (
config->id ==
'b')
311 {
313#ifdef RESOURCE_DEBUG
314 printf(
"feInitResource(config,warn): Get '%s' from \"%s\"\n",
config->key, executable);
315#endif
316 if (executable !=
NULL)
317 {
318 strcpy(value, executable);
319 executable = strrchr(value,
DIR_SEP);
320 if (executable !=
NULL) *executable =
'\0';
321 }
322 }
323
324#ifdef RESOURCE_DEBUG
325 printf("value:%s\n", value);
326#endif
327
329 {
331 }
333 {
334 printf(
"Bug >>Wrong Resource Specification of '%s'<< at \"%s:%d\"\n",
config->key,__FILE__,__LINE__);
335
337 }
338
339
342 {
343#ifdef RESOURCE_DEBUG
344 printf(
"feInitResource(config,warn): Set value of '%s' to \"%s\"\n",
config->key, value);
345#endif
348 }
350 {
351
353 if (executable !=
NULL)
354 {
357 {
359#ifdef RESOURCE_DEBUG
360 printf(
"feInitResource(config,warn): Set value of '%s' to \"%s\"\n",
config->key,
config->value);
361#endif
363 }
364 }
365 }
366
367
368
369 if (warn > 0 || (warn < 0 && config->value !=
NULL))
370 {
371 printf(
"// ** Could not get '%s'.\n",
config->key);
372 printf("// ** Either set environment variable '%s' to '%s',\n",
375 printf(
"// ** or make sure that '%s' is at \"%s\"\n",
config->key, value);
376 }
377#ifdef RESOURCE_DEBUG
378 printf(
"feInitResource(config,warn): Set value of '%s' to NULL",
config->key);
379#endif
382}
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)