Add some new symbols.
[metze/wireshark/wip.git] / ui / 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 #include "cmdarg_err.h"
14
15 static void (*print_err)(const char *, va_list ap);
16 static void (*print_err_cont)(const char *, va_list ap);
17
18 /*
19  * Set the reporting functions for error messages.
20  */
21 void
22 cmdarg_err_init(void (*err)(const char *, va_list),
23                 void (*err_cont)(const char *, va_list))
24 {
25     print_err = err;
26     print_err_cont = err_cont;
27 }
28
29 /*
30  * Report an error in command-line arguments.
31  */
32 void
33 cmdarg_err(const char *fmt, ...)
34 {
35     va_list ap;
36
37     va_start(ap, fmt);
38     print_err(fmt, ap);
39     va_end(ap);
40 }
41
42 /*
43  * Report additional information for an error in command-line arguments.
44  */
45 void
46 cmdarg_err_cont(const char *fmt, ...)
47 {
48     va_list ap;
49
50     va_start(ap, fmt);
51     print_err_cont(fmt, ap);
52     va_end(ap);
53 }
54
55 /*
56  * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
57  *
58  * Local variables:
59  * c-basic-offset: 4
60  * tab-width: 8
61  * indent-tabs-mode: nil
62  * End:
63  *
64  * vi: set shiftwidth=4 tabstop=8 expandtab:
65  * :indentSize=4:tabSize=8:noTabs=true:
66  */