dcerpc-nt: add UNION_ALIGN_TO... helpers
[wireshark-sm.git] / wsutil / cmdarg_err.c
blob85a4d8d45c2f01653a64e9e30b86e26addabf8eb
1 /* cmdarg_err.c
2 * Routines to report command-line argument errors.
4 * Wireshark - Network traffic analyzer
5 * By Gerald Combs <gerald@wireshark.org>
6 * Copyright 1998 Gerald Combs
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
11 #include "config.h"
13 #include "cmdarg_err.h"
15 static void (*print_err)(const char *, va_list ap);
16 static void (*print_err_cont)(const char *, va_list ap);
19 * Set the reporting functions for error messages.
21 void
22 cmdarg_err_init(void (*err)(const char *, va_list),
23 void (*err_cont)(const char *, va_list))
25 print_err = err;
26 print_err_cont = err_cont;
30 * Report an error in command-line arguments.
32 void
33 vcmdarg_err(const char *fmt, va_list ap)
35 print_err(fmt, ap);
38 void
39 cmdarg_err(const char *fmt, ...)
41 va_list ap;
43 va_start(ap, fmt);
44 print_err(fmt, ap);
45 va_end(ap);
49 * Report additional information for an error in command-line arguments.
51 void
52 cmdarg_err_cont(const char *fmt, ...)
54 va_list ap;
56 va_start(ap, fmt);
57 print_err_cont(fmt, ap);
58 va_end(ap);