rtEXIEncoder.h File Reference

EXI low-level C encode functions. More...

#include "rtexisrc/osrtexi.h"

Go to the source code of this file.


Defines

#define rtEXIEncEventCode1(pctxt, name, part1, nbits1)   rtEXIEncEventCode (pctxt, name, part1, -1, -1, nbits1, 0, 0)
#define rtEXIEncEventCode2(pctxt, name, part1, part2, nbits1, nbits2)   rtEXIEncEventCode (pctxt, name, part1, part2, -1, nbits1, nbits2, 0)
#define RTEXIENCCHEVENT(pctxt, encfunc, value, stat)
#define RTEXIENC_CH_DATA_EE_0_1(pctxt, encfunc, value, stat)
#define RTEXIENC_CH_STR_EE_0_1(pctxt, value, pqname, charSet, stat)
#define RTEXIENC_CH_NBIT_EE_0_1(pctxt, value, nbits, stat)
#define RTEXIENC_CH_BINARY_EE_0_1(pctxt, encfunc, len, value, stat)

Functions

EXTERNEXI int rtEXIEncAttribute (OSCTXT *pctxt, const OSUTF8CHAR *prefix, const OSUTF8CHAR *namespaceURI, const OSUTF8CHAR *localName, const OSUTF8CHAR *value)
 This function writes an attribute in the current element.
EXTERNEXI int rtEXIEncBinary (OSCTXT *pctxt, OSUINT32 nocts, const OSOCTET *value)
 This function encodes a binary (OCTET) string value.
EXTERNEXI int rtEXIEncBoolValue (OSCTXT *pctxt, OSBOOL value)
 This function encodes a boolean value.
EXTERNEXI int rtEXIEncBoolValueWithPattern (OSCTXT *pctxt, OSBOOL value, OSUINT8 pattern)
 This function encodes a boolean value with pattern facet.
EXTERNEXI int rtEXIEncComment (OSCTXT *pctxt, const OSUTF8CHAR *data)
 This function encode an XML comment.
EXTERNEXI int rtEXIEncCharacters (OSCTXT *pctxt, const OSUTF8CHAR *text)
 This function encodes a string of characters.
EXTERNEXI int rtEXIEncCharArray (OSCTXT *pctxt, const OSUTF8CHAR *text, OSUINT32 nbytes)
 This function encodes a given number of bytes from a character array or string.
EXTERNEXI int rtEXIEncDate (OSCTXT *pctxt, const OSNumDateTime *pvalue)
 This function encodes a numeric date value.
EXTERNEXI int rtEXIEncDateString (OSCTXT *pctxt, const OSUTF8CHAR *pvalue)
 This function encodes a date string value.
EXTERNEXI int rtEXIEncDateTime (OSCTXT *pctxt, const OSNumDateTime *pvalue)
 This function encodes a numeric date/time value.
EXTERNEXI int rtEXIEncDateTimeString (OSCTXT *pctxt, const OSUTF8CHAR *pvalue)
 This function encodes a date/time string value.
EXTERNEXI int rtEXIEncDecimalValue (OSCTXT *pctxt, OSREAL value)
 This function encodes a variable of the XSD decimal type.
EXTERNEXI int rtEXIEncDoubleValue (OSCTXT *pctxt, OSREAL value)
 This function encodes a variable of the float type.
EXTERNEXI int rtEXIEncDTD (OSCTXT *pctxt, const OSUTF8CHAR *name, const OSUTF8CHAR *publix, const OSUTF8CHAR *system, const OSUTF8CHAR *text)
 This function encodes a DTD declaration.
EXTERNEXI int rtEXIEncElemGrammarEvent (OSCTXT *pctxt, OSUINT16 eventId)
 This function writes a start element event code (SE) for a specific XML element as specified in an EXI grammar.
EXTERNEXI int rtEXIEncElemGrammarEE (OSCTXT *pctxt)
 This function writes an end element event code (EE) for a specific XML element as specified in an EXI grammar.
