* debug/xtrace.sh: Unify translatable messages.

* elf/ldd.bash.in: Likewise.
	* elf/sprof.c: Likewise.
	* locale/programs/locale.c: Likewise.
	* malloc/memusage.sh: Likewise.
	* nss/getent.c: Likewise.

2009-02-06  Joseph Myers  <joseph@codesourcery.com>

	* debug/pcprofiledump.c (print_version,
	argp_program_version_hook): New function.
	* elf/ldconfig.c (more_help): New function.
	(argp): Use it.
	* elf/sln.c (usage): New function.
	(main): Support --help and --version.
	* malloc/memusagestat.c (print_version): New function.
	(argp_program_version_hook): New variable.
	* nscd/nscd.c (more_help): New function.
	(argp): Use it.
	* posix/getconf.c (main): Send --version output to stdout.
	Support --help.
	* sunrpc/rpc_main.c (usage, options_usage): Take STREAM and STATUS
	arguments.  All callers changed.
	(print_version): New function.
	(parseargs): Support --help and --version.
	* sunrpc/rpcinfo.c (usage): Take STREAM argument.  All callers
	changed.
	(print_version): New function.
	(main): Use getopt_long.  Support --help and --version.
	* sysdeps/unix/sysv/linux/lddlibc4.c (main): Support --help and
	--version.

2009-02-06  Ulrich Drepper  <drepper@redhat.com>
This commit is contained in:
Ulrich Drepper 2009-02-06 20:13:07 +00:00
parent e2e390fad8
commit cbbcaf2369
17 changed files with 1007 additions and 572 deletions

View file

@ -1,3 +1,37 @@
2009-02-06 Ulrich Drepper <drepper@redhat.com>
* debug/xtrace.sh: Unify translatable messages.
* elf/ldd.bash.in: Likewise.
* elf/sprof.c: Likewise.
* locale/programs/locale.c: Likewise.
* malloc/memusage.sh: Likewise.
* nss/getent.c: Likewise.
2009-02-06 Joseph Myers <joseph@codesourcery.com>
* debug/pcprofiledump.c (print_version,
argp_program_version_hook): New function.
* elf/ldconfig.c (more_help): New function.
(argp): Use it.
* elf/sln.c (usage): New function.
(main): Support --help and --version.
* malloc/memusagestat.c (print_version): New function.
(argp_program_version_hook): New variable.
* nscd/nscd.c (more_help): New function.
(argp): Use it.
* posix/getconf.c (main): Send --version output to stdout.
Support --help.
* sunrpc/rpc_main.c (usage, options_usage): Take STREAM and STATUS
arguments. All callers changed.
(print_version): New function.
(parseargs): Support --help and --version.
* sunrpc/rpcinfo.c (usage): Take STREAM argument. All callers
changed.
(print_version): New function.
(main): Use getopt_long. Support --help and --version.
* sysdeps/unix/sysv/linux/lddlibc4.c (main): Support --help and
--version.
2009-02-06 Ulrich Drepper <drepper@redhat.com>
* malloc/memusage.c (DEFAULT_BUFFER_SIZE): Change to 32768.

View file

