diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-12-31 16:55:23 -0800 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2019-01-01 02:07:06 +0000 |
commit | ba589a4e445a8ad8054073eff846087fc61c9ef8 (patch) | |
tree | ac5bcee756541531a1864ce01c60f3f0395e0dc5 /ui/cmdarg_err.h | |
parent | 5a5d236d1f1c0149e9e9fa291cbd251006a8dd40 (diff) |
Move some command-line-oriented routines from wsutil to ui.
cmdarg_err() is for reporting errors for command-line programs and
command-line errors in GUI programs; it's not something for any of the
Wireshark libraries to use.
The various routines for parsing numerical command-line arguments are
not for general use, they're just for use when parsing arguments.
Change-Id: I100bd4a55ab8ee4497f41d9651b0c5670e6c1e7f
Reviewed-on: https://code.wireshark.org/review/31281
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/cmdarg_err.h')
-rw-r--r-- | ui/cmdarg_err.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/ui/cmdarg_err.h b/ui/cmdarg_err.h new file mode 100644 index 0000000000..96328a0b66 --- /dev/null +++ b/ui/cmdarg_err.h @@ -0,0 +1,47 @@ +/* cmdarg_err.h + * Declarations of routines to report command-line argument errors. + * + * Wireshark - Network traffic analyzer + * By Gerald Combs <gerald@wireshark.org> + * Copyright 1998 Gerald Combs + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef __UI_CMDARG_ERR_H__ +#define __UI_CMDARG_ERR_H__ + +#include <stdarg.h> + +#include <glib.h> + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * Set the reporting functions for error messages. + */ +extern void +cmdarg_err_init(void (*err)(const char *, va_list), + void (*err_cont)(const char *, va_list)); + +/* + * Report an error in command-line arguments. + */ +extern void +cmdarg_err(const char *fmt, ...) + G_GNUC_PRINTF(1, 2); + +/* + * Report additional information for an error in command-line arguments. + */ +extern void +cmdarg_err_cont(const char *fmt, ...) + G_GNUC_PRINTF(1, 2); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __UI_CMDARG_ERR_H__ */ |