EXTERNEXI int rtEXIEncEndDocument (OSCTXT *pctxt)
 This function writes an end document event.
EXTERNEXI int rtEXIEncEndElement (OSCTXT *pctxt)
 This function writes an end element event.
EXTERNEXI int rtEXIEncEndEvent (OSCTXT *pctxt)
 This function writes EE event code.
EXTERNEXI int rtEXIEncEntityRef (OSCTXT *pctxt, const OSUTF8CHAR *name)
 This function writes an XML entity reference.
EXTERNEXI int rtEXIEncEventCode (OSCTXT *pctxt, const char *name, OSINT32 part1, OSINT32 part2, OSINT32 part3, OSUINT32 nbits1, OSUINT32 nbits2, OSUINT32 nbits3)
 This function writes an event code using the given bit field sizes.
EXTERNEXI int rtEXIEncGDay (OSCTXT *pctxt, const OSNumDateTime *pvalue)
 This function encodes a numeric gDay value.
EXTERNEXI int rtEXIEncGDayString (OSCTXT *pctxt, const OSUTF8CHAR *pvalue)
 This function encodes a gDay string value.
EXTERNEXI int rtEXIEncGMonth (OSCTXT *pctxt, const OSNumDateTime *pvalue)
 This function encodes a numeric gMonth value.
EXTERNEXI int rtEXIEncGMonthDay (OSCTXT *pctxt, const OSNumDateTime *pvalue)
 This function encodes a numeric gMonthDay value.
EXTERNEXI int rtEXIEncGMonthDayString (OSCTXT *pctxt, const OSUTF8CHAR *pvalue)
 This function encodes a gMonthDay string value.
EXTERNEXI int rtEXIEncGMonthString (OSCTXT *pctxt, const OSUTF8CHAR *pvalue)
 This function encodes a gMonth string value.
EXTERNEXI int rtEXIEncGYear (OSCTXT *pctxt, const OSNumDateTime *pvalue)
 This function encodes a numeric gYear value.
EXTERNEXI int rtEXIEncGYearMonth (OSCTXT *pctxt, const OSNumDateTime *pvalue)
 This function encodes a numeric gYearMonth value.
EXTERNEXI int rtEXIEncGYearMonthString (OSCTXT *pctxt, const OSUTF8CHAR *pvalue)
 This function encodes a gYearMonth string value.
EXTERNEXI int rtEXIEncGYearString (OSCTXT *pctxt, const OSUTF8CHAR *pvalue)
 This function encodes a gYear string value.
EXTERNEXI int rtEXIEncHeader (OSCTXT *pctxt)
 This function encodes the EXI header that is at the start of all EXI messages.
EXTERNEXI int rtEXIEncInitCompression (OSCTXT *pctxt, OSUINT32 nmChannelIds)
 This function initialize encoder to use compressed or precompressed EXI stream.
EXTERNEXI int rtEXIEncInt64Value (OSCTXT *pctxt, OSINT64 value)
 This function encodes a variable of the 64-bit integer type.
EXTERNEXI int rtEXIEncIntCHEvent (OSCTXT *pctxt, OSINT32 value)
 This function encodes a variable of the XSD integer type as a CH content event.
EXTERNEXI int rtEXIEncIntElem (OSCTXT *pctxt, OSINT32 value, const OSUTF8CHAR *elemName, OSXMLNamespace *pNS)
 This function encodes a complete XML element (<tag>content</tag>) in which the content is a signed integer.
EXTERNEXI int rtEXIEncIntValue (OSCTXT *pctxt, OSINT32 value)
 This function encodes a variable of the XSD integer type.
EXTERNEXI int rtEXIEncNBitUIntValue (OSCTXT *pctxt, OSUINT32 value, OSUINT32 nbits)
 This function encodes an unsigned integer value in a bit field of the given width.
