* eliminates remaining -ansic -pedantic warnings

* project settings set to report -pedantic warnings 

git-svn-id: https://svn.code.sf.net/p/openv2g/code/trunk@4 d9f2db14-54d0-4bde-b00c-16405c910529
This commit is contained in:
daniel_peintner 2010-09-28 07:46:44 +00:00
parent 8f499da64a
commit e42f201089
13 changed files with 1262 additions and 12504 deletions

View file

@ -30,11 +30,13 @@
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.113647340" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug"> <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.113647340" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.1898653479" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" valueType="enumerated"/> <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.1898653479" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.294845555" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/> <option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.294845555" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.773068816" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"> <option id="gnu.c.compiler.option.include.paths.773068816" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/OpenV2G/src/codec}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/OpenV2G/src/codec}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/OpenV2G/src/service}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/OpenV2G/src/service}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/OpenV2G/src/test}&quot;"/> <listOptionValue builtIn="false" value="&quot;${workspace_loc:/OpenV2G/src/test}&quot;"/>
</option> </option>
<option id="gnu.c.compiler.option.warnings.pedantic.1676854851" superClass="gnu.c.compiler.option.warnings.pedantic" value="true" valueType="boolean"/>
<option id="gnu.c.compiler.option.misc.ansi.722225100" superClass="gnu.c.compiler.option.misc.ansi" value="true" valueType="boolean"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.67299528" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/> <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.67299528" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool> </tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.867726048" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug"> <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.867726048" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">

View file

@ -1 +1 @@
<EFBFBD>˜A<EFBFBD>™¡©±ºcF€ <EFBFBD>˜A<EFBFBD>™¡©±ºc<EFBFBD>

View file

