Move C code into ndn-cpp/c
diff --git a/Makefile.am b/Makefile.am
index c55c3f0..1cf0f8c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -14,17 +14,17 @@
 bin_PROGRAMS = test-encode-decode-interest
 
 libndn_c_a_SOURCES = \
-  ndn-cpp/config.h \
-  ndn-cpp/Name.h \
-  ndn-cpp/encoding/BinaryXMLDecoder.c ndn-cpp/encoding/BinaryXMLDecoder.h \
-  ndn-cpp/encoding/BinaryXMLEncoder.c ndn-cpp/encoding/BinaryXMLEncoder.h \
-  ndn-cpp/encoding/BinaryXMLName.c ndn-cpp/encoding/BinaryXMLName.h \
-  ndn-cpp/encoding/BinaryXMLStructureDecoder.c ndn-cpp/encoding/BinaryXMLStructureDecoder.h \
-  ndn-cpp/util/DynamicUCharArray.c ndn-cpp/util/DynamicUCharArray.h \
-  ndn-cpp/util/ndn_memory.c ndn-cpp/util/ndn_memory.h
+  config.h \
+  ndn-cpp/c/Name.h \
+  ndn-cpp/c/encoding/BinaryXMLDecoder.c ndn-cpp/c/encoding/BinaryXMLDecoder.h \
+  ndn-cpp/c/encoding/BinaryXMLEncoder.c ndn-cpp/c/encoding/BinaryXMLEncoder.h \
+  ndn-cpp/c/encoding/BinaryXMLName.c ndn-cpp/c/encoding/BinaryXMLName.h \
+  ndn-cpp/c/encoding/BinaryXMLStructureDecoder.c ndn-cpp/c/encoding/BinaryXMLStructureDecoder.h \
+  ndn-cpp/c/util/DynamicUCharArray.c ndn-cpp/c/util/DynamicUCharArray.h \
+  ndn-cpp/c/util/ndn_memory.c ndn-cpp/c/util/ndn_memory.h
 
 libndn_cpp_a_SOURCES = \
-  ndn-cpp/config.h ndn-cpp/common.h \
+  config.h ndn-cpp/common.h \
   ndn-cpp/Name.cpp ndn-cpp/Name.h ndn-cpp/Name.hpp \
   ndn-cpp/encoding/BinaryXML.h \
   ndn-cpp/encoding/BinaryXMLStructureDecoder.hpp \
diff --git a/Makefile.in b/Makefile.in
index bc1094f..ed9e0dc 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -134,12 +134,12 @@
 libndn_c_a_AR = $(AR) $(ARFLAGS)
 libndn_c_a_LIBADD =
 am__dirstamp = $(am__leading_dot)dirstamp
-am_libndn_c_a_OBJECTS = ndn-cpp/encoding/BinaryXMLDecoder.$(OBJEXT) \
-	ndn-cpp/encoding/BinaryXMLEncoder.$(OBJEXT) \
-	ndn-cpp/encoding/BinaryXMLName.$(OBJEXT) \
-	ndn-cpp/encoding/BinaryXMLStructureDecoder.$(OBJEXT) \
-	ndn-cpp/util/DynamicUCharArray.$(OBJEXT) \
-	ndn-cpp/util/ndn_memory.$(OBJEXT)
+am_libndn_c_a_OBJECTS = ndn-cpp/c/encoding/BinaryXMLDecoder.$(OBJEXT) \
+	ndn-cpp/c/encoding/BinaryXMLEncoder.$(OBJEXT) \
+	ndn-cpp/c/encoding/BinaryXMLName.$(OBJEXT) \
+	ndn-cpp/c/encoding/BinaryXMLStructureDecoder.$(OBJEXT) \
+	ndn-cpp/c/util/DynamicUCharArray.$(OBJEXT) \
+	ndn-cpp/c/util/ndn_memory.$(OBJEXT)
 libndn_c_a_OBJECTS = $(am_libndn_c_a_OBJECTS)
 libndn_cpp_a_AR = $(AR) $(ARFLAGS)
 libndn_cpp_a_LIBADD =
