No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / examples / hello-c / hello.c
blob5807cac10178c06bc0baf230a584b5a6dcd48f55
1 /* Example for use of GNU gettext.
2 Copyright (C) 2003 Free Software Foundation, Inc.
3 This file is in the public domain.
5 Source code of the C program. */
8 /* Get setlocale() declaration. */
9 #include <locale.h>
11 /* Get printf() declaration. */
12 #include <stdio.h>
14 /* Get getpid() declaration. */
15 #if HAVE_UNISTD_H
16 # include <unistd.h>
17 #endif
19 /* Get gettext(), textdomain(), bindtextdomain() declaration. */
20 #include "gettext.h"
21 /* Define shortcut for gettext(). */
22 #define _(string) gettext (string)
24 int
25 main ()
27 setlocale (LC_ALL, "");
28 textdomain ("hello-c");
29 bindtextdomain ("hello-c", LOCALEDIR);
31 printf ("%s\n", _("Hello, world!"));
32 printf (_("This program is running as process number %d."), getpid ());
33 putchar ('\n');
35 return 0;