>>51689211
/* hello.c -- print a greeting message and exit.
Copyright 1992, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2005,
2006, 2007, 2008, 2010, 2011, 2013, 2014, 2015 Free Software
Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
[. . .]
/* Forward declarations. */
static void print_help (FILE *out);
static void print_version (void);
int
main (int argc, char *argv[])
{
int optc;
int lose = 0;
const char *greeting_msg;
wchar_t *mb_greeting;
size_t len;
[ . . .]
/* Having initialized gettext, get the default message. */
greeting_msg = _("Hello, world!");
/* Even exiting has subtleties. On exit, if any writes failed, change
the exit status. The /dev/full device on GNU/Linux can be used for
testing; for instance, hello >/dev/full should exit unsuccessfully.
This is implemented in the Gnulib module "closeout". */
atexit (close_stdout);
while ((optc = getopt_long (argc, argv, "g:t", longopts, NULL)) != -1)
switch (optc)
{ [. . .] }
[. . .]
/* Print greeting message and exit. */
wprintf (L"%ls\n", mb_greeting);
free(mb_greeting);
exit (EXIT_SUCCESS);
}
/* Print help info. This long message is split into
several pieces to help translators be able to align different
blocks and identify the various pieces. */
[. . .]