test-gencat.c 849 B

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