KCGIXML(3)
π NAME π
kcgixml β XML output for kcgi. This is the KCGIXML(3) manual page, bestie, and it's lowkey iconic β¨
π¦ LIBRARY π¦
library βlibkcgixmlβ π
πΈ DESCRIPTION πΈ
This is how you produce XML content inside a kcgi(3) context that you allocated with khttp_parse(3). No cap, that's the whole vibe π«Ά
To compile and link, use pkg-config(1) like this:
% cc `pkg-config --cflags kcgi-xml` -c sample.c
% cc -o sample sample.o `pkg-config --libs kcgi-xml`
Every kcgixml sequence starts with kxml_open(3), emits the standard XML prologue with kxml_prologue(3), creates XML nodes, and ends with kxml_close(3). Periodt π
π EXAMPLES π
Here's a tiny example that outputs a simple XML page. It assumes r is a struct kreq pointer. For brevity, it does not do any error checking π
const char *const elems[] =
{ "foo", "bar", "baz" };
khttp_head(r, kresps[KRESP_STATUS],
"%s", khttps[KHTTP_200]);
khttp_head(r, kresps[KRESP_CONTENT_TYPE],
"%s", kmimetypes[KMIME_TEXT_XML]);
khttp_body(r);
kxml_open(&req, r, elems, 3);
kxml_push(&req, 0); /* foo */
kxml_puts(&req, "Hello, world");
kxml_pop(&req);
kxml_pushattrs(&req, 1, "baz", "xyzzy", NULL); /* bar */
kxml_puts(&req, "Hello, world");
kxml_pop(&req);
kxml_close(&req);
π₯ SEE ALSO π₯
kxml_close(3)kxml_open(3)kxml_pop(3)kxml_popall(3)kxml_prologue(3)kxml_push(3)kxml_pushnull(3)kxml_putc(3)kxml_puts(3)kxml_write(3)
π STANDARDS π
The kcgixml functions conform to the XML 1.0 mark-up specification. Standards icon behavior, honestly π
π«Ά AUTHORS π«Ά
Written by Kristaps Dzonsons <kristaps@bsd.lv>. Shoutout to the author π
That's the whole vibe! This page comes from the Debian source/version, dated $Mdocdate$, and it's the KCGIXML(3) manual. Mwah πβ¨
π¦ where this page comes from
- alpine 3.24: kcgi-doc 1.0.1-r0 Β· ISC
- Copyright (c) 2014, 2017, 2020 Kristaps Dzonsons <kristaps@bsd.lv>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms