LIBXO(3)

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

πŸ’– LIBXO πŸ’–

okay bestie, welcome to the Library Functions Manual for LIBXO(3) β€” yes it's giving very serious C library energy but I promise it's cute once you get it 🫢


✨ NAME ✨

xo_set_writer β€” set custom writer functions for a libxo handle


πŸ“š LIBRARY πŸ“š

library β€œlibxo”

like, that's the whole vibe. it's in libxo, that's the house it lives in πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

#include <libxo/xo.h>

void typedef xo_ssize_t (*xo_write_func_t)(void *, const char *);

typedef void (*xo_close_func_t)(void *);

typedef int (*xo_flush_func_t)(void *);
xo_set_writer(xo_handle_t *handle, void *opaque);
                        "xo_write_func_t write_func"
                        "xo_close_func_t close_func"
                        "xo_flush_func_t flush_func"

not me putting the function-pointer typedefs right up top so you know exactly what shapes of functions we're dealing with πŸ‘‘


🌸 DESCRIPTION 🌸

so the whole point of xo_set_writer() is that it lets you hand libxo your own custom β€œwrite” functions, so you get to control how libxo actually writes its data. main character customization energy, fr fr.

an opaque argument gets recorded and then passed right back to the write_func function β€” that's so your function can grab whatever context info it needs. it's giving "here's your little bag of stuff back, do your thing" πŸŽ’βœ¨

the close_func function is where you can release that opaque data, plus any other resources you were holding onto. no cap, clean up after yourself bestie.

and the flush_func function should flush out any pending data that's associated with the opaque pointer. get that data out of the buffer and onto wherever it's going 🌊


πŸ‘€ SEE ALSO πŸ‘€

go read those too, they're iconic, iykyk πŸ’œ


πŸ¦‹ HISTORY πŸ¦‹

the libxo library first appeared in FreeBSD 11.0.


πŸ‘‘ AUTHORS πŸ‘‘

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

thank you phil, king behavior πŸ™‡β™€οΈ


🌈 ADDITIONAL DOCUMENTATION 🌈

FreeBSD uses libxo version 1.7.5. the complete documentation lives on github:

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

libxo lives on github as:

https://github.com/Juniper/libxo

and the latest release of libxo is available at:

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

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

(yeah there's two HISTORY sections, and honestly? slay, we're keeping both, no detail left behind πŸ’€)

the libxo library was added in FreeBSD 11.0.


πŸ’œ AUTHOR πŸ’œ

Phil Shafer


this page is the Debian build of LIBXO(3), dated December 4, 2014 β€” and that's the whole thing bestie, you understood the assignment, periodt πŸ’…βœ¨πŸŽ€πŸ¦‹
πŸ“¦ where this page comes from