]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/libxo/libxo/xo_set_writer.3
fd: remove redundant saturation check from fget_unlocked_seq
[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_set_writer
15 .Nd set custom writer functions for a libxo handle
16 .Sh LIBRARY
17 .Lb libxo
18 .Sh SYNOPSIS
19 .In libxo/xo.h
20 .Ft void
21 .Sy typedef xo_ssize_t (*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 SEE ALSO
55 .Xr xo_emit 3 ,
56 .Xr libxo 3
57 .Sh HISTORY
58 The
59 .Nm libxo
60 library first appeared in
61 .Fx 11.0 .
62 .Sh AUTHORS
63 .Nm libxo
64 was written by
65 .An Phil Shafer Aq Mt phil@freebsd.org .
66