@@ -387,17 +387,17 @@
 ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}
 lib_LIBRARIES = libndn-c.a libndn-cpp.a
 libndn_c_a_SOURCES = \
-  ndn-cpp/config.h \
-  ndn-cpp/Name.h \
-  ndn-cpp/encoding/BinaryXMLDecoder.c ndn-cpp/encoding/BinaryXMLDecoder.h \
-  ndn-cpp/encoding/BinaryXMLEncoder.c ndn-cpp/encoding/BinaryXMLEncoder.h \
-  ndn-cpp/encoding/BinaryXMLName.c ndn-cpp/encoding/BinaryXMLName.h \
-  ndn-cpp/encoding/BinaryXMLStructureDecoder.c ndn-cpp/encoding/BinaryXMLStructureDecoder.h \
-  ndn-cpp/util/DynamicUCharArray.c ndn-cpp/util/DynamicUCharArray.h \
-  ndn-cpp/util/ndn_memory.c ndn-cpp/util/ndn_memory.h
+  config.h \
+  ndn-cpp/c/Name.h \
+  ndn-cpp/c/encoding/BinaryXMLDecoder.c ndn-cpp/c/encoding/BinaryXMLDecoder.h \
+  ndn-cpp/c/encoding/BinaryXMLEncoder.c ndn-cpp/c/encoding/BinaryXMLEncoder.h \
+  ndn-cpp/c/encoding/BinaryXMLName.c ndn-cpp/c/encoding/BinaryXMLName.h \
+  ndn-cpp/c/encoding/BinaryXMLStructureDecoder.c ndn-cpp/c/encoding/BinaryXMLStructureDecoder.h \
+  ndn-cpp/c/util/DynamicUCharArray.c ndn-cpp/c/util/DynamicUCharArray.h \
+  ndn-cpp/c/util/ndn_memory.c ndn-cpp/c/util/ndn_memory.h
 
 libndn_cpp_a_SOURCES = \
-  ndn-cpp/config.h ndn-cpp/common.h \
+  config.h ndn-cpp/common.h \
   ndn-cpp/Name.cpp ndn-cpp/Name.h ndn-cpp/Name.hpp \
   ndn-cpp/encoding/BinaryXML.h \
   ndn-cpp/encoding/BinaryXMLStructureDecoder.hpp \
@@ -493,35 +493,35 @@
 
 clean-libLIBRARIES:
 	-test -z "$(lib_LIBRARIES)" || rm -f $(lib_LIBRARIES)
