aboutsummaryrefslogtreecommitdiffstats
path: root/samples/c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--samples/c++/Makefile.am14
-rw-r--r--samples/c++/Makefile.in478
-rw-r--r--samples/c++/sample1.cpp47
-rw-r--r--samples/c++/sample2.cpp43
-rw-r--r--samples/c++/sample3.cpp54
-rw-r--r--samples/c++/stubcpp.cpp161
-rw-r--r--samples/c/Makefile.am15
-rw-r--r--samples/c/Makefile.in478
-rw-r--r--samples/c/sample1.c63
-rw-r--r--samples/c/sample2.c52
-rw-r--r--samples/c/sample3.c104
-rw-r--r--samples/c/stub.c84
12 files changed, 1593 insertions, 0 deletions
diff --git a/samples/c++/Makefile.am b/samples/c++/Makefile.am
new file mode 100644
index 0000000..b1cdb9b
--- /dev/null
+++ b/samples/c++/Makefile.am
@@ -0,0 +1,14 @@
+
+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++/Makefile.in b/samples/c++/Makefile.in
new file mode 100644
index 0000000..b84b8dc
--- /dev/null
+++ b/samples/c++/Makefile.in
@@ -0,0 +1,478 @@
+# Makefile.in generated by automake 1.10.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.
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+noinst_PROGRAMS = stubcpp$(EXEEXT) sample1$(EXEEXT) sample2$(EXEEXT) \
+ sample3$(EXEEXT)
+subdir = samples/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
+CONFIG_HEADER = $(top_builddir)/ac_config.h
+CONFIG_CLEAN_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 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+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)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+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@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+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++
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(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; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu samples/c++/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu samples/c++/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(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
+
+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)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+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@
+
+.cpp.o:
+@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@ mv -f $(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
+@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
+@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 $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ 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; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ 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; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ 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" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ 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 $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ 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++/sample1.cpp b/samples/c++/sample1.cpp
new file mode 100644
index 0000000..7344838
--- /dev/null
+++ b/samples/c++/sample1.cpp
@@ -0,0 +1,47 @@
+/*************************************************************************
+ ** 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
new file mode 100644
index 0000000..defceb8
--- /dev/null
+++ b/samples/c++/sample2.cpp
@@ -0,0 +1,43 @@
+/*************************************************************************
+ ** 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
new file mode 100644
index 0000000..da1de79
--- /dev/null
+++ b/samples/c++/sample3.cpp
@@ -0,0 +1,54 @@
+/*************************************************************************
+ ** 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
new file mode 100644
index 0000000..59c9769
--- /dev/null
+++ b/samples/c++/stubcpp.cpp
@@ -0,0 +1,161 @@
+
+#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);
+}
diff --git a/samples/c/Makefile.am b/samples/c/Makefile.am
new file mode 100644
index 0000000..8664b48
--- /dev/null
+++ b/samples/c/Makefile.am
@@ -0,0 +1,15 @@
+
+noinst_PROGRAMS = stub sample1 sample2 sample3
+
+stub_SOURCES = stub.c
+
+sample1_SOURCES = sample1.c
+
+sample2_SOURCES = sample2.c
+
+sample3_SOURCES = sample3.c
+
+AM_CPPFLAGS = -I $(top_srcdir)
+
+LDADD = -L../../.libs -lconfig
+
diff --git a/samples/c/Makefile.in b/samples/c/Makefile.in
new file mode 100644
index 0000000..1aaf2be
--- /dev/null
+++ b/samples/c/Makefile.in
@@ -0,0 +1,478 @@
+# Makefile.in generated by automake 1.10.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.
+# 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+noinst_PROGRAMS = stub$(EXEEXT) sample1$(EXEEXT) sample2$(EXEEXT) \
+ sample3$(EXEEXT)
+subdir = samples/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
+CONFIG_HEADER = $(top_builddir)/ac_config.h
+CONFIG_CLEAN_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_stub_OBJECTS = stub.$(OBJEXT)
+stub_OBJECTS = $(am_stub_OBJECTS)
+stub_LDADD = $(LDADD)
+stub_DEPENDENCIES =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(sample1_SOURCES) $(sample2_SOURCES) $(sample3_SOURCES) \
+ $(stub_SOURCES)
+DIST_SOURCES = $(sample1_SOURCES) $(sample2_SOURCES) \
+ $(sample3_SOURCES) $(stub_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+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@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+stub_SOURCES = stub.c
+sample1_SOURCES = sample1.c
+sample2_SOURCES = sample2.c
+sample3_SOURCES = sample3.c
+AM_CPPFLAGS = -I $(top_srcdir)
+LDADD = -L../../.libs -lconfig
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(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; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu samples/c/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu samples/c/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(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
+
+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)
+ $(LINK) $(sample1_OBJECTS) $(sample1_LDADD) $(LIBS)
+sample2$(EXEEXT): $(sample2_OBJECTS) $(sample2_DEPENDENCIES)
+ @rm -f sample2$(EXEEXT)
+ $(LINK) $(sample2_OBJECTS) $(sample2_LDADD) $(LIBS)
+sample3$(EXEEXT): $(sample3_OBJECTS) $(sample3_DEPENDENCIES)
+ @rm -f sample3$(EXEEXT)
+ $(LINK) $(sample3_OBJECTS) $(sample3_LDADD) $(LIBS)
+stub$(EXEEXT): $(stub_OBJECTS) $(stub_DEPENDENCIES)
+ @rm -f stub$(EXEEXT)
+ $(LINK) $(stub_OBJECTS) $(stub_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+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)/stub.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ 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; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ 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; }; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ 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" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ 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 $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-info: install-info-am
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ 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/sample1.c b/samples/c/sample1.c
new file mode 100644
index 0000000..a119c10
--- /dev/null
+++ b/samples/c/sample1.c
@@ -0,0 +1,63 @@
+/*************************************************************************
+ ** Sample1
+ ** Load sample.cfg and increment the "X" setting
+ *************************************************************************/
+
+#include <stdio.h>
+#include <libconfig.h>
+
+struct config_t cfg;
+
+/***************************************************************************/
+
+int main(int argc, char **argv)
+{
+ char *file = "sample.cfg", *var = "x";
+
+ if(argc >= 2)
+ file = argv[1];
+
+ if(argc >= 3)
+ var = argv[2];
+
+/* Initialize the configuration */
+ config_init(&cfg);
+
+ /* Load the file */
+ printf("loading [%s]...", file);
+ if(!config_read_file(&cfg, file))
+ printf("failed\n");
+ else
+ {
+ config_setting_t *setting = NULL;
+
+ printf("ok\n");
+
+ /* Get the variable setting from the configuration.. */
+ printf("increment \"%s\"...", var);
+ setting = config_lookup(&cfg, var);
+ if(!setting)
+ printf("failed\n");
+ else
+ {
+ long x = config_setting_get_int(setting);
+ x++;
+ config_setting_set_int(setting, x);
+ printf("ok (%s=%lu)\n", var, x);
+
+ /* Save the changes */
+ printf("saving [%s]...", file);
+ config_write_file(&cfg, file);
+ printf("ok\n");
+
+ printf("Done!\n");
+ }
+ }
+
+ /* Free the configuration */
+ config_destroy(&cfg);
+
+ return 0;
+}
+
+/***************************************************************************/
diff --git a/samples/c/sample2.c b/samples/c/sample2.c
new file mode 100644
index 0000000..09c45de
--- /dev/null
+++ b/samples/c/sample2.c
@@ -0,0 +1,52 @@
+/*************************************************************************
+ ** Sample2
+ ** Load sample.cfg and access the "values" array
+ *************************************************************************/
+
+#include <stdio.h>
+#include <libconfig.h>
+
+struct config_t cfg;
+
+/***************************************************************************/
+
+int main()
+{
+ /* Initialize the configuration */
+ config_init(&cfg);
+
+ /* Load the file */
+ printf("loading [sample.cfg]..");
+ if (!config_read_file(&cfg, "sample.cfg"))
+ printf("failed\n");
+ else
+ {
+ config_setting_t *array = NULL;
+
+ printf("ok\n");
+
+ /* Display the "values" array */
+ printf("display \"values\"..");
+ array = config_lookup(&cfg, "values");
+ if (!array)
+ printf("failed\n");
+ else
+ {
+ long value1,value2;
+ value1 = config_setting_get_int_elem(array, 0);
+ value2 = config_setting_get_int_elem(array, 1);
+ printf("[%lu %lu]..ok\n", value1, value2);
+
+ printf("Done!\n");
+ }
+
+ }
+
+ /* Free the configuration */
+ config_destroy(&cfg);
+
+ return 0;
+}
+
+
+/***************************************************************************/
diff --git a/samples/c/sample3.c b/samples/c/sample3.c
new file mode 100644
index 0000000..22f5f36
--- /dev/null
+++ b/samples/c/sample3.c
@@ -0,0 +1,104 @@
+/*************************************************************************
+ ** Sample3
+ ** Load sample.cfg and try to add a setting "foo"..
+ ** on success save to testfoo.cfg
+ *************************************************************************/
+
+#include <stdio.h>
+#include <libconfig.h>
+
+/***************************************************************************/
+
+/*
+ */
+
+int print_path(config_setting_t *setting)
+{
+ if(setting)
+ {
+ const char *name = config_setting_name(setting);
+
+ if(print_path(config_setting_parent(setting)))
+ putchar('.');
+
+ if(! config_setting_is_root(setting))
+ {
+ if(! name)
+ printf("[%d]", config_setting_index(setting));
+ else
+ printf(name);
+
+ return(1);
+ }
+ }
+
+ return(0);
+}
+
+/*
+ */
+
+int main()
+{
+ struct config_t cfg;
+ config_setting_t *setting = NULL;
+ int i;
+
+ do
+ {
+ /* Initialize the configuration */
+ config_init(&cfg);
+
+ /* Load the file */
+ printf("loading [sample.cfg]...");
+ if (!config_read_file(&cfg, "sample.cfg"))
+ {
+ puts("failed");
+ break;
+ }
+
+ puts("ok");
+
+ /* Add setting "foo" */
+ printf("add setting \"foo\"...");
+ setting = config_setting_add(cfg.root, "foo", CONFIG_TYPE_INT);
+ if (!setting)
+ {
+ puts("failed");
+ break;
+ }
+
+ config_setting_set_int(setting, 1234);
+ puts("ok");
+
+ /** Look up an array element */
+ printf("looking up array element...");
+ setting = config_lookup(&cfg, "arrays.values.[0]");
+ if(! setting)
+ {
+ puts("failed");
+ break;
+ }
+
+ printf("value is: %d\n", config_setting_get_int(setting));
+ printf("path is: ");
+ print_path(setting);
+ putchar('\n');
+
+ /* Save to "samplefoo.cfg" */
+ printf("saving [samplefoo.cfg]...");
+ config_write_file(&cfg, "samplefoo.cfg");
+ puts("ok");
+
+ puts("Done!");
+ }
+ while(0);
+
+ /* Free the configuration */
+ config_destroy(&cfg);
+
+ return 0;
+}
+
+
+/***************************************************************************/
diff --git a/samples/c/stub.c b/samples/c/stub.c
new file mode 100644
index 0000000..a4608b7
--- /dev/null
+++ b/samples/c/stub.c
@@ -0,0 +1,84 @@
+#ifdef _MSC_VER
+#pragma warning (disable: 4996)
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "libconfig.h"
+
+int main(int argc, char **argv)
+{
+ config_t cfg;
+ FILE *fp;
+ int i, x;
+ const char *s;
+ const config_setting_t *array;
+ config_setting_t *old;
+
+ fp = fopen("test.cfg", "rb");
+
+ if(! fp)
+ {
+ printf("Unable to open test.cfg\n");
+ exit(1);
+ }
+
+ config_init(&cfg);
+ x = config_read(&cfg, fp);
+
+ fclose(fp);
+
+ if(! x)
+ {
+ printf("error on line %d: %s\n", cfg.error_line, cfg.error_text);
+ exit(1);
+ }
+
+ if(! config_lookup_string(&cfg, "application.group1.group2.zzz", &s))
+ puts("NOT FOUND");
+ else
+ printf("found: %s\n", s);
+
+ array = config_lookup(&cfg, "application.group1.my_array");
+ if(array)
+ {
+ for(i = 0; i < config_setting_length(array); i++)
+ {
+ long val = config_setting_get_int_elem(array, i);
+ printf("value [%i]: %ld\n", i, val);
+ }
+ }
+
+ {
+ config_setting_t *root = config_root_setting(&cfg);
+
+ config_setting_t *new = config_setting_add(root, "foobar",
+ CONFIG_TYPE_LIST);
+
+ config_setting_t *newgrp, *newval;
+
+
+ if(! config_setting_set_float_elem(new, -1, 3.141592654))
+ puts("FAILED");
+
+ if(! config_setting_set_string_elem(new, -1, "Hello, world!"))
+ puts("FAILED");
+
+ newgrp = config_setting_add(new, NULL, CONFIG_TYPE_GROUP);
+
+ newval = config_setting_add(newgrp, "baz", CONFIG_TYPE_INT);
+
+ old = config_lookup(&cfg, "application.group1");
+
+ printf("old is: %p\n", old);
+ config_setting_remove(old, "group2");
+ }
+
+ config_write(&cfg, stdout);
+
+
+ config_destroy(&cfg);
+
+
+ return(0);
+}