Added ndn_Exclude_compareComponents.
diff --git a/Makefile.am b/Makefile.am
index fa66b15..091e5d1 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,7 +16,7 @@
 libndn_c_la_SOURCES = \
   config.h \
   ndn-cpp/c/data.h \
-  ndn-cpp/c/interest.h \
+  ndn-cpp/c/interest.c ndn-cpp/c/interest.h \
   ndn-cpp/c/key.h \
   ndn-cpp/c/name.c ndn-cpp/c/name.h \
   ndn-cpp/c/publisher-public-key-digest.h \
diff --git a/Makefile.in b/Makefile.in
index 9c03216..8e0426c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -132,8 +132,8 @@
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libndn_c_la_LIBADD =
 am__dirstamp = $(am__leading_dot)dirstamp
-am_libndn_c_la_OBJECTS = ndn-cpp/c/name.lo ndn-cpp/c/errors.lo \
-	ndn-cpp/c/encoding/binary-xml-data.lo \
+am_libndn_c_la_OBJECTS = ndn-cpp/c/interest.lo ndn-cpp/c/name.lo \
+	ndn-cpp/c/errors.lo ndn-cpp/c/encoding/binary-xml-data.lo \
 	ndn-cpp/c/encoding/binary-xml-decoder.lo \
 	ndn-cpp/c/encoding/binary-xml-element-reader.lo \
 	ndn-cpp/c/encoding/binary-xml-encoder.lo \
@@ -457,7 +457,7 @@
 libndn_c_la_SOURCES = \
   config.h \
   ndn-cpp/c/data.h \
-  ndn-cpp/c/interest.h \
+  ndn-cpp/c/interest.c ndn-cpp/c/interest.h \
   ndn-cpp/c/key.h \
   ndn-cpp/c/name.c ndn-cpp/c/name.h \
   ndn-cpp/c/publisher-public-key-digest.h \
@@ -605,6 +605,8 @@
 ndn-cpp/c/$(DEPDIR)/$(am__dirstamp):
 	@$(MKDIR_P) ndn-cpp/c/$(DEPDIR)
 	@: > ndn-cpp/c/$(DEPDIR)/$(am__dirstamp)
+ndn-cpp/c/interest.lo: ndn-cpp/c/$(am__dirstamp) \
+	ndn-cpp/c/$(DEPDIR)/$(am__dirstamp)
 ndn-cpp/c/name.lo: ndn-cpp/c/$(am__dirstamp) \
 	ndn-cpp/c/$(DEPDIR)/$(am__dirstamp)
 ndn-cpp/c/errors.lo: ndn-cpp/c/$(am__dirstamp) \
@@ -831,6 +833,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/$(DEPDIR)/key.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/$(DEPDIR)/name.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/$(DEPDIR)/errors.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/$(DEPDIR)/interest.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/$(DEPDIR)/name.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/encoding/$(DEPDIR)/binary-xml-data.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@ndn-cpp/c/encoding/$(DEPDIR)/binary-xml-decoder.Plo@am__quote@
diff --git a/ndn-cpp/c/interest.c b/ndn-cpp/c/interest.c
new file mode 100644
index 0000000..361412e
--- /dev/null
+++ b/ndn-cpp/c/interest.c
@@ -0,0 +1,18 @@
+/**
+ * @author: Jeff Thompson
+ * See COPYING for copyright and distribution information.
+ */
+
+#include "util/ndn_memory.h"
+#include "interest.h"
+
+int ndn_Exclude_compareComponents(struct ndn_NameComponent *component1, struct ndn_NameComponent *component2)
+{
+  if (component1->valueLength < component2->valueLength)
+    return -1;
+  if (component1->valueLength > component2->valueLength)
+    return 1;
+
+  // The components are equal length.  Just do a byte compare.  
+  return ndn_memcmp(component1->value, component2->value, component1->valueLength);
+}
diff --git a/ndn-cpp/c/interest.h b/ndn-cpp/c/interest.h
index b596c50..bdb28b1 100644
--- a/ndn-cpp/c/interest.h
+++ b/ndn-cpp/c/interest.h
@@ -62,6 +62,15 @@
   self->nEntries = 0;
 }
 
+/**
+ * Compare the components using NDN component ordering.
+ * A component is less if it is shorter, otherwise if equal length do a byte comparison.
+ * @param component1 A pointer to the first name component.
+ * @param component2 A pointer to the second name component.
+ * @return -1 if component1 is less than component2, 1 if greater or 0 if equal.
+ */
+int ndn_Exclude_compareComponents(struct ndn_NameComponent *component1, struct ndn_NameComponent *component2);
+
 enum {
   ndn_Interest_CHILD_SELECTOR_LEFT = 0,
   ndn_Interest_CHILD_SELECTOR_RIGHT = 1,