-ndn-cpp/encoding/$(am__dirstamp):
-	@$(MKDIR_P) ndn-cpp/encoding
-	@: > ndn-cpp/encoding/$(am__dirstamp)
-ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp):
-	@$(MKDIR_P) ndn-cpp/encoding/$(DEPDIR)
-	@: > ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp)
-ndn-cpp/encoding/BinaryXMLDecoder.$(OBJEXT):  \
-	ndn-cpp/encoding/$(am__dirstamp) \
-	ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp)
-ndn-cpp/encoding/BinaryXMLEncoder.$(OBJEXT):  \
-	ndn-cpp/encoding/$(am__dirstamp) \
-	ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp)
-ndn-cpp/encoding/BinaryXMLName.$(OBJEXT):  \
-	ndn-cpp/encoding/$(am__dirstamp) \
-	ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp)
-ndn-cpp/encoding/BinaryXMLStructureDecoder.$(OBJEXT):  \
-	ndn-cpp/encoding/$(am__dirstamp) \
-	ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp)
-ndn-cpp/util/$(am__dirstamp):
-	@$(MKDIR_P) ndn-cpp/util
-	@: > ndn-cpp/util/$(am__dirstamp)
-ndn-cpp/util/$(DEPDIR)/$(am__dirstamp):
-	@$(MKDIR_P) ndn-cpp/util/$(DEPDIR)
-	@: > ndn-cpp/util/$(DEPDIR)/$(am__dirstamp)
-ndn-cpp/util/DynamicUCharArray.$(OBJEXT):  \
-	ndn-cpp/util/$(am__dirstamp) \
-	ndn-cpp/util/$(DEPDIR)/$(am__dirstamp)
-ndn-cpp/util/ndn_memory.$(OBJEXT): ndn-cpp/util/$(am__dirstamp) \
-	ndn-cpp/util/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/c/encoding/$(am__dirstamp):
+	@$(MKDIR_P) ndn-cpp/c/encoding
+	@: > ndn-cpp/c/encoding/$(am__dirstamp)
+ndn-cpp/c/encoding/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) ndn-cpp/c/encoding/$(DEPDIR)
+	@: > ndn-cpp/c/encoding/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/c/encoding/BinaryXMLDecoder.$(OBJEXT):  \
+	ndn-cpp/c/encoding/$(am__dirstamp) \
+	ndn-cpp/c/encoding/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/c/encoding/BinaryXMLEncoder.$(OBJEXT):  \
+	ndn-cpp/c/encoding/$(am__dirstamp) \
+	ndn-cpp/c/encoding/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/c/encoding/BinaryXMLName.$(OBJEXT):  \
+	ndn-cpp/c/encoding/$(am__dirstamp) \
+	ndn-cpp/c/encoding/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/c/encoding/BinaryXMLStructureDecoder.$(OBJEXT):  \
+	ndn-cpp/c/encoding/$(am__dirstamp) \
+	ndn-cpp/c/encoding/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/c/util/$(am__dirstamp):
+	@$(MKDIR_P) ndn-cpp/c/util
+	@: > ndn-cpp/c/util/$(am__dirstamp)
+ndn-cpp/c/util/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) ndn-cpp/c/util/$(DEPDIR)
+	@: > ndn-cpp/c/util/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/c/util/DynamicUCharArray.$(OBJEXT):  \
+	ndn-cpp/c/util/$(am__dirstamp) \
+	ndn-cpp/c/util/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/c/util/ndn_memory.$(OBJEXT): ndn-cpp/c/util/$(am__dirstamp) \
+	ndn-cpp/c/util/$(DEPDIR)/$(am__dirstamp)
 
 libndn-c.a: $(libndn_c_a_OBJECTS) $(libndn_c_a_DEPENDENCIES) $(EXTRA_libndn_c_a_DEPENDENCIES) 
 	$(AM_V_at)-rm -f libndn-c.a
@@ -535,6 +535,12 @@
 	@: > ndn-cpp/$(DEPDIR)/$(am__dirstamp)
 ndn-cpp/Name.$(OBJEXT): ndn-cpp/$(am__dirstamp) \
 	ndn-cpp/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/encoding/$(am__dirstamp):
+	@$(MKDIR_P) ndn-cpp/encoding
+	@: > ndn-cpp/encoding/$(am__dirstamp)
+ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp):
+	@$(MKDIR_P) ndn-cpp/encoding/$(DEPDIR)
+	@: > ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp)
 ndn-cpp/encoding/BinaryXMLWireFormat.$(OBJEXT):  \
 	ndn-cpp/encoding/$(am__dirstamp) \
 	ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp)
