LIBXO(3)

πŸ“¦
version 1.7.5 Β· 2 versions
, in epel 9, fedora 43, fedora 44, nixpkgs unstable

πŸ’– LIBXO(3) πŸ’–

okay bestie, welcome to the LIBXO(3) page β€” section 3, Library Functions Manual, library functions, the whole vibe. today we're talking about setting the output style on a libxo handle. it's giving "one tiny function, infinite formats". let's go πŸ¦‹


✨ NAME ✨

xo_set_style, xo_set_style_name β€” set the output style for a libxo handle


πŸ“š LIBRARY πŸ“š

library β€œlibxo”


🌸 SYNOPSIS 🌸

#include <libxo/xo.h>

void
xo_set_style(xo_handle_t *handle, unsigned style);

int
xo_set_style_name(xo_handle_t *handle, const char *style);

πŸ’… DESCRIPTION πŸ’…

so like. you've got a handle. you want it to speak a certain language β€” text, XML, JSON, HTML, pick your fighter. that's what xo_set_style() is for, bestie. it sets the output style for a handle. πŸŽ€

and if you want the default handle? just pass a NULL handle. iconic. no cap.

the set of output styles libxo gives you is:

  • XO_STYLE_TEXT β€” traditional text output. the classic. the original main character. πŸ‘‘
  • XO_STYLE_XML β€” XML encoded data 🧚
  • XO_STYLE_JSON β€” JSON encoded data ✨
  • XO_STYLE_HTML β€” HTML encoded data 🌈

then there's xo_set_style_name() β€” same energy, but you set the style by name, encoded as a string. and the name can be any of the styles: "text", "xml", "json", or "html". literally just type the word. lowkey the easiest API in the whole library fr fr.

EXAMPLE: c xo_set_style_name(NULL, "html");

that's it. that's the whole thing. it ate. πŸ’…


πŸ‘€ SEE ALSO πŸ‘€

xo_emit(3), libxo(3)


πŸ•°οΈ HISTORY πŸ•°οΈ

the libxo library first appeared in FreeBSD 11.0. yes bestie, it's been around. 🫢


✍️ AUTHORS ✍️

libxo was written by Phil Shafer <phil@freebsd.org>.


πŸ“– ADDITIONAL DOCUMENTATION πŸ“–

FreeBSD uses libxo version 1.7.5. complete documentation can be found on github:

https://juniper.github.io/libxo/1.7.5/html/index.html

libxo lives on github as:

https://github.com/Juniper/libxo

the latest release of libxo is available at:

https://github.com/Juniper/libxo/releases

go read it, it's giving "well documented library". obsessed. πŸ’œ


πŸ•°οΈ HISTORY πŸ•°οΈ

(yeah there's another one, the manpage said it twice, so we're saying it twice πŸ’€)

the libxo library was added in FreeBSD 11.0.


✍️ AUTHOR ✍️

Phil Shafer


and that's the whole page bestie!! this one's from Debian, dated December 4, 2014, and it's the LIBXO(3) page β€” so if you ever need to flip your handle's style from "text" to "json" mid-vibe, you know exactly where to be. slay, stay encoded, and go emit something gorgeous πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from