1LIBXO(3)                 BSD Library Functions Manual                 LIBXO(3)
2

NAME

4     xo_create, xo_create_to_file, xo_destroy — create and destroy libxo out‐
5     put handles
6

LIBRARY

8     library “libxo”
9

SYNOPSIS

11     #include <libxo/xo.h>
12
13     xo_handle_t *
14     xo_create(unsigned style, unsigned flags);
15
16     xo_handle_t *
17     xo_create_to_file(FILE *fp, unsigned style, unsigned flags);
18
19     void
20     xo_destroy(xo_handle_t *handle);
21

DESCRIPTION

23     A libxo handle can be allocated using the xo_create() function.
24
25             Example:
26               xo_handle_t *xop = xo_create(XO_STYLE_JSON, XOF_WARN);
27               ....
28               xo_emit_h(xop, "testing\n");
29
30     By default, libxo writes output to standard output.  A convenience func‐
31     tion is provided for situations when output should be written to a dif‐
32     ferent file.
33
34     Use the XOF_CLOSE_FP flag to trigger a call to fclose(3) for the FILE
35     pointer when the handle is destroyed.
36
37     The xo_destroy() function releases a handle and any resources it is us‐
38     ing.  Calling xo_destroy() with a NULL handle will release any resources
39     associated with the default handle.
40

SEE ALSO

42     xo_emit(3), xo_set_options(3), libxo(3)
43

HISTORY

45     The libxo library first appeared in FreeBSD 11.0.
46

AUTHORS

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

ADDITIONAL DOCUMENTATION

52     FreeBSD uses libxo version 1.6.0.  Complete documentation can be found on
53     github:
54
55           https://juniper.github.io/libxo/1.6.0/html/index.html
56
57     libxo lives on github as:
58
59           https://github.com/Juniper/libxo
60
61     The latest release of libxo is available at:
62
63           https://github.com/Juniper/libxo/releases
64

HISTORY

66     The libxo library was added in FreeBSD 11.0.
67

AUTHOR

69     Phil Shafer
70
71BSD                            December 4, 2014                            BSD
Impressum