@@ -604,22 +610,23 @@
 mostlyclean-compile:
 	-rm -f *.$(OBJEXT)
 	-rm -f ndn-cpp/*.$(OBJEXT)
+	-rm -f ndn-cpp/c/encoding/*.$(OBJEXT)
+	-rm -f ndn-cpp/c/util/*.$(OBJEXT)
 	-rm -f ndn-cpp/encoding/*.$(OBJEXT)
-	-rm -f ndn-cpp/util/*.$(OBJEXT)
 	-rm -f test/*.$(OBJEXT)
 
 distclean-compile:
 	-rm -f *.tab.c
 
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/$(DEPDIR)/Name.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/encoding/$(DEPDIR)/BinaryXMLDecoder.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/encoding/$(DEPDIR)/BinaryXMLEncoder.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/encoding/$(DEPDIR)/BinaryXMLName.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/encoding/$(DEPDIR)/BinaryXMLStructureDecoder.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/encoding/$(DEPDIR)/BinaryXMLDecoder.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/encoding/$(DEPDIR)/BinaryXMLEncoder.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/encoding/$(DEPDIR)/BinaryXMLName.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/encoding/$(DEPDIR)/BinaryXMLStructureDecoder.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/util/$(DEPDIR)/DynamicUCharArray.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/util/$(DEPDIR)/ndn_memory.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/encoding/$(DEPDIR)/BinaryXMLWireFormat.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/encoding/$(DEPDIR)/WireFormat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/util/$(DEPDIR)/DynamicUCharArray.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/util/$(DEPDIR)/ndn_memory.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test-encode-decode-interest.Po@am__quote@
 
 .c.o:
@@ -904,10 +911,12 @@
 	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
 	-rm -f ndn-cpp/$(DEPDIR)/$(am__dirstamp)
 	-rm -f ndn-cpp/$(am__dirstamp)
+	-rm -f ndn-cpp/c/encoding/$(DEPDIR)/$(am__dirstamp)
+	-rm -f ndn-cpp/c/encoding/$(am__dirstamp)
+	-rm -f ndn-cpp/c/util/$(DEPDIR)/$(am__dirstamp)
+	-rm -f ndn-cpp/c/util/$(am__dirstamp)
 	-rm -f ndn-cpp/encoding/$(DEPDIR)/$(am__dirstamp)
 	-rm -f ndn-cpp/encoding/$(am__dirstamp)
-	-rm -f ndn-cpp/util/$(DEPDIR)/$(am__dirstamp)
-	-rm -f ndn-cpp/util/$(am__dirstamp)
 	-rm -f test/$(DEPDIR)/$(am__dirstamp)
 	-rm -f test/$(am__dirstamp)
 
@@ -921,7 +930,7 @@
 
 distclean: distclean-am
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-	-rm -rf ndn-cpp/$(DEPDIR) ndn-cpp/encoding/$(DEPDIR) ndn-cpp/util/$(DEPDIR) test/$(DEPDIR)
+	-rm -rf ndn-cpp/$(DEPDIR) ndn-cpp/c/encoding/$(DEPDIR) ndn-cpp/c/util/$(DEPDIR) ndn-cpp/encoding/$(DEPDIR) test/$(DEPDIR)
 	-rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
 	distclean-hdr distclean-tags
@@ -969,7 +978,7 @@
 maintainer-clean: maintainer-clean-am
 	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
 	-rm -rf $(top_srcdir)/autom4te.cache
-	-rm -rf ndn-cpp/$(DEPDIR) ndn-cpp/encoding/$(DEPDIR) ndn-cpp/util/$(DEPDIR) test/$(DEPDIR)
+	-rm -rf ndn-cpp/$(DEPDIR) ndn-cpp/c/encoding/$(DEPDIR) ndn-cpp/c/util/$(DEPDIR) ndn-cpp/encoding/$(DEPDIR) test/$(DEPDIR)
 	-rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
diff --git a/ndn-cpp/Name.h b/ndn-cpp/c/Name.h
similarity index 100%
rename from ndn-cpp/Name.h
rename to ndn-cpp/c/Name.h
diff --git a/ndn-cpp/encoding/BinaryXML.h b/ndn-cpp/c/encoding/BinaryXML.h
similarity index 100%
rename from ndn-cpp/encoding/BinaryXML.h
rename to ndn-cpp/c/encoding/BinaryXML.h
diff --git a/ndn-cpp/encoding/BinaryXMLDecoder.c b/ndn-cpp/c/encoding/BinaryXMLDecoder.c
similarity index 100%
rename from ndn-cpp/encoding/BinaryXMLDecoder.c
rename to ndn-cpp/c/encoding/BinaryXMLDecoder.c
diff --git a/ndn-cpp/encoding/BinaryXMLDecoder.h b/ndn-cpp/c/encoding/BinaryXMLDecoder.h
similarity index 100%
rename from ndn-cpp/encoding/BinaryXMLDecoder.h
rename to ndn-cpp/c/encoding/BinaryXMLDecoder.h
diff --git a/ndn-cpp/encoding/BinaryXMLEncoder.c b/ndn-cpp/c/encoding/BinaryXMLEncoder.c
similarity index 100%
rename from ndn-cpp/encoding/BinaryXMLEncoder.c
rename to ndn-cpp/c/encoding/BinaryXMLEncoder.c
diff --git a/ndn-cpp/encoding/BinaryXMLEncoder.h b/ndn-cpp/c/encoding/BinaryXMLEncoder.h
similarity index 100%
rename from ndn-cpp/encoding/BinaryXMLEncoder.h
rename to ndn-cpp/c/encoding/BinaryXMLEncoder.h
diff --git a/ndn-cpp/encoding/BinaryXMLName.c b/ndn-cpp/c/encoding/BinaryXMLName.c
similarity index 100%
rename from ndn-cpp/encoding/BinaryXMLName.c
rename to ndn-cpp/c/encoding/BinaryXMLName.c
diff --git a/ndn-cpp/encoding/BinaryXMLName.h b/ndn-cpp/c/encoding/BinaryXMLName.h
similarity index 100%
rename from ndn-cpp/encoding/BinaryXMLName.h
rename to ndn-cpp/c/encoding/BinaryXMLName.h
diff --git a/ndn-cpp/encoding/BinaryXMLStructureDecoder.c b/ndn-cpp/c/encoding/BinaryXMLStructureDecoder.c
similarity index 100%
rename from ndn-cpp/encoding/BinaryXMLStructureDecoder.c
rename to ndn-cpp/c/encoding/BinaryXMLStructureDecoder.c
diff --git a/ndn-cpp/encoding/BinaryXMLStructureDecoder.h b/ndn-cpp/c/encoding/BinaryXMLStructureDecoder.h
similarity index 100%
rename from ndn-cpp/encoding/BinaryXMLStructureDecoder.h
rename to ndn-cpp/c/encoding/BinaryXMLStructureDecoder.h
diff --git a/ndn-cpp/util/DynamicUCharArray.c b/ndn-cpp/c/util/DynamicUCharArray.c
similarity index 100%
rename from ndn-cpp/util/DynamicUCharArray.c
rename to ndn-cpp/c/util/DynamicUCharArray.c
diff --git a/ndn-cpp/util/DynamicUCharArray.h b/ndn-cpp/c/util/DynamicUCharArray.h
similarity index 100%
rename from ndn-cpp/util/DynamicUCharArray.h
rename to ndn-cpp/c/util/DynamicUCharArray.h
diff --git a/ndn-cpp/util/ndn_memory.c b/ndn-cpp/c/util/ndn_memory.c
similarity index 100%
rename from ndn-cpp/util/ndn_memory.c
rename to ndn-cpp/c/util/ndn_memory.c
diff --git a/ndn-cpp/util/ndn_memory.h b/ndn-cpp/c/util/ndn_memory.h
similarity index 97%
rename from ndn-cpp/util/ndn_memory.h
rename to ndn-cpp/c/util/ndn_memory.h
index 07bd24c..9051a02 100644
--- a/ndn-cpp/util/ndn_memory.h
+++ b/ndn-cpp/c/util/ndn_memory.h
@@ -11,7 +11,7 @@
 #ifndef NDN_MEMORY_H
 #define	NDN_MEMORY_H
 
-#include "../../config.h"
+#include "../../../config.h"
 
 #ifdef	__cplusplus
 extern "C" {
diff --git a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
index e771522..b453794 100644
--- a/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
+++ b/ndn-cpp/encoding/BinaryXMLWireFormat.cpp
@@ -5,7 +5,7 @@
  */
 
 #include <stdexcept>
-#include "BinaryXMLName.h"
+#include "../c/encoding/BinaryXMLName.h"
 #include "../Name.hpp"
 #include "BinaryXMLWireFormat.hpp"