about summary refs log tree commit diff
path: root/intl/gettext.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-07-27 08:47:23 +0000
committerUlrich Drepper <drepper@redhat.com>2002-07-27 08:47:23 +0000
commit3172f58fa34e806ba4d4a521572ea7c3acea015f (patch)
tree1f37577eb79e42349da33290fa5e38999c71c63a /intl/gettext.h
parentd683fe11f91717f0f9c2cf238c8bff0f1618c1ae (diff)
downloadglibc-3172f58fa34e806ba4d4a521572ea7c3acea015f.tar.gz
glibc-3172f58fa34e806ba4d4a521572ea7c3acea015f.tar.xz
glibc-3172f58fa34e806ba4d4a521572ea7c3acea015f.zip
Update.
2002-07-15  Alexandre Oliva  <aoliva@redhat.com>

	* configure.in (static_nss): Set to `yes' if --disable-shared.

2002-07-23  Bruno Haible  <bruno@clisp.org>

	* intl/loadmsgcat.c (PRI*): Redefine the macros if PRI_MACROS_BROKEN
	is set.

2002-07-25  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h: New file.
	* sysdeps/unix/sysv/linux/ia64/profil-counter.h: Fix profil_counter
	arguments.

2002-07-25  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/alpha/adjtime.c (__adjtimex_internal): Add
	alias.

2002-07-21  Bruno Haible  <bruno@clisp.org>

	* intl/libintl.h (__GNU_GETTEXT_SUPPORTED_REVISION): New macro.
	* intl/gettext.h (struct mo_file_header): New fields n_sysdep_segments,
	sysdep_segments_offset, n_sysdep_strings, orig_sysdep_tab_offset,
	trans_sysdep_tab_offset.
	(struct sysdep_segment): New type.
	(struct sysdep_string): New type.
	(SEGMENTS_END): New macro.
	* intl/gettextP.h (struct sysdep_string_desc): New type.
	(struct loaded_domain): New fields malloced, n_sysdep_strings,
	orig_sysdep_tab, trans_sysdep_tab, must_swap_hash_tab. Make fields
	orig_tab, trans_tab, hash_tab to const pointers because they point
	into read-only memory.
	* intl/loadmsgcat.c: Include stdint.h, inttypes.h, hash-string.h.
	(PRI*): Define fallback values.
	(get_sysdep_segment_value): New function.
	(_nl_load_domain): Distinguish major and minor revision parts. Add
	support for minor revision 1 with system dependent strings.
	(_nl_unload_domain): Also free the 'malloced' field.
	* intl/dcigettext.c (_nl_find_msg): Remove test for domain->hash_size,
	now done in loadmsgcat.c. Add support for system dependent strings.
Diffstat (limited to 'intl/gettext.h')
-rw-r--r--intl/gettext.h58
1 files changed, 53 insertions, 5 deletions
diff --git a/intl/gettext.h b/intl/gettext.h
index 11a0236daf..65e0b27440 100644
--- a/intl/gettext.h
+++ b/intl/gettext.h
@@ -1,5 +1,5 @@
 /* Internal header for GNU gettext internationalization functions.
-   Copyright (C) 1995, 1997, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1997, 2000-2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -76,26 +76,74 @@ struct mo_file_header
   nls_uint32 magic;
   /* The revision number of the file format.  */
   nls_uint32 revision;
+
+  /* The following are only used in .mo files with major revision 0.  */
+
   /* The number of strings pairs.  */
   nls_uint32 nstrings;
   /* Offset of table with start offsets of original strings.  */
   nls_uint32 orig_tab_offset;
-  /* Offset of table with start offsets of translation strings.  */
+  /* Offset of table with start offsets of translated strings.  */
   nls_uint32 trans_tab_offset;
-  /* Size of hashing table.  */
+  /* Size of hash table.  */
   nls_uint32 hash_tab_size;
-  /* Offset of first hashing entry.  */
+  /* Offset of first hash table entry.  */
   nls_uint32 hash_tab_offset;
+
+  /* The following are only used in .mo files with minor revision >= 1.  */
+
+  /* The number of system dependent segments.  */
+  nls_uint32 n_sysdep_segments;
+  /* Offset of table describing system dependent segments.  */
+  nls_uint32 sysdep_segments_offset;
+  /* The number of system dependent strings pairs.  */
+  nls_uint32 n_sysdep_strings;
+  /* Offset of table with start offsets of original sysdep strings.  */
+  nls_uint32 orig_sysdep_tab_offset;
+  /* Offset of table with start offsets of translated sysdep strings.  */
+  nls_uint32 trans_sysdep_tab_offset;
 };
 
+/* Descriptor for static string contained in the binary .mo file.  */
 struct string_desc
 {
-  /* Length of addressed string.  */
+  /* Length of addressed string, not including the trailing NUL.  */
   nls_uint32 length;
   /* Offset of string in file.  */
   nls_uint32 offset;
 };
 
+/* The following are only used in .mo files with minor revision >= 1.  */
+
+/* Descriptor for system dependent string segment.  */
+struct sysdep_segment
+{
+  /* Length of addressed string, including the trailing NUL.  */
+  nls_uint32 length;
+  /* Offset of string in file.  */
+  nls_uint32 offset;
+};
+
+/* Descriptor for system dependent string.  */
+struct sysdep_string
+{
+  /* Offset of static string segments in file.  */
+  nls_uint32 offset;
+  /* Alternating sequence of static and system dependent segments.
+     The last segment is a static segment, including the trailing NUL.  */
+  struct segment_pair
+  {
+    /* Size of static segment.  */
+    nls_uint32 segsize;
+    /* Reference to system dependent string segment, or ~0 at the end.  */
+    nls_uint32 sysdepref;
+  } segments[1];
+};
+
+/* Marker for the end of the segments[] array.  This has the value 0xFFFFFFFF,
+   regardless whether 'int' is 16 bit, 32 bit, or 64 bit.  */
+#define SEGMENTS_END ((nls_uint32) ~0)
+
 /* @@ begin of epilog @@ */
 
 #endif	/* gettext.h  */