KCGIXML(3)

πŸ“¦
version 1.0.1 Β· 2 versions
, in alpine 3.24

πŸ’– 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 πŸ”₯

πŸ‘‘ 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms