Back to index

glibc  2.9
locarchive.h
Go to the documentation of this file.
00001 /* Definitions for locale archive handling.
00002    Copyright (C) 2002 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004 
00005    The GNU C Library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Lesser General Public
00007    License as published by the Free Software Foundation; either
00008    version 2.1 of the License, or (at your option) any later version.
00009 
00010    The GNU C Library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Lesser General Public License for more details.
00014 
00015    You should have received a copy of the GNU Lesser General Public
00016    License along with the GNU C Library; if not, write to the Free
00017    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00018    02111-1307 USA.  */
00019 
00020 #ifndef _LOCARCHIVE_H
00021 #define _LOCARCHIVE_H 1
00022 
00023 #include <stdint.h>
00024 
00025 
00026 #define AR_MAGIC 0xde020109
00027 
00028 struct locarhead
00029 {
00030   uint32_t magic;
00031   /* Serial number.  */
00032   uint32_t serial;
00033   /* Name hash table.  */
00034   uint32_t namehash_offset;
00035   uint32_t namehash_used;
00036   uint32_t namehash_size;
00037   /* String table.  */
00038   uint32_t string_offset;
00039   uint32_t string_used;
00040   uint32_t string_size;
00041   /* Table with locale records.  */
00042   uint32_t locrectab_offset;
00043   uint32_t locrectab_used;
00044   uint32_t locrectab_size;
00045   /* MD5 sum hash table.  */
00046   uint32_t sumhash_offset;
00047   uint32_t sumhash_used;
00048   uint32_t sumhash_size;
00049 };
00050 
00051 
00052 struct namehashent
00053 {
00054   /* Hash value of the name.  */
00055   uint32_t hashval;
00056   /* Offset of the name in the string table.  */
00057   uint32_t name_offset;
00058   /* Offset of the locale record.  */
00059   uint32_t locrec_offset;
00060 };
00061 
00062 
00063 struct sumhashent
00064 {
00065   /* MD5 sum.  */
00066   char sum[16];
00067   /* Offset of the file in the archive.  */
00068   uint32_t file_offset;
00069 };
00070 
00071 struct locrecent
00072 {
00073   uint32_t refs;            /* # of namehashent records that point here */
00074   struct
00075   {
00076     uint32_t offset;
00077     uint32_t len;
00078   } record[__LC_LAST];
00079 };
00080 
00081 
00082 struct locarhandle
00083 {
00084   int fd;
00085   void *addr;
00086   size_t len;
00087 };
00088 
00089 
00090 /* In memory data for the locales with their checksums.  */
00091 typedef struct locale_category_data
00092 {
00093   off64_t size;
00094   void *addr;
00095   char sum[16];
00096 } locale_data_t[__LC_LAST];
00097 
00098 #endif /* locarchive.h */