1 /* @(#)nlsdefs.h	1.5 10/12/19 Copyright 2004-2010 J. Schilling */
2 /*
3  *	Native language support
4  *
5  *	Copyright (c) 2004-2010 J. Schilling
6  */
7 /*
8  * The contents of this file are subject to the terms of the
9  * Common Development and Distribution License, Version 1.0 only
10  * (the "License").  You may not use this file except in compliance
11  * with the License.
12  *
13  * See the file CDDL.Schily.txt in this distribution for details.
14  *
15  * When distributing Covered Code, include this CDDL HEADER in each
16  * file and include the License file CDDL.Schily.txt from this distribution.
17  */
18 
19 #ifndef	_SCHILY_NLSDEFS_H
20 #define	_SCHILY_NLSDEFS_H
21 
22 #ifndef _SCHILY_MCONFIG_H
23 #include <schily/mconfig.h>
24 #endif
25 
26 #ifndef	NO_NLS
27 #ifndef	USE_NLS
28 #define	USE_NLS			/* Make nls the default */
29 #endif
30 #endif
31 
32 #ifdef	HAVE_LIBINTL_H
33 #ifndef	_INCL_LIBINTL_H
34 #include <libintl.h>		/* gettext() */
35 #define	_INCL_LIBINTL_H
36 #endif
37 #else
38 #undef	USE_NLS
39 #endif
40 
41 #ifndef	_SCHILY_LOCALE_H
42 #include <schily/locale.h>	/* LC_* definitions */
43 #endif
44 #ifndef	_INCL_LOCALE_H
45 #undef	USE_NLS
46 #endif
47 
48 #ifdef	HAVE_LANGINFO_H
49 #ifndef	_INCL_LAGINFO_H
50 #include <langinfo.h>		/* YESSTR amnd similar */
51 #define	_INCL_LANGINFO_H
52 #endif
53 #else
54 #undef	USE_NLS
55 #endif
56 
57 #ifndef	HAVE_GETTEXT
58 #undef	USE_NLS
59 #endif
60 
61 #ifdef	NO_NLS
62 #undef	USE_NLS
63 #endif
64 
65 #ifdef	NO_TEXT_DOMAIN
66 #undef	TEXT_DOMAIN
67 #endif
68 
69 #ifndef	USE_NLS
70 #undef	gettext
71 #define	gettext(s)			s
72 #undef	dgettext
73 #define	dgettext(d, s)			s
74 #undef	dcgettext
75 #define	dcgettext(d, s, c)		s
76 
77 #undef	textdomain
78 #define	textdomain(a)			((char *)0)
79 #undef	bindtextdomain
80 #define	bindtextdomain(d, dir)		((char *)0)
81 #undef	bind_textdomain_codeset
82 #define	bind_textdomain_codeset(d, c)	((char *)0)
83 #endif
84 
85 #ifdef	lint
86 /*
87  * Allow lint to check printf() format strings.
88  */
89 #define	_(s)				s
90 #else	/* lint */
91 
92 #ifdef	USE_DGETTEXT			/* e.g. in a library */
93 #define	_(s)				dgettext(TEXT_DOMAIN, s)
94 #else
95 #define	_(s)				gettext(s)
96 #endif
97 #endif	/* lint */
98 /*
99  * Allow to mark strings for xgettext(1)
100  */
101 #define	__(s)				s
102 
103 #endif	/* _SCHILY_NLSDEFS_H */
104