From 54c6eb9d08ee310cec9604d018a1d496a838827e Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sun, 3 Feb 2008 04:16:26 +0200 Subject: [PATCH] libcompat: Remove unused files --- ChangeLog | 10 +++++ libcompat/Makefile.am | 3 -- libcompat/closeout.c | 60 ----------------------------- libcompat/closeout.h | 10 ----- libcompat/error.h | 62 ------------------------------ libcompat/long-options.c | 83 ---------------------------------------- libcompat/long-options.h | 32 ---------------- 7 files changed, 10 insertions(+), 250 deletions(-) delete mode 100644 libcompat/closeout.c delete mode 100644 libcompat/closeout.h delete mode 100644 libcompat/error.h delete mode 100644 libcompat/long-options.c delete mode 100644 libcompat/long-options.h diff --git a/ChangeLog b/ChangeLog index 25f86503..00028ce7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-02-03 Guillem Jover + + * libcompat/Makefile.am (libcompat_a_SOURCES): Remove closeout.c, + closeout.h, error.h, long-options.c and long-options.h. + * libcompat/closeout.c: Remove unused file. + * libcompat/closeout.h: Likewise. + * libcompat/error.h: Likewise. + * libcompat/long-options.c: Likewise. + * libcompat/long-options.h: Likewise. + 2008-02-03 Raphael Hertzog * scripts/dpkg-shlibdeps.pl: Handle better the case when the diff --git a/libcompat/Makefile.am b/libcompat/Makefile.am index ba93ee40..f7893cca 100644 --- a/libcompat/Makefile.am +++ b/libcompat/Makefile.am @@ -9,9 +9,6 @@ INCLUDES = \ noinst_LIBRARIES = libcompat.a libcompat_a_SOURCES = \ - closeout.c closeout.h \ - error.h \ getopt.c getopt.h \ getopt1.c \ - long-options.c long-options.h \ obstack.c obstack.h diff --git a/libcompat/closeout.c b/libcompat/closeout.c deleted file mode 100644 index a4a986fa..00000000 --- a/libcompat/closeout.c +++ /dev/null @@ -1,60 +0,0 @@ -/* closeout.c - close standard output - Copyright (C) 1998 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 2, 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. */ - -#if HAVE_CONFIG_H -# include -#endif - -#if ENABLE_NLS -# include -# define _(Text) gettext (Text) -#else -# define _(Text) Text -#endif - -#if HAVE_STDLIB_H -# include -#endif -#ifndef EXIT_FAILURE -# define EXIT_FAILURE 1 -#endif - -#include -#ifndef errno -extern int errno; -#endif - -#include -#include "closeout.h" -#include "error.h" - -/* Close standard output, exiting with status STATUS on failure. */ -void -close_stdout_status (int status) -{ - if (ferror (stdout)) - error (status, 0, _("write error")); - if (fclose (stdout) != 0) - error (status, errno, _("write error")); -} - -/* Close standard output, exiting with status EXIT_FAILURE on failure. */ -void -close_stdout (void) -{ - close_stdout_status (EXIT_FAILURE); -} diff --git a/libcompat/closeout.h b/libcompat/closeout.h deleted file mode 100644 index 49eeaf6d..00000000 --- a/libcompat/closeout.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef PARAMS -# if defined PROTOTYPES || (defined __STDC__ && __STDC__) -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - -void close_stdout PARAMS ((void)); -void close_stdout_status PARAMS ((int status)); diff --git a/libcompat/error.h b/libcompat/error.h deleted file mode 100644 index b7150557..00000000 --- a/libcompat/error.h +++ /dev/null @@ -1,62 +0,0 @@ -/* Declaration for error-reporting function - Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc. - - NOTE: The canonical source of this file is maintained with the GNU C - Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. - - 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, 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 _ERROR_H -#define _ERROR_H 1 - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined (__STDC__) && __STDC__ - -/* Print a message with `fprintf (stderr, FORMAT, ...)'; - if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM). - If STATUS is nonzero, terminate the program with `exit (STATUS)'. */ - -extern void error (int status, int errnum, const char *format, ...); - -extern void error_at_line (int status, int errnum, const char *fname, - unsigned int lineno, const char *format, ...); - -/* If NULL, error will flush stdout, then print on stderr the program - name, a colon and a space. Otherwise, error will call this - function without parameters instead. */ -extern void (*error_print_progname) (void); - -#else -void error (); -void error_at_line (); -extern void (*error_print_progname) (); -#endif - -/* This variable is incremented each time `error' is called. */ -extern unsigned int error_message_count; - -/* Sometimes we want to have at most one error per line. This - variable controls whether this mode is selected or not. */ -extern int error_one_per_line; - -#ifdef __cplusplus -} -#endif - -#endif /* error.h */ diff --git a/libcompat/long-options.c b/libcompat/long-options.c deleted file mode 100644 index 3cbd7b2a..00000000 --- a/libcompat/long-options.c +++ /dev/null @@ -1,83 +0,0 @@ -/* Utility to accept --help and --version options as unobtrusively as possible. - Copyright (C) 1993, 1994, 1998 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 2, 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. */ - -/* Written by Jim Meyering. */ - -#if HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include "closeout.h" -#include "long-options.h" - -static struct option const long_options[] = -{ - {"help", no_argument, 0, 'h'}, - {"version", no_argument, 0, 'v'}, - {0, 0, 0, 0} -}; - -/* Process long options --help and --version, but only if argc == 2. - Be careful not to gobble up `--'. */ - -void -parse_long_options (argc, argv, command_name, package, version, usage) - int argc; - char **argv; - const char *command_name; - const char *package; - const char *version; - void (*usage)(int); -{ - int c; - int saved_opterr; - - saved_opterr = opterr; - - /* Don't print an error message for unrecognized options. */ - opterr = 0; - - if (argc == 2 - && (c = getopt_long (argc, argv, "+", long_options, NULL)) != -1) - { - switch (c) - { - case 'h': - (*usage) (0); - - case 'v': - printf ("%s (%s) %s\n", command_name, package, version); - close_stdout (); /* FIXME: output failure exit status - should be settable via an arg. */ - exit (0); - - default: - /* Don't process any other long-named options. */ - break; - } - } - - /* Restore previous value. */ - opterr = saved_opterr; - - /* Reset this to zero so that getopt internals get initialized from - the probably-new parameters when/if getopt is called later. */ - optind = 0; -} diff --git a/libcompat/long-options.h b/libcompat/long-options.h deleted file mode 100644 index 219b00f4..00000000 --- a/libcompat/long-options.h +++ /dev/null @@ -1,32 +0,0 @@ -/* long-options.h -- declaration for --help- and --version-handling function. - Copyright (C) 1993, 1994, 1997 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 2, 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. */ - -/* Written by Jim Meyering. */ - -#ifndef PARAMS -# if defined PROTOTYPES || (defined __STDC__ && __STDC__) -# define PARAMS(Args) Args -# else -# define PARAMS(Args) () -# endif -#endif - -void - parse_long_options PARAMS ((int _argc, char **_argv, - const char *_command_name, - const char *_package, - const char *_version, void (*_usage) (int))); -- 2.39.5