+
+#include "EXIHeaderEncoder.h"
+#include "BitOutputStream.h"
+#include "BitEncoderChannel.h"
+
+#ifndef EXI_HEADER_ENCODER_C
+#define EXI_HEADER_ENCODER_C
+
+int writeEXIHeader(bitstream_t* stream) {
+ return writeBits(stream, 8, 144);
+}
+
+
+#endif
+
+
diff --git a/src/codec/EXIHeader.h b/src/codec/EXIHeaderEncoder.h
similarity index 89%
rename from src/codec/EXIHeader.h
rename to src/codec/EXIHeaderEncoder.h
index 6a2b1a0..b286f07 100644
--- a/src/codec/EXIHeader.h
+++ b/src/codec/EXIHeaderEncoder.h
@@ -31,10 +31,8 @@ extern "C" {
#include "EXITypes.h"
-#ifndef EXI_HEADER_H
-#define EXI_HEADER_H
-
-int readEXIHeader(bitstream_t* stream);
+#ifndef EXI_HEADER_ENCODER_H
+#define EXI_HEADER_ENCODER_H
int writeEXIHeader(bitstream_t* stream);
diff --git a/src/test/main_codec.c b/src/test/main_codec.c
index c960265..408ce30 100644
--- a/src/test/main_codec.c
+++ b/src/test/main_codec.c
@@ -24,7 +24,7 @@
* Sample program to illustrate how to read an EXI stream and
* directly write it again to an output
*
- * e.g., data/test/sessionSetupReq.xml_SCHEMA.exi out/test/sessionSetupReq.xml_SCHEMA.exi
+ * e.g., data/test/sessionSetupReq.xml.exi out/test/sessionSetupReq.xml.exi
********************************************************************/
#include
@@ -104,13 +104,13 @@ int main(int argc, char *argv[]) {
do {
if (errn < 0) {
- printf("[Encode-ERROR] %d \n", errno);
+ printf("[Encode-ERROR] %d \n", errn);
return errn;
}
errn = exiDecodeNextEvent(&iStream, &stateDecode, &event);
if (errn < 0) {
- printf("[Decode-ERROR] %d \n", errno);
+ printf("[Decode-ERROR] %d \n", errn);
return errn;
}
@@ -119,7 +119,7 @@ int main(int argc, char *argv[]) {
/* decode */
errn = exiDecodeStartDocument(&iStream, &stateDecode);
if (errn < 0) {
- printf("[Decode-ERROR] %d \n", errno);
+ printf("[Decode-ERROR] %d \n", errn);
return errn;
}
printf(">> START_DOCUMENT \n");
@@ -130,7 +130,7 @@ int main(int argc, char *argv[]) {
/* decode */
errn = exiDecodeEndDocument(&iStream, &stateDecode);
if (errn < 0) {
- printf("[Decode-ERROR] %d \n", errno);
+ printf("[Decode-ERROR] %d \n", errn);
return errn;
}
printf(">> END_DOCUMENT \n");
@@ -143,7 +143,7 @@ int main(int argc, char *argv[]) {
/* decode */
errn = exiDecodeStartElement(&iStream, &stateDecode, &eqn);
if (errn < 0) {
- printf("[Decode-ERROR] %d \n", errno);
+ printf("[Decode-ERROR] %d \n", errn);
return errn;
}
exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName);
@@ -156,7 +156,7 @@ int main(int argc, char *argv[]) {
/* decode */
errn = exiDecodeEndElement(&iStream, &stateDecode, &eqn);
if (errn < 0) {
- printf("[Decode-ERROR] %d \n", errno);
+ printf("[Decode-ERROR] %d \n", errn);
return errn;
}
exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName);
@@ -169,7 +169,7 @@ int main(int argc, char *argv[]) {
/* decode */
errn = exiDecodeCharacters(&iStream, &stateDecode, &val);
if (errn < 0) {
- printf("[Decode-ERROR] %d \n", errno);
+ printf("[Decode-ERROR] %d \n", errn);
return errn;
}
if (val.type == INTEGER_BIG) {
@@ -198,7 +198,7 @@ int main(int argc, char *argv[]) {
/* decode */
errn = exiDecodeAttribute(&iStream, &stateDecode, &eqn, &val);
if (errn < 0) {
- printf("[Decode-ERROR] %d \n", errno);
+ printf("[Decode-ERROR] %d \n", errn);
return errn;
}
exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName);