GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  KCGIXML (3)

NAME

kcgixml, kxml_close, kxml_open, kxml_push, kxml_pushattrs, kxml_pushnull, kxml_pushnullattrs, kxml_pop, kxml_popall, kxml_putc, kxml_puts, kxml_write - XML handling functions for kcgi

CONTENTS

Library
Synopsis
Description
Return Values
Standards
Authors

LIBRARY


.Lb libkcgixml

SYNOPSIS


.In stdint.h
.In kcgi.h
.In kcgixml.h int
.Fo kxml_close struct kxmlreq *xml
.Fc void
.Fo kxml_open struct kxmlreq *xml struct kreq *req const char *const *elems size_t elemsz
.Fc int
.Fo kxml_push struct kxmlreq *xml size_t elem
.Fc int
.Fo kxml_pushattrs struct kxmlreq *xml size_t elem ...
.Fc void
.Fo kxml_pushnull struct kxmlreq *xml size_t elem
.Fc void
.Fo kxml_pushnullattrs struct kxmlreq *xml size_t elem ...
.Fc int
.Fo kxml_pop struct kxmlreq *xml
.Fc void
.Fo kxml_popall struct kxmlreq *xml
.Fc void
.Fo kxml_putc struct kxmlreq *xml char c
.Fc void
.Fo kxml_puts struct kxmlreq *xml const char *cp
.Fc int
.Fo kxml_write const char *cp size_t sz void *arg
.Fc

DESCRIPTION

The kcgixml functions extend kcgi(3) output with very simple XML-specific output. None of these functions may be called before khttp_body(3).

All kcgixml sequences begin and end with kxml_open and kxml_close, respectively. An array of possible elements is passed as elems to kxml_open. This is later indexed into with kxml_push, kxml_pushnull, kxml_pushattrs, and kxml_pushnullattrs to open elements. The kxml_pop family closes out opened elements.

To use these functions, you must include the
.In kcgixml.h header and compile with
.Lb kcgixml , for example,

% cc -I/usr/local/include -c -o sample.o sample.c
% cc -L/usr/local/lib -o sample -lkcgixml -lkcgi -lz

kxml_close
  Close an XML context as opened with kxml_open. This will also close any open elements. You should not use the object after invoking this function.
kxml_open
  Open an XML context, binding it to elems, a set of elements (e.g., "DAV:set" or "html"), the number of elements elemsz, the kcgi(3) request object req, and an output object xml.
kxml_push
  Push the element-open tag indexed by elem onto the output stream.
kxml_pushattrs
  Push the element-open tag indexed by elem onto the output stream, as well as a sequence of nil-terminated pairs of attributes. The last attribute key must be a NULL to terminate the list.
kxml_pushnull
  Like kxml_push, but producing an empty-element tag.
kxml_pushnullattrs
  Like kxml_pushattrs, but producing an empty-element tag.
kxml_pop
  Pop the current open tag as opened by kxml_push or kxml_pushattrs.
kxml_popall
  Pop all open tags.
kxml_putc
  Write a single character within the currently-open tag, escaping it properly as opaque text.
kxml_puts
  Invokes kxml_putc for all characters in the nil-terminated string.
kxml_write
  Invokes kxml_putc for all elements in the bounded buffer.

RETURN VALUES

Functions returning an
.Vt int indicating zero on failure and non-zero on success. This occurs if the requested element is over (for kxml_push) or under (for kxml_pop) the scope domain.

STANDARDS

The kcgixml functions conform to the XML 1.0 mark-up specification.

AUTHORS

The kcgixml library was written by
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
Search for    or go to Top of page |  Section 3 |  Main Index


Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.