1 /* Utility to help print --version output in a consistent format.
2 Copyright (C) 1999-2005 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software Foundation,
16 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
18 /* Written by Jim Meyering. */
25 #include "version-etc.h"
32 # include "unlocked-io.h"
36 #define _(msgid) gettext (msgid)
38 /* Default copyright goes to the FSF. */
40 const char* version_etc_copyright
=
41 /* Do *not* mark this string for translation. */
42 "Copyright (C) 2005 Free Software Foundation, Inc.";
45 /* Like version_etc, below, but with the NULL-terminated author list
46 provided via a variable of type va_list. */
48 version_etc_va (FILE *stream
,
49 const char *command_name
, const char *package
,
50 const char *version
, va_list authors
)
54 /* Count the number of authors. */
59 __va_copy (tmp_authors
, authors
);
61 tmp_authors
= authors
;
65 while (va_arg (tmp_authors
, const char *) != NULL
)
70 fprintf (stream
, "%s (%s) %s\n", command_name
, package
, version
);
72 fprintf (stream
, "%s %s\n", package
, version
);
77 /* The caller must provide at least one author name. */
80 /* TRANSLATORS: %s denotes an author name. */
81 vfprintf (stream
, _("Written by %s.\n"), authors
);
84 /* TRANSLATORS: Each %s denotes an author name. */
85 vfprintf (stream
, _("Written by %s and %s.\n"), authors
);
88 /* TRANSLATORS: Each %s denotes an author name. */
89 vfprintf (stream
, _("Written by %s, %s, and %s.\n"), authors
);
92 /* TRANSLATORS: Each %s denotes an author name.
93 You can use line breaks, estimating that each author name occupies
94 ca. 16 screen columns and that a screen line has ca. 80 columns. */
95 vfprintf (stream
, _("Written by %s, %s, %s,\nand %s.\n"), authors
);
98 /* TRANSLATORS: Each %s denotes an author name.
99 You can use line breaks, estimating that each author name occupies
100 ca. 16 screen columns and that a screen line has ca. 80 columns. */
101 vfprintf (stream
, _("Written by %s, %s, %s,\n%s, and %s.\n"), authors
);
104 /* TRANSLATORS: Each %s denotes an author name.
105 You can use line breaks, estimating that each author name occupies
106 ca. 16 screen columns and that a screen line has ca. 80 columns. */
107 vfprintf (stream
, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"),
111 /* TRANSLATORS: Each %s denotes an author name.
112 You can use line breaks, estimating that each author name occupies
113 ca. 16 screen columns and that a screen line has ca. 80 columns. */
114 vfprintf (stream
, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"),
118 /* TRANSLATORS: Each %s denotes an author name.
119 You can use line breaks, estimating that each author name occupies
120 ca. 16 screen columns and that a screen line has ca. 80 columns. */
121 vfprintf (stream
, _("\
122 Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"),
126 /* TRANSLATORS: Each %s denotes an author name.
127 You can use line breaks, estimating that each author name occupies
128 ca. 16 screen columns and that a screen line has ca. 80 columns. */
129 vfprintf (stream
, _("\
130 Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"),
134 /* 10 or more authors. Use an abbreviation, since the human reader
135 will probably not want to read the entire list anyway. */
136 /* TRANSLATORS: Each %s denotes an author name.
137 You can use line breaks, estimating that each author name occupies
138 ca. 16 screen columns and that a screen line has ca. 80 columns. */
139 vfprintf (stream
, _("\
140 Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"),
147 fputs (version_etc_copyright
, stream
);
151 This is free software; see the source for copying conditions. There is NO\n\
152 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"),
157 /* Display the --version information the standard way.
159 If COMMAND_NAME is NULL, the PACKAGE is asumed to be the name of
160 the program. The formats are therefore:
166 COMMAND_NAME (PACKAGE) VERSION.
168 The author names are passed as separate arguments, with an additional
169 NULL argument at the end. */
171 version_etc (FILE *stream
,
172 const char *command_name
, const char *package
,
173 const char *version
, /* const char *author1, ...*/ ...)
177 va_start (authors
, version
);
178 version_etc_va (stream
, command_name
, package
, version
, authors
);