EXTERNEXI int rtEXIEncNamespace (OSCTXT *pctxt, const OSUTF8CHAR *prefix, const OSUTF8CHAR *namespaceURI, OSBOOL indicator)
 This function encodes a namespace declaration.
EXTERNEXI int rtEXIEncoderInit (OSCTXT *pctxt)
 This function initializes the encoder.
EXTERNEXI int rtEXIEncProcessingInstruction (OSCTXT *pctxt, const OSUTF8CHAR *target, const OSUTF8CHAR *data)
 This function writes an XML processing instruction.
EXTERNEXI int rtEXIEncQNameValue (OSCTXT *pctxt, const OSXMLFullQName *pvalue, const OSXMLFullQName *pqname)
 This function encodes a QName value for AT and CH events.
EXTERNEXI int rtEXIEncSimpleTypeEvent (OSCTXT *pctxt, const char *name, OSINT32 part1, OSBOOL hasXsiAttrs)
 This function writes an event code for simple type elements.
EXTERNEXI int rtEXIEncStartDocument (OSCTXT *pctxt)
 This function writes a start document event.
EXTERNEXI int rtEXIEncStartElement (OSCTXT *pctxt, const OSUTF8CHAR *elemName, OSXMLNamespace *pNS)
 This function writes a start element event.
EXTERNEXI int rtEXIEncString (OSCTXT *pctxt, const OSUTF8CHAR *value, const OSXMLFullQName *pqname, const OSUINT16 *charSet)
 This function encodes a character string value.
EXTERNEXI int rtEXIEncString2 (OSCTXT *pctxt, const OSUTF8CHAR *value, const OSUTF8CHAR *elemName, struct OSXMLNamespace *pNS, const OSUINT16 *charSet)
 This version of the rtEXIEncString function uses standard generated encode function arguments.
EXTERNEXI int rtEXIEncTime (OSCTXT *pctxt, const OSNumDateTime *pvalue)
 This function encodes a numeric time value.
EXTERNEXI int rtEXIEncTimeString (OSCTXT *pctxt, const OSUTF8CHAR *pvalue)
 This function encodes a time string value.
EXTERNEXI int rtEXIEncUInt64Value (OSCTXT *pctxt, OSUINT64 value)
 This function encodes an 64-bit unsigned integer value.
EXTERNEXI int rtEXIEncUIntCHEvent (OSCTXT *pctxt, OSUINT32 value)
 This function encodes a variable of the XSD unsigned integer type as a CH content event.
EXTERNEXI int rtEXIEncUIntElem (OSCTXT *pctxt, OSUINT32 value, const OSUTF8CHAR *elemName, OSXMLNamespace *pNS)
 This function encodes a complete XML element (<tag>content</tag>) in which the content is an unsigned integer.
EXTERNEXI int rtEXIEncUIntValue (OSCTXT *pctxt, OSUINT32 value)
 This function encodes an unsigned integer value.
EXTERNEXI int rtEXIEncUTF8Str (OSCTXT *pctxt, const OSUTF8CHAR *value, size_t lengthIncr, const OSUINT16 *charSet)
 This function encodes a UTF-8 character string value.

Detailed Description

EXI low-level C encode functions.

Definition in file rtEXIEncoder.h.


Function Documentation

EXTERNEXI int rtEXIEncAttribute ( OSCTXT *  pctxt,
const OSUTF8CHAR *  prefix,
const OSUTF8CHAR *  namespaceURI,
const OSUTF8CHAR *  localName,
const OSUTF8CHAR *  value 
)

This function writes an attribute in the current element.

Parameters:
pctxt Pointer to OSCTXT structure
prefix The attribute's prefix or empty (null or "") for no prefix.
namespaceURI The attribute's namespace URI or empty for the default namespace.
localName The attribute's local name which must be a non-empty string.
value The attributes's value which must be non-null.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncBinary ( OSCTXT *  pctxt,
OSUINT32  nocts,
const OSOCTET *  value 
)

