xref: /dflybsd-src/contrib/grep/lib/version-etc.h (revision 91b9ed38d3db6a8a8ac5b66da1d43e6e331e259a)
195b7b453SJohn Marino /* Print --version and bug-reporting information in a consistent format.
2*09d4459fSDaniel Fojt    Copyright (C) 1999, 2003, 2005, 2009-2020 Free Software Foundation, Inc.
395b7b453SJohn Marino 
495b7b453SJohn Marino    This program is free software: you can redistribute it and/or modify
595b7b453SJohn Marino    it under the terms of the GNU General Public License as published by
695b7b453SJohn Marino    the Free Software Foundation; either version 3 of the License, or
795b7b453SJohn Marino    (at your option) any later version.
895b7b453SJohn Marino 
995b7b453SJohn Marino    This program is distributed in the hope that it will be useful,
1095b7b453SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
1195b7b453SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1295b7b453SJohn Marino    GNU General Public License for more details.
1395b7b453SJohn Marino 
1495b7b453SJohn Marino    You should have received a copy of the GNU General Public License
15*09d4459fSDaniel Fojt    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
1695b7b453SJohn Marino 
1795b7b453SJohn Marino /* Written by Jim Meyering. */
1895b7b453SJohn Marino 
1995b7b453SJohn Marino #ifndef VERSION_ETC_H
2095b7b453SJohn Marino # define VERSION_ETC_H 1
2195b7b453SJohn Marino 
2295b7b453SJohn Marino # include <stdarg.h>
2395b7b453SJohn Marino # include <stdio.h>
2495b7b453SJohn Marino 
25cf28ed85SJohn Marino /* The 'sentinel' attribute was added in gcc 4.0.  */
26200fbe8dSJohn Marino #ifndef _GL_ATTRIBUTE_SENTINEL
2795b7b453SJohn Marino # if 4 <= __GNUC__
28200fbe8dSJohn Marino #  define _GL_ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
2995b7b453SJohn Marino # else
30200fbe8dSJohn Marino #  define _GL_ATTRIBUTE_SENTINEL /* empty */
3195b7b453SJohn Marino # endif
3295b7b453SJohn Marino #endif
3395b7b453SJohn Marino 
3495b7b453SJohn Marino extern const char version_etc_copyright[];
3595b7b453SJohn Marino 
3695b7b453SJohn Marino /* The three functions below display the --version information in the
3795b7b453SJohn Marino    standard way: command and package names, package version, followed
3895b7b453SJohn Marino    by a short GPLv3+ notice and a list of up to 10 author names.
3995b7b453SJohn Marino 
40cf28ed85SJohn Marino    If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of
4195b7b453SJohn Marino    the program.  The formats are therefore:
4295b7b453SJohn Marino 
4395b7b453SJohn Marino    PACKAGE VERSION
4495b7b453SJohn Marino 
4595b7b453SJohn Marino    or
4695b7b453SJohn Marino 
4795b7b453SJohn Marino    COMMAND_NAME (PACKAGE) VERSION.
4895b7b453SJohn Marino 
4995b7b453SJohn Marino    The functions differ in the way they are passed author names: */
5095b7b453SJohn Marino 
5195b7b453SJohn Marino /* N_AUTHORS names are supplied in array AUTHORS.  */
5295b7b453SJohn Marino extern void version_etc_arn (FILE *stream,
5395b7b453SJohn Marino                              const char *command_name, const char *package,
5495b7b453SJohn Marino                              const char *version,
5595b7b453SJohn Marino                              const char * const * authors, size_t n_authors);
5695b7b453SJohn Marino 
5795b7b453SJohn Marino /* Names are passed in the NULL-terminated array AUTHORS.  */
5895b7b453SJohn Marino extern void version_etc_ar (FILE *stream,
5995b7b453SJohn Marino                             const char *command_name, const char *package,
6095b7b453SJohn Marino                             const char *version, const char * const * authors);
6195b7b453SJohn Marino 
6295b7b453SJohn Marino /* Names are passed in the NULL-terminated va_list.  */
6395b7b453SJohn Marino extern void version_etc_va (FILE *stream,
6495b7b453SJohn Marino                             const char *command_name, const char *package,
6595b7b453SJohn Marino                             const char *version, va_list authors);
6695b7b453SJohn Marino 
6795b7b453SJohn Marino /* Names are passed as separate arguments, with an additional
6895b7b453SJohn Marino    NULL argument at the end.  */
6995b7b453SJohn Marino extern void version_etc (FILE *stream,
7095b7b453SJohn Marino                          const char *command_name, const char *package,
7195b7b453SJohn Marino                          const char *version,
7295b7b453SJohn Marino                          /* const char *author1, ..., NULL */ ...)
73200fbe8dSJohn Marino   _GL_ATTRIBUTE_SENTINEL;
7495b7b453SJohn Marino 
75cf28ed85SJohn Marino /* Display the usual "Report bugs to" stanza.  */
7695b7b453SJohn Marino extern void emit_bug_reporting_address (void);
7795b7b453SJohn Marino 
7895b7b453SJohn Marino #endif /* VERSION_ETC_H */
79