@ -1,5 +1,5 @@
/* Dump information generated by PC profiling.
Copyright (C) 1999, 2002, 2007 Free Software Foundation, Inc.
Copyright (C) 1999, 2002, 2007, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
@ -66,6 +66,10 @@ static char *more_help (int key, const char *text, void *input);
/* Prototype for option handler. */
static error_t parse_opt (int key, char *arg, struct argp_state *state);
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
/* Data structure to communicate with argp functions. */
static struct argp argp =
{
@ -209,3 +213,16 @@ For bug reporting instructions, please see:\n\
}
return (char *) text;
}
/* Print the version information. */
static void
print_version (FILE *stream, struct argp_state *state)
{
fprintf (stream, "pcprofiledump (GNU %s) %s\n", PACKAGE, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"), "2009");
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
}

View file

@ -54,8 +54,10 @@ do_help() {
Mandatory arguments to long options are also mandatory for any corresponding
short options.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.\n"
"
printf $"For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
"
exit 0
}

View file

@ -132,6 +132,9 @@ static void print_version (FILE *stream, struct argp_state *state);
void (*argp_program_version_hook) (FILE *, struct argp_state *)
= print_version;
/* Function to print some extra text in the help message. */
static char *more_help (int key, const char *text, void *input);
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
{
@ -161,7 +164,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state);
/* Data structure to communicate with argp functions. */
static struct argp argp =
{
options, parse_opt, NULL, doc, NULL, NULL, NULL
options, parse_opt, NULL, doc, NULL, more_help, NULL
};
/* Check if string corresponds to an important hardware capability or
@ -288,6 +291,23 @@ parse_opt (int key, char *arg, struct argp_state *state)
return 0;
}
/* Print bug-reporting information in the help message. */
static char *
more_help (int key, const char *text, void *input)
{
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
return strdup (gettext ("\
For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n"));
default:
break;
}
return (char *) text;
}
/* Print the version information. */
static void
print_version (FILE *stream, struct argp_state *state)

View file

@ -52,8 +52,10 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-r, --function-relocs process data and function relocations
-u, --unused print unused direct dependencies
-v, --verbose print all information
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>."
"
echo $"For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
"
exit 0
;;
-d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \

View file

