|
Packit Service |
82fcde |
#include <locale.h>
|
|
Packit Service |
82fcde |
#include <nl_types.h>
|
|
Packit Service |
82fcde |
#include <stdio.h>
|
|
Packit Service |
82fcde |
#include <stdlib.h>
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
static int
|
|
Packit Service |
82fcde |
do_test (void)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
nl_catd catalog;
|
|
Packit Service |
82fcde |
setlocale (LC_ALL, "");
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
printf ("LC_MESSAGES = %s\n", setlocale (LC_MESSAGES, NULL));
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
catalog = catopen ("sample", NL_CAT_LOCALE);
|
|
Packit Service |
82fcde |
if (catalog == (nl_catd) -1)
|
|
Packit Service |
82fcde |
{
|
|
Packit Service |
82fcde |
printf ("no catalog: %m\n");
|
|
Packit Service |
82fcde |
exit (1);
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
printf ("%s\n", catgets(catalog, 1, 1, "sample 1"));
|
|
Packit Service |
82fcde |
printf ("%s\n", catgets(catalog, 1, 2, "sample 2"));
|
|
Packit Service |
82fcde |
printf ("%s\n", catgets(catalog, 1, 3, "sample 3"));
|
|
Packit Service |
82fcde |
printf ("%s\n", catgets(catalog, 1, 4, "sample 4"));
|
|
Packit Service |
82fcde |
printf ("%s\n", catgets(catalog, 1, 5, "sample 5"));
|
|
Packit Service |
82fcde |
printf ("%s\n", catgets(catalog, 1, 6, "sample 6"));
|
|
Packit Service |
82fcde |
printf ("%s\n", catgets(catalog, 1, 7, "sample 7"));
|
|
Packit Service |
82fcde |
catclose (catalog);
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
return 0;
|
|
Packit Service |
82fcde |
}
|
|
Packit Service |
82fcde |
|
|
Packit Service |
82fcde |
#define TEST_FUNCTION do_test ()
|
|
Packit Service |
82fcde |
#include "../test-skeleton.c"
|