Add some new symbols.
[metze/wireshark/wip.git] / wsutil / cmdarg_err.c
1 /* cmdarg_err.c
2  * Routines to report command-line argument errors.
3  *
4  * Wireshark - Network traffic analyzer
5  * By Gerald Combs <gerald@wireshark.org>
6  * Copyright 1998 Gerald Combs
7  *
8  * SPDX-License-Identifier: GPL-2.0-or-later
9  */
10
11 #include "config.h"
12
13
14 #include <wsutil/cmdarg_err.h>
15
16 static void (*print_err)(const char *, va_list ap);
17 static void (*print_err_cont)(const char *, va_list ap);
18
19 /*
20  * Set the reporting functions for error messages.
21  */
22 void
23 cmdarg_err_init(void (*err)(const char *, va_list),
24                 void (*err_cont)(const char *, va_list))
25 {
26     print_err = err;
27     print_err_cont = err_cont;
28 }
29
30 /*
31  * Report an error in command-line arguments.
32  */
33 void
34 cmdarg_err(const char *fmt, ...)
35 {
36     va_list ap;
37
38     va_start(ap, fmt);
39     print_err(fmt, ap);
40     va_end(ap);
41 }
42
43 /*
44  * Report additional information for an error in command-line arguments.
45  */
46 void
47 cmdarg_err_cont(const char *fmt, ...)
48 {
49     va_list ap;
50
51     va_start(ap, fmt);
52     print_err_cont(fmt, ap);
53     va_end(ap);
54 }
55
56 /*
57  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
58  *
59  * Local variables:
60  * c-basic-offset: 4
61  * tab-width: 8
62  * indent-tabs-mode: nil
63  * End:
64  *
65  * vi: set shiftwidth=4 tabstop=8 expandtab:
66  * :indentSize=4:tabSize=8:noTabs=true:
67  */