1#include <locale.h>
2#include <nl_types.h>
3#include <stdio.h>
4#include <stdlib.h>
5
6static int
7do_test (void)
8{
9 nl_catd catalog;
10 setlocale (LC_ALL, "");
11
12 printf (format: "LC_MESSAGES = %s\n", setlocale (LC_MESSAGES, NULL));
13
14 catalog = catopen (cat_name: "sample", NL_CAT_LOCALE);
15 if (catalog == (nl_catd) -1)
16 {
17 printf (format: "no catalog: %m\n");
18 exit (1);
19 }
20
21 printf (format: "%s\n", catgets(catalog: catalog, set: 1, number: 1, string: "sample 1"));
22 printf (format: "%s\n", catgets(catalog: catalog, set: 1, number: 2, string: "sample 2"));
23 printf (format: "%s\n", catgets(catalog: catalog, set: 1, number: 3, string: "sample 3"));
24 printf (format: "%s\n", catgets(catalog: catalog, set: 1, number: 4, string: "sample 4"));
25 printf (format: "%s\n", catgets(catalog: catalog, set: 1, number: 5, string: "sample 5"));
26 printf (format: "%s\n", catgets(catalog: catalog, set: 1, number: 6, string: "sample 6"));
27 printf (format: "%s\n", catgets(catalog: catalog, set: 1, number: 7, string: "sample 7"));
28 catclose (catalog: catalog);
29
30 return 0;
31}
32
33#define TEST_FUNCTION do_test ()
34#include "../test-skeleton.c"
35

source code of glibc/catgets/test-gencat.c