@ -1,5 +1,5 @@
/* `sln' program to create symbolic links between files.
Copyright (C) 1998, 1999, 2001 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2001, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -16,9 +16,15 @@
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <error.h>
#include <errno.h>
#include <libintl.h>
#include <locale.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
@ -28,19 +34,37 @@
#include <string.h>
#include <limits.h>
#include "../version.h"
#define PACKAGE _libc_intl_domainname
#if !defined S_ISDIR && defined S_IFDIR
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif
static int makesymlink (const char *src, const char *dest);
static int makesymlinks (const char *file);
static void usage (void);
int
main (int argc, char **argv)
{
/* Set locale via LC_ALL. */
setlocale (LC_ALL, "");
/* Set the text message domain. */
textdomain (PACKAGE);
switch (argc)
{
case 2:
if (strcmp (argv[1], "--version") == 0) {
printf ("sln (GNU libc) %s\n", VERSION);
return 0;
} else if (strcmp (argv[1], "--help") == 0) {
usage ();
return 0;
}
return makesymlinks (argv [1]);
break;
@ -49,12 +73,20 @@ main (int argc, char **argv)
break;
default:
printf ("Usage: %s src dest|file\n", argv [0]);
usage ();
return 1;
break;
}
}
static void
usage (void)
{
printf (_("Usage: sln src dest|file\n\n"));
printf (_("For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n"));
}
static int
makesymlinks (file)
const char *file;
@ -75,7 +107,7 @@ makesymlinks (file)
fp = fopen (file, "r");
if (fp == NULL)
{
fprintf (stderr, "%s: file open error: %m\n", file);
fprintf (stderr, _("%s: file open error: %m\n"), file);
return 1;
}
}
@ -112,7 +144,7 @@ makesymlinks (file)
++cp;
if (*cp == '\0')
{
fprintf (stderr, "No target in line %d\n", lineno);
fprintf (stderr, _("No target in line %d\n"), lineno);
ret = 1;
continue;
}
@ -144,13 +176,13 @@ makesymlink (src, dest)
{
if (S_ISDIR (stats.st_mode))
{
fprintf (stderr, "%s: destination must not be a directory\n",
fprintf (stderr, _("%s: destination must not be a directory\n"),
dest);
return 1;
}
else if (unlink (dest) && errno != ENOENT)
{
fprintf (stderr, "%s: failed to remove the old destination\n",
fprintf (stderr, _("%s: failed to remove the old destination\n"),
dest);
return 1;
}
@ -158,7 +190,7 @@ makesymlink (src, dest)
else if (errno != ENOENT)
{
error = strerror (errno);
fprintf (stderr, "%s: invalid destination: %s\n", dest, error);
fprintf (stderr, _("%s: invalid destination: %s\n"), dest, error);
return -1;
}
@ -173,7 +205,7 @@ makesymlink (src, dest)
{
error = strerror (errno);
unlink (dest);
fprintf (stderr, "Invalid link from \"%s\" to \"%s\": %s\n",
fprintf (stderr, _("Invalid link from \"%s\" to \"%s\": %s\n"),
src, dest, error);
return 1;
}
@ -182,7 +214,7 @@ makesymlink (src, dest)
else
{
error = strerror (errno);
fprintf (stderr, "Invalid link from \"%s\" to \"%s\": %s\n",
fprintf (stderr, _("Invalid link from \"%s\" to \"%s\": %s\n"),
src, dest, error);
return 1;
}

View file

@ -86,9 +86,9 @@ static const struct argp_option options[] =
};
/* Short description of program. */
static const char doc[] = N_("Read and display shared object profiling data.\v\
For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n");
static const char doc[] = N_("Read and display shared object profiling data.");
//For bug reporting instructions, please see:\n \
//<http://www.gnu.org/software/libc/bugs.html>.\n");
/* Strings for arguments in help texts. */
static const char args_doc[] = N_("SHOBJ [PROFDATA]");
@ -96,10 +96,13 @@ static const char args_doc[] = N_("SHOBJ [PROFDATA]");
/* Prototype for option handler. */
static error_t parse_opt (int key, char *arg, struct argp_state *state);
/* Function to print some extra text in the help message. */
static char *more_help (int key, const char *text, void *input);
/* Data structure to communicate with argp functions. */
static struct argp argp =
{
options, parse_opt, args_doc, doc
options, parse_opt, args_doc, doc, NULL, more_help
};
@ -347,6 +350,23 @@ parse_opt (int key, char *arg, struct argp_state *state)
}
static char *
more_help (int key, const char *text, void *input)
{
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
return strdup (gettext ("\
For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n"));
default:
break;
}
return (char *) text;
}
/* Print the version information. */
static void
print_version (FILE *stream, struct argp_state *state)

View file

@ -84,9 +84,7 @@ static const struct argp_option options[] =
};
/* Short description of program. */
static const char doc[] = N_("Get locale-specific information.\v\
For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n");
static const char doc[] = N_("Get locale-specific information.");
/* Strings for arguments in help texts. */
static const char args_doc[] = N_("NAME\n[-a|-m]");
@ -94,10 +92,13 @@ static const char args_doc[] = N_("NAME\n[-a|-m]");
/* Prototype for option handler. */
static error_t parse_opt (int key, char *arg, struct argp_state *state);
/* Function to print some extra text in the help message. */
static char *more_help (int key, const char *text, void *input);
/* Data structure to communicate with argp functions. */
static struct argp argp =
{
options, parse_opt, args_doc, doc
options, parse_opt, args_doc, doc, NULL, more_help
};
@ -267,6 +268,23 @@ parse_opt (int key, char *arg, struct argp_state *state)
}
static char *
more_help (int key, const char *text, void *input)
{
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
return strdup (gettext ("\
For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n"));
default:
break;
}
return (char *) text;
}
/* Print the version information. */
static void
print_version (FILE *stream, struct argp_state *state)

View file

@ -61,8 +61,10 @@ Profile memory usage of PROGRAM.
Mandatory arguments to long options are also mandatory for any corresponding
short options.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>."
"
print $"For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
"
exit 0
}

View file

