dnxXml.h File Reference

Types and definitions for DNX XML functionality. More...

#include "dnxTransport.h"

Go to the source code of this file.

Data Structures

struct  DnxXmlBuf

Enumerations

enum  DnxXmlType {
  DNX_XML_UNKNOWN = 0, DNX_XML_SHORT, DNX_XML_USHORT, DNX_XML_INT,
  DNX_XML_UINT, DNX_XML_LONG, DNX_XML_ULONG, DNX_XML_STR_UNESCAPED,
  DNX_XML_XID, DNX_XML_STR
}

Functions

int dnxXmlOpen (DnxXmlBuf *xbuf, char *tag)
 Open and write header information to a dnx xml buffer.
int dnxXmlAdd (DnxXmlBuf *xbuf, char *xTag, DnxXmlType xType, void *xData)
 Add an XML data element to a dnx xml buffer.
int dnxXmlGet (DnxXmlBuf *xbuf, char *xTag, DnxXmlType xType, void *xData)
 Return the C data typed value associated with a specified tag.
int dnxXmlCmpStr (DnxXmlBuf *xbuf, char *xTag, char *cmpstr)
 Compare a string with an XML node text value.
int dnxXmlClose (DnxXmlBuf *xbuf)
 Validate and close a dnx xml buffer.


Detailed Description

Types and definitions for DNX XML functionality.

Author:
Robert W. Ingraham (dnx-devel@lists.sourceforge.net)
Attention:
Please submit patches to http://dnx.sourceforge.net

Definition in file dnxXml.h.


Enumeration Type Documentation

enum DnxXmlType

Enumerator:
DNX_XML_UNKNOWN 
DNX_XML_SHORT 
DNX_XML_USHORT 
DNX_XML_INT 
DNX_XML_UINT 
DNX_XML_LONG 
DNX_XML_ULONG 
DNX_XML_STR_UNESCAPED 
DNX_XML_XID 
DNX_XML_STR 

Definition at line 33 of file dnxXml.h.


Function Documentation

int dnxXmlAdd ( DnxXmlBuf xbuf,
char *  xTag,
DnxXmlType  xType,
void *  xData 
)

Add an XML data element to a dnx xml buffer.

Parameters:
[out] xbuf - the dnx xml buffer to be appended to.
[in] xTag - the xml tag to use for this new data element.
[in] xType - the C data type of the xml element data.
[in] xData - an opaque pointer to a C data variable to be expressed in xml in xbuf.
Returns:
Zero on success, or a non-zero error value.

Definition at line 409 of file dnxXml.c.

References DnxXmlBuf::buf, DNX_ERR_CAPACITY, DNX_MAX_MSG, DNX_OK, DNX_XML_MIN_HEADER, dnxXmlToString(), and DnxXmlBuf::size.

Referenced by dnxSendJob(), dnxSendMgmtReply(), dnxSendMgmtRequest(), dnxSendNodeRequest(), and dnxSendResult().

int dnxXmlClose ( DnxXmlBuf xbuf  ) 

Validate and close a dnx xml buffer.

Parameters:
[in,out] xbuf - the buffer to be validated and closed.
Returns:
Zero on success, or a non-zero error value.

Definition at line 616 of file dnxXml.c.

References DnxXmlBuf::buf, DNX_ERR_CAPACITY, DNX_MAX_MSG, DNX_OK, and DnxXmlBuf::size.

Referenced by dnxSendJob(), dnxSendMgmtReply(), dnxSendMgmtRequest(), dnxSendNodeRequest(), and dnxSendResult().

int dnxXmlCmpStr ( DnxXmlBuf xbuf,
char *  xTag,
char *  cmpstr 
)

Compare a string with an XML node text value.

Parameters:
[in,out] xbuf - the buffer to be validated and closed.
[in] xTag - the tag for which to search in xbuf.
[in] cmpstr - the comparison string to match.
Returns:
Zero on match; non-zero on not found, or no match.

Definition at line 596 of file dnxXml.c.

References DNX_ERR_SYNTAX, DNX_MAX_MSG, DNX_OK, DNX_XML_STR, and dnxXmlGetTagValue().

Referenced by dnxWaitForJob(), dnxWaitForMgmtReply(), dnxWaitForMgmtRequest(), dnxWaitForNodeRequest(), and dnxWaitForResult().

int dnxXmlGet ( DnxXmlBuf xbuf,
char *  xTag,
DnxXmlType  xType,
void *  xData 
)

Return the C data typed value associated with a specified tag.

Parameters:
[in] xbuf - the dnx xml buffer from which to extract a value.
[in] xTag - the tag for which to search in xbuf.
[in] xType - the C data type of the specified tag.
[out] xData - the address of storage for the returned C data value. Note that xData must be large enough to hold an element of the specified C data type. In the case of a string, xData actually accepts a char pointer, not character data of a specified length. Note also that the caller is responsible for freeing the memory returned if xType is DNX_XML_STR.
Returns:
Zero on success, or a non-zero error value.

Definition at line 447 of file dnxXml.c.

References DNX_ERR_INVALID, DNX_ERR_MEMORY, DNX_ERR_SYNTAX, DNX_MAX_MSG, DNX_OK, DNX_XML_INT, DNX_XML_LONG, DNX_XML_SHORT, DNX_XML_STR, DNX_XML_STR_UNESCAPED, DNX_XML_UINT, DNX_XML_ULONG, DNX_XML_USHORT, DNX_XML_XID, dnxXmlGetTagValue(), dnxXmlUnescapeStr(), and xstrdup.

Referenced by dnxWaitForJob(), dnxWaitForMgmtReply(), dnxWaitForMgmtRequest(), dnxWaitForNodeRequest(), and dnxWaitForResult().

int dnxXmlOpen ( DnxXmlBuf xbuf,
char *  tag 
)

Open and write header information to a dnx xml buffer.

Parameters:
[out] xbuf - the dnx xml buffer to be opened.
[in] tag - the major xml request tag to write to xbuf.
Returns:
Always returns zero.

Definition at line 387 of file dnxXml.c.

References DnxXmlBuf::buf, DNX_OK, and DnxXmlBuf::size.

Referenced by dnxSendJob(), dnxSendMgmtReply(), dnxSendMgmtRequest(), dnxSendNodeRequest(), and dnxSendResult().


Generated on Tue Apr 13 15:48:08 2010 for DNX by  doxygen 1.5.6