00001 /* Description of GNU message catalog format: general file layout.
00002 Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
00003
00004 This program is free software; you can redistribute it and/or modify
00005 it under the terms of the GNU General Public License as published by
00006 the Free Software Foundation; either version 2, or (at your option)
00007 any later version.
00008
00009 This program is distributed in the hope that it will be useful,
00010 but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00012 GNU General Public License for more details.
00013
00014 You should have received a copy of the GNU General Public License
00015 along with this program; if not, write to the Free Software Foundation,
00016 Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
00017
00018 #ifndef _GETTEXT_H
00019 #define _GETTEXT_H 1
00020
00021 #if HAVE_LIMITS_H || _LIBC
00022 # include <limits.h>
00023 #endif
00024
00025 /* @@ end of prolog @@ */
00026
00027 /* The magic number of the GNU message catalog format. */
00028 #define _MAGIC 0x950412de
00029 #define _MAGIC_SWAPPED 0xde120495
00030
00031 /* Revision number of the currently used .mo (binary) file format. */
00032 #define MO_REVISION_NUMBER 0
00033
00034 /* The following contortions are an attempt to use the C preprocessor
00035 to determine an unsigned integral type that is 32 bits wide. An
00036 alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
00037 as of version autoconf-2.13, the AC_CHECK_SIZEOF macro doesn't work
00038 when cross-compiling. */
00039
00040 #if __STDC__
00041 # define UINT_MAX_32_BITS 4294967295U
00042 #else
00043 # define UINT_MAX_32_BITS 0xFFFFFFFF
00044 #endif
00045
00046 /* If UINT_MAX isn't defined, assume it's a 32-bit type.
00047 This should be valid for all systems GNU cares about because
00048 that doesn't include 16-bit systems, and only modern systems
00049 (that certainly have <limits.h>) have 64+-bit integral types. */
00050
00051 #ifndef UINT_MAX
00052 # define UINT_MAX UINT_MAX_32_BITS
00053 #endif
00054
00055 #if UINT_MAX == UINT_MAX_32_BITS
00056 typedef unsigned nls_uint32;
00057 #else
00058 # if USHRT_MAX == UINT_MAX_32_BITS
00059 typedef unsigned short nls_uint32;
00060 # else
00061 # if ULONG_MAX == UINT_MAX_32_BITS
00062 typedef unsigned long nls_uint32;
00063 # else
00064 /* The following line is intended to throw an error. Using #error is
00065 not portable enough. */
00066 "Cannot determine unsigned 32-bit data type."
00067 # endif
00068 # endif
00069 #endif
00070
00071
00072 /* Header for binary .mo file format. */
00073 struct mo_file_header
00074 {
00075 /* The magic number. */
00076 nls_uint32 magic;
00077 /* The revision number of the file format. */
00078 nls_uint32 revision;
00079 /* The number of strings pairs. */
00080 nls_uint32 nstrings;
00081 /* Offset of table with start offsets of original strings. */
00082 nls_uint32 orig_tab_offset;
00083 /* Offset of table with start offsets of translation strings. */
00084 nls_uint32 trans_tab_offset;
00085 /* Size of hashing table. */
00086 nls_uint32 hash_tab_size;
00087 /* Offset of first hashing entry. */
00088 nls_uint32 hash_tab_offset;
00089 };
00090
00091 struct string_desc
00092 {
00093 /* Length of addressed string. */
00094 nls_uint32 length;
00095 /* Offset of string in file. */
00096 nls_uint32 offset;
00097 };
00098
00099 /* @@ begin of epilog @@ */
00100
00101 #endif /* gettext.h */
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001