---
name: "xo_message"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/xo_message"
---

# xo\_message(3)

emit messages in multiple output styles

## NAME

**xo\_message**, **xo\_message\_c**, **xo\_message\_hc**, **xo\_message\_hcv** – emit messages in multiple output styles

## LIBRARY

library “libxo”

## SYNOPSIS

**#include \<libxo/xo.h\>**

*void*\

**xo\_message**(*const char \*fmt*, *...*);

*void*\

**xo\_message\_e**(*const char \*fmt*, *...*);

*void*\

**xo\_message\_c**(*int code*, *const char \*fmt*, *...*);

*void*\

**xo\_message\_hc**(*xo\_handle\_t \*xop*, *int code, const char \*fmt*, *...*);

*void*\

**xo\_message\_hcv**(*xo\_handle\_t \*xop*, *int code*, *const char \*fmt*, *va\_list vap*);

## DESCRIPTION

**xo\_message** generates text message which lack any sort of structure. These functions should not be used under normal conditions, since they completely defeat the value of using libxo.  They are provided for scenarios when the output's content is genuinely unknown and unusable. It is used in converting programs where err/warn where not used, and error messages went to **stdout**, not **stderr**. Use of **xo\_message** allows backwards compatibility with that output, but does not put the error in a useful form.

The **xo\_message** function generates output strings using the printf-style format string and arguments provided. If the format string does not end in a newline, **xo\_message\_e** will appear a colon, a space, and the error associated with the current **errno** value. **xo\_message\_c** **behaves** **similarly** **for** **the** **value** **passed** **in** **the** *code* parameter. **xo\_message\_hc** accepts a *handle* as opened by [xo\_create(3)](/xo_create/3.md) and **xo\_message\_hcv** **accepts** **a** **va\_list** **parameter** **of** **arguments.**

## SEE ALSO

[xo\_emit(3)](/xo_emit/3.md), [libxo(3)](/libxo/3.md)

## HISTORY

The **libxo** library first appeared in FreeBSD 11.0.

## AUTHORS

**libxo** was written by Phil Shafer ⟨*phil@freebsd.org*⟩.
