Index: .cvsignore ================================================================== --- .cvsignore +++ .cvsignore @@ -12,5 +12,11 @@ lc_register_var.3 lc_register_callback.3 lc_process.3 lc_geterrno.3 libconfig.3 +libconfig.dll.a +test-lc.exe +lc_process_file.3 +lc_cleanup.3 +libconfig.dll.def +libconfig.dll Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -6,27 +6,39 @@ config.h/* config.log config.log/* config.status config.status/* +lc_cleanup.3 +lc_cleanup.3/* lc_geterrno.3 lc_geterrno.3/* lc_geterrstr.3 lc_geterrstr.3/* lc_process.3 lc_process.3/* +lc_process_file.3 +lc_process_file.3/* lc_register_callback.3 lc_register_callback.3/* lc_register_var.3 lc_register_var.3/* libconfig.3 libconfig.3/* libconfig.a libconfig.a/* +libconfig.dll +libconfig.dll.a +libconfig.dll.a/* +libconfig.dll.def +libconfig.dll.def/* +libconfig.dll/* libconfig.h libconfig.h/* libconfig.so libconfig.so/* test-lc +test-lc.exe +test-lc.exe/* test-lc/* test.cfg test.cfg/* Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -33,14 +33,14 @@ OBJS = libconfig.o conf_space.o conf_section.o conf_apache.o conf_colon.o conf_equal.o conf_xml.o @LIBOBJS@ SHOBJS = libconfig_shr.o conf_space_shr.o conf_section_shr.o conf_apache_shr.o conf_colon_shr.o conf_equal_shr.o conf_xml_shr.o @SHLIBOBJS@ all: $(LIBS) $(BINS) libconfig.$(SHOBJEXT): $(SHOBJS) - $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(SHOBJFLAGS) $(SHOBJLDFLAGS) -o $@ $? + $(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) $(SHOBJLDFLAGS) -o $@ $^ $(LDFLAGS) libconfig.$(AREXT): $(OBJS) - $(AR) rcu $@ $? + $(AR) rcu $@ $^ -$(RANLIB) $@ libconfig.o: libconfig.c compat.h win32.h config.h libconfig.h libconfig_shr.o: libconfig.c compat.h win32.h config.h libconfig.h $(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) -c -o $@ libconfig.c @@ -49,25 +49,27 @@ $(CC) $(CPPFLAGS) $(CFLAGS) $(SHOBJFLAGS) -c -o $@ $? libconfig.h: libconfig.h.in cat $? | $(CPP) $(CPPFLAGS) - | grep -v '^#' | grep -v '^ *$$' | sed 's/^!/# /g;s/__BLANK_LINE__//' > $@ -test-lc: $(LIBS) test-lc.c - $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(filter %.c, $?) $(LDFLAGS) -Wl,-R -Wl,. -L. -lconfig +test-lc$(EXEEXT): $(LIBS) test-lc.c + $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $(filter %.c, $^) $(LDFLAGS) -Wl,-R -Wl,. -L. -lconfig .PHONY: clean distclean install clean: - rm -f *.o $(BINS) $(LIBS) libconfig.h *~ test-lc *.dll.a *.dll.def *.dll + rm -f *.o $(BINS) $(LIBS) libconfig.h *~ test-lc$(EXEEXT) *.dll.a *.dll.def *.dll distclean: clean rm -f Makefile config.h config.status config.log lc_geterrno.3 lc_process.3 lc_cleanup.3 lc_process_file.3 lc_register_var.3 lc_geterrstr.3 lc_register_callback.3 libconfig.3 install: all libconfig.h -$(INSTALL) -d $(mandir) -$(INSTALL) -d $(mandir)/man3 -$(INSTALL) -d $(libdir) -$(INSTALL) -d $(includedir) + -$(INSTALL) -m 644 libconfig.$(SHOBJEXT).def $(libdir)/libconfig.$(SHOBJEXT).def + -$(INSTALL) -m 644 libconfig.$(SHOBJEXT).a $(libdir)/libconfig.$(SHOBJEXT).a $(INSTALL) -m 755 libconfig.$(SHOBJEXT) $(libdir)/libconfig.$(SHOBJEXT).$(PKGVERS) $(INSTALL) -m 644 libconfig.$(AREXT) $(libdir)/libconfig.$(AREXT) $(INSTALL) -m 644 lc_register_callback.3 $(mandir)/man3/lc_register_callback.3 $(INSTALL) -m 644 lc_register_var.3 $(mandir)/man3/lc_register_var.3 $(INSTALL) -m 644 lc_process_file.3 $(mandir)/man3/lc_process_file.3 Index: build/build_win32.sh ================================================================== --- build/build_win32.sh +++ build/build_win32.sh @@ -10,7 +10,7 @@ if [ ! -z "${CROSS}" ]; then CROSSCMD="${CROSS}-" fi export CFLAGS LDFLAGS CPPFLAGS make distclean -./configure --host=${CROSS} && \ +./configure --host=${CROSS} --prefix=${HOME}/root/windows-i386/ --with-libopennet=${HOME}/root/windows-i386/ && \ make || exit 1 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.1.7. +# Generated by GNU Autoconf 2.59 for libconfig 0.1.8. # # 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.1.7' -PACKAGE_STRING='libconfig 0.1.7' +PACKAGE_VERSION='0.1.8' +PACKAGE_STRING='libconfig 0.1.8' 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.1.7 to adapt to many kinds of systems. +\`configure' configures libconfig 0.1.8 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.1.7:";; + short | recursive ) echo "Configuration of libconfig 0.1.8:";; esac cat <<\_ACEOF Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -953,11 +953,11 @@ fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -libconfig configure 0.1.7 +libconfig configure 0.1.8 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. @@ -967,11 +967,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.1.7, which was +It was created by libconfig $as_me 0.1.8, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF @@ -17208,11 +17208,11 @@ ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF -This file was extended by libconfig $as_me 0.1.7, which was +This file was extended by libconfig $as_me 0.1.8, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -17268,11 +17268,11 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -libconfig config.status 0.1.7 +libconfig config.status 0.1.8 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.1.7) +AC_INIT(libconfig, 0.1.8) AC_CONFIG_HEADER(config.h) dnl Find out about the host OS DC_CHK_OS_INFO Index: lc_register_var.3.in ================================================================== --- lc_register_var.3.in +++ lc_register_var.3.in @@ -78,14 +78,17 @@ .TP LC_VAR_BOOL_BY_EXISTANCE This type of variable takes no arguments, it is set to true (1) by its existance in a configuration file, environment variable, or on the command line. If it is not specified, the value of the data passed is not changed. The data passed should be of type "int *". .TP LC_VAR_CIDR -XXX: blah +This type of variable accepts a CIDR format netmask and IP. This is not yet implemented. (XXX) .TP LC_VAR_IP -XXX: blah +This type of variable accepts an IP address in decimal-dot format. The value is stored in a uint32_t. +.TP +LC_VAR_ADDR +This type of variable accepts an address in either host or decimal-dot format. The value is stored in a uint32_t. This is not yet implemented. (XXX) .SH "RETURN VALUE" On success 0 is returned, otherwise -1 is returned. .SH EXAMPLE Index: libconfig.c ================================================================== --- libconfig.c +++ libconfig.c @@ -50,12 +50,10 @@ return(0); } static int lc_process_var_cidr(void *data, const char *value) { - - return(0); } static int lc_process_var_ip(void *data, const char *value) { uint32_t *dataval = NULL, retval = 0; @@ -280,10 +278,13 @@ return(lc_process_var_sizesizet(data, value)); break; case LC_VAR_IP: return(lc_process_var_ip(data, value)); break; + case LC_VAR_CIDR: + return(lc_process_var_cidr(data, value)); + break; case LC_VAR_TIME: case LC_VAR_DATE: case LC_VAR_FILENAME: case LC_VAR_DIRECTORY: #ifdef DEBUG @@ -791,11 +792,13 @@ return(chkretval); } static int lc_process_files(const char *appname, lc_conf_type_t type, const char *extraconfig) { +#ifdef HAVE_GETPWUID struct passwd *pwinfo = NULL; +#endif char configfiles[3][13][512] = {{{0}}}; char *configfile = NULL; char *homedir = NULL; int configsetidx = 0, configidx = 0; int chkretval = 0, retval = 0; Index: libconfig.spec ================================================================== --- libconfig.spec +++ libconfig.spec @@ -30,11 +30,13 @@ /usr/lib/libconfig.a /usr/lib/libconfig.so /usr/lib/libconfig.so.@@VERS@@ /usr/lib/libconfig.so.0 /usr/include/libconfig.h -/usr/man/man3/lc_geterrno.3 -/usr/man/man3/lc_geterrstr.3 -/usr/man/man3/lc_process.3 /usr/man/man3/lc_register_callback.3 /usr/man/man3/lc_register_var.3 +/usr/man/man3/lc_process_file.3 +/usr/man/man3/lc_geterrstr.3 +/usr/man/man3/lc_geterrno.3 +/usr/man/man3/lc_process.3 +/usr/man/man3/lc_cleanup.3 /usr/man/man3/libconfig.3