Back to Evolution Project page
00001 /* Internal header for GNU gettext internationalization functions. 00002 Copyright (C) 1995, 1997 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 Library General Public 00015 License along with the GNU C Library; see the file COPYING.LIB. If not, 00016 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00017 Boston, MA 02111-1307, USA. */ 00018 00019 #ifndef _GETTEXT_H 00020 #define _GETTEXT_H 1 00021 00022 #include <stdio.h> 00023 00024 #if HAVE_LIMITS_H || _LIBC 00025 # include <limits.h> 00026 #endif 00027 00028 /* @@ end of prolog @@ */ 00029 00030 /* The magic number of the GNU message catalog format. */ 00031 #define _MAGIC 0x950412de 00032 #define _MAGIC_SWAPPED 0xde120495 00033 00034 /* Revision number of the currently used .mo (binary) file format. */ 00035 #define MO_REVISION_NUMBER 0 00036 00037 /* The following contortions are an attempt to use the C preprocessor 00038 to determine an unsigned integral type that is 32 bits wide. An 00039 alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but 00040 doing that would require that the configure script compile and *run* 00041 the resulting executable. Locally running cross-compiled executables 00042 is usually not possible. */ 00043 00044 #if __STDC__ 00045 # define UINT_MAX_32_BITS 4294967295U 00046 #else 00047 # define UINT_MAX_32_BITS 0xFFFFFFFF 00048 #endif 00049 00050 /* If UINT_MAX isn't defined, assume it's a 32-bit type. 00051 This should be valid for all systems GNU cares about because 00052 that doesn't include 16-bit systems, and only modern systems 00053 (that certainly have <limits.h>) have 64+-bit integral types. */ 00054 00055 #ifndef UINT_MAX 00056 # define UINT_MAX UINT_MAX_32_BITS 00057 #endif 00058 00059 #if UINT_MAX == UINT_MAX_32_BITS 00060 typedef unsigned nls_uint32; 00061 #else 00062 # if USHRT_MAX == UINT_MAX_32_BITS 00063 typedef unsigned short nls_uint32; 00064 # else 00065 # if ULONG_MAX == UINT_MAX_32_BITS 00066 typedef unsigned long nls_uint32; 00067 # else 00068 /* The following line is intended to throw an error. Using #error is 00069 not portable enough. */ 00070 "Cannot determine unsigned 32-bit data type." 00071 # endif 00072 # endif 00073 #endif 00074 00075 00076 /* Header for binary .mo file format. */ 00077 struct mo_file_header 00078 { 00079 /* The magic number. */ 00080 nls_uint32 magic; 00081 /* The revision number of the file format. */ 00082 nls_uint32 revision; 00083 /* The number of strings pairs. */ 00084 nls_uint32 nstrings; 00085 /* Offset of table with start offsets of original strings. */ 00086 nls_uint32 orig_tab_offset; 00087 /* Offset of table with start offsets of translation strings. */ 00088 nls_uint32 trans_tab_offset; 00089 /* Size of hashing table. */ 00090 nls_uint32 hash_tab_size; 00091 /* Offset of first hashing entry. */ 00092 nls_uint32 hash_tab_offset; 00093 }; 00094 00095 struct string_desc 00096 { 00097 /* Length of addressed string. */ 00098 nls_uint32 length; 00099 /* Offset of string in file. */ 00100 nls_uint32 offset; 00101 }; 00102 00103 /* @@ begin of epilog @@ */ 00104 00105 #endif /* gettext.h */