From b2e3d177abf93989afd8d647597e797f69b564df Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 23 Jul 2001 23:01:08 +0000 Subject: Update. 2001-07-23 Ulrich Drepper * iconv/gconv_cache.c (__gconv_lookup_cache): Handle encoding from and to INTERNAL. * iconv/iconvconfig.c: Create a special record for the INTERNAL encoding name in the output file. --- iconv/iconvconfig.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'iconv/iconvconfig.c') diff --git a/iconv/iconvconfig.c b/iconv/iconvconfig.c index a8523bf25c..1d76c8f1ca 100644 --- a/iconv/iconvconfig.c +++ b/iconv/iconvconfig.c @@ -714,6 +714,8 @@ add_builtins (void) /* add the builtin transformations. */ for (cnt = 0; cnt < nbuiltin_trans; ++cnt) + { + printf("%s: %s -> %s\n", builtin_trans[cnt].module,builtin_trans[cnt].from,builtin_trans[cnt].to); new_module (builtin_trans[cnt].from, strlen (builtin_trans[cnt].from) + 1, builtin_trans[cnt].to, @@ -721,6 +723,7 @@ add_builtins (void) "", builtin_trans[cnt].module, strlen (builtin_trans[cnt].module) + 1, builtin_trans[cnt].cost, 0); + } } @@ -755,6 +758,11 @@ generate_name_list (void) { size_t i; + /* A name we always need. */ + tsearch (new_name ("INTERNAL", strtabadd (strtab, "INTERNAL", + sizeof ("INTERNAL"))), + &names, name_compare); + for (i = 0; i < nmodule_list; ++i) { struct module *runp; @@ -796,10 +804,19 @@ static void generate_name_info (void) { size_t i; + int idx; - name_info = (struct name_info *) xcalloc (nmodule_list, + name_info = (struct name_info *) xcalloc (nmodule_list + 1, sizeof (struct name_info)); + /* First add a special entry for the INTERNAL name. This must have + index zero. */ + idx = name_to_module_idx ("INTERNAL", 1); + name_info[0].canonical_name = "INTERNAL"; + name_info[0].canonical_strent = strtabadd (strtab, "INTERNAL", + sizeof ("INTERNAL")); + assert (nname_info == 1); + for (i = 0; i < nmodule_list; ++i) { struct module *runp; @@ -807,7 +824,7 @@ generate_name_info (void) for (runp = module_list[i]; runp != NULL; runp = runp->next) if (strcmp (runp->fromname, "INTERNAL") == 0) { - int idx = name_to_module_idx (runp->toname, 1); + idx = name_to_module_idx (runp->toname, 1); name_info[idx].from_internal = runp; assert (name_info[idx].canonical_name == NULL || strcmp (name_info[idx].canonical_name, @@ -817,7 +834,7 @@ generate_name_info (void) } else if (strcmp (runp->toname, "INTERNAL") == 0) { - int idx = name_to_module_idx (runp->fromname, 1); + idx = name_to_module_idx (runp->fromname, 1); name_info[idx].to_internal = runp; assert (name_info[idx].canonical_name == NULL || strcmp (name_info[idx].canonical_name, -- cgit v1.2.3