From e14e3990ef75795b40ee06a4b59a3e6af2d3aef0 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 2 Feb 2010 21:53:14 -0800 Subject: [PATCH] verbose-msg: Remove. This feature is not used very much and in fact is really only useful at all because it is difficult to understand how PSPP configuration works. Upcoming commits will make PSPP configuration much simpler, so we drop it now to simplify the code in advance. --- doc/invoking.texi | 40 +------------------------ src/data/file-name.c | 7 +---- src/language/prompt.c | 3 +- src/language/syntax-file.c | 4 +-- src/libpspp/automake.mk | 2 -- src/libpspp/verbose-msg.c | 53 --------------------------------- src/libpspp/verbose-msg.h | 26 ---------------- src/ui/terminal/terminal-opts.c | 7 +---- 8 files changed, 5 insertions(+), 137 deletions(-) delete mode 100644 src/libpspp/verbose-msg.c delete mode 100644 src/libpspp/verbose-msg.h diff --git a/doc/invoking.texi b/doc/invoking.texi index 3052162f..2b8a521d 100644 --- a/doc/invoking.texi +++ b/doc/invoking.texi @@ -41,7 +41,7 @@ pspp [ -B @var{dir} | --config-dir=@var{dir} ] [ -o @var{device} | --device=@var [ -I @var{dir} | --include=@var{dir} ] [ -i | --interactive ] [ -r | --no-statrc ] [ -h | --help ] [ -l | --list ] [ -s | --safer ] - [ --testing-mode ] [ -V | --version ] [ -v | --verbose ] + [ --testing-mode ] [ -V | --version ] [ @var{key}=@var{value} ] @var{file}@enddots{} @end example @@ -213,44 +213,6 @@ Prints a brief message listing PSPP's version, warranties you don't have, copying conditions and copyright, and e-mail address for bug reports, then terminates. -@item -v -@item --verbose - -Increments PSPP's verbosity level. Higher verbosity levels cause -PSPP to display greater amounts of information about what it is -doing. Often useful for debugging PSPP's configuration. - -This option can be given multiple times to set the verbosity level to -that value. The default verbosity level is 0, in which no informational -messages will be displayed. - -Higher verbosity levels cause messages to be displayed when the -corresponding events take place. - -@table @asis -@item 1 - -Driver and subsystem initializations. - -@item 2 - -Completion of driver initializations. Beginning of driver closings. - -@item 3 - -Completion of driver closings. - -@item 4 - -Files searched for; success of searches. - -@item 5 - -Individual directories included in file searches. -@end table - -Each verbosity level also includes messages from lower verbosity levels. - @end table diff --git a/src/data/file-name.c b/src/data/file-name.c index cf58b6db..d8defd1d 100644 --- a/src/data/file-name.c +++ b/src/data/file-name.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006, 2007, 2009 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. 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 @@ -34,7 +34,6 @@ #include #include #include -#include #include #include "xalloc.h" @@ -132,8 +131,6 @@ fn_search_path (const char *base_name, const char *path_) ds_init_cstr (&path, path_); fn_interp_vars (ds_ss (&path), insert_env_var, NULL, &path); - verbose_msg (2, _("searching for \"%s\" in path \"%s\""), - base_name, ds_cstr (&path)); while (ds_separate (&path, ss_cstr (":"), &save_idx, &dir)) { /* Construct file name. */ @@ -147,14 +144,12 @@ fn_search_path (const char *base_name, const char *path_) /* Check whether file exists. */ if (fn_exists (ds_cstr (&file))) { - verbose_msg (2, _("...found \"%s\""), ds_cstr (&file)); ds_destroy (&path); return ds_cstr (&file); } } /* Failure. */ - verbose_msg (2, _("...not found")); ds_destroy (&path); ds_destroy (&file); return NULL; diff --git a/src/language/prompt.c b/src/language/prompt.c index 34690d50..ede6a5e3 100644 --- a/src/language/prompt.c +++ b/src/language/prompt.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2010 Free Software Foundation, Inc. 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 @@ -31,7 +31,6 @@ #include #include #include -#include #include #include diff --git a/src/language/syntax-file.c b/src/language/syntax-file.c index 9470e508..ad277b58 100644 --- a/src/language/syntax-file.c +++ b/src/language/syntax-file.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2009 Free Software Foundation, Inc. + Copyright (C) 1997-9, 2000, 2009, 2010 Free Software Foundation, Inc. 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 @@ -33,7 +33,6 @@ #include #include #include -#include #include #include @@ -89,7 +88,6 @@ read_syntax_file (struct getl_interface *s, /* Open file, if not yet opened. */ if (sfs->syntax_file == NULL) { - verbose_msg (1, _("opening \"%s\" as syntax file"), sfs->fn); sfs->syntax_file = fn_open (sfs->fn, "r"); if (sfs->syntax_file == NULL) diff --git a/src/libpspp/automake.mk b/src/libpspp/automake.mk index 59ac613d..2795dc20 100644 --- a/src/libpspp/automake.mk +++ b/src/libpspp/automake.mk @@ -80,8 +80,6 @@ src_libpspp_libpspp_la_SOURCES = \ src/libpspp/tmpfile.h \ src/libpspp/tower.c \ src/libpspp/tower.h \ - src/libpspp/verbose-msg.c \ - src/libpspp/verbose-msg.h \ src/libpspp/version.h DISTCLEANFILES+=src/libpspp/version.c diff --git a/src/libpspp/verbose-msg.c b/src/libpspp/verbose-msg.c deleted file mode 100644 index a65db7d8..00000000 --- a/src/libpspp/verbose-msg.c +++ /dev/null @@ -1,53 +0,0 @@ -/* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. - - 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 3 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, see . */ - -#include - -#include - -#include -#include - -#include "progname.h" - -/* Level of verbosity. - Higher values cause more output. */ -static int verbosity; - -/* Increases the verbosity level. */ -void -verbose_increment_level (void) -{ - verbosity++; -} - -/* Writes MESSAGE formatted with printf, to stderr, if the - verbosity level is at least LEVEL. */ -void -verbose_msg (int level, const char *format, ...) -{ - if (level <= verbosity) - { - va_list args; - - va_start (args, format); - fprintf (stderr, "%s: ", program_name); - vfprintf (stderr, format, args); - putc ('\n', stderr); - va_end (args); - } -} - diff --git a/src/libpspp/verbose-msg.h b/src/libpspp/verbose-msg.h deleted file mode 100644 index 2a19331f..00000000 --- a/src/libpspp/verbose-msg.h +++ /dev/null @@ -1,26 +0,0 @@ -/* PSPP - a program for statistical analysis. - Copyright (C) 1997-9, 2000, 2006 Free Software Foundation, Inc. - - 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 3 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, see . */ - -#ifndef VERBOSE_MSG_H -#define VERBOSE_MSG_H 1 - -#include - -void verbose_increment_level (void); -void verbose_msg (int level, const char *format, ...) - PRINTF_FORMAT (2, 3); - -#endif /* verbose-msg.h */ diff --git a/src/ui/terminal/terminal-opts.c b/src/ui/terminal/terminal-opts.c index 955a6b0e..c55dc57f 100644 --- a/src/ui/terminal/terminal-opts.c +++ b/src/ui/terminal/terminal-opts.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008 Free Software Foundation + Copyright (C) 2008, 2010 Free Software Foundation 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 @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -44,7 +43,6 @@ static const struct argp_option test_options [] = { - {"verbose", 'v', 0, 0, N_("Increase diagnostic verbosity level"), 0}, {"testing-mode", 'T', 0, OPTION_HIDDEN, 0, 0}, { 0, 0, 0, 0, 0, 0 } @@ -58,9 +56,6 @@ parse_test_opts (int key, char *arg, struct argp_state *state) case 'T': settings_set_testing_mode (true); break; - case 'v': - verbose_increment_level (); - break; default: return ARGP_ERR_UNKNOWN; } -- 2.30.2