diff --git a/ndn-cpp/c/encoding/BinaryXMLDecoder.c b/ndn-cpp/c/encoding/BinaryXMLDecoder.c
index 311b30a..025e679 100644
--- a/ndn-cpp/c/encoding/BinaryXMLDecoder.c
+++ b/ndn-cpp/c/encoding/BinaryXMLDecoder.c
@@ -30,9 +30,9 @@
  * @param value
  * @param valueLength
  * @param resultOut output the parsed integer.
- * @return 0 for success, else an error string, including if an element of value is not a decimal digit.
+ * @return 0 for success, else an error code, including if an element of value is not a decimal digit.
  */
-static char *parseUnsignedDecimalInt(unsigned char *value, unsigned int valueLength, unsigned int *resultOut)
+static ndn_Error parseUnsignedDecimalInt(unsigned char *value, unsigned int valueLength, unsigned int *resultOut)
 {
   unsigned int result = 0;
   
@@ -40,7 +40,7 @@
   for (i = 0; i < valueLength; ++i) {
     unsigned char digit = value[i];
     if (!(digit >= '0' && digit <= '9'))
-      return "parseUnsignedDecimalInt: element of value is not a decimal digit";
+      return NDN_ERROR_element_of_value_is_not_a_decimal_digit;
 
     result *= 10;
     result += (unsigned int)(digit - '0');
@@ -50,20 +50,20 @@
   return 0;
 }
 
-char *ndn_BinaryXMLDecoder_decodeTypeAndValue(struct ndn_BinaryXMLDecoder *self, unsigned int *type, unsigned int *valueOut) 
+ndn_Error ndn_BinaryXMLDecoder_decodeTypeAndValue(struct ndn_BinaryXMLDecoder *self, unsigned int *type, unsigned int *valueOut) 
 {
   unsigned int value = 0;
   int gotFirstOctet = 0;
   
 	while (1) {
     if (self->offset >= self->inputLength)
-      return "ndn_BinaryXMLDecoder_decodeTypeAndVal: read past the end of the input";
+      return NDN_ERROR_read_past_the_end_of_the_input;
     
 		unsigned int octet = unsafeReadOctet(self);
 		
     if (!gotFirstOctet) {
       if (octet == 0)
-        return "ndn_BinaryXMLDecoder_decodeTypeAndVal: the first header octet may not be zero";
+        return NDN_ERROR_the_first_header_octet_may_not_be_zero;
       
       gotFirstOctet = 1;
     }
@@ -82,49 +82,49 @@
   return 0;
 }
 
-char *ndn_BinaryXMLDecoder_readElementStartDTag(struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag)
+ndn_Error ndn_BinaryXMLDecoder_readElementStartDTag(struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag)
 {
-  char *error;
+  ndn_Error error;
   unsigned int type;
   unsigned int value;
   if (error = ndn_BinaryXMLDecoder_decodeTypeAndValue(self, &type, &value))
     return error;
   
   if (type != ndn_BinaryXML_DTAG)
-    return "ndn_BinaryXMLDecoder_readElementStartDTag: header type is not a DTAG";
+    return NDN_ERROR_header_type_is_not_a_DTAG;
   
   if (value != expectedTag)
-    return "ndn_BinaryXMLDecoder_readElementStartDTag: did not get the expected DTAG";
+    return NDN_ERROR_did_not_get_the_expected_DTAG;
   
   return 0;
 }
 
-char *ndn_BinaryXMLDecoder_readElementClose(struct ndn_BinaryXMLDecoder *self)
+ndn_Error ndn_BinaryXMLDecoder_readElementClose(struct ndn_BinaryXMLDecoder *self)
 {
   if (self->offset >= self->inputLength)
-    return "ndn_BinaryXMLDecoder_readElementClose: read past the end of the input";
+    return NDN_ERROR_read_past_the_end_of_the_input;
   
   if (unsafeReadOctet(self) != ndn_BinaryXML_CLOSE)
-    return "ndn_BinaryXMLDecoder_readElementStartDTag: did not get the expected element close";
+    return NDN_ERROR_did_not_get_the_expected_element_close;
   
   return 0;
 }
 
-char *ndn_BinaryXMLDecoder_peekDTag(struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, int *gotExpectedTag)
+ndn_Error ndn_BinaryXMLDecoder_peekDTag(struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, int *gotExpectedTag)
 {
   // Default to 0.
   *gotExpectedTag = 0;
 
   // First check if it is an element close (which cannot be the expected tag).  
   if (self->offset >= self->inputLength)
-    return "ndn_BinaryXMLDecoder_readElementClose: read past the end of the input";
+    return NDN_ERROR_read_past_the_end_of_the_input;
   if (unsafeGetOctet(self) == 0)
     return 0;
 
   unsigned int type;
   unsigned int value;
   unsigned int saveOffset = self->offset;
-  char *error = ndn_BinaryXMLDecoder_decodeTypeAndValue(self, &type, &value);
+  ndn_Error error = ndn_BinaryXMLDecoder_decodeTypeAndValue(self, &type, &value);
   // Restore offset.
   self->offset = saveOffset;
   
@@ -137,16 +137,16 @@
   return 0;
 }
 
-char *ndn_BinaryXMLDecoder_readBinaryDTagElement
+ndn_Error ndn_BinaryXMLDecoder_readBinaryDTagElement
   (struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, int allowNull, unsigned char **value, unsigned int *valueLen)
 {
-  char *error;
+  ndn_Error error;
   if (error = ndn_BinaryXMLDecoder_readElementStartDTag(self, expectedTag))
     return error;
   
   if (allowNull) {
     if (self->offset >= self->inputLength)
-      return "ndn_BinaryXMLDecoder_readBinaryDTagElement: read past the end of the input";
+      return NDN_ERROR_read_past_the_end_of_the_input;
   
     if (unsafeGetOctet(self) == ndn_BinaryXML_CLOSE) {
       // The binary item is missing, and this is allowed, so read the element close and return a null value.
@@ -170,10 +170,10 @@
   return 0;
 }
 
-char *ndn_BinaryXMLDecoder_readUDataDTagElement
+ndn_Error ndn_BinaryXMLDecoder_readUDataDTagElement
   (struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, unsigned char **value, unsigned int *valueLen)
 {
-  char *error;
+  ndn_Error error;
   if (error = ndn_BinaryXMLDecoder_readElementStartDTag(self, expectedTag))
     return error;
     
@@ -181,7 +181,7 @@
   if (error = ndn_BinaryXMLDecoder_decodeTypeAndValue(self, &itemType, valueLen))
     return error;
   if (itemType != ndn_BinaryXML_UDATA)
-    return "ndn_BinaryXMLDecoder_readUDataDTagElement: item is not UDATA";
+    return NDN_ERROR_item_is_not_UDATA;
   *value = self->input + self->offset;
   self->offset += *valueLen;
   
@@ -191,12 +191,12 @@
   return 0;
 }
 
-char *ndn_BinaryXMLDecoder_readUnsignedIntegerDTagElement
+ndn_Error ndn_BinaryXMLDecoder_readUnsignedIntegerDTagElement
   (struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, unsigned int *value)
 {
   unsigned char *udataValue;
   unsigned int udataValueLength;
-  char *error;
+  ndn_Error error;
   if (error = ndn_BinaryXMLDecoder_readUDataDTagElement(self, expectedTag, &udataValue, &udataValueLength))
     return error;
   
@@ -206,11 +206,11 @@
   return 0;
 }
 
-char *ndn_BinaryXMLDecoder_readOptionalUnsignedIntegerDTagElement
+ndn_Error ndn_BinaryXMLDecoder_readOptionalUnsignedIntegerDTagElement
   (struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, int *value)
 {
   int gotExpectedTag;
-  char *error;
+  ndn_Error error;
   if (error = ndn_BinaryXMLDecoder_peekDTag(self, expectedTag, &gotExpectedTag))
     return error;
     
diff --git a/ndn-cpp/c/encoding/BinaryXMLDecoder.h b/ndn-cpp/c/encoding/BinaryXMLDecoder.h
index 9c83c3b..0c1427e 100644
--- a/ndn-cpp/c/encoding/BinaryXMLDecoder.h
+++ b/ndn-cpp/c/encoding/BinaryXMLDecoder.h
@@ -6,6 +6,8 @@
 #ifndef NDN_BINARYXMLDECODER_H
 #define	NDN_BINARYXMLDECODER_H
 
+#include "../errors.h"
+
 #ifdef	__cplusplus
 extern "C" {
 #endif
@@ -28,25 +30,25 @@
  * @param self pointer to the ndn_BinaryXMLDecoder struct
  * @param type output for the header type
  * @param value output for the header value
- * @return 0 for success, else an error string for read past the end of the input or if the initial byte is zero
+ * @return 0 for success, else an error code for read past the end of the input or if the initial byte is zero
  */
-char *ndn_BinaryXMLDecoder_decodeTypeAndValue(struct ndn_BinaryXMLDecoder *self, unsigned int *type, unsigned int *value);
+ndn_Error ndn_BinaryXMLDecoder_decodeTypeAndValue(struct ndn_BinaryXMLDecoder *self, unsigned int *type, unsigned int *value);
 
 /**
  * Decode the header from self's input starting at offset, expecting the type to be DTAG and the value to be expectedTag.
  * Update offset.
  * @param self pointer to the ndn_BinaryXMLDecoder struct
  * @param expectedTag the expected value for DTAG
- * @return 0 for success, else an error string, including an error if not the expected tag
+ * @return 0 for success, else an error code, including an error if not the expected tag
  */
-char *ndn_BinaryXMLDecoder_readElementStartDTag(struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag);
+ndn_Error ndn_BinaryXMLDecoder_readElementStartDTag(struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag);
 
 /**
  * Read one byte from self's input starting at offset, expecting it to be the element close.
  * @param self pointer to the ndn_BinaryXMLDecoder struct
- * @return 0 for success, else an error string, including an error if not the element close
+ * @return 0 for success, else an error code, including an error if not the element close
  */
-char *ndn_BinaryXMLDecoder_readElementClose(struct ndn_BinaryXMLDecoder *self);
+ndn_Error ndn_BinaryXMLDecoder_readElementClose(struct ndn_BinaryXMLDecoder *self);
 
 /**
  * Decode the header from self's input starting at offset, and if it is a DTAG where the value is the expectedTag,
@@ -54,9 +56,9 @@
  * @param self pointer to the ndn_BinaryXMLDecoder struct
  * @param expectedTag the expected value for DTAG
  * @param gotExpectedTag output a 1 if got the expected tag, else 0
- * @return 0 for success, else an error string for read past the end of the input
+ * @return 0 for success, else an error code for read past the end of the input
  */
-char *ndn_BinaryXMLDecoder_peekDTag(struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, int *gotExpectedTag);
+ndn_Error ndn_BinaryXMLDecoder_peekDTag(struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, int *gotExpectedTag);
 
 /**
  * Decode the header from self's input starting at offset, expecting the type to be DTAG and the value to be expectedTag.
@@ -70,10 +72,10 @@
  * binary data item is absent, then return 0.
  * @param valueLen output the length of the binary data. However, if allowNull is 1 and the
  * binary data item is absent, then return 0.
- * @return 0 for success, else an error string, including an error if not the expected tag, or if allowNull is 0
+ * @return 0 for success, else an error code, including an error if not the expected tag, or if allowNull is 0
  * and the binary data is absent
  */
-char *ndn_BinaryXMLDecoder_readBinaryDTagElement
+ndn_Error ndn_BinaryXMLDecoder_readBinaryDTagElement
   (struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, int allowNull, unsigned char **value, unsigned int *valueLen);
 
 /**
@@ -84,9 +86,9 @@
  * @param expectedTag the expected value for DTAG
  * @param value output a pointer to the binary data inside self's input buffer.
  * @param valueLen output the length of the binary data.
- * @return 0 for success, else an error string, including an error if not the expected tag, or if the item is not UDATA.
+ * @return 0 for success, else an error code, including an error if not the expected tag, or if the item is not UDATA.
  */
-char *ndn_BinaryXMLDecoder_readUDataDTagElement
+ndn_Error ndn_BinaryXMLDecoder_readUDataDTagElement
   (struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, unsigned char **value, unsigned int *valueLen);
 
 /**
@@ -96,10 +98,10 @@
  * @param self pointer to the ndn_BinaryXMLDecoder struct
  * @param expectedTag the expected value for DTAG
  * @param value output the unsigned integer
- * @return 0 for success, else an error string, including an error if not the expected tag, or if the item is not UDATA,
+ * @return 0 for success, else an error code, including an error if not the expected tag, or if the item is not UDATA,
  * or can't parse the integer
  */
-char *ndn_BinaryXMLDecoder_readUnsignedIntegerDTagElement
+ndn_Error ndn_BinaryXMLDecoder_readUnsignedIntegerDTagElement
   (struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, unsigned int *value);
 
 /**
@@ -108,10 +110,10 @@
  * @param self pointer to the ndn_BinaryXMLDecoder struct
  * @param expectedTag the expected value for DTAG
  * @param value output the unsigned integer cast to int, or -1 if the next element doesn't have expectedTag.
- * @return 0 for success, else an error string, including an error if the item is not UDATA,
+ * @return 0 for success, else an error code, including an error if the item is not UDATA,
  * or can't parse the integer
  */
-char *ndn_BinaryXMLDecoder_readOptionalUnsignedIntegerDTagElement
+ndn_Error ndn_BinaryXMLDecoder_readOptionalUnsignedIntegerDTagElement
   (struct ndn_BinaryXMLDecoder *self, unsigned int expectedTag, int *value);
 
 /**
diff --git a/ndn-cpp/c/encoding/BinaryXMLEncoder.c b/ndn-cpp/c/encoding/BinaryXMLEncoder.c
index cf35741..eacd197 100644
--- a/ndn-cpp/c/encoding/BinaryXMLEncoder.c
+++ b/ndn-cpp/c/encoding/BinaryXMLEncoder.c
@@ -19,11 +19,11 @@
  * @param self pointer to the ndn_BinaryXMLEncoder struct
  * @param array the array to copy
  * @param arrayLength the length of the array
- * @return 0 for success, else an error string
+ * @return 0 for success, else an error code
  */
-static char *writeArray(struct ndn_BinaryXMLEncoder *self, unsigned char *array, unsigned int arrayLength)
+static ndn_Error writeArray(struct ndn_BinaryXMLEncoder *self, unsigned char *array, unsigned int arrayLength)
 {
-  char *error;
+  ndn_Error error;
   if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + arrayLength))
     return error;
   
@@ -59,14 +59,14 @@
 	return nBytes;
 }
 
-char *ndn_BinaryXMLEncoder_encodeTypeAndValue(struct ndn_BinaryXMLEncoder *self, unsigned int type, unsigned int value)
+ndn_Error ndn_BinaryXMLEncoder_encodeTypeAndValue(struct ndn_BinaryXMLEncoder *self, unsigned int type, unsigned int value)
 {
 	if (type > ndn_BinaryXML_UDATA)
-		return "ndn_BinaryXMLEncoder_encodeTypeAndValue: type is out of range";
+		return NDN_ERROR_header_type_is_out_of_range;
   
 	// Encode backwards. Calculate how many bytes we need.
 	unsigned int nEncodingBytes = getNEncodingBytes(value);
-  char *error;
+  ndn_Error error;
   if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + nEncodingBytes))
     return error;
 
@@ -86,16 +86,16 @@
 	}
 	if (value != 0)
     // This should not happen if getNEncodingBytes is correct.
-		return "ndn_BinaryXMLEncoder_encodeTypeAndValue: : miscalculated N encoding bytes";
+		return NDN_ERROR_encodeTypeAndValue_miscalculated_N_encoding_bytes;
 	
 	self->offset+= nEncodingBytes;
   
   return 0;
 }
 
-char *ndn_BinaryXMLEncoder_writeElementClose(struct ndn_BinaryXMLEncoder *self)
+ndn_Error ndn_BinaryXMLEncoder_writeElementClose(struct ndn_BinaryXMLEncoder *self)
 {
-  char *error;
+  ndn_Error error;
   if (error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1))
     return error;
   
@@ -105,9 +105,9 @@
   return 0;
 }
 