@ -110,6 +110,7 @@ int decodeUnsignedInteger64(bitstream_t* stream, uint64_t* uint64) {
*/ */
int decodeInteger32(bitstream_t* stream, int32_t* int32) { int decodeInteger32(bitstream_t* stream, int32_t* int32) {
int b; int b;
uint32_t uint32;
int errn = decodeBoolean(stream, &b); int errn = decodeBoolean(stream, &b);
if (errn < 0) { if (errn < 0) {
@ -119,13 +120,15 @@ int decodeInteger32(bitstream_t* stream, int32_t* int32) {
if (b) { if (b) {
/* For negative values, the Unsigned Integer holds the /* For negative values, the Unsigned Integer holds the
* magnitude of the value minus 1 */ * magnitude of the value minus 1 */
errn = decodeUnsignedInteger32(stream, int32); errn = decodeUnsignedInteger32(stream, &uint32);
*int32 = -(*int32 + 1); *int32 = -(uint32 + 1);
return errn;
} else { } else {
/* positive */ /* positive */
return decodeUnsignedInteger32(stream, int32); errn = decodeUnsignedInteger32(stream, &uint32);
*int32 = (int32_t)(uint32);
} }
return errn;
} }
/** /**
@ -136,6 +139,7 @@ int decodeInteger32(bitstream_t* stream, int32_t* int32) {
*/ */
int decodeInteger64(bitstream_t* stream, int64_t* int64) { int decodeInteger64(bitstream_t* stream, int64_t* int64) {
int b; int b;
uint64_t uint64;
int errn = decodeBoolean(stream, &b); int errn = decodeBoolean(stream, &b);
if (errn < 0) { if (errn < 0) {
@ -145,13 +149,15 @@ int decodeInteger64(bitstream_t* stream, int64_t* int64) {
if (b) { if (b) {
/* For negative values, the Unsigned Integer holds the /* For negative values, the Unsigned Integer holds the
* magnitude of the value minus 1 */ * magnitude of the value minus 1 */
errn = decodeUnsignedInteger64(stream, int64); errn = decodeUnsignedInteger64(stream, &uint64);
*int64 = -(*int64 + 1); *int64 = -(uint64 + 1);
return errn;
} else { } else {
/* positive */ /* positive */
return decodeUnsignedInteger64(stream, int64); errn = decodeUnsignedInteger64(stream, &uint64);
*int64 = (int64_t)(uint64);
} }
return errn;
} }
/** /**

View file

@ -38,14 +38,11 @@
int toBitstream(const char * filename, bitstream_t* bitstream) { int toBitstream(const char * filename, bitstream_t* bitstream) {
FILE* f; FILE* f;
// bitstream_t* bitstream;
int character; int character;
size_t len = 0, pos = 0, i; size_t len = 0, pos = 0, i;
f = fopen(filename, "rb"); f = fopen(filename, "rb");
// bitstream = malloc(sizeof(bitstream_t));
if (f == NULL) { if (f == NULL) {
printf("\n[Error] no valid file handle !\n"); printf("\n[Error] no valid file handle !\n");
return -1; return -1;

View file

@ -49,7 +49,7 @@
int exiPushStack(exi_state_t* state, size_t newState, eqname_t* eqn) { int exiPushStack(exi_state_t* state, size_t newState, eqname_t* eqn) {
if ((state->stackIndex + 1) < EXI_ELEMENT_STACK_SIZE) { if ((state->stackIndex + 1) < EXI_ELEMENT_STACK_SIZE) {
state->grammarStack[++state->stackIndex] = newState; state->grammarStack[++state->stackIndex] = newState;
// copy qname /* copy qname */
state->elementStack[state->stackIndex].localPart = eqn->localPart; state->elementStack[state->stackIndex].localPart = eqn->localPart;
state->elementStack[state->stackIndex].namespaceURI = eqn->namespaceURI; state->elementStack[state->stackIndex].namespaceURI = eqn->namespaceURI;
return 0; return 0;

View file

@ -37,7 +37,7 @@ extern "C" {
#include "EXITypes.h" #include "EXITypes.h"
// size_t exiGetCurrentState(struct exiState* state); /* size_t exiGetCurrentState(struct exiState* state); */
int exiPushStack(exi_state_t* state, size_t newState, eqname_t* eqn); int exiPushStack(exi_state_t* state, size_t newState, eqname_t* eqn);

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -74,15 +74,6 @@ typedef struct {
size_t len; size_t len;
} string_ucs_t; } string_ucs_t;
/* ASCII strings */
typedef struct {
size_t size;
char* ascii;
/* current length == number of characters, (len <= size) */
size_t len;
} string_ascii_t;
typedef struct { typedef struct {
/* range of the mantissa is -(2^63) to 2^63-1 */ /* range of the mantissa is -(2^63) to 2^63-1 */
int64_t mantissa; int64_t mantissa;
@ -161,8 +152,10 @@ typedef struct {
typedef struct { typedef struct {
/* union of base types */ /* type of value */
union { exi_datatype_t type;
/* base types */
int boolean; int boolean;
int8_t int8; int8_t int8;
uint8_t uint8; uint8_t uint8;
@ -170,14 +163,11 @@ typedef struct {
int32_t int32; int32_t int32;
int64_t int64; int64_t int64;
uint8_t enumeration; uint8_t enumeration;
};
/* Bytes, Strings and Lists are not base types */ /* Bytes, Strings and Lists are not native types anymore */
bytes_t binary; bytes_t binary;
string_ucs_t string; string_ucs_t string;
list_t list; list_t list;
/* value datatype */
exi_datatype_t type;
} exi_value_t; } exi_value_t;

View file

@ -72,7 +72,6 @@ int exiGetLocalName(size_t uriID, size_t localNameID, const char** localName) {
if ( uriID < stringTable.len ) { if ( uriID < stringTable.len ) {
if ( localNameID < stringTable.localNames[uriID].len ) { if ( localNameID < stringTable.localNames[uriID].len ) {
*localName = stringTable.localNames[uriID].entries[localNameID]; *localName = stringTable.localNames[uriID].entries[localNameID];
// strcpy(stringTable.localNames[uriID].entries[localNameID], localName);
} else { } else {
return EXI_ERROR_OUT_OF_BOUNDS; return EXI_ERROR_OUT_OF_BOUNDS;
} }

View file

@ -59,20 +59,19 @@ const char * localNames3[] = {
}; };
/* localName entries for URI id = 4 */ /* localName entries for URI id = 4 */
const char * localNames4[] = { const char * localNames4[] = {
"ChargingProfile", "ContractID", "EAmount", "EVSEID", "EVSEIMax", "ContractID", "EAmount", "EVSEID", "EVSEIMax", "EVSEMaxPhases",
"EVSEMaxPhases", "EVSEMaxPower", "EVSEStatus", "EVSEVoltage", "EnergyProvider", "EVSEMaxPower", "EVSEStatus", "EVSEVoltage", "EnergyProvider", "EoC",
"EoC", "LineLockReq", "LineLockReqType", "LineLockRes", "LineLockResType", "LineLockReq", "LineLockReqType", "LineLockRes", "LineLockResType", "MeterInfo",
"MeterInfo", "MeteringAuthPubKey", "MeteringReceiptReq", "MeteringReceiptReqType", "MeteringReceiptRes", "MeteringAuthPubKey", "MeteringReceiptReq", "MeteringReceiptReqType", "MeteringReceiptRes", "MeteringReceiptResType",
"MeteringReceiptResType", "MeteringStatusReq", "MeteringStatusReqType", "MeteringStatusRes", "MeteringStatusResType", "MeteringStatusReq", "MeteringStatusReqType", "MeteringStatusRes", "MeteringStatusResType", "PCurrent",
"PCurrent", "PEVID", "PEVMaxPhases", "PEVMaxPower", "PEVMaxVoltage", "PEVID", "PEVMaxPhases", "PEVMaxPower", "PEVMaxVoltage", "PEVMinVoltage",
"PEVMinVoltage", "PEVPubKey", "PEVStatus", "PaymentDetailsReq", "PaymentDetailsReqType", "PEVPubKey", "PEVStatus", "PaymentDetailsReq", "PaymentDetailsReqType", "PaymentDetailsRes",
"PaymentDetailsRes", "PaymentDetailsResType", "PowerDeliveryReq", "PowerDeliveryReqType", "PowerDeliveryRes", "PaymentDetailsResType", "PowerDeliveryReq", "PowerDeliveryReqType", "PowerDeliveryRes", "PowerDeliveryResType",
"PowerDeliveryResType", "PowerDiscoveryReq", "PowerDiscoveryReqType", "PowerDiscoveryRes", "PowerDiscoveryResType", "PowerDiscoveryReq", "PowerDiscoveryReqType", "PowerDiscoveryRes", "PowerDiscoveryResType", "ReqLockStatus",
"ReqLockStatus", "ReqSwitchStatus", "ResponseCode", "ServiceDiscoveryReq", "ServiceDiscoveryReqType", "ReqSwitchStatus", "ResponseCode", "ServiceDiscoveryReq", "ServiceDiscoveryReqType", "ServiceDiscoveryRes",
"ServiceDiscoveryRes", "ServiceDiscoveryResType", "ServiceList", "ServicePaymentSelectionReq", "ServicePaymentSelectionReqType", "ServiceDiscoveryResType", "ServiceList", "ServicePaymentSelectionReq", "ServicePaymentSelectionReqType", "ServicePaymentSelectionRes",
"ServicePaymentSelectionRes", "ServicePaymentSelectionResType", "ServiceScope", "ServiceType", "SessionSetupReq", "ServicePaymentSelectionResType", "ServiceScope", "ServiceType", "SessionSetupReq", "SessionSetupReqType",
"SessionSetupReqType", "SessionSetupRes", "SessionSetupResType", "TCurrent", "Tariff", "SessionSetupRes", "SessionSetupResType", "TCurrent", "Tariff"
"TariffTable"
}; };
/* localName entries for URI id = 5 */ /* localName entries for URI id = 5 */
const char * localNames5[] = { const char * localNames5[] = {
@ -80,37 +79,35 @@ const char * localNames5[] = {
"Currency", "EPrice", "EVSEStandby", "EVSEStatusType", "Event", "Currency", "EPrice", "EVSEStandby", "EVSEStatusType", "Event",
"EventList", "EventListType", "FatalError", "FaultCode", "FaultMsg", "EventList", "EventListType", "FatalError", "FaultCode", "FaultMsg",
"FloatingValueType", "MeterID", "MeterInfoType", "MeterPubKey", "MeterReading", "FloatingValueType", "MeterID", "MeterInfoType", "MeterPubKey", "MeterReading",
"MeterStatus", "Multiplier", "NotificationType", "PEVStatusType", "PaymentOption", "MeterStatus", "Multiplier", "NotificationType", "PEVStatusType", "PowerSwitchClosed",
"PowerSwitchClosed", "ProtocolVersion", "RCD", "Service", "ServiceDescriptionType", "ProtocolVersion", "RCD", "Service", "ServiceDescriptionType", "ServiceDetails",
"ServiceDetails", "ServiceID", "ServiceListType", "ServiceName", "ServiceScope", "ServiceID", "ServiceListType", "ServiceName", "ServiceScope", "ServiceSessionID",
"ServiceSessionID", "ServiceType", "SessionID", "SessionInformationType", "ShutDownTime", "ServiceType", "SessionID", "SessionInformationType", "ShutDownTime", "TMeter",
"SigMeterReading", "TMeter", "Tariff", "TariffDescrType", "TariffDescription", "Tariff", "TariffDescrType", "TariffDescription", "TariffEntries", "TariffEntriesType",
"TariffEntries", "TariffEntriesType", "TariffEntry", "TariffEntryType", "TariffID", "TariffEntry", "TariffEntryType", "TariffID", "TariffPMax", "TariffStart",
"TariffPMax", "TariffStart", "TariffTableType", "Unit", "Value", "TariffTableType", "Unit", "Value", "contractIDType", "currencyType",
"contractIDType", "currencyType", "energyProviderType", "eventEntryType", "evseIDType", "energyProviderType", "eventEntryType", "evseIDType", "fatalErrorType", "faultCodeType",
"fatalErrorType", "faultCodeType", "lockStatusType", "maxPhasesType", "meterIDType", "lockStatusType", "maxPhasesType", "meterIDType", "meterStatusType", "paymentOptionListType",
"meterStatusType", "paymentOptionListType", "paymentOptionType", "pevIDType", "protocolVersionType", "paymentOptionType", "pevIDType", "protocolVersionType", "pubKeyType", "rcdType",
"pubKeyType", "rcdType", "responseCode_LineLockType", "responseCode_MeteringReceiptType", "responseCode_MeteringStatusType", "responseCode_LineLockType", "responseCode_MeteringReceiptType", "responseCode_MeteringStatusType", "responseCode_PaymentDetailsType", "responseCode_PowerDeliveryType",
"responseCode_PaymentDetailsType", "responseCode_PowerDeliveryType", "responseCode_PowerDiscoveryType", "responseCode_ServiceDiscoveryType", "responseCode_ServicePaymentSelectionType", "responseCode_PowerDiscoveryType", "responseCode_ServiceDiscoveryType", "responseCode_ServicePaymentSelectionType", "responseCode_SessionSetupType", "serviceDetailsType",
"responseCode_SessionSetupType", "serviceDetailsType", "serviceIDType", "serviceNameType", "serviceScopeType", "serviceIDType", "serviceNameType", "serviceScopeType", "serviceTypeType", "sessionIDType",
"serviceTypeType", "sessionIDType", "standbyType", "switchStatusType", "tariffDescriptionType", "standbyType", "switchStatusType", "tariffDescriptionType", "tariffIDType", "tariffStartType",
"tariffIDType", "tariffStartType", "timeType", "unitMultiplierType", "unitSymbolType" "timeType", "unitMultiplierType", "unitSymbolType"
}; };
/* localName entries for URI id = 6 */ /* localName entries for URI id = 6 */
const char * localNames6[] = { const char * localNames6[] = {
"Body", "BodyBaseType", "BodyElement", "BodyType", "Header", "Body", "BodyBaseType", "BodyElement", "BodyType", "Header",
"HeaderType", "Notification", "Security", "SessionInformation", "V2G_Message" "HeaderType", "Notification", "SessionInformation", "V2G_Message"
}; };
struct exiPartition localNamePartitions[7] = { struct exiPartition localNamePartitions[7] = {
{ 0, localNames0 }, { 0, localNames0 },
{ 4, localNames1 }, { 4, localNames1 },
{ 2, localNames2 }, { 2, localNames2 },
{ 46, localNames3 }, { 46, localNames3 },
{ 66, localNames4 }, { 64, localNames4 },
{ 95, localNames5 }, { 93, localNames5 },
{ 10, localNames6 } { 9, localNames6 }
}; };
const char * uris[] = { const char * uris[] = {
"", "http://www.w3.org/XML/1998/namespace", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/2001/XMLSchema", "urn:iso:15118:2:2010:MsgBody", "urn:iso:15118:2:2010:MsgDataTypes", "urn:iso:15118:2:2010:MsgDef" "", "http://www.w3.org/XML/1998/namespace", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/2001/XMLSchema", "urn:iso:15118:2:2010:MsgBody", "urn:iso:15118:2:2010:MsgDataTypes", "urn:iso:15118:2:2010:MsgDef"

View file

@ -29,7 +29,7 @@ extern "C" {
#include "EXITypes.h" #include "EXITypes.h"
// TODO utf8/cstring//wchar_t/char16_t/char32_t methods /* TODO utf8/cstring//wchar_t/char16_t/char32_t methods */
#ifndef UCS_STRING_H #ifndef UCS_STRING_H
@ -37,7 +37,7 @@ extern "C" {
int toUCSString(char* chars, string_ucs_t* s); int toUCSString(char* chars, string_ucs_t* s);
// Note: fails if string contains non ASCII characters /* Note: fails if string contains non ASCII characters */
int toASCIIString(string_ucs_t* string, char* outASCII); int toASCIIString(string_ucs_t* string, char* outASCII);
#endif #endif

View file

@ -36,6 +36,12 @@
#include "EXITypes.h" #include "EXITypes.h"
#include "Bitstream.h" #include "Bitstream.h"
#define ARRAY_SIZE_BYTES 50
#define ARRAY_SIZE_STRINGS 50
/* avoids warning: initializer element is not computable at load time */
uint8_t data[ARRAY_SIZE_BYTES];
uint32_t codepoints[ARRAY_SIZE_STRINGS];
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
@ -45,20 +51,18 @@ int main(int argc, char *argv[]) {
bitstream_t iStream, oStream; bitstream_t iStream, oStream;
size_t posDecode, posEncode; size_t posDecode, posEncode;
// EXI set-up /* EXI set-up */
exi_state_t stateDecode; exi_state_t stateDecode;
exi_state_t stateEncode; exi_state_t stateEncode;
exi_event_t event; exi_event_t event;
eqname_t eqn; eqname_t eqn;
exi_value_t val; exi_value_t val;
// BINARY memory allocation /* BINARY memory setup */
uint8_t data[10]; bytes_t bytes = { ARRAY_SIZE_BYTES, data, 0 };
bytes_t bytes = { 10, data };
// STRING memory allocation /* STRING memory setuo */
uint32_t codepoints[50]; string_ucs_t string = { ARRAY_SIZE_STRINGS, codepoints, 0 };
string_ucs_t string = { 50, codepoints };
const char * localName; const char * localName;
const char * namespaceURI; const char * namespaceURI;
@ -73,13 +77,13 @@ int main(int argc, char *argv[]) {
/* parse EXI stream to internal byte structures */ /* parse EXI stream to internal byte structures */
toBitstream(argv[1], &iStream); toBitstream(argv[1], &iStream);
// input /* input */
posDecode = 0; posDecode = 0;
iStream.pos = &posDecode; iStream.pos = &posDecode;
iStream.buffer = 0; iStream.buffer = 0;
iStream.capacity = 0; iStream.capacity = 0;
// output /* output */
posEncode = 0; posEncode = 0;
oStream.data = malloc(sizeof(uint8_t)*iStream.size); oStream.data = malloc(sizeof(uint8_t)*iStream.size);
oStream.size = iStream.size; oStream.size = iStream.size;
@ -112,31 +116,31 @@ int main(int argc, char *argv[]) {
switch (event) { switch (event) {
case START_DOCUMENT: case START_DOCUMENT:
// decode /* decode */
errn = exiDecodeStartDocument(&iStream, &stateDecode); errn = exiDecodeStartDocument(&iStream, &stateDecode);
if (errn < 0) { if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno); printf("[Decode-ERROR] %d \n", errno);
return errn; return errn;
} }
printf(">> START_DOCUMENT \n"); printf(">> START_DOCUMENT \n");
// encode /* encode */
errn = exiEncodeStartDocument(&oStream, &stateEncode); errn = exiEncodeStartDocument(&oStream, &stateEncode);
break; break;
case END_DOCUMENT: case END_DOCUMENT:
// decode /* decode */
errn = exiDecodeEndDocument(&iStream, &stateDecode); errn = exiDecodeEndDocument(&iStream, &stateDecode);
if (errn < 0) { if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno); printf("[Decode-ERROR] %d \n", errno);
return errn; return errn;
} }
printf(">> END_DOCUMENT \n"); printf(">> END_DOCUMENT \n");
// encode /* encode */
errn = exiEncodeEndDocument(&oStream, &stateEncode); errn = exiEncodeEndDocument(&oStream, &stateEncode);
/* signalize end of document */ /* signalize end of document */
noEndOfDocument = 0; /* false */ noEndOfDocument = 0; /* false */
break; break;
case START_ELEMENT: case START_ELEMENT:
// decode /* decode */
errn = exiDecodeStartElement(&iStream, &stateDecode, &eqn); errn = exiDecodeStartElement(&iStream, &stateDecode, &eqn);
if (errn < 0) { if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno); printf("[Decode-ERROR] %d \n", errno);
@ -145,11 +149,11 @@ int main(int argc, char *argv[]) {
exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName); exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName);
exiGetUri(eqn.namespaceURI, &namespaceURI); exiGetUri(eqn.namespaceURI, &namespaceURI);
printf(">> SE {%s}%s \n", namespaceURI, localName); printf(">> SE {%s}%s \n", namespaceURI, localName);
// encode /* encode */
errn = exiEncodeStartElement(&oStream, &stateEncode, &eqn); errn = exiEncodeStartElement(&oStream, &stateEncode, &eqn);
break; break;
case END_ELEMENT: case END_ELEMENT:
// decode /* decode */
errn = exiDecodeEndElement(&iStream, &stateDecode, &eqn); errn = exiDecodeEndElement(&iStream, &stateDecode, &eqn);
if (errn < 0) { if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno); printf("[Decode-ERROR] %d \n", errno);
@ -158,11 +162,11 @@ int main(int argc, char *argv[]) {
exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName); exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName);
exiGetUri(eqn.namespaceURI, &namespaceURI); exiGetUri(eqn.namespaceURI, &namespaceURI);
printf("<< EE {%s}%s \n", namespaceURI, localName); printf("<< EE {%s}%s \n", namespaceURI, localName);
// encode /* encode */
errn = exiEncodeEndElement(&oStream, &stateEncode, &eqn); errn = exiEncodeEndElement(&oStream, &stateEncode, &eqn);
break; break;
case CHARACTERS: case CHARACTERS:
// decode /* decode */
errn = exiDecodeCharacters(&iStream, &stateDecode, &val); errn = exiDecodeCharacters(&iStream, &stateDecode, &val);
if (errn < 0) { if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno); printf("[Decode-ERROR] %d \n", errno);
@ -187,11 +191,11 @@ int main(int argc, char *argv[]) {
} else { } else {
printf(" CH ?? \n"); printf(" CH ?? \n");
} }
// encode /* encode */
errn = exiEncodeCharacters(&oStream, &stateEncode, &val); errn = exiEncodeCharacters(&oStream, &stateEncode, &val);
break; break;
case ATTRIBUTE: case ATTRIBUTE:
// decode /* decode */
errn = exiDecodeAttribute(&iStream, &stateDecode, &eqn, &val); errn = exiDecodeAttribute(&iStream, &stateDecode, &eqn, &val);
if (errn < 0) { if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno); printf("[Decode-ERROR] %d \n", errno);
@ -200,11 +204,11 @@ int main(int argc, char *argv[]) {
exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName); exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName);
exiGetUri(eqn.namespaceURI, &namespaceURI); exiGetUri(eqn.namespaceURI, &namespaceURI);
printf(" AT {%s}%s \n", namespaceURI, localName); printf(" AT {%s}%s \n", namespaceURI, localName);
// encode /* encode */
errn = exiEncodeAttribute(&oStream, &stateEncode, &eqn, &val); errn = exiEncodeAttribute(&oStream, &stateEncode, &eqn, &val);
break; break;
default: default:
// ERROR /* ERROR */
return -1; return -1;
} }