This function encodes a binary (OCTET) string value.

Parameters:
pctxt Pointer to context block structure.
nocts Number of octets in value
value Pointer to string of octets to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncBoolValue ( OSCTXT *  pctxt,
OSBOOL  value 
)

This function encodes a boolean value.

Parameters:
pctxt Pointer to context block structure.
value OSBOOL value.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncBoolValueWithPattern ( OSCTXT *  pctxt,
OSBOOL  value,
OSUINT8  pattern 
)

This function encodes a boolean value with pattern facet.

Parameters:
pctxt Pointer to context block structure.
value OSBOOL value.
pattern Mask of enabled values:
  • 0 - "false"
  • 1 - "0"
  • 2 - "true"
  • 3 - "1"
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncCharacters ( OSCTXT *  pctxt,
const OSUTF8CHAR *  text 
)

This function encodes a string of characters.

Parameters:
pctxt Pointer to context block structure.
text Pointer to text to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncCharArray ( OSCTXT *  pctxt,
const OSUTF8CHAR *  text,
OSUINT32  nbytes 
)

This function encodes a given number of bytes from a character array or string.

This function may be used from within a SAX characters handler when the string is not null-terminated.

Parameters:
pctxt Pointer to context block structure.
text Pointer to text to be encoded.
nbytes Number of bytes to encode.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncComment ( OSCTXT *  pctxt,
const OSUTF8CHAR *  data 
)

This function encode an XML comment.

Parameters:
pctxt Pointer to context block structure.
data The comment to be encoded
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncDate ( OSCTXT *  pctxt,
const OSNumDateTime *  pvalue 
)

This function encodes a numeric date value.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to numeric date/time stricture.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncDateString ( OSCTXT *  pctxt,
const OSUTF8CHAR *  pvalue 
)

This function encodes a date string value.

Parameters:
pctxt Pointer to context block structure.
pvalue Date string to be encoded
  • The format of date is CCYY-MM-DD
  • The value of CCYY is from 0000-9999
  • The value of MM is 01 - 12
  • The value of DD is 01 - XX (where XX is the Days in MM month in CCYY year)
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncDateTime ( OSCTXT *  pctxt,
const OSNumDateTime *  pvalue 
)

This function encodes a numeric date/time value.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to numeric date/time stricture.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncDateTimeString ( OSCTXT *  pctxt,
const OSUTF8CHAR *  pvalue 
)

This function encodes a date/time string value.

Parameters:
pctxt Pointer to context block structure.
pvalue Date/time string to be encoded
  • The format is CCYY-MM-DDTHH:MM:SS[.frac][TZ]
  • The value of CCYY is from 0000-9999
  • The value of MM is 01 - 12
  • The value of DD is 01 - XX (where XX is the Days in MM month in CCYY year)
  • The value of HH is 00 - 23
  • The value of MM is 00 - 59
  • The value of SS is 00 - 59
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncDecimalValue ( OSCTXT *  pctxt,
OSREAL  value 
)

This function encodes a variable of the XSD decimal type.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncDoubleValue ( OSCTXT *  pctxt,
OSREAL  value 
)

This function encodes a variable of the float type.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncDTD ( OSCTXT *  pctxt,
const OSUTF8CHAR *  name,
const OSUTF8CHAR *  publix,
const OSUTF8CHAR *  system,
const OSUTF8CHAR *  text 
)

This function encodes a DTD declaration.

Parameters:
pctxt Pointer to context block structure.
name The DTD's root element.
publix The DTD's public identifier.
system The DTD's system identifier.
text The DTD's textual representation.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncElemGrammarEE ( OSCTXT *  pctxt  ) 

This function writes an end element event code (EE) for a specific XML element as specified in an EXI grammar.

It is assumed state table information in the EXI context is set to point at the first state record in a state group containing the EE event type to be encoded.

