252{
253
254#ifdef RESOURCE_DEBUG
255 printf(
"feInitResource(config->key: '%s', warn: '%d') : entering ...\n",
config->key, warn);
256#endif
257
259
260
262 {
265 {
266#ifdef RESOURCE_DEBUG
267 printf("feInitResource(config,warn): Found value from env:%s\n", evalue);
268#endif
269 strcpy(value, evalue);
271 ||
274 {
275#ifdef RESOURCE_DEBUG
276 printf(
"feInitResource(config,warn): Set value of config (with key: '%s') to '%s'\n",
config->key, value);
277#endif
280 }
281 }
282 }
283
284 *value = '\0';
285
287 {
289 if (executable !=
NULL)
290 {
291#ifdef RESOURCE_DEBUG
292 printf("exec:%s\n", executable);
293#endif
294 strcpy(value, executable);
295#ifdef RESOURCE_DEBUG
296 printf("value:%s\n", value);
297#endif
299 }
300 }
301
302 else if (
config->id ==
'b')
303 {
305#ifdef RESOURCE_DEBUG
306 printf(
"feInitResource(config,warn): Get '%s' from \"%s\"\n",
config->key, executable);
307#endif
308 if (executable !=
NULL)
309 {
310 strcpy(value, executable);
311 executable = strrchr(value,
DIR_SEP);
312 if (executable !=
NULL) *executable =
'\0';
313 }
314 }
315
316#ifdef RESOURCE_DEBUG
317 printf("value:%s\n", value);
318#endif
319
321 {
323 }
325 {
326 printf(
"Bug >>Wrong Resource Specification of '%s'<< at \"%s:%d\"\n",
config->key,__FILE__,__LINE__);
327
329 }
330
331
334 {
335#ifdef RESOURCE_DEBUG
336 printf(
"feInitResource(config,warn): Set value of '%s' to \"%s\"\n",
config->key, value);
337#endif
340 }
342 {
343
345 if (executable !=
NULL)
346 {
349 {
351#ifdef RESOURCE_DEBUG
352 printf(
"feInitResource(config,warn): Set value of '%s' to \"%s\"\n",
config->key,
config->value);
353#endif
355 }
356 }
357 }
358
359
360
361 if (warn > 0 || (warn < 0 && config->value !=
NULL))
362 {
363 printf(
"// ** Could not get '%s'.\n",
config->key);
364 printf("// ** Either set environment variable '%s' to '%s',\n",
367 printf(
"// ** or make sure that '%s' is at \"%s\"\n",
config->key, value);
368 }
369#ifdef RESOURCE_DEBUG
370 printf(
"feInitResource(config,warn): Set value of '%s' to NULL",
config->key);
371#endif
374}
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)