version-etc.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* Print --version and bug-reporting information in a consistent format.
  2. Copyright (C) 1999, 2003, 2005, 2009-2013 Free Software Foundation, Inc.
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  13. /* Written by Jim Meyering. */
  14. #ifndef VERSION_ETC_H
  15. # define VERSION_ETC_H 1
  16. # include <stdarg.h>
  17. # include <stdio.h>
  18. /* The 'sentinel' attribute was added in gcc 4.0. */
  19. #ifndef _GL_ATTRIBUTE_SENTINEL
  20. # if 4 <= __GNUC__
  21. # define _GL_ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
  22. # else
  23. # define _GL_ATTRIBUTE_SENTINEL /* empty */
  24. # endif
  25. #endif
  26. extern const char version_etc_copyright[];
  27. /* The three functions below display the --version information in the
  28. standard way: command and package names, package version, followed
  29. by a short GPLv3+ notice and a list of up to 10 author names.
  30. If COMMAND_NAME is NULL, the PACKAGE is assumed to be the name of
  31. the program. The formats are therefore:
  32. PACKAGE VERSION
  33. or
  34. COMMAND_NAME (PACKAGE) VERSION.
  35. The functions differ in the way they are passed author names: */
  36. /* N_AUTHORS names are supplied in array AUTHORS. */
  37. extern void version_etc_arn (FILE *stream,
  38. const char *command_name, const char *package,
  39. const char *version,
  40. const char * const * authors, size_t n_authors);
  41. /* Names are passed in the NULL-terminated array AUTHORS. */
  42. extern void version_etc_ar (FILE *stream,
  43. const char *command_name, const char *package,
  44. const char *version, const char * const * authors);
  45. /* Names are passed in the NULL-terminated va_list. */
  46. extern void version_etc_va (FILE *stream,
  47. const char *command_name, const char *package,
  48. const char *version, va_list authors);
  49. /* Names are passed as separate arguments, with an additional
  50. NULL argument at the end. */
  51. extern void version_etc (FILE *stream,
  52. const char *command_name, const char *package,
  53. const char *version,
  54. /* const char *author1, ..., NULL */ ...)
  55. _GL_ATTRIBUTE_SENTINEL;
  56. /* Display the usual "Report bugs to" stanza. */
  57. extern void emit_bug_reporting_address (void);
  58. #endif /* VERSION_ETC_H */