| 1 | /* Print --version and bug-reporting information in a consistent format. |
| 2 | Copyright (C) 1999, 2003, 2005, 2009-2024 Free Software Foundation, Inc. |
| 3 | |
| 4 | This file is free software: you can redistribute it and/or modify |
| 5 | it under the terms of the GNU Lesser General Public License as |
| 6 | published by the Free Software Foundation, either version 3 of the |
| 7 | License, or (at your option) any later version. |
| 8 | |
| 9 | This file 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 Lesser General Public License for more details. |
| 13 | |
| 14 | You should have received a copy of the GNU Lesser General Public License |
| 15 | along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
| 16 | |
| 17 | /* Written by Jim Meyering. */ |
| 18 | |
| 19 | #ifndef VERSION_ETC_H |
| 20 | # define VERSION_ETC_H 1 |
| 21 | |
| 22 | /* This file uses _GL_ATTRIBUTE_SENTINEL. */ |
| 23 | # if !_GL_CONFIG_H_INCLUDED |
| 24 | # error "Please include config.h first." |
| 25 | # endif |
| 26 | |
| 27 | # include <stdarg.h> |
| 28 | # include <stdio.h> |
| 29 | |
| 30 | # ifdef __cplusplus |
| 31 | extern "C" |
| 32 | { |
| 33 | # endif |
| 34 | |
| 35 | extern const char version_etc_copyright[]; |
| 36 | |
| 37 | /* The three functions below display the --version information in the |
| 38 | standard way: command and package names, package version, followed |
| 39 | by a short GPLv3+ notice and a list of up to 10 author names. |
| 40 | |
| 41 | If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of |
| 42 | the program. The formats are therefore: |
| 43 | |
| 44 | PACKAGE VERSION |
| 45 | |
| 46 | or |
| 47 | |
| 48 | COMMAND_NAME (PACKAGE) VERSION. |
| 49 | |
| 50 | The functions differ in the way they are passed author names: */ |
| 51 | |
| 52 | /* N_AUTHORS names are supplied in array AUTHORS. */ |
| 53 | extern void version_etc_arn (FILE *stream, |
| 54 | const char *command_name, const char *package, |
| 55 | const char *version, |
| 56 | const char * const * authors, size_t n_authors); |
| 57 | |
| 58 | /* Names are passed in the NULL-terminated array AUTHORS. */ |
| 59 | extern void version_etc_ar (FILE *stream, |
| 60 | const char *command_name, const char *package, |
| 61 | const char *version, const char * const * authors); |
| 62 | |
| 63 | /* Names are passed in the NULL-terminated va_list. */ |
| 64 | extern void version_etc_va (FILE *stream, |
| 65 | const char *command_name, const char *package, |
| 66 | const char *version, va_list authors); |
| 67 | |
| 68 | /* Names are passed as separate arguments, with an additional |
| 69 | NULL argument at the end. */ |
| 70 | extern void version_etc (FILE *stream, |
| 71 | const char *command_name, const char *package, |
| 72 | const char *version, |
| 73 | /* const char *author1, ..., NULL */ ...) |
| 74 | _GL_ATTRIBUTE_SENTINEL ((0)); |
| 75 | |
| 76 | /* Display the usual "Report bugs to" stanza. */ |
| 77 | extern void emit_bug_reporting_address (void); |
| 78 | |
| 79 | # ifdef __cplusplus |
| 80 | } |
| 81 | # endif |
| 82 | |
| 83 | #endif /* VERSION_ETC_H */ |