System dependent I/O functions for dynamiclinker, generic version.
[glibc/history.git] / intl / gettext.h
blob8d5c1212343934645208f681ae755f24fdfb0d4f
1 /* Internal header for GNU gettext internationalization functions.
2 Copyright (C) 1995, 1997 Free Software Foundation, Inc.
4 This file is part of the GNU C Library. Its master source is NOT part of
5 the C library, however. The master source lives in /gd/gnu/lib.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If not,
19 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 #ifndef _GETTEXT_H
23 #define _GETTEXT_H 1
25 #include <stdio.h>
27 #if HAVE_LIMITS_H || _LIBC
28 # include <limits.h>
29 #endif
31 /* @@ end of prolog @@ */
33 /* The magic number of the GNU message catalog format. */
34 #define _MAGIC 0x950412de
35 #define _MAGIC_SWAPPED 0xde120495
37 /* Revision number of the currently used .mo (binary) file format. */
38 #define MO_REVISION_NUMBER 0
40 /* The following contortions are an attempt to use the C preprocessor
41 to determine an unsigned integral type that is 32 bits wide. An
42 alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
43 doing that would require that the configure script compile and *run*
44 the resulting executable. Locally running cross-compiled executables
45 is usually not possible. */
47 #if __STDC__
48 # define UINT_MAX_32_BITS 4294967295U
49 #else
50 # define UINT_MAX_32_BITS 0xFFFFFFFF
51 #endif
53 /* If UINT_MAX isn't defined, assume it's a 32-bit type.
54 This should be valid for all systems GNU cares about because
55 that doesn't include 16-bit systems, and only modern systems
56 (that certainly have <limits.h>) have 64+-bit integral types. */
58 #ifndef UINT_MAX
59 # define UINT_MAX UINT_MAX_32_BITS
60 #endif
62 #if UINT_MAX == UINT_MAX_32_BITS
63 typedef unsigned nls_uint32;
64 #else
65 # if USHRT_MAX == UINT_MAX_32_BITS
66 typedef unsigned short nls_uint32;
67 # else
68 # if ULONG_MAX == UINT_MAX_32_BITS
69 typedef unsigned long nls_uint32;
70 # else
71 /* The following line is intended to throw an error. Using #error is
72 not portable enough. */
73 "Cannot determine unsigned 32-bit data type."
74 # endif
75 # endif
76 #endif
79 /* Header for binary .mo file format. */
80 struct mo_file_header
82 /* The magic number. */
83 nls_uint32 magic;
84 /* The revision number of the file format. */
85 nls_uint32 revision;
86 /* The number of strings pairs. */
87 nls_uint32 nstrings;
88 /* Offset of table with start offsets of original strings. */
89 nls_uint32 orig_tab_offset;
90 /* Offset of table with start offsets of translation strings. */
91 nls_uint32 trans_tab_offset;
92 /* Size of hashing table. */
93 nls_uint32 hash_tab_size;
94 /* Offset of first hashing entry. */
95 nls_uint32 hash_tab_offset;
98 struct string_desc
100 /* Length of addressed string. */
101 nls_uint32 length;
102 /* Offset of string in file. */
103 nls_uint32 offset;
106 /* @@ begin of epilog @@ */
108 #endif /* gettext.h */