@ -1,5 +1,6 @@
/* Generate graphic from memory profiling data.
Copyright (C) 1998, 1999, 2000, 2005, 2006 Free Software Foundation, Inc.
Copyright (C) 1998, 1999, 2000, 2005, 2006,
2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@ -38,6 +39,8 @@
#include <gdfontl.h>
#include <gdfonts.h>
#include "../version.h"
#define PACKAGE _libc_intl_domainname
/* Default size of the generated image. */
#define XSIZE 800
@ -73,6 +76,10 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state);
/* Function to print some extra text in the help message. */
static char *more_help (int key, const char *text, void *input);
/* Name and version of program. */
static void print_version (FILE *stream, struct argp_state *state);
void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
/* Data structure to communicate with argp functions. */
static struct argp argp =
{
@ -535,3 +542,16 @@ For bug reporting instructions, please see:\n\
}
return (char *) text;
}
/* Print the version information. */
static void
print_version (FILE *stream, struct argp_state *state)
{
fprintf (stream, "memusagestat (GNU %s) %s\n", PACKAGE, VERSION);
fprintf (stream, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"), "2009");
fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
}

View file

@ -91,6 +91,9 @@ static int write_pid (const char *file);
static void print_version (FILE *stream, struct argp_state *state);
void (*argp_program_version_hook) (FILE *, struct argp_state *) = print_version;
/* Function to print some extra text in the help message. */
static char *more_help (int key, const char *text, void *input);
/* Definitions of arguments for argp functions. */
static const struct argp_option options[] =
{
@ -117,7 +120,7 @@ static error_t parse_opt (int key, char *arg, struct argp_state *state);
/* Data structure to communicate with argp functions. */
static struct argp argp =
{
options, parse_opt, NULL, doc,
options, parse_opt, NULL, doc, NULL, more_help
};
/* True if only statistics are requested. */
@ -401,6 +404,23 @@ parse_opt (int key, char *arg, struct argp_state *state)
return 0;
}
/* Print bug-reporting information in the help message. */
static char *
more_help (int key, const char *text, void *input)
{
switch (key)
{
case ARGP_KEY_HELP_EXTRA:
/* We print some extra information. */
return strdup (gettext ("\
For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n"));
default:
break;
}
return (char *) text;
}
/* Print the version information. */
static void
print_version (FILE *stream, struct argp_state *state)

View file

@ -59,9 +59,7 @@ static const struct argp_option args_options[] =
};
/* Short description of program. */
static const char doc[] = N_("Get entries from administrative database.\v\
For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n");
static const char doc[] = N_("Get entries from administrative database.");
/* Prototype for option handler. */
static error_t parse_option (int key, char *arg, struct argp_state *state);
@ -839,6 +837,12 @@ more_help (int key, const char *text, void *input)
col += len + 1;
}
fputs ("\n\n", fp);
fprintf (fp, gettext ("\
For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n"));
if (fclose (fp) == 0)
return doc;
}

File diff suppressed because it is too large Load diff

View file