-char *ndn_BinaryXMLEncoder_writeBlob(struct ndn_BinaryXMLEncoder *self, unsigned char *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXMLEncoder_writeBlob(struct ndn_BinaryXMLEncoder *self, unsigned char *value, unsigned int valueLength)
 {
-  char *error;
+  ndn_Error error;
   if (error = ndn_BinaryXMLEncoder_encodeTypeAndValue(self, ndn_BinaryXML_BLOB, valueLength))
     return error;
   
@@ -117,9 +117,9 @@
   return 0;
 }
 
-char *ndn_BinaryXMLEncoder_writeBlobDTagElement(struct ndn_BinaryXMLEncoder *self, unsigned int tag, unsigned char *value, unsigned int valueLength)
+ndn_Error ndn_BinaryXMLEncoder_writeBlobDTagElement(struct ndn_BinaryXMLEncoder *self, unsigned int tag, unsigned char *value, unsigned int valueLength)
 {
-  char *error;
+  ndn_Error error;
   if (error = ndn_BinaryXMLEncoder_writeElementStartDTag(self, tag))
     return error;
   
diff --git a/ndn-cpp/c/encoding/BinaryXMLEncoder.h b/ndn-cpp/c/encoding/BinaryXMLEncoder.h
index 2805d81..eb87602 100644
--- a/ndn-cpp/c/encoding/BinaryXMLEncoder.h
+++ b/ndn-cpp/c/encoding/BinaryXMLEncoder.h
@@ -6,6 +6,7 @@
 #ifndef NDN_BINARYXMLENCODER_H
 #define	NDN_BINARYXMLENCODER_H
 
+#include "../errors.h"
 #include "../util/DynamicUCharArray.h"
 #include "BinaryXML.h"
 
@@ -42,17 +43,17 @@
  * @param self pointer to the ndn_BinaryXMLEncoder struct
  * @param type the header type
  * @param value the header value
- * @return 0 for success, else an error string
+ * @return 0 for success, else an error code
  */
-char *ndn_BinaryXMLEncoder_encodeTypeAndValue(struct ndn_BinaryXMLEncoder *self, unsigned int type, unsigned int value);
+ndn_Error ndn_BinaryXMLEncoder_encodeTypeAndValue(struct ndn_BinaryXMLEncoder *self, unsigned int type, unsigned int value);
 
 /**
  * Write an element start header using DTAG with the tag to self->output.
  * @param self pointer to the ndn_BinaryXMLEncoder struct
  * @param tag the DTAG tag
- * @return 0 for success, else an error string
+ * @return 0 for success, else an error code
  */
-static inline char *ndn_BinaryXMLEncoder_writeElementStartDTag(struct ndn_BinaryXMLEncoder *self, unsigned int tag) 
+static inline ndn_Error ndn_BinaryXMLEncoder_writeElementStartDTag(struct ndn_BinaryXMLEncoder *self, unsigned int tag) 
 {
   return ndn_BinaryXMLEncoder_encodeTypeAndValue(self, ndn_BinaryXML_DTAG, tag);
 }
@@ -60,18 +61,18 @@
 /**
  * Write an element close to self->output.
  * @param self pointer to the ndn_BinaryXMLEncoder struct
- * @return 0 for success, else an error string
+ * @return 0 for success, else an error code
  */
-char *ndn_BinaryXMLEncoder_writeElementClose(struct ndn_BinaryXMLEncoder *self);
+ndn_Error ndn_BinaryXMLEncoder_writeElementClose(struct ndn_BinaryXMLEncoder *self);
 
 /**
  * Write a BLOB header, then the bytes of the blob value to self->output.
  * @param self pointer to the ndn_BinaryXMLEncoder struct
  * @param value an array of bytes for the blob value
  * @param valueLength the length of the array
- * @return 0 for success, else an error string
+ * @return 0 for success, else an error code
  */
-char *ndn_BinaryXMLEncoder_writeBlob(struct ndn_BinaryXMLEncoder *self, unsigned char *value, unsigned int valueLength);
+ndn_Error ndn_BinaryXMLEncoder_writeBlob(struct ndn_BinaryXMLEncoder *self, unsigned char *value, unsigned int valueLength);
 
 /**
  * Write an element start header using DTAG with the tag to self->output, then the blob, then an element close.
@@ -80,9 +81,9 @@
  * @param tag the DTAG tag
  * @param value an array of bytes for the blob value
  * @param valueLength the length of the array
- * @return 0 for success, else an error string
+ * @return 0 for success, else an error code
  */
-char *ndn_BinaryXMLEncoder_writeBlobDTagElement(struct ndn_BinaryXMLEncoder *self, unsigned int tag, unsigned char *value, unsigned int valueLength);
+ndn_Error ndn_BinaryXMLEncoder_writeBlobDTagElement(struct ndn_BinaryXMLEncoder *self, unsigned int tag, unsigned char *value, unsigned int valueLength);
 
 #ifdef	__cplusplus
 }
diff --git a/ndn-cpp/c/encoding/BinaryXMLInterest.c b/ndn-cpp/c/encoding/BinaryXMLInterest.c
index a00d3be..1131428 100644
--- a/ndn-cpp/c/encoding/BinaryXMLInterest.c
+++ b/ndn-cpp/c/encoding/BinaryXMLInterest.c
@@ -8,9 +8,9 @@
 #include "BinaryXMLName.h"
 #include "BinaryXMLInterest.h"
 
-char *ndn_decodeBinaryXMLInterest(struct ndn_Interest *interest, struct ndn_BinaryXMLDecoder *decoder)
+ndn_Error ndn_decodeBinaryXMLInterest(struct ndn_Interest *interest, struct ndn_BinaryXMLDecoder *decoder)
 {
-  char *error;
+  ndn_Error error;
   if (error = ndn_BinaryXMLDecoder_readElementStartDTag(decoder, ndn_BinaryXML_DTag_Interest))
     return error;
     
diff --git a/ndn-cpp/c/encoding/BinaryXMLInterest.h b/ndn-cpp/c/encoding/BinaryXMLInterest.h
index 12de088..38917aa 100644
--- a/ndn-cpp/c/encoding/BinaryXMLInterest.h
+++ b/ndn-cpp/c/encoding/BinaryXMLInterest.h
@@ -6,15 +6,16 @@
 #ifndef NDN_BINARYXMLINTEREST_H
 #define	NDN_BINARYXMLINTEREST_H
 
+#include "../errors.h"
 #include "../Interest.h"
 
 #ifdef	__cplusplus
 extern "C" {
 #endif
 
-char *ndn_encodeBinaryXMLInterest(struct ndn_Interest *interest, struct ndn_BinaryXMLEncoder *encoder);
+ndn_Error ndn_encodeBinaryXMLInterest(struct ndn_Interest *interest, struct ndn_BinaryXMLEncoder *encoder);
 
-char *ndn_decodeBinaryXMLInterest(struct ndn_Interest *interest, struct ndn_BinaryXMLDecoder *decoder);
+ndn_Error ndn_decodeBinaryXMLInterest(struct ndn_Interest *interest, struct ndn_BinaryXMLDecoder *decoder);
 
 #ifdef	__cplusplus
 }
diff --git a/ndn-cpp/c/encoding/BinaryXMLName.c b/ndn-cpp/c/encoding/BinaryXMLName.c
index 9c2ea6a..bc32058 100644
--- a/ndn-cpp/c/encoding/BinaryXMLName.c
+++ b/ndn-cpp/c/encoding/BinaryXMLName.c
@@ -7,9 +7,9 @@
 #include "BinaryXMLDecoder.h"
 #include "BinaryXMLName.h"
 
-char *ndn_encodeBinaryXMLName(struct ndn_Name *name, struct ndn_BinaryXMLEncoder *encoder)
+ndn_Error ndn_encodeBinaryXMLName(struct ndn_Name *name, struct ndn_BinaryXMLEncoder *encoder)
 {
-  char *error;
+  ndn_Error error;
   if (error = ndn_BinaryXMLEncoder_writeElementStartDTag(encoder, ndn_BinaryXML_DTag_Name))
     return error;
   
@@ -26,9 +26,9 @@
   return 0;
 }
 
-char *ndn_decodeBinaryXMLName(struct ndn_Name *name, struct ndn_BinaryXMLDecoder *decoder)
+ndn_Error ndn_decodeBinaryXMLName(struct ndn_Name *name, struct ndn_BinaryXMLDecoder *decoder)
 {
-  char *error;
+  ndn_Error error;
   if (error = ndn_BinaryXMLDecoder_readElementStartDTag(decoder, ndn_BinaryXML_DTag_Name))
     return error;
     
@@ -48,7 +48,7 @@
     
     // Add the component to the name.
     if (name->nComponents >= name->maxComponents)
-      return "ndn_decodeBinaryXMLName: read a component past the maximum number of components allowed in the name";
+      return NDN_ERROR_read_a_component_past_the_maximum_number_of_components_allowed_in_the_name;
     ndn_NameComponent_init(name->components + name->nComponents, component, componentLen);
     ++name->nComponents;
   }
diff --git a/ndn-cpp/c/encoding/BinaryXMLName.h b/ndn-cpp/c/encoding/BinaryXMLName.h
index 764fc1e..6560f3e 100644
--- a/ndn-cpp/c/encoding/BinaryXMLName.h
+++ b/ndn-cpp/c/encoding/BinaryXMLName.h
@@ -6,6 +6,7 @@
 #ifndef NDN_BINARYXMLNAME_H
 #define	NDN_BINARYXMLNAME_H
 
+#include "../errors.h"
 #include "../Name.h"
 #include "BinaryXMLEncoder.h"
 
@@ -13,9 +14,9 @@
 extern "C" {
 #endif
 
-char *ndn_encodeBinaryXMLName(struct ndn_Name *name, struct ndn_BinaryXMLEncoder *encoder);
+ndn_Error ndn_encodeBinaryXMLName(struct ndn_Name *name, struct ndn_BinaryXMLEncoder *encoder);
 
-char *ndn_decodeBinaryXMLName(struct ndn_Name *name, struct ndn_BinaryXMLDecoder *decoder);
+ndn_Error ndn_decodeBinaryXMLName(struct ndn_Name *name, struct ndn_BinaryXMLDecoder *decoder);
 
 #ifdef	__cplusplus
 }
diff --git a/ndn-cpp/c/encoding/BinaryXMLStructureDecoder.c b/ndn-cpp/c/encoding/BinaryXMLStructureDecoder.c
index 571db24..f9d7dda 100644
--- a/ndn-cpp/c/encoding/BinaryXMLStructureDecoder.c
+++ b/ndn-cpp/c/encoding/BinaryXMLStructureDecoder.c
@@ -29,7 +29,7 @@
   self->state = ndn_BinaryXMLStructureDecoder_READ_HEADER_OR_CLOSE;    
 }
 
-char *ndn_BinaryXMLStructureDecoder_findElementEnd
+ndn_Error ndn_BinaryXMLStructureDecoder_findElementEnd
   (struct ndn_BinaryXMLStructureDecoder *self, unsigned char *input, unsigned int inputLength) 
 {
   if (self->gotElementEnd)
@@ -56,7 +56,7 @@
           return 0;
         }
         if (self->level < 0)
-          return "ndn_BinaryXMLStructureDecoder_findElementEnd: Unexpected close tag";
+          return NDN_ERROR_findElementEnd_unexpected_close_tag;
           
         // Get ready for the next header.
         startHeader(self);
@@ -68,7 +68,7 @@
         if (self->offset >= inputLength) {
           // We can't get all of the header bytes from this input. Save in headerBuffer.
           if (self->headerLength > sizeof(self->headerBuffer))
-            return "ndn_BinaryXMLStructureDecoder_findElementEnd: Can't store more header bytes than the size of headerBuffer";
+            return NDN_ERROR_cannot_store_more_header_bytes_than_the_size_of_headerBuffer;
           self->useHeaderBuffer = 1;
           unsigned int nNewBytes = self->headerLength - startingHeaderLength;
           ndn_memcpy(self->headerBuffer + startingHeaderLength, input + (self->offset - nNewBytes), nNewBytes);
@@ -87,7 +87,7 @@
       if (self->useHeaderBuffer) {
         // Copy the remaining bytes into headerBuffer.
         if (self->headerLength > sizeof(self->headerBuffer))
-          return "ndn_BinaryXMLStructureDecoder_findElementEnd: Can't store more header bytes than the size of headerBuffer";
+          return NDN_ERROR_cannot_store_more_header_bytes_than_the_size_of_headerBuffer;
         unsigned int nNewBytes = self->headerLength - startingHeaderLength;
         ndn_memcpy(self->headerBuffer + startingHeaderLength, input + (self->offset - nNewBytes), nNewBytes);
 
@@ -95,13 +95,13 @@
         struct ndn_BinaryXMLDecoder bufferDecoder;
         ndn_BinaryXMLDecoder_init(&bufferDecoder, self->headerBuffer, sizeof(self->headerBuffer));
         if (ndn_BinaryXMLDecoder_decodeTypeAndValue(&bufferDecoder, &type, &value))
-          return "ndn_BinaryXMLStructureDecoder_findElementEnd: Can't read header type and value";
+          return NDN_ERROR_findElementEnd_cannot_read_header_type_and_value;
       }
       else {
         // We didn't have to use the headerBuffer.
         ndn_BinaryXMLDecoder_seek(&decoder, self->offset - self->headerLength);
         if (ndn_BinaryXMLDecoder_decodeTypeAndValue(&decoder, &type, &value))
-          return "ndn_BinaryXMLStructureDecoder_findElementEnd: Can't read header type and value";
+          return NDN_ERROR_findElementEnd_cannot_read_header_type_and_value;
       }
         
       // Set the next state based on the type.
@@ -128,7 +128,7 @@
         self->state = ndn_BinaryXMLStructureDecoder_READ_BYTES;
       }
       else
-        return "ndn_BinaryXMLStructureDecoder_findElementEnd: Unrecognized header type";
+        return NDN_ERROR_findElementEnd_unrecognized_header_type;
     }  
     else if (self->state == ndn_BinaryXMLStructureDecoder_READ_BYTES) {
       unsigned int nRemainingBytes = inputLength - self->offset;
@@ -144,6 +144,6 @@
     }
     else
       // We don't expect this to happen.
