|
NAMEstructs_xml_input ,
structs_xml_output —
XML conversion for data structures
LIBRARYPDEL Library (libpdel, -lpdel)SYNOPSIS#include <sys/types.h>
#include <stdio.h>
#include
<pdel/structs/structs.h>
#include <pdel/structs/xml.h>
int
int
DESCRIPTIONThese routines convert instances of structs(3) data structures to and from XML.
The elem_tag is the XML document tag
expected. This is the top-level XML tag and the only tag that may contain
attributes. If attrp is not
name1 '\0' value1 '\0' name2 '\0' value2 '\0' ... nameN '\0' valueN '\0' '\0' The concatenated name, value pairs are stored in a buffer allocated with typed_mem(3) type attr_type, a pointer to which is then stored in *attrp. The caller is responsible for freeing this memory. The logger is a pointer to a logging function having this type: typedef void structs_xmllog_t(int sev, const char *fmt, ...); Here sev is a syslog(3) severity level. logger may also take one of the following predefined values: STRUCTS_LOGGER_NONE Discard log output STRUCTS_LOGGER_STDERR Log to standard error STRUCTS_LOGGER_ALOG Log using alog(3) The flags argument may contain any of the following values OR'd together: STRUCTS_XML_UNINIT The data structure is uninitialized STRUCTS_XML_LOOSE Unknown tags and nested attributes OK STRUCTS_XML_SCAN Don't try to build data structure STRUCTS_XML_COMB_TAGS Allow combined tags The
All of the fields defined in the data structure need not be
present in the XML input; missing fields are left unmodified. Therefore if
the
If only specific sub-fields of the data structure are desired in
the output, these may be specified with a non- The flags argument may contain any of the following values OR'd together: STRUCTS_XML_FULL Output a sub-field equal to its default value By default, RETURN VALUESAll of the above functions indicate an error condition by returning either -1 orNULL and setting errno to an
appropriate value.
Whenever there is an error, no partial work is done: the state of the parameters has not changed, and nothing has been allocated or freed. SEE ALSOhttp_servlet_xmlrpc(3), http_xml(3), libpdel(3), structs(3), structs_xmlrpc(3), typed_mem(3)Extensible Markup Language (XML) 1.0 (Second Edition), http://www.w3.org/TR/REC-xml. HISTORYThe PDEL library was developed at Packet Design, LLC.http://www.packetdesign.com/
AUTHORSArchie Cobbs ⟨archie@freebsd.org⟩
Visit the GSP FreeBSD Man Page Interface. |