DELETED build/test.conf Index: build/test.conf ================================================================== --- build/test.conf +++ /dev/null @@ -1,14 +0,0 @@ - - -
- test Bob was here -
- - - Free yes, no - - -# -# - -sally 3 Index: config.h.in ================================================================== --- config.h.in +++ config.h.in @@ -51,10 +51,13 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strsep' function. */ #undef HAVE_STRSEP + +/* Define to 1 if you have the `strtof' function. */ +#undef HAVE_STRTOF /* Define to 1 if you have the `strtoll' function. */ #undef HAVE_STRTOLL /* Define to 1 if you have the header file. */ Index: configure ================================================================== --- configure +++ configure @@ -1,9 +1,9 @@ #! /bin/sh # From configure.ac Revision . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for libconfig 0.2.3. +# Generated by GNU Autoconf 2.59 for libconfig 0.2.4. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -266,12 +266,12 @@ : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='libconfig' PACKAGE_TARNAME='libconfig' -PACKAGE_VERSION='0.2.3' -PACKAGE_STRING='libconfig 0.2.3' +PACKAGE_VERSION='0.2.4' +PACKAGE_STRING='libconfig 0.2.4' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include @@ -776,11 +776,11 @@ # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libconfig 0.2.3 to adapt to many kinds of systems. +\`configure' configures libconfig 0.2.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. @@ -837,11 +837,11 @@ _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libconfig 0.2.3:";; + short | recursive ) echo "Configuration of libconfig 0.2.4:";; esac cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) @@ -958,11 +958,11 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -libconfig configure 0.2.3 +libconfig configure 0.2.4 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. @@ -972,11 +972,11 @@ exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libconfig $as_me 0.2.3, which was +It was created by libconfig $as_me 0.2.4, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF @@ -16979,11 +16979,12 @@ fi done -for ac_func in getpwuid + +for ac_func in getpwuid strtof do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then @@ -17452,11 +17453,11 @@ ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by libconfig $as_me 0.2.3, which was +This file was extended by libconfig $as_me 0.2.4, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -17512,11 +17513,11 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -libconfig config.status 0.2.3 +libconfig config.status 0.2.4 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -1,7 +1,7 @@ AC_REVISION($Revision $) -AC_INIT(libconfig, 0.2.3) +AC_INIT(libconfig, 0.2.4) AC_CONFIG_HEADER(config.h) dnl Find out about the host OS DC_CHK_OS_INFO @@ -37,11 +37,11 @@ AC_CHECK_HEADERS(ctype.h dirent.h pwd.h stdio.h stdlib.h string.h sys/stat.h sys/time.h sys/types.h time.h unistd.h netdb.h netinet/in.h) AC_HEADER_TIME AC_REPLACE_FUNCS(strsep strtoll getuid) -AC_CHECK_FUNCS(getpwuid) +AC_CHECK_FUNCS(getpwuid strtof) dnl This MUST be last. DC_SYNC_SHLIBOBJS AC_OUTPUT(Makefile lc_geterrno.3 lc_process.3 lc_register_var.3 lc_geterrstr.3 lc_seterrstr.3 lc_register_callback.3 lc_cleanup.3 lc_process_file.3 libconfig.3 lc_handle_type.3) Index: lc_register_var.3.in ================================================================== --- lc_register_var.3.in +++ lc_register_var.3.in @@ -44,10 +44,16 @@ For a "int" integer type variable. The data passed should be of type "int *". .TP LC_VAR_SHORT For a "short" integer type variable. The data passed should be of type "short *". .TP +LC_VAR_FLOAT +For a "float" floating point type variable. The data passed should be of type "float *". +.TP +LC_VAR_DOUBLE +For a "double" floating point type variable. The data passed should be of type "double *". +.TP LC_VAR_BOOL For a boolean type variable. The data passed should be of type "int *". When a true value is specified the variable is set to 1. When a false value is specified the variable is set to 0. Any other value sets the variable to -1. Valid true values are: enable, true, yes, on, y, and 1. Valid false values are: disable, false, off, no, n, and 0. .TP LC_VAR_FILENAME Not implemented. Index: libconfig.c ================================================================== --- libconfig.c +++ libconfig.c @@ -330,10 +330,27 @@ static int lc_process_var_sizesizet(size_t *data, const char *value, const char **endptr) { *data = lc_process_size(value, endptr); return(0); } + +static int lc_process_var_float(float *data, const char *value, const char **endptr) { +#ifdef HAVE_STRTOF + *data = strtof(value, endptr); +#else + *data = strtod(value, endptr); +#endif + + return(0); +} + +static int lc_process_var_double(float *data, const char *value, const char **endptr) { + *data = strtod(value, endptr); + + return(0); +} + int lc_handle_type(lc_var_type_t type, const char *value, void *data) { const char *next; int is_list; @@ -400,10 +417,16 @@ return(lc_process_var_hostname6(data, value, &next)); break; case LC_VAR_CIDR: return(lc_process_var_cidr(data, value, &next)); break; + case LC_VAR_DOUBLE: + return(lc_process_var_double(data, value, &next)); + break; + case LC_VAR_FLOAT: + return(lc_process_var_float(data, value, &next)); + break; case LC_VAR_TIME: case LC_VAR_DATE: case LC_VAR_FILENAME: case LC_VAR_DIRECTORY: #ifdef DEBUG Index: libconfig.h.in ================================================================== --- libconfig.h.in +++ libconfig.h.in @@ -47,10 +47,12 @@ LC_VAR_ADDR4, LC_VAR_ADDR6, LC_VAR_HOSTNAME, LC_VAR_HOSTNAME4, LC_VAR_HOSTNAME6, + LC_VAR_DOUBLE, + LC_VAR_FLOAT, LC_VAR_LIST = 0x80 } lc_var_type_t; __BLANK_LINE__ ADDED test.conf Index: test.conf ================================================================== --- /dev/null +++ test.conf @@ -0,0 +1,14 @@ + + +
+ test Bob was here +
+ + + Free yes, no + + +# +# + +sally 3