diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-04-01 13:19:51 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-04-01 13:19:51 +0000 |
commit | 5891046a8615390bd96fb3cf1c4663bf00d12e47 (patch) | |
tree | 9bf6842ab437a66a259d909737ab6c1d8ad8b478 /iconv/gconv_conf.c | |
parent | f9f219d99a5b3b29af184bff9afe70aa9ed427a1 (diff) | |
download | glibc-5891046a8615390bd96fb3cf1c4663bf00d12e47.tar glibc-5891046a8615390bd96fb3cf1c4663bf00d12e47.tar.gz glibc-5891046a8615390bd96fb3cf1c4663bf00d12e47.tar.bz2 glibc-5891046a8615390bd96fb3cf1c4663bf00d12e47.zip |
Update.
* iconv/gconv_conf.c (builtin_aliases): New variable.
(__gconv_read_conf): Add builtin aliases.
* iconv/gconv_builtin.c (builtin_map): Define BUILTIN?ALIAS as an
noop macro before including gconv_builtin.h.
* iconv/gconv_builtin.h: Add alias names.
Diffstat (limited to 'iconv/gconv_conf.c')
-rw-r--r-- | iconv/gconv_conf.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c index fb03372def..0c5ceef9e2 100644 --- a/iconv/gconv_conf.c +++ b/iconv/gconv_conf.c @@ -1,5 +1,5 @@ /* Handle configuration data. - Copyright (C) 1997 Free Software Foundation, Inc. + Copyright (C) 1997, 1998 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -56,6 +56,20 @@ static struct gconv_module builtin_modules[] = cost: Cost, \ module_name: Name \ }, +#define BUILTIN_ALIAS(From, To) + +#include "gconv_builtin.h" +}; + +#undef BUILTIN_TRANSFORMATION +#undef BUILTIN_ALIAS + +static const char * +builtin_aliases[] = +{ +#define BUILTIN_TRANSFORMATION(From, ConstPfx, ConstLen, To, Cost, Name, \ + Fct, Init, End) +#define BUILTIN_ALIAS(From, To) From " " To, #include "gconv_builtin.h" }; @@ -362,6 +376,7 @@ __gconv_read_conf (void) void *modules = NULL; size_t nmodules = 0; int save_errno = errno; + size_t cnt; if (user_path == NULL) /* No user-defined path. Make a modifiable copy of the default path. */ @@ -428,6 +443,14 @@ __gconv_read_conf (void) } } + /* Add aliases for builtin conversions. */ + cnt = sizeof (builtin_aliases) / sizeof (builtin_aliases[0]); + while (cnt > 0) + { + char *copy = strdupa (builtin_aliases[--cnt]); + add_alias (copy); + } + /* Restore the error number. */ __set_errno (save_errno); } |