-      return "ndn_BinaryXMLStructureDecoder_findElementEnd: Unrecognized state";
+      return NDN_ERROR_findElementEnd_unrecognized_state;
   }
 }
diff --git a/ndn-cpp/c/encoding/BinaryXMLStructureDecoder.h b/ndn-cpp/c/encoding/BinaryXMLStructureDecoder.h
index 2d91562..04ddd08 100644
--- a/ndn-cpp/c/encoding/BinaryXMLStructureDecoder.h
+++ b/ndn-cpp/c/encoding/BinaryXMLStructureDecoder.h
@@ -6,6 +6,8 @@
 #ifndef NDN_BINARYXMLSTRUCTUREDECODER_H
 #define	NDN_BINARYXMLSTRUCTUREDECODER_H
 
+#include "../errors.h"
+
 #ifdef	__cplusplus
 extern "C" {
 #endif
@@ -37,9 +39,9 @@
  * @param self pointer to the ndn_BinaryXMLStructureDecoder struct
  * @param input the input buffer. You have to pass in input each time because the buffer could be reallocated.
  * @param inputLength the number of bytes in input.
- * @return 0 for success, else an error string
+ * @return 0 for success, else an error code
  */
-char *ndn_BinaryXMLStructureDecoder_findElementEnd
+ndn_Error ndn_BinaryXMLStructureDecoder_findElementEnd
   (struct ndn_BinaryXMLStructureDecoder *self, unsigned char *input, unsigned int inputLength);
 
 #ifdef	__cplusplus
