1LIBXO(3) BSD Library Functions Manual LIBXO(3)
2
4 xo_parse_args, xo_set_program — detect, parse, and remove arguments for
5 libxo
6
8 library “libxo”
9
11 #include <libxo/xo.h>
12
13 int
14 xo_parse_args(int argc, char **argv);
15
16 int
17 xo_set_program(const char *name);
18
20 The xo_parse_args() function is used to process command-line arguments,
21 which are described in xo_options(7). libxo specific options are pro‐
22 cessed and removed from the argument list so the calling application does
23 not need to process them. If successful, a new value for argc is re‐
24 turned. On failure, a message it emitted and -1 is returned.
25
26 argc = xo_parse_args(argc, argv);
27 if (argc < 0)
28 exit(EXIT_FAILURE);
29
30 Following the call to xo_parse_args(), the application can process the
31 remaining arguments in a normal manner.
32
33 The xo_set_program() function sets name of the program as reported by
34 functions like xo_failure(), xo_warn(), xo_err(), etc. The program name
35 is initialized by xo_parse_args(), but subsequent calls to
36 xo_set_program() can override this value.
37
38 Note that the value is not copied, so the memory passed to
39 xo_set_program() (and xo_parse_args()) must be maintained by the caller.
40
42 xo_emit(3), xo_options(7,) libxo(3)
43
45 The libxo library first appeared in FreeBSD 11.0.
46
48 libxo was written by Phil Shafer <phil@freebsd.org>.
49
50
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
66 The libxo library was added in FreeBSD 11.0.
67
69 Phil Shafer
70
71BSD November 17, 2020 BSD