1 /* Definitions for locale archive handling. 2 Copyright (C) 2002 Free Software Foundation, Inc. 3 This file is part of the GNU C Library. 4 5 The GNU C Library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 10 The GNU C Library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with the GNU C Library; if not, write to the Free 17 Software Foundation, Inc., 18 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef _LOCARCHIVE_H 22 #define _LOCARCHIVE_H 1 23 24 #include <stdint.h> 25 26 #define AR_MAGIC 0xde020109 27 28 struct locarhead { 29 uint32_t magic; 30 /* Serial number. */ 31 uint32_t serial; 32 /* Name hash table. */ 33 uint32_t namehash_offset; 34 uint32_t namehash_used; 35 uint32_t namehash_size; 36 /* String table. */ 37 uint32_t string_offset; 38 uint32_t string_used; 39 uint32_t string_size; 40 /* Table with locale records. */ 41 uint32_t locrectab_offset; 42 uint32_t locrectab_used; 43 uint32_t locrectab_size; 44 /* MD5 sum hash table. */ 45 uint32_t sumhash_offset; 46 uint32_t sumhash_used; 47 uint32_t sumhash_size; 48 }; 49 50 51 struct namehashent { 52 /* Hash value of the name. */ 53 uint32_t hashval; 54 /* Offset of the name in the string table. */ 55 uint32_t name_offset; 56 /* Offset of the locale record. */ 57 uint32_t locrec_offset; 58 }; 59 60 61 struct sumhashent { 62 /* MD5 sum. */ 63 char sum[16]; 64 /* Offset of the file in the archive. */ 65 uint32_t file_offset; 66 }; 67 68 struct locrecent { 69 uint32_t refs; /* # of namehashent records that point here */ 70 struct { 71 uint32_t offset; 72 uint32_t len; 73 } record[__LC_LAST]; 74 }; 75 76 77 struct locarhandle { 78 int fd; 79 void *addr; 80 size_t len; 81 }; 82 83 84 /* In memory data for the locales with their checksums. */ 85 typedef struct locale_category_data { 86 off_t size; 87 void *addr; 88 char sum[16]; 89 } locale_data_t[__LC_LAST]; 90 91 #endif /* locarchive.h */ 92