Parameters:
pctxt Pointer to context block structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncElemGrammarEvent ( OSCTXT *  pctxt,
OSUINT16  eventId 
)

This function writes a start element event code (SE) for a specific XML element as specified in an EXI grammar.

It is assumed state table information in the EXI context is set to point at the first state record in a state group.

Parameters:
pctxt Pointer to context block structure.
eventId ID of event to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncEndDocument ( OSCTXT *  pctxt  ) 

This function writes an end document event.

Parameters:
pctxt Pointer to context block structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncEndElement ( OSCTXT *  pctxt  ) 

This function writes an end element event.

Parameters:
pctxt Pointer to context block structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncEndEvent ( OSCTXT *  pctxt  ) 

This function writes EE event code.

Parameters:
pctxt Pointer to context block structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncEntityRef ( OSCTXT *  pctxt,
const OSUTF8CHAR *  name 
)

This function writes an XML entity reference.

Parameters:
pctxt Pointer to context block structure.
name The entity's name.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncEventCode ( OSCTXT *  pctxt,
const char *  name,
OSINT32  part1,
OSINT32  part2,
OSINT32  part3,
OSUINT32  nbits1,
OSUINT32  nbits2,
OSUINT32  nbits3 
)

This function writes an event code using the given bit field sizes.

Parameters:
pctxt Pointer to context block structure.
name Textual name of event (for example, "SE(*)")
part1 Part 1 of event code. -1 if not used.
part2 Part 2 of event code. -1 if not used.
part3 Part 3 of event code. -1 if not used.
nbits1 Length of bit field for part 1.
nbits2 Length of bit field for part 2.
nbits3 Length of bit field for part 3.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncGDay ( OSCTXT *  pctxt,
const OSNumDateTime *  pvalue 
)

This function encodes a numeric gDay value.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to numeric date/time stricture.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncGDayString ( OSCTXT *  pctxt,
const OSUTF8CHAR *  pvalue 
)

This function encodes a gDay string value.

Parameters:
pctxt Pointer to context block structure.
pvalue gDay string to be encoded
  • The format of gDay is ---DD
  • The value of DD is 01 - 31
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncGMonth ( OSCTXT *  pctxt,
const OSNumDateTime *  pvalue 
)

This function encodes a numeric gMonth value.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to numeric date/time stricture.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncGMonthDay ( OSCTXT *  pctxt,
const OSNumDateTime *  pvalue 
)

This function encodes a numeric gMonthDay value.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to numeric date/time stricture.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncGMonthDayString ( OSCTXT *  pctxt,
const OSUTF8CHAR *  pvalue 
)

This function encodes a gMonthDay string value.

Parameters:
pctxt Pointer to context block structure.
pvalue gMonthDay string to be encoded
  • The format of gMonthDay is --MM-DD
  • The value of MM is 01 - 12
  • The value of DD is 01 - XX (where XX is the Days in MM month)
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncGMonthString ( OSCTXT *  pctxt,
const OSUTF8CHAR *  pvalue 
)

This function encodes a gMonth string value.

Parameters:
pctxt Pointer to context block structure.
pvalue gMonth string to be encoded
  • The format of gMonth is --MM
  • The value of MM is 01 - 12
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncGYear ( OSCTXT *  pctxt,
const OSNumDateTime *  pvalue 
)

This function encodes a numeric gYear value.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to numeric date/time stricture.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncGYearMonth ( OSCTXT *  pctxt,
const OSNumDateTime *  pvalue 
)

This function encodes a numeric gYearMonth value.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to numeric date/time stricture.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncGYearMonthString ( OSCTXT *  pctxt,
const OSUTF8CHAR *  pvalue 
)

This function encodes a gYearMonth string value.

