1 /* Utility to help print --version output in a consistent format.
2 Copyright (C) 1999-2007 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
18 /* Written by Jim Meyering. */
23 #include "version-etc.h"
30 # include "unlocked-io.h"
34 #define _(msgid) gettext (msgid)
36 enum { COPYRIGHT_YEAR
= 2007 };
38 /* Like version_etc, below, but with the NULL-terminated author list
39 provided via a variable of type va_list. */
41 version_etc_va (FILE *stream
,
42 const char *command_name
, const char *package
,
43 const char *version
, va_list authors
)
47 /* Count the number of authors. */
51 va_copy (tmp_authors
, authors
);
54 while (va_arg (tmp_authors
, const char *) != NULL
)
59 fprintf (stream
, "%s (%s) %s\n", command_name
, package
, version
);
61 fprintf (stream
, "%s %s\n", package
, version
);
63 /* TRANSLATORS: Translate "(C)" to the copyright symbol
64 (C-in-a-circle), if this symbol is available in the user's
65 locale. Otherwise, do not translate "(C)"; leave it as-is. */
66 fprintf (stream
, version_etc_copyright
, _("(C)"), COPYRIGHT_YEAR
);
70 License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>\n\
71 This is free software: you are free to change and redistribute it.\n\
72 There is NO WARRANTY, to the extent permitted by law.\n\
80 /* The caller must provide at least one author name. */
83 /* TRANSLATORS: %s denotes an author name. */
84 vfprintf (stream
, _("Written by %s.\n"), authors
);
87 /* TRANSLATORS: Each %s denotes an author name. */
88 vfprintf (stream
, _("Written by %s and %s.\n"), authors
);
91 /* TRANSLATORS: Each %s denotes an author name. */
92 vfprintf (stream
, _("Written by %s, %s, and %s.\n"), authors
);
95 /* TRANSLATORS: Each %s denotes an author name.
96 You can use line breaks, estimating that each author name occupies
97 ca. 16 screen columns and that a screen line has ca. 80 columns. */
98 vfprintf (stream
, _("Written by %s, %s, %s,\nand %s.\n"), authors
);
101 /* TRANSLATORS: Each %s denotes an author name.
102 You can use line breaks, estimating that each author name occupies
103 ca. 16 screen columns and that a screen line has ca. 80 columns. */
104 vfprintf (stream
, _("Written by %s, %s, %s,\n%s, and %s.\n"), authors
);
107 /* TRANSLATORS: Each %s denotes an author name.
108 You can use line breaks, estimating that each author name occupies
109 ca. 16 screen columns and that a screen line has ca. 80 columns. */
110 vfprintf (stream
, _("Written by %s, %s, %s,\n%s, %s, and %s.\n"),
114 /* TRANSLATORS: Each %s denotes an author name.
115 You can use line breaks, estimating that each author name occupies
116 ca. 16 screen columns and that a screen line has ca. 80 columns. */
117 vfprintf (stream
, _("Written by %s, %s, %s,\n%s, %s, %s, and %s.\n"),
121 /* TRANSLATORS: Each %s denotes an author name.
122 You can use line breaks, estimating that each author name occupies
123 ca. 16 screen columns and that a screen line has ca. 80 columns. */
124 vfprintf (stream
, _("\
125 Written by %s, %s, %s,\n%s, %s, %s, %s,\nand %s.\n"),
129 /* TRANSLATORS: Each %s denotes an author name.
130 You can use line breaks, estimating that each author name occupies
131 ca. 16 screen columns and that a screen line has ca. 80 columns. */
132 vfprintf (stream
, _("\
133 Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, and %s.\n"),
137 /* 10 or more authors. Use an abbreviation, since the human reader
138 will probably not want to read the entire list anyway. */
139 /* TRANSLATORS: Each %s denotes an author name.
140 You can use line breaks, estimating that each author name occupies
141 ca. 16 screen columns and that a screen line has ca. 80 columns. */
142 vfprintf (stream
, _("\
143 Written by %s, %s, %s,\n%s, %s, %s, %s,\n%s, %s, and others.\n"),
151 /* Display the --version information the standard way.
153 If COMMAND_NAME is NULL, the PACKAGE is asumed to be the name of
154 the program. The formats are therefore:
160 COMMAND_NAME (PACKAGE) VERSION.
162 The author names are passed as separate arguments, with an additional
163 NULL argument at the end. */
165 version_etc (FILE *stream
,
166 const char *command_name
, const char *package
,
167 const char *version
, /* const char *author1, ...*/ ...)
171 va_start (authors
, version
);
172 version_etc_va (stream
, command_name
, package
, version
, authors
);