1 /****************************************************************************/
2 /*                                                                          */
3 /*  The FreeType project -- a free and portable quality TrueType renderer.  */
4 /*                                                                          */
5 /*  E. Dieterich                                                            */
6 /*                                                                          */
7 /*  fterror: test errstr functionality.                                     */
8 /*                                                                          */
9 /****************************************************************************/
10 
11 
12 #include <stdio.h>
13 #include <stdlib.h>
14 
15 #include "freetype.h"
16 #include "ftxerr18.h"
17 
18 /*
19  *  Basically, an external program using FreeType shouldn't depend on an
20  *  internal file of the FreeType library, especially not on ft_conf.h -- but
21  *  to avoid another configure script which tests for the existence of the
22  *  i18n stuff we include ft_conf.h here since we can be sure that our test
23  *  programs use the same configuration options as the library itself.
24  */
25 
26 #include "ft_conf.h"
27 
28 
29 #ifdef HAVE_LIBINTL_H
30 
31 #ifdef HAVE_LOCALE_H
32 #include <locale.h>
33 #endif
34 
35 #include <libintl.h>
36 
37 #else /* HAVE_LIBINTL_H */
38 
39 #define gettext( x )  ( x )
40 
41 #endif /* HAVE_LIBINTL_H */
42 
43 
44   int
main(void)45   main( void )
46   {
47     int    i;
48 #ifdef HAVE_LIBINTL_H
49     char*  domain;
50 
51 
52     setlocale( LC_ALL, "" );
53     bindtextdomain( "freetype", LOCALEDIR );
54     domain = textdomain( "freetype" );
55 #endif
56 
57 #if 0
58     printf( "domain: %s\n", domain = textdomain( "" ) );
59 #endif
60     printf( gettext( "Start of fterror.\n" ) );
61 
62     for ( i = 0; i < 10; i++ )
63       printf( "Code: %i, %s\n", i, TT_ErrToString18( i ) );
64 
65 #if 0
66     printf( "domain: %s\n", domain = textdomain( "" ) );
67 #endif
68     printf( gettext( "End of fterror.\n" ) );
69 
70     exit( EXIT_SUCCESS );      /* for safety reasons */
71 
72     return 0;       /* never reached */
73   }
74 
75 
76 /* End */
77