diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-11-17 05:59:21 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-11-17 05:59:21 +0000 |
commit | 2f7fd680e20345bbda6731cd041ee9ed0a04690f (patch) | |
tree | 9e6da69ba8d3c7b296f4f2d93963fe0a43cbead6 /cmdarg_err.h | |
parent | 7586ab64db1b8124d5eaf91974e7237760b9ae63 (diff) |
Handle "-G" only in Tethereal - it doesn't work in Ethereal, and isn't
necessary there.
Add a "cmdarg_err()" routine to report command-line option errors; it
creates a console if necessary, and prints the command name and the
trailing newline. Also add "cmdarg_err_cont()", which also creates a
console if necessary, and prints a trailing newline but no command name;
it's used to continue the message. Use those, rather than
"g_warning()", for errors.
That means that we no longer need to pass the command name to various
command-line argument parsing routines.
svn path=/trunk/; revision=16526
Diffstat (limited to 'cmdarg_err.h')
-rw-r--r-- | cmdarg_err.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/cmdarg_err.h b/cmdarg_err.h new file mode 100644 index 0000000000..e50b89a8a5 --- /dev/null +++ b/cmdarg_err.h @@ -0,0 +1,46 @@ +/* cmdarg_err.h + * Declarations of routines to report command-line errors. + * + * $Id$ + * + * Ethereal - Network traffic analyzer + * By Gerald Combs <gerald@ethereal.com> + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __CMDARG_ERR_H__ +#define __CMDARG_ERR_H__ + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/* + * Report an error in command-line arguments. + */ +extern void cmdarg_err(const char *fmt, ...); + +/* + * Report additional information for an error in command-line arguments. + */ +extern void cmdarg_err_cont(const char *fmt, ...); + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* __CMDARG_ERR_H__ */ |