diff options
| author | Jonathan McCrohan <jmccrohan@gmail.com> | 2011-12-01 22:56:23 +0000 | 
|---|---|---|
| committer | Jonathan McCrohan <jmccrohan@gmail.com> | 2011-12-01 22:56:23 +0000 | 
| commit | 429e46051dba814e7d6c74368eb1bba550222cbe (patch) | |
| tree | ed1dd43cd23c69f156aae2165006a16a66262cef /samples/c++ | |
| parent | 58bf1382be0cbcf3f9649286fd2719b789a1595f (diff) | |
| download | libconfig-429e46051dba814e7d6c74368eb1bba550222cbe.tar.gz | |
Imported Upstream version 1.4.8upstream/1.4.8
Diffstat (limited to '')
| -rw-r--r-- | examples/c++/Makefile.in (renamed from samples/c++/Makefile.in) | 201 | ||||
| -rw-r--r-- | samples/c++/Makefile.am | 14 | ||||
| -rw-r--r-- | samples/c++/sample1.cpp | 47 | ||||
| -rw-r--r-- | samples/c++/sample2.cpp | 43 | ||||
| -rw-r--r-- | samples/c++/sample3.cpp | 54 | ||||
| -rw-r--r-- | samples/c++/stubcpp.cpp | 161 | 
6 files changed, 120 insertions, 400 deletions
| diff --git a/samples/c++/Makefile.in b/examples/c++/Makefile.in index b84b8dc..798c5db 100644 --- a/samples/c++/Makefile.in +++ b/examples/c++/Makefile.in @@ -1,8 +1,9 @@ -# Makefile.in generated by automake 1.10.1 from Makefile.am. +# Makefile.in generated by automake 1.11.1 from Makefile.am.  # @configure_input@  # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008  Free Software Foundation, Inc. +# 2003, 2004, 2005, 2006, 2007, 2008, 2009  Free Software Foundation, +# Inc.  # This Makefile.in is free software; the Free Software Foundation  # gives unlimited permission to copy and/or distribute it,  # with or without modifications, as long as this notice is preserved. @@ -16,8 +17,9 @@  VPATH = @srcdir@  pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@  pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@  am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd  install_sh_DATA = $(install_sh) -c -m 644  install_sh_PROGRAM = $(install_sh) -c @@ -33,37 +35,39 @@ POST_UNINSTALL = :  build_triplet = @build@  host_triplet = @host@  target_triplet = @target@ -noinst_PROGRAMS = stubcpp$(EXEEXT) sample1$(EXEEXT) sample2$(EXEEXT) \ -	sample3$(EXEEXT) -subdir = samples/c++ +noinst_PROGRAMS = example1$(EXEEXT) example2$(EXEEXT) \ +	example3$(EXEEXT) example4$(EXEEXT) +subdir = examples/c++  DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in  ACLOCAL_M4 = $(top_srcdir)/aclocal.m4  am__aclocal_m4_deps = $(top_srcdir)/configure.ac  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \  	$(ACLOCAL_M4) -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +mkinstalldirs = $(SHELL) $(top_srcdir)/aux-build/mkinstalldirs  CONFIG_HEADER = $(top_builddir)/ac_config.h  CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES =  PROGRAMS = $(noinst_PROGRAMS) -am_sample1_OBJECTS = sample1.$(OBJEXT) -sample1_OBJECTS = $(am_sample1_OBJECTS) -sample1_LDADD = $(LDADD) -sample1_DEPENDENCIES = -am_sample2_OBJECTS = sample2.$(OBJEXT) -sample2_OBJECTS = $(am_sample2_OBJECTS) -sample2_LDADD = $(LDADD) -sample2_DEPENDENCIES = -am_sample3_OBJECTS = sample3.$(OBJEXT) -sample3_OBJECTS = $(am_sample3_OBJECTS) -sample3_LDADD = $(LDADD) -sample3_DEPENDENCIES = -am_stubcpp_OBJECTS = stubcpp.$(OBJEXT) -stubcpp_OBJECTS = $(am_stubcpp_OBJECTS) -stubcpp_LDADD = $(LDADD) -stubcpp_DEPENDENCIES = +am_example1_OBJECTS = example1.$(OBJEXT) +example1_OBJECTS = $(am_example1_OBJECTS) +example1_LDADD = $(LDADD) +example1_DEPENDENCIES = $(top_builddir)/lib/libconfig++.la +am_example2_OBJECTS = example2.$(OBJEXT) +example2_OBJECTS = $(am_example2_OBJECTS) +example2_LDADD = $(LDADD) +example2_DEPENDENCIES = $(top_builddir)/lib/libconfig++.la +am_example3_OBJECTS = example3.$(OBJEXT) +example3_OBJECTS = $(am_example3_OBJECTS) +example3_LDADD = $(LDADD) +example3_DEPENDENCIES = $(top_builddir)/lib/libconfig++.la +am_example4_OBJECTS = example4.$(OBJEXT) +example4_OBJECTS = $(am_example4_OBJECTS) +example4_LDADD = $(LDADD) +example4_DEPENDENCIES = $(top_builddir)/lib/libconfig++.la  DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/aux-build/depcomp  am__depfiles_maybe = depfiles +am__mv = mv -f  CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \  	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)  LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ @@ -73,10 +77,10 @@ CXXLD = $(CXX)  CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \  	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \  	$(LDFLAGS) -o $@ -SOURCES = $(sample1_SOURCES) $(sample2_SOURCES) $(sample3_SOURCES) \ -	$(stubcpp_SOURCES) -DIST_SOURCES = $(sample1_SOURCES) $(sample2_SOURCES) \ -	$(sample3_SOURCES) $(stubcpp_SOURCES) +SOURCES = $(example1_SOURCES) $(example2_SOURCES) $(example3_SOURCES) \ +	$(example4_SOURCES) +DIST_SOURCES = $(example1_SOURCES) $(example2_SOURCES) \ +	$(example3_SOURCES) $(example4_SOURCES)  ETAGS = etags  CTAGS = ctags  DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -102,20 +106,20 @@ DEFS = @DEFS@  DEPDIR = @DEPDIR@  DLLTOOL = @DLLTOOL@  DSYMUTIL = @DSYMUTIL@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@  ECHO_C = @ECHO_C@  ECHO_N = @ECHO_N@  ECHO_T = @ECHO_T@  EGREP = @EGREP@  EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@  GREP = @GREP@  INSTALL = @INSTALL@  INSTALL_DATA = @INSTALL_DATA@  INSTALL_PROGRAM = @INSTALL_PROGRAM@  INSTALL_SCRIPT = @INSTALL_SCRIPT@  INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@  LDFLAGS = @LDFLAGS@  LEX = @LEX@  LEXLIB = @LEXLIB@ @@ -123,18 +127,23 @@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@  LIBOBJS = @LIBOBJS@  LIBS = @LIBS@  LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@  LN_S = @LN_S@  LTLIBOBJS = @LTLIBOBJS@  MAKEINFO = @MAKEINFO@  MKDIR_P = @MKDIR_P@ +NM = @NM@  NMEDIT = @NMEDIT@  OBJDUMP = @OBJDUMP@  OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@  PACKAGE = @PACKAGE@  PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@  PACKAGE_NAME = @PACKAGE_NAME@  PACKAGE_STRING = @PACKAGE_STRING@  PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@  PACKAGE_VERSION = @PACKAGE_VERSION@  PATH_SEPARATOR = @PATH_SEPARATOR@  RANLIB = @RANLIB@ @@ -151,7 +160,7 @@ abs_top_builddir = @abs_top_builddir@  abs_top_srcdir = @abs_top_srcdir@  ac_ct_CC = @ac_ct_CC@  ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@  am__include = @am__include@  am__leading_dot = @am__leading_dot@  am__quote = @am__quote@ @@ -201,12 +210,16 @@ target_vendor = @target_vendor@  top_build_prefix = @top_build_prefix@  top_builddir = @top_builddir@  top_srcdir = @top_srcdir@ -stubcpp_SOURCES = stubcpp.cpp -sample1_SOURCES = sample1.cpp -sample2_SOURCES = sample2.cpp -sample3_SOURCES = sample3.cpp -AM_CPPFLAGS = -I $(top_srcdir) -LDADD = -L../../.libs -lconfig++ +example1_SOURCES = example1.cpp +example2_SOURCES = example2.cpp +example3_SOURCES = example3.cpp +example4_SOURCES = example4.cpp +AM_CPPFLAGS = -I $(top_srcdir)/lib +LDADD = $(top_builddir)/lib/libconfig++.la +EXTRA_DIST = \ +	example.cfg invalid.cfg \ +	*.vcproj +  all: all-am  .SUFFIXES: @@ -215,14 +228,14 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)  	@for dep in $?; do \  	  case '$(am__configure_deps)' in \  	    *$$dep*) \ -	      cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ -		&& exit 0; \ +	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ +	        && { if test -f $@; then exit 0; else break; fi; }; \  	      exit 1;; \  	  esac; \  	done; \ -	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  samples/c++/Makefile'; \ -	cd $(top_srcdir) && \ -	  $(AUTOMAKE) --gnu  samples/c++/Makefile +	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/c++/Makefile'; \ +	$(am__cd) $(top_srcdir) && \ +	  $(AUTOMAKE) --gnu examples/c++/Makefile  .PRECIOUS: Makefile  Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status  	@case '$?' in \ @@ -240,25 +253,28 @@ $(top_srcdir)/configure:  $(am__configure_deps)  	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh  $(ACLOCAL_M4):  $(am__aclocal_m4_deps)  	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps):  clean-noinstPROGRAMS: -	@list='$(noinst_PROGRAMS)'; for p in $$list; do \ -	  f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ -	  echo " rm -f $$p $$f"; \ -	  rm -f $$p $$f ; \ -	done -sample1$(EXEEXT): $(sample1_OBJECTS) $(sample1_DEPENDENCIES)  -	@rm -f sample1$(EXEEXT) -	$(CXXLINK) $(sample1_OBJECTS) $(sample1_LDADD) $(LIBS) -sample2$(EXEEXT): $(sample2_OBJECTS) $(sample2_DEPENDENCIES)  -	@rm -f sample2$(EXEEXT) -	$(CXXLINK) $(sample2_OBJECTS) $(sample2_LDADD) $(LIBS) -sample3$(EXEEXT): $(sample3_OBJECTS) $(sample3_DEPENDENCIES)  -	@rm -f sample3$(EXEEXT) -	$(CXXLINK) $(sample3_OBJECTS) $(sample3_LDADD) $(LIBS) -stubcpp$(EXEEXT): $(stubcpp_OBJECTS) $(stubcpp_DEPENDENCIES)  -	@rm -f stubcpp$(EXEEXT) -	$(CXXLINK) $(stubcpp_OBJECTS) $(stubcpp_LDADD) $(LIBS) +	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ +	echo " rm -f" $$list; \ +	rm -f $$list || exit $$?; \ +	test -n "$(EXEEXT)" || exit 0; \ +	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ +	echo " rm -f" $$list; \ +	rm -f $$list +example1$(EXEEXT): $(example1_OBJECTS) $(example1_DEPENDENCIES)  +	@rm -f example1$(EXEEXT) +	$(CXXLINK) $(example1_OBJECTS) $(example1_LDADD) $(LIBS) +example2$(EXEEXT): $(example2_OBJECTS) $(example2_DEPENDENCIES)  +	@rm -f example2$(EXEEXT) +	$(CXXLINK) $(example2_OBJECTS) $(example2_LDADD) $(LIBS) +example3$(EXEEXT): $(example3_OBJECTS) $(example3_DEPENDENCIES)  +	@rm -f example3$(EXEEXT) +	$(CXXLINK) $(example3_OBJECTS) $(example3_LDADD) $(LIBS) +example4$(EXEEXT): $(example4_OBJECTS) $(example4_DEPENDENCIES)  +	@rm -f example4$(EXEEXT) +	$(CXXLINK) $(example4_OBJECTS) $(example4_LDADD) $(LIBS)  mostlyclean-compile:  	-rm -f *.$(OBJEXT) @@ -266,28 +282,28 @@ mostlyclean-compile:  distclean-compile:  	-rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sample1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sample2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sample3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stubcpp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example1.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example2.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example3.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/example4.Po@am__quote@  .cpp.o:  @am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po  @AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@  @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@  @am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<  .cpp.obj:  @am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po  @AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@  @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@  @am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`  .cpp.lo:  @am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@	mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo  @AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@  @AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@  @am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $< @@ -303,14 +319,14 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)  	unique=`for i in $$list; do \  	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \  	  done | \ -	  $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ +	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \  	      END { if (nonempty) { for (i in files) print i; }; }'`; \  	mkid -fID $$unique  tags: TAGS  TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \  		$(TAGS_FILES) $(LISP) -	tags=; \ +	set x; \  	here=`pwd`; \  	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \  	unique=`for i in $$list; do \ @@ -318,29 +334,34 @@ TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \  	  done | \  	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \  	      END { if (nonempty) { for (i in files) print i; }; }'`; \ -	if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ +	shift; \ +	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \  	  test -n "$$unique" || unique=$$empty_fix; \ -	  $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ -	    $$tags $$unique; \ +	  if test $$# -gt 0; then \ +	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ +	      "$$@" $$unique; \ +	  else \ +	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ +	      $$unique; \ +	  fi; \  	fi  ctags: CTAGS  CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \  		$(TAGS_FILES) $(LISP) -	tags=; \  	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \  	unique=`for i in $$list; do \  	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \  	  done | \  	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \  	      END { if (nonempty) { for (i in files) print i; }; }'`; \ -	test -z "$(CTAGS_ARGS)$$tags$$unique" \ +	test -z "$(CTAGS_ARGS)$$unique" \  	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ -	     $$tags $$unique +	     $$unique  GTAGS:  	here=`$(am__cd) $(top_builddir) && pwd` \ -	  && cd $(top_srcdir) \ -	  && gtags -i $(GTAGS_ARGS) $$here +	  && $(am__cd) $(top_srcdir) \ +	  && gtags -i $(GTAGS_ARGS) "$$here"  distclean-tags:  	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -361,13 +382,17 @@ distdir: $(DISTFILES)  	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \  	  if test -d $$d/$$file; then \  	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ +	    if test -d "$(distdir)/$$file"; then \ +	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ +	    fi; \  	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ -	      cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ +	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ +	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \  	    fi; \ -	    cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ +	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \  	  else \ -	    test -f $(distdir)/$$file \ -	    || cp -p $$d/$$file $(distdir)/$$file \ +	    test -f "$(distdir)/$$file" \ +	    || cp -p $$d/$$file "$(distdir)/$$file" \  	    || exit 1; \  	  fi; \  	done @@ -395,6 +420,7 @@ clean-generic:  distclean-generic:  	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) +	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)  maintainer-clean-generic:  	@echo "This command is intended for maintainers to use" @@ -416,6 +442,8 @@ dvi-am:  html: html-am +html-am: +  info: info-am  info-am: @@ -424,18 +452,28 @@ install-data-am:  install-dvi: install-dvi-am +install-dvi-am: +  install-exec-am:  install-html: install-html-am +install-html-am: +  install-info: install-info-am +install-info-am: +  install-man:  install-pdf: install-pdf-am +install-pdf-am: +  install-ps: install-ps-am +install-ps-am: +  installcheck-am:  maintainer-clean: maintainer-clean-am @@ -473,6 +511,7 @@ uninstall-am:  	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \  	pdf pdf-am ps ps-am tags uninstall uninstall-am +  # Tell versions [3.59,3.63) of GNU make to not export all variables.  # Otherwise a system limit (for SysV at least) may be exceeded.  .NOEXPORT: diff --git a/samples/c++/Makefile.am b/samples/c++/Makefile.am deleted file mode 100644 index b1cdb9b..0000000 --- a/samples/c++/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ - -noinst_PROGRAMS = stubcpp sample1 sample2 sample3 - -stubcpp_SOURCES = stubcpp.cpp - -sample1_SOURCES = sample1.cpp - -sample2_SOURCES = sample2.cpp - -sample3_SOURCES = sample3.cpp - -AM_CPPFLAGS = -I $(top_srcdir) - -LDADD = -L../../.libs -lconfig++ diff --git a/samples/c++/sample1.cpp b/samples/c++/sample1.cpp deleted file mode 100644 index 7344838..0000000 --- a/samples/c++/sample1.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/************************************************************************* - ** Sample1 - ** Load sample.cfg and increment the "X" setting - *************************************************************************/ - -#include <iostream> -#include <libconfig.h++> - -using namespace libconfig; -using namespace std; - -/***************************************************************************/ - -int main() -{ -  Config cfg; - -  try -  { -    /* Load the configuration.. */ -    cout << "loading [sample.cfg].."; -    cfg.readFile("sample.cfg"); -    cout << "ok" << endl; - -    /* Increment "x" */ -    cout << "increment \"x\".."; -    Setting& s = cfg.lookup("x"); -    long x = s; -    s = ++x; -    cout << "ok (x=" << x << ")" << endl; - -    // Save the configuration -    cout << "saving [sample.cfg].."; -    cfg.writeFile("sample.cfg"); -    cout << "ok" << endl; - -    cout << "Done!" << endl; -  } -  catch (...) -  { -    cout << "failed" << endl; -  } - -  return 0; -} - -/***************************************************************************/ diff --git a/samples/c++/sample2.cpp b/samples/c++/sample2.cpp deleted file mode 100644 index defceb8..0000000 --- a/samples/c++/sample2.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/************************************************************************* - ** Sample2 - ** Load sample.cfg and access the "values" array - *************************************************************************/ - -#include <iostream> -#include <libconfig.h++> - -using namespace libconfig; -using namespace std; - -/***************************************************************************/ - -int main() -{ -  Config cfg; -  try -  { -    /* Load the configuration.. */ -    cout << "loading [sample.cfg].."; -    cfg.readFile("sample.cfg"); -    cout << "ok" << endl; - -    // Display the "values" array -    cout << "display the \"values\" array.."; -    Setting& s = cfg.lookup("values"); -    long value1 = s[0]; -    long value2 = s[1]; -    cout << "[" << value1 << "," << value2 << "].."; -    cout << "ok" << endl; - -    cout << "Done!" << endl; -  } -  catch (...) -  { -    cout << "failed" << endl; -  } - -  return 0; -} - - -/***************************************************************************/ diff --git a/samples/c++/sample3.cpp b/samples/c++/sample3.cpp deleted file mode 100644 index da1de79..0000000 --- a/samples/c++/sample3.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/************************************************************************* - ** Sample3 - ** Load sample.cfg and try to add a setting "foo".. - **   on success save to testfoo.cfg - *************************************************************************/ - -#include <iostream> -#include <libconfig.h++> - -using namespace libconfig; -using namespace std; - -/***************************************************************************/ - -int main() -{ -  Config cfg; -  try -  { -    /* Load the configuration.. */ -    cout << "loading [sample.cfg]..."; -    cfg.readFile("sample.cfg"); -    cout << "ok" << endl; - -    /* Add setting "foo" */ -    cout << "add setting \"foo\"/..."; -    Setting &root = cfg.getRoot(); -    Setting &foo  = root.add("foo", Setting::TypeInt); -    foo = 1234; -    cout << "ok" << endl; - -    /** Look up an array element */ -    cout << "looking up array element..."; -    Setting &elem = cfg.lookup("arrays.values.[0]"); -    int val = elem; -    std::cout << "value is: " << val << std::endl; -    std::cout << "path is: " << elem.getPath() << std::endl; -     -    /* Save to "samplefoo.cfg" */ -    cout << "saving [samplefoo.cfg]..."; -    cfg.writeFile("samplefoo.cfg"); -    cout << "ok" << endl; - -    cout << "Done!" << endl; -  } -  catch (...) -  { -    cout << "failed" << endl; -  } - -  return 0; -} - -/***************************************************************************/ diff --git a/samples/c++/stubcpp.cpp b/samples/c++/stubcpp.cpp deleted file mode 100644 index 59c9769..0000000 --- a/samples/c++/stubcpp.cpp +++ /dev/null @@ -1,161 +0,0 @@ - -#include <stdio.h> -#include <stdlib.h> -#include <iostream> - -#include "libconfig.h++" - -using namespace libconfig; - -int main(int argc, char **argv) -{ -  Config cfg; -  char *locale = NULL; - -#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) \ -  && ! defined(__MINGW32__) - -  locale = "French"; - -#elif defined(__APPLE__) - -  locale = "fr_CA.ISO8859-1"; -   -#else - -  locale = "fr_FR.ISO-8859-1"; - -#endif -   -  printf("new locale: %s\n", setlocale(LC_NUMERIC, locale)); -  printf("before locale override; pi is: %f\n", 3.141592); -   -  try -  { -    FILE *fp = fopen("test.cfg", "r"); - -    if(! fp) -    { -      printf("Unable to open test.cfg\n"); -      exit(1); -    } -     -    cfg.read(fp); -    fclose(fp); -     -//  const ConfigSetting& setting = cfg.lookup("application.window.size.w"); -//  long val = setting; -     -    long val = cfg.lookup("application.window.size.w"); -    printf("val: %ld\n", val); - -    std::string title = cfg.lookup("application.window.title"); -    std::cout << "title: " << title << std::endl; - -    Setting &ss = cfg.lookup("application.window.title"); -    std::string title2 = ss; -    std::cout << "title: " << title2 << std::endl; - -    std::string rr = "foo"; - -    rr = (const char *)cfg.lookup("application.window.title"); -//    rr = (std::string)(cfg.lookup("application.window.title")); -    std::cout << "rr: " << rr << std::endl; - -    const char *rrr = cfg.lookup("application.window.title"); -    std::cout << "rrr: " << rrr << std::endl; -     -    Setting &s = cfg.lookup("application.group1.my_array");   -    long val4; -    val4 = s[4]; -    printf("item #4 is: %ld\n", val4); -    printf("location of my_array is %d\n", s.getSourceLine()); - -    Setting &grp = cfg.lookup("application.group1.group2"); - -    Setting &zzz = cfg.lookup("application.group1.group2.zzz"); -    printf("location of zzz is at %d\n", zzz.getSourceLine()); - -    Setting &root = cfg.getRoot(); - -    Setting &rootn = root.add("new-one-at-top", Setting::TypeGroup); - -    Setting &ngp = rootn.add("element",  Setting::TypeFloat); - -    Setting &misc = root["misc"]; -    unsigned int portnum = 0; -    misc.lookupValue("port", portnum); -    printf("port # is: %d\n", portnum); -     -    ngp = 1.1234567890123; -     -//    long val22 = s[22]; -//    printf("item #22 is: %d\n", val22); - -    Setting &snew = grp.add("foobar",  Setting::TypeArray); - -    snew.add(Setting::TypeInt); -    snew.add(Setting::TypeInt); - -    snew.add(Setting::TypeInt); -    snew.add(Setting::TypeInt); -     -    puts("created new array"); - -    snew[0] = 55; -    puts("elem 0"); -    snew[1] = 66; -    puts("elem 1"); - -    cfg.setAutoConvert(true); - -    double dd = cfg.lookup("application.group1.x"); -    printf("auto-converted int->double: %f\n", dd); - -    int ii = cfg.lookup("misc.pi"); -    printf("auto-converted double->int: %d\n", ii); -    -    Setting &sdel = cfg.lookup("application"); - -    sdel.remove("group1"); - -     -    Setting &books = cfg.lookup("books"); -    puts("found books"); -    Setting &book = books.add(Setting::TypeGroup); -    puts("added book"); - -    Setting &sss = book.add("Title", Setting::TypeString); -    puts("added title"); -     -    sss = "Alice in Wonderland"; - -    Setting &sss2 = book.add("Price", Setting::TypeFloat); -    sss2 = 9.99; - -    cfg.write(stdout); - -    Setting &good = cfg.lookup("books.[2].author"); -    std::string author = good; -    std::cout << "author: " << author << std::endl; -     -    Setting &bad = books[1]["blargh"]; -  } -  catch(ParseException& ex) -  { -    printf("error on line %d: %s\n", ex.getLine(), -           ex.getError()); -  } -  catch(SettingNotFoundException nfex) -  { -    printf("setting not found: %s\n", nfex.getPath()); -  } -  catch(ConfigException& cex) -  { -    printf("config exception!\n"); -  } -  -  printf("locale restored; pi is: %f\n", 3.141592); -  -  return(0); -} | 
