---
name: "xo_set_style"
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_set_style"
---

# xo\_set\_style(3)

set the output style for a libxo handle

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

Use the **xo\_set\_style**() function to set the output style for a handle. To use the default handle, pass a NULL handle. The set of output styles used by **libxo** is:

| |
| --- |
| **Flag Description** |
| XO\_STYLE\_TEXT Traditional text output |
| XO\_STYLE\_XML XML encoded data |
| XO\_STYLE\_JSON JSON encoded data |
| XO\_STYLE\_HTML HTML encoded data |

The **xo\_set\_style\_name**() function can be used to set the style based on a name encoded as a string. The name can be any of the styles: "text", "xml", "json", or "html".

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

## 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*⟩.
