NAME
read_dbl_from_config_file - Reads a number from a config file
SYNOPSIS
#include "l/l_config.h"
Example compile flags (system dependent):
-DLINUX_X86_64 -DLINUX_X86_64_OPTERON -DGNU_COMPILER
-I/home/kobus/include
-L/home/kobus/misc/load/linux_x86_64_opteron -L/usr/lib/x86_64-linux-gnu
-lKJB -lfftw3 -lgsl -lgslcblas -ljpeg -lSVM -lstdc++ -lpthread -lSLATEC -lg2c -lacml -lacml_mv -lblas -lg2c -lncursesw
int read_dbl_from_config_file
(
double *value_ptr,
const char *env_var,
const char *sub_dir,
const char *file_name,
const char *message_name,
char *config_file_name,
size_t config_file_name_size
);
DESCRIPTION
This routine reads a number from a configuration file, checking several
possible locations for the file. If the parameter "env_var" is not NULL, then
it first tries using this string as the configuration file name. Next it
looks for "file_name" in the current directory, then the user's home
directory, and, depending on how the library was built, then a "shared"
home directory and/or the programmer's home directory, and/or other
locations. See open_config_file for more details on the search locations.
If the parameter sub_dir is not null, then it is used as a subdirectory for
all search locations other than one in the env_var variable (if not NULL),
and the current directory.
The parameter message_name can be used to specify a name for the
configuration file to be used in error and verbose output messages. If
message_name is NULL, then "configuration" is used.
If the buffer config_file_name is not NULL, then the file name actually used
is copied into it. If it is used, then its size must be passed in via
config_file_name_size;
If file_name is the special name "off" (or "none" or "0"), then the above
does not apply. In this case, *value_ptr is set to DBL_NOT_SET, which is
guaranteed to be negative.
The file name actually used is put into the buffer config_file_name whose
size must be passed in via max_len;
The result is put into *value_ptr.
RETURNS
Either NO_ERROR, or ERROR, with an appropriate error message being set.
DISCLAIMER
This software is not adequatedly tested. It is recomended that
results are checked independantly where appropriate.
AUTHOR
Kobus Barnard
DOCUMENTER
Kobus Barnard
SEE ALSO
check_config_sub_dir
,
open_config_file
,
get_config_file