mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-15 07:30:13 +00:00
6b98979fc9
2001-07-22 Ulrich Drepper <drepper@redhat.com> * iconv/gconv_builtin.c (struct builtin_map): Remove init and end elements. (BUILTIN_TRANSFORMATION): Remove Init and End parameters. (__gconv_get_builtin_trans): Initialize __init_fct and __end_fct to NULL. * iconv/gconv_builtin.h: Remove NULL parameters for Init and End in all BUILTIN_TRANSFORMATION calls. * iconv/gconv_conf.c (BUILTIN_TRANSFORMATION): Remove Init and End parameters. * iconv/gconv_simple.c: Likewise. * iconv/gconv_db.c (gen_steps): Internal converters don't have initializers, move the code accordingly. * iconv/gconv_conf.c (__gconv_read_conf): Don't read configuration file if STATIC_GCONV is defined. * iconv/gconv_conf.c (__gconv_path_envvar): New global variable. (__gconv_get_path): Use it instead of call getenv. (__gconv_read_conf): First see whether cache can be used. If yes, don't do any work here. * iconv/gconv_db.c (__gconv_release_step): Renamed from release_step and exported. Change callers. (__gconv_find_transform): First call __gconv_lookup_cache and only continue if it signals no cache available. Remove some unnecessary tests. * iconv/gconv_int.h: Declare __gconv_path_envvar, __gconv_lookup_cache, __gconv_release_step, and __gconv_loaded_cache. * iconv/gconv_cache.c: New file. * iconv/iconvconfig.c: New file. * iconv/iconvconfig.h: New file. * iconv/strtab.c: New file. * iconv/Makefile: Add rules to build new files and programs.
68 lines
1.6 KiB
C
68 lines
1.6 KiB
C
/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
|
|
This file is part of the GNU C Library.
|
|
Contributed by Ulrich Drepper <drepper@redhat.com>, 2000.
|
|
|
|
The GNU C Library is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU Library General Public License as
|
|
published by the Free Software Foundation; either version 2 of the
|
|
License, or (at your option) any later version.
|
|
|
|
The GNU C Library is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Library General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Library General Public
|
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
Boston, MA 02111-1307, USA. */
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
typedef uint16_t gidx_t;
|
|
|
|
|
|
struct gconvcache_header
|
|
{
|
|
uint32_t magic;
|
|
gidx_t string_offset;
|
|
gidx_t hash_offset;
|
|
gidx_t hash_size;
|
|
gidx_t module_offset;
|
|
gidx_t otherconv_offset;
|
|
};
|
|
|
|
struct hash_entry
|
|
{
|
|
gidx_t string_offset;
|
|
gidx_t module_idx;
|
|
};
|
|
|
|
struct module_entry
|
|
{
|
|
gidx_t canonname_offset;
|
|
gidx_t fromdir_offset;
|
|
gidx_t fromname_offset;
|
|
gidx_t todir_offset;
|
|
gidx_t toname_offset;
|
|
gidx_t extra_offset;
|
|
};
|
|
|
|
struct extra_entry
|
|
{
|
|
gidx_t module_cnt;
|
|
struct extra_entry_module
|
|
{
|
|
gidx_t outname_offset;
|
|
gidx_t dir_offset;
|
|
gidx_t name_offset;
|
|
} module[0];
|
|
};
|
|
|
|
|
|
#define GCONVCACHE_MAGIC 0x20010324
|
|
|
|
|
|
#define GCONV_MODULES_CACHE GCONV_DIR "/gconv-modules.cache"
|