2005-07-20 Ulrich Drepper <drepper@redhat.com>
[glibc/history.git] / catgets / test-gencat.c
blobeaa9b895f6eca1c5032f3db58c88e516eafd4322
1 #include <locale.h>
2 #include <nl_types.h>
3 #include <stdio.h>
4 #include <stdlib.h>
6 int
7 main (void)
9 nl_catd catalog;
10 setlocale (LC_ALL, "");
12 printf ("LC_MESSAGES = %s\n", setlocale (LC_MESSAGES, NULL));
14 catalog = catopen ("sample", NL_CAT_LOCALE);
15 if (catalog == (nl_catd) -1)
17 printf ("no catalog: %m\n");
18 exit (1);
21 printf ("%s\n", catgets(catalog, 1, 1, "sample 1"));
22 printf ("%s\n", catgets(catalog, 1, 2, "sample 2"));
23 printf ("%s\n", catgets(catalog, 1, 3, "sample 3"));
24 printf ("%s\n", catgets(catalog, 1, 4, "sample 4"));
25 printf ("%s\n", catgets(catalog, 1, 5, "sample 5"));
26 printf ("%s\n", catgets(catalog, 1, 6, "sample 6"));
27 printf ("%s\n", catgets(catalog, 1, 7, "sample 7"));
28 catclose (catalog);
30 return 0;