Parameters:
pctxt Pointer to context block structure.
pvalue gYearMonth string to be encoded
  • The format of gYearMonth is CCYY-MM
  • The value of CCYY is from 0000-9999
  • The value of MM is 01 - 12
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncGYearString ( OSCTXT *  pctxt,
const OSUTF8CHAR *  pvalue 
)

This function encodes a gYear string value.

Parameters:
pctxt Pointer to context block structure.
pvalue gYear string to be encoded
  • The format of gYear is CCYY
  • The value of CCYY is from 0000-9999
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncHeader ( OSCTXT *  pctxt  ) 

This function encodes the EXI header that is at the start of all EXI messages.

Parameters:
pctxt Pointer to context block structure. Header options are determined from flags within the EXI info block of the context.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncInitCompression ( OSCTXT *  pctxt,
OSUINT32  nmChannelIds 
)

This function initialize encoder to use compressed or precompressed EXI stream.

Parameters:
pctxt Pointer to context block structure.
nmChannelIds Number of preallocated value channels.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncInt64Value ( OSCTXT *  pctxt,
OSINT64  value 
)

This function encodes a variable of the 64-bit integer type.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncIntCHEvent ( OSCTXT *  pctxt,
OSINT32  value 
)

This function encodes a variable of the XSD integer type as a CH content event.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncIntElem ( OSCTXT *  pctxt,
OSINT32  value,
const OSUTF8CHAR *  elemName,
OSXMLNamespace *  pNS 
)

This function encodes a complete XML element (<tag>content</tag>) in which the content is a signed integer.

Parameters:
pctxt Pointer to context block structure.
value Integer value to be encoded.
elemName Local name of element.
pNS Pointer to namespace structure containing prefix, and namespace URI.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncIntValue ( OSCTXT *  pctxt,
OSINT32  value 
)

This function encodes a variable of the XSD integer type.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncNamespace ( OSCTXT *  pctxt,
const OSUTF8CHAR *  prefix,
const OSUTF8CHAR *  namespaceURI,
OSBOOL  indicator 
)

This function encodes a namespace declaration.

If the "preserve prefixes" option is set to false, nothing is written.

Parameters:
pctxt Pointer to context block structure.
prefix The non-empty prefix being declared.
namespaceURI The namespace associated with the prefix.
indicator Indicator bit used to indicate this namespace prefix is associated with last encoded element QName.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncNBitUIntValue ( OSCTXT *  pctxt,
OSUINT32  value,
OSUINT32  nbits 
)

This function encodes an unsigned integer value in a bit field of the given width.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
nbits Size of bit field.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncoderInit ( OSCTXT *  pctxt  ) 

This function initializes the encoder.

It must be called before any other encode functions when encoding a document or fragment.

Parameters:
pctxt Pointer to a context structure.
Returns:
Status of the operation:
  • 0 if success
  • a negative status code if failure

EXTERNEXI int rtEXIEncProcessingInstruction ( OSCTXT *  pctxt,
const OSUTF8CHAR *  target,
const OSUTF8CHAR *  data 
)

This function writes an XML processing instruction.

Parameters:
pctxt Pointer to context block structure.
target The PI's target.
data The PI's data.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncQNameValue ( OSCTXT *  pctxt,
const OSXMLFullQName *  pvalue,
const OSXMLFullQName *  pqname 
)

This function encodes a QName value for AT and CH events.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to QName value to be encoded.
pqname Pointer to QName of attribute or element.
  • 0 - encode xsi:type.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncSimpleTypeEvent ( OSCTXT *  pctxt,
const char *  name,
OSINT32  part1,
OSBOOL  hasXsiAttrs 
)

This function writes an event code for simple type elements.

Parameters:
pctxt Pointer to context block structure.
name Textual name of event (for example, "SE(*)")
part1 Part 1 of event code.
hasXsiAttrs Is element nillable or it type has named subtypes.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncStartDocument ( OSCTXT *  pctxt  ) 

This function writes a start document event.