@ -1008,13 +1008,27 @@ main (int argc, char *argv[])
if (argc > 1 && strcmp (argv[1], "--version") == 0)
{
fprintf (stderr, "getconf (GNU %s) %s\n", PACKAGE, VERSION);
fprintf (stderr, gettext ("\
printf ("getconf (GNU %s) %s\n", PACKAGE, VERSION);
printf (gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"), "2009");
fprintf (stderr, gettext ("Written by %s.\n"), "Roland McGrath");
printf (gettext ("Written by %s.\n"), "Roland McGrath");
return 0;
}
if (argc > 1 && strcmp (argv[1], "--help") == 0)
{
printf (gettext ("\
Usage: getconf [-v SPEC] VAR\n\
or: getconf [-v SPEC] PATH_VAR PATH\n\
\n\
Get the configuration value for variable VAR, or for variable PATH_VAR\n\
for path PATH. If SPEC is given, give values for compilation\n\
environment SPEC.\n\n"));
printf (gettext ("For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n"));
return 0;
}

View file

@ -52,6 +52,9 @@
#include "rpc_scan.h"
#include "proto.h"
#include "../version.h"
#define PACKAGE _libc_intl_domainname
#define EXTEND 1 /* alias for TRUE */
#define DONT_EXTEND 0 /* alias for FALSE */
@ -132,8 +135,9 @@ static void addarg (const char *cp);
static void putarg (int whereto, const char *cp);
static void checkfiles (const char *infile, const char *outfile);
static int parseargs (int argc, const char *argv[], struct commandline *cmd);
static void usage (void) __attribute__ ((noreturn));
static void options_usage (void) __attribute__ ((noreturn));
static void usage (FILE *stream, int status) __attribute__ ((noreturn));
static void options_usage (FILE *stream, int status) __attribute__ ((noreturn));
static void print_version (void);
static void c_initialize (void);
static char *generate_guard (const char *pathname);
@ -185,7 +189,7 @@ main (int argc, const char *argv[])
(void) memset ((char *) &cmd, 0, sizeof (struct commandline));
clear_args ();
if (!parseargs (argc, argv, &cmd))
usage ();
usage (stderr, 1);
if (cmd.cflag || cmd.hflag || cmd.lflag || cmd.tflag || cmd.sflag ||
cmd.mflag || cmd.nflag || cmd.Ssflag || cmd.Scflag)
@ -787,7 +791,7 @@ s_output (int argc, const char *argv[], const char *infile, const char *define,
{
if (outfilename)
unlink (outfilename);
usage ();
usage (stderr, 1);
}
write_rest ();
}
@ -1218,6 +1222,10 @@ parseargs (int argc, const char *argv[], struct commandline *cmd)
}
cmd->infile = argv[i];
}
else if (strcmp (argv[i], "--help") == 0)
usage (stdout, 0);
else if (strcmp (argv[i], "--version") == 0)
print_version ();
else
{
for (j = 1; argv[i][j] != 0; j++)
@ -1442,46 +1450,56 @@ parseargs (int argc, const char *argv[], struct commandline *cmd)
}
static void
usage (void)
usage (FILE *stream, int status)
{
fprintf (stderr, _("usage: %s infile\n"), cmdname);
fprintf (stderr, _("\t%s [-abkCLNTM][-Dname[=value]] [-i size] \
fprintf (stream, _("usage: %s infile\n"), cmdname);
fprintf (stream, _("\t%s [-abkCLNTM][-Dname[=value]] [-i size] \
[-I [-K seconds]] [-Y path] infile\n"), cmdname);
fprintf (stderr, _("\t%s [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] \
fprintf (stream, _("\t%s [-c | -h | -l | -m | -t | -Sc | -Ss | -Sm] \
[-o outfile] [infile]\n"), cmdname);
fprintf (stderr, _("\t%s [-s nettype]* [-o outfile] [infile]\n"), cmdname);
fprintf (stderr, _("\t%s [-n netid]* [-o outfile] [infile]\n"), cmdname);
options_usage ();
exit (1);
fprintf (stream, _("\t%s [-s nettype]* [-o outfile] [infile]\n"), cmdname);
fprintf (stream, _("\t%s [-n netid]* [-o outfile] [infile]\n"), cmdname);
options_usage (stream, status);
exit (status);
}
static void
options_usage (void)
options_usage (FILE *stream, int status)
{
f_print (stderr, "options:\n");
f_print (stderr, "-a\t\tgenerate all files, including samples\n");
f_print (stderr, "-b\t\tbackward compatibility mode (generates code for SunOS 4.1)\n");
f_print (stderr, "-c\t\tgenerate XDR routines\n");
f_print (stderr, "-C\t\tANSI C mode\n");
f_print (stderr, "-Dname[=value]\tdefine a symbol (same as #define)\n");
f_print (stderr, "-h\t\tgenerate header file\n");
f_print (stderr, "-i size\t\tsize at which to start generating inline code\n");
f_print (stderr, "-I\t\tgenerate code for inetd support in server (for SunOS 4.1)\n");
f_print (stderr, "-K seconds\tserver exits after K seconds of inactivity\n");
f_print (stderr, "-l\t\tgenerate client side stubs\n");
f_print (stderr, "-L\t\tserver errors will be printed to syslog\n");
f_print (stderr, "-m\t\tgenerate server side stubs\n");
f_print (stderr, "-M\t\tgenerate MT-safe code\n");
f_print (stderr, "-n netid\tgenerate server code that supports named netid\n");
f_print (stderr, "-N\t\tsupports multiple arguments and call-by-value\n");
f_print (stderr, "-o outfile\tname of the output file\n");
f_print (stderr, "-s nettype\tgenerate server code that supports named nettype\n");
f_print (stderr, "-Sc\t\tgenerate sample client code that uses remote procedures\n");
f_print (stderr, "-Ss\t\tgenerate sample server code that defines remote procedures\n");
f_print (stderr, "-Sm \t\tgenerate makefile template \n");
f_print (stderr, "-t\t\tgenerate RPC dispatch table\n");
f_print (stderr, "-T\t\tgenerate code to support RPC dispatch tables\n");
f_print (stderr, "-Y path\t\tdirectory name to find C preprocessor (cpp)\n");
f_print (stream, _("options:\n"));
f_print (stream, _("-a\t\tgenerate all files, including samples\n"));
f_print (stream, _("-b\t\tbackward compatibility mode (generates code for SunOS 4.1)\n"));
f_print (stream, _("-c\t\tgenerate XDR routines\n"));
f_print (stream, _("-C\t\tANSI C mode\n"));
f_print (stream, _("-Dname[=value]\tdefine a symbol (same as #define)\n"));
f_print (stream, _("-h\t\tgenerate header file\n"));
f_print (stream, _("-i size\t\tsize at which to start generating inline code\n"));
f_print (stream, _("-I\t\tgenerate code for inetd support in server (for SunOS 4.1)\n"));
f_print (stream, _("-K seconds\tserver exits after K seconds of inactivity\n"));
f_print (stream, _("-l\t\tgenerate client side stubs\n"));
f_print (stream, _("-L\t\tserver errors will be printed to syslog\n"));
f_print (stream, _("-m\t\tgenerate server side stubs\n"));
f_print (stream, _("-M\t\tgenerate MT-safe code\n"));
f_print (stream, _("-n netid\tgenerate server code that supports named netid\n"));
f_print (stream, _("-N\t\tsupports multiple arguments and call-by-value\n"));
f_print (stream, _("-o outfile\tname of the output file\n"));
f_print (stream, _("-s nettype\tgenerate server code that supports named nettype\n"));
f_print (stream, _("-Sc\t\tgenerate sample client code that uses remote procedures\n"));
f_print (stream, _("-Ss\t\tgenerate sample server code that defines remote procedures\n"));
f_print (stream, _("-Sm \t\tgenerate makefile template \n"));
f_print (stream, _("-t\t\tgenerate RPC dispatch table\n"));
f_print (stream, _("-T\t\tgenerate code to support RPC dispatch tables\n"));
f_print (stream, _("-Y path\t\tdirectory name to find C preprocessor (cpp)\n"));
exit (1);
f_print (stream, "\n%s", _("\
For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n"));
exit (status);
}
static void
print_version (void)
{
printf ("rpcgen (GNU %s) %s\n", PACKAGE, VERSION);
exit (0);
}

View file

@ -58,6 +58,9 @@ static char sccsid[] = "@(#)rpcinfo.c 1.22 87/08/12 SMI";
#include <locale.h>
#include <libintl.h>
#include "../version.h"
#define PACKAGE _libc_intl_domainname
#define MAXHOSTLEN 256
#define MIN_VERS ((u_long) 0)
@ -70,7 +73,8 @@ static void pmapdump (int argc, char **argv);
static bool_t reply_proc (void *res, struct sockaddr_in *who);
static void brdcst (int argc, char **argv) __attribute__ ((noreturn));
static void deletereg (int argc, char **argv);
static void usage (void);
static void usage (FILE *stream);
static void print_version (void);
static u_long getprognum (char *arg);
static u_long getvers (char *arg);
static void get_inet_address (struct sockaddr_in *addr, char *host);
@ -92,6 +96,11 @@ main (int argc, char **argv)
int errflg;
int function;
u_short portnum;
static const struct option long_options[] = {
{ "help", no_argument, NULL, 'H' },
{ "version", no_argument, NULL, 'V' },
{ NULL, 0, NULL, 0 }
};
setlocale (LC_ALL, "");
textdomain (_libc_intl_domainname);
@ -99,7 +108,7 @@ main (int argc, char **argv)
function = NONE;
portnum = 0;
errflg = 0;
while ((c = getopt (argc, argv, "ptubdn:")) != -1)
while ((c = getopt_long (argc, argv, "ptubdn:", long_options, NULL)) != -1)
{
switch (c)
{
@ -143,6 +152,14 @@ main (int argc, char **argv)
function = DELETES;
break;
case 'H':
usage (stdout);
return 0;
case 'V':
print_version ();
return 0;
case '?':
errflg = 1;
}
@ -150,7 +167,7 @@ main (int argc, char **argv)
if (errflg || function == NONE)
{
usage ();
usage (stderr);
return 1;
}
@ -160,7 +177,7 @@ main (int argc, char **argv)
case PMAPDUMP:
if (portnum != 0)
{
usage ();
usage (stderr);
return 1;
}
pmapdump (argc - optind, argv + optind);
@ -177,7 +194,7 @@ main (int argc, char **argv)
case BRDCST:
if (portnum != 0)
{
usage ();
usage (stderr);
return 1;
}
brdcst (argc - optind, argv + optind);
@ -208,7 +225,7 @@ udpping (portnum, argc, argv)
if (argc < 2 || argc > 3)
{
usage ();
usage (stderr);
exit (1);
}
prognum = getprognum (argv[1]);
@ -363,7 +380,7 @@ tcpping (portnum, argc, argv)
if (argc < 2 || argc > 3)
{
usage ();
usage (stderr);
exit (1);
}
prognum = getprognum (argv[1]);
@ -532,7 +549,7 @@ pmapdump (argc, argv)
if (argc > 1)
{
usage ();
usage (stderr);
exit (1);
}
if (argc == 1)
@ -624,7 +641,7 @@ brdcst (argc, argv)
if (argc != 2)
{
usage ();
usage (stderr);
exit (1);
}
prognum = getprognum (argv[0]);
@ -650,7 +667,7 @@ deletereg (argc, argv)
if (argc != 2)
{
usage ();
usage (stderr);
exit (1);
}
if (getuid ())
@ -669,15 +686,25 @@ deletereg (argc, argv)
}
static void
usage ()
usage (FILE *stream)
{
fputs (_("Usage: rpcinfo [ -n portnum ] -u host prognum [ versnum ]\n"),
stderr);
stream);
fputs (_(" rpcinfo [ -n portnum ] -t host prognum [ versnum ]\n"),
stderr);
fputs (_(" rpcinfo -p [ host ]\n"), stderr);
fputs (_(" rpcinfo -b prognum versnum\n"), stderr);
fputs (_(" rpcinfo -d prognum versnum\n"), stderr);
stream);
fputs (_(" rpcinfo -p [ host ]\n"), stream);
fputs (_(" rpcinfo -b prognum versnum\n"), stream);
fputs (_(" rpcinfo -d prognum versnum\n"), stream);
fputc ('\n', stream);
fprintf (stream, _("\
For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n"));
}
static void
print_version (void)
{
printf ("rpcinfo (GNU %s) %s\n", PACKAGE, VERSION);
}
static u_long

View file

@ -1,5 +1,5 @@
/* Stub for ldd script to print Linux libc4 dependencies.
Copyright (C) 1998, 2005 Free Software Foundation, Inc.
Copyright (C) 1998, 2005, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998.
@ -56,6 +56,24 @@ main (int argc, char *argv[])
if (argc != 2)
return 1;
if (strcmp (argv[1], "--help") == 0)
{
printf (gettext ("Usage: lddlibc4 FILE\n\n"));
printf (gettext ("For bug reporting instructions, please see:\n\
<http://www.gnu.org/software/libc/bugs.html>.\n"));
return 0;
}
else if (strcmp (argv[1], "--version") == 0)
{
printf ("lddlibc4 (GNU %s) %s\n", PACKAGE, VERSION);
printf (gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"), "2009");
return 0;
}
filename = argv[1];
/* First see whether this is really an a.out binary. */