4
0

print-copyr.c 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Print a copyright notice suitable for the current locale.
  2. Copyright (C) 2001 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 2, or (at your option)
  6. 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, write to the Free Software Foundation,
  13. Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
  14. /* Written by Paul Eggert. */
  15. #if HAVE_CONFIG_H
  16. # include <config.h>
  17. #endif
  18. #include "unicodeio.h"
  19. #include "print-copyr.h"
  20. #include <stdio.h>
  21. #define COPYRIGHT_SIGN 0x00A9
  22. /* Print "(C)". */
  23. static int
  24. print_parenthesized_c (unsigned int code, void *callback_arg)
  25. {
  26. FILE *stream = callback_arg;
  27. return fputs ("(C)", stream);
  28. }
  29. /* Print "Copyright (C) " followed by NOTICE and then a newline,
  30. transliterating "(C)" to an actual copyright sign (C-in-a-circle)
  31. if possible. */
  32. void
  33. print_copyright (char const *notice)
  34. {
  35. fputs ("Copyright ", stdout);
  36. unicode_to_mb (COPYRIGHT_SIGN, print_unicode_success, print_parenthesized_c,
  37. stdout);
  38. fputc (' ', stdout);
  39. puts (notice);
  40. }