This method must be called before writing a document or a fragment.

Parameters:
pctxt Pointer to context block structure.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncStartElement ( OSCTXT *  pctxt,
const OSUTF8CHAR *  elemName,
OSXMLNamespace *  pNS 
)

This function writes a start element event.

If this method is called before rtEXIEncStartDocument, then the encoder assumes a fragment is being written.

Parameters:
pctxt Pointer to context block structure.
elemName The non-empty element name.
pNS Pointer to namespace structure containing prefix, and namespace URI.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncString ( OSCTXT *  pctxt,
const OSUTF8CHAR *  value,
const OSXMLFullQName *  pqname,
const OSUINT16 *  charSet 
)

This function encodes a character string value.

It uses the string tables to determine if the actual string value should be encoded or not.

Parameters:
pctxt Pointer to context block structure.
value Pointer to string value to be encoded.
pqname Pointer to a QName structure containing localName, prefix, and namespace URI.
charSet Pointer to restricted character set to be used for encoding the string or NULL if not restricted.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncString2 ( OSCTXT *  pctxt,
const OSUTF8CHAR *  value,
const OSUTF8CHAR *  elemName,
struct OSXMLNamespace *  pNS,
const OSUINT16 *  charSet 
)

This version of the rtEXIEncString function uses standard generated encode function arguments.

Parameters:
pctxt Pointer to context block structure.
value Pointer to string value to be encoded.
elemName The non-empty element name.
pNS Pointer to namespace structure containing prefix, and namespace URI.
charSet Pointer to restricted character set to be used for encoding the string or NULL if not restricted.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncTime ( OSCTXT *  pctxt,
const OSNumDateTime *  pvalue 
)

This function encodes a numeric time value.

Parameters:
pctxt Pointer to context block structure.
pvalue Pointer to numeric date/time stricture.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncTimeString ( OSCTXT *  pctxt,
const OSUTF8CHAR *  pvalue 
)

This function encodes a time string value.

Parameters:
pctxt Pointer to context block structure.
pvalue Time string to be encoded
  • The format of time is HH:MM:SS[.frac][TZ]
  • The value of HH is 00 - 23
  • The value of MM is 00 - 59
  • The value of SS is 00 - 59
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncUInt64Value ( OSCTXT *  pctxt,
OSUINT64  value 
)

This function encodes an 64-bit unsigned integer value.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncUIntCHEvent ( OSCTXT *  pctxt,
OSUINT32  value 
)

This function encodes a variable of the XSD unsigned integer type as a CH content event.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncUIntElem ( OSCTXT *  pctxt,
OSUINT32  value,
const OSUTF8CHAR *  elemName,
OSXMLNamespace *  pNS 
)

This function encodes a complete XML element (<tag>content</tag>) in which the content is an unsigned integer.

Parameters:
pctxt Pointer to context block structure.
value Integer value to be encoded.
elemName Local name of element.
pNS Pointer to namespace structure containing prefix, and namespace URI.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncUIntValue ( OSCTXT *  pctxt,
OSUINT32  value 
)

This function encodes an unsigned integer value.

Parameters:
pctxt Pointer to context block structure.
value Value to be encoded.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.

EXTERNEXI int rtEXIEncUTF8Str ( OSCTXT *  pctxt,
const OSUTF8CHAR *  value,
size_t  lengthIncr,
const OSUINT16 *  charSet 
)

This function encodes a UTF-8 character string value.

It does not use the string tables to determine if the actual string value should be encoded or not (i.e. it directly encodes the content).

Parameters:
pctxt Pointer to context block structure.
value Pointer to string value to be encoded.
lengthIncr Value to be added to string length before encoding. This value is normally zero; however, some string table operations require an increment of 1 or 2.
charSet Pointer to restricted character set to be used for encoding the string or NULL if not restricted.
Returns:
Completion status of operation:
  • 0 = success,
  • negative return value is error.