TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags
[wireshark-sm.git] / wsutil / cmdarg_err.c
blob5040666a11597132427ff6820460182e9e1cae77
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);
62 * Error printing routines that report to the standard error.
64 void
65 stderr_cmdarg_err(const char *msg_format, va_list ap)
67 fprintf(stderr, "%s: ", g_get_prgname());
68 vfprintf(stderr, msg_format, ap);
69 fprintf(stderr, "\n");
72 void
73 stderr_cmdarg_err_cont(const char *msg_format, va_list ap)
75 vfprintf(stderr, msg_format, ap);
76 fprintf(stderr, "\n");