xo_set_writer(3)

xo_set_writer3

Set custom writer functions for a libxo handle

Usage

#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"

Library

library “libxo”

Overview

The xo_set_writer() function allows custom “write” functions which can tailor how libxo writes data. An opaque argument is recorded and passed back to the write_func function, allowing the function to acquire context information. The close_func function can release this opaque data and any other resources as needed. The flush_func function should flush any pending data associated with the opaque pointer.

Releases

25 releases since FreeBSD 11.0-RELEASE; the text changed 2 times.

  1. 11.0–11.1
  2. 11.2–12.4
  3. 13.0–16.0

History

The libxo library first appeared in FreeBSD 11.0.

Authors

libxo was written by Phil Shafer ⟨[email protected]⟩.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.