249{
250
251#ifdef RESOURCE_DEBUG
252 printf(
"feInitResource(config->key: '%s', warn: '%d') : entering ...\n",
config->key, warn);
253#endif
254
256
257
259 {
262 {
263#ifdef RESOURCE_DEBUG
264 printf("feInitResource(config,warn): Found value from env:%s\n", evalue);
265#endif
266 strcpy(value, evalue);
268 ||
271 {
272#ifdef RESOURCE_DEBUG
273 printf(
"feInitResource(config,warn): Set value of config (with key: '%s') to '%s'\n",
config->key, value);
274#endif
277 }
278 }
279 }
280
281 *value = '\0';
282
284 {
286 if (executable !=
NULL)
287 {
288#ifdef RESOURCE_DEBUG
289 printf("exec:%s\n", executable);
290#endif
291 strcpy(value, executable);
292#ifdef RESOURCE_DEBUG
293 printf("value:%s\n", value);
294#endif
296 }
297 }
298
299 else if (
config->id ==
'b')
300 {
302#ifdef RESOURCE_DEBUG
303 printf(
"feInitResource(config,warn): Get '%s' from \"%s\"\n",
config->key, executable);
304#endif
305 if (executable !=
NULL)
306 {
307 strcpy(value, executable);
308 executable = strrchr(value,
DIR_SEP);
309 if (executable !=
NULL) *executable =
'\0';
310 }
311 }
312
313#ifdef RESOURCE_DEBUG
314 printf("value:%s\n", value);
315#endif
316
318 {
320 }
322 {
323 printf(
"Bug >>Wrong Resource Specification of '%s'<< at \"%s:%d\"\n",
config->key,__FILE__,__LINE__);
324
326 }
327
328
331 {
332#ifdef RESOURCE_DEBUG
333 printf(
"feInitResource(config,warn): Set value of '%s' to \"%s\"\n",
config->key, value);
334#endif
337 }
339 {
340
342 if (executable !=
NULL)
343 {
346 {
348#ifdef RESOURCE_DEBUG
349 printf(
"feInitResource(config,warn): Set value of '%s' to \"%s\"\n",
config->key,
config->value);
350#endif
352 }
353 }
354 }
355
356
357
358 if (warn > 0 || (warn < 0 && config->value !=
NULL))
359 {
360 printf(
"// ** Could not get '%s'.\n",
config->key);
361 printf("// ** Either set environment variable '%s' to '%s',\n",
364 printf(
"// ** or make sure that '%s' is at \"%s\"\n",
config->key, value);
365 }
366#ifdef RESOURCE_DEBUG
367 printf(
"feInitResource(config,warn): Set value of '%s' to NULL",
config->key);
368#endif
371}
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)