]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libxo/libxo/xo_set_writer.3
MFhead @ r283351
[FreeBSD/FreeBSD.git] / contrib / libxo / libxo / xo_set_writer.3
1 .\" #
2 .\" # Copyright (c) 2014, Juniper Networks, Inc.
3 .\" # All rights reserved.
4 .\" # This SOFTWARE is licensed under the LICENSE provided in the
5 .\" # ../Copyright file. By downloading, installing, copying, or 
6 .\" # using the SOFTWARE, you agree to be bound by the terms of that
7 .\" # LICENSE.
8 .\" # Phil Shafer, July 2014
9 .\" 
10 .Dd December 4, 2014
11 .Dt LIBXO 3
12 .Os
13 .Sh NAME
14 .Nm xo_emit
15 .Nd emit formatted output based on format string and arguments
16 .Sh LIBRARY
17 .Lb libxo
18 .Sh SYNOPSIS
19 .In libxo/xo.h
20 .Ft void
21 .Sy typedef int (*xo_write_func_t)(void *, const char *);
22 .Pp
23 .Sy typedef void (*xo_close_func_t)(void *);
24 .Pp
25 .Sy typedef int (*xo_flush_func_t)(void *);
26 .Fn xo_set_writer "xo_handle_t *handle" "void *opaque"
27                         "xo_write_func_t write_func"
28                         "xo_close_func_t close_func"
29                         "xo_flush_func_t flush_func"
30 .Sh DESCRIPTION
31 The
32 .Fn xo_set_writer
33 function allows custom
34 .Dq write
35 functions
36 which can tailor how
37 .Nm libxo
38 writes data.
39 An
40 .Fa opaque
41 argument is
42 recorded and passed back to the
43 .Fa write_func
44 function, allowing the function
45 to acquire context information.
46 The
47 .Fa close_func
48 function can
49 release this opaque data and any other resources as needed.
50 The
51 .Fa flush_func
52 function should
53 flush any pending data associated with the opaque pointer.
54 .Sh ADDITIONAL DOCUMENTATION
55 Complete documentation can be found on github:
56 .Bd -literal -offset indent
57 http://juniper.github.io/libxo/libxo-manual.html
58 .Ed
59 .Pp
60 .Nm libxo
61 lives on github as:
62 .Bd -literal -offset indent
63 https://github.com/Juniper/libxo
64 .Ed
65 .Pp
66 The latest release of
67 .Nm libxo
68 is available at:
69 .Bd -literal -offset indent
70 https://github.com/Juniper/libxo/releases
71 .Ed
72 .Sh SEE ALSO
73 .Xr xo_emit 3
74 .Sh HISTORY
75 The
76 .Nm libxo
77 library was added in
78 .Fx 11.0 .
79 .Sh AUTHOR
80 Phil Shafer