diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2008-11-19 22:32:29 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2008-11-19 22:32:29 +0000 |
commit | bf48bbc8583ed2d742d8c98e6105bd559ae48890 (patch) | |
tree | fbb3cacd363b00e6522b4c956cc89c6d06fa6332 /src | |
parent | adcc0f9106753140a5c5feab9e243e9ecb71a4f8 (diff) | |
download | iconv-bf48bbc8583ed2d742d8c98e6105bd559ae48890.tar.gz iconv-bf48bbc8583ed2d742d8c98e6105bd559ae48890.tar.bz2 |
Dump the list of known encoding aliases when asked. Don't expect any kind of sort order -- that would require a level of thought I don't have right now.
svn path=/trunk/iconv/; revision=5746
Diffstat (limited to 'src')
-rw-r--r-- | src/aliases.c | 10 | ||||
-rw-r--r-- | src/internal.h | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/aliases.c b/src/aliases.c index 1292685..db20f71 100644 --- a/src/aliases.c +++ b/src/aliases.c @@ -23,8 +23,6 @@ static struct canon *create_canon(const char *canon, short mibenum); static int hash_val(const char *alias); #ifdef TEST -static void dump_alias_data(void); - int main (void) { struct canon *c; @@ -165,7 +163,6 @@ void free_alias_data(void) } } -#ifdef TEST /** * Dump all alias data to stdout */ @@ -178,22 +175,23 @@ void dump_alias_data(void) for (i = 0; i != HASH_SIZE; i++) { for (c = canon_tab[i]; c; c = c->next) { - printf("%d %s\n", i, c->name); + printf("%s\n", c->name); size += offsetof(struct canon, name) + c->name_len; } for (a = alias_tab[i]; a; a = a->next) { - printf("%d %s\n", i, a->name); + printf("%s\n", a->name); size += offsetof(struct alias, name) + a->name_len; } } +#ifdef TEST size += (sizeof(canon_tab) / sizeof(canon_tab[0])); size += (sizeof(alias_tab) / sizeof(alias_tab[0])); printf("%d\n", size); -} #endif +} /** * Create alias data from Aliases file diff --git a/src/internal.h b/src/internal.h index 9150efc..c1d04f3 100644 --- a/src/internal.h +++ b/src/internal.h @@ -56,6 +56,7 @@ struct canon { /* in aliases.c */ int create_alias_data(const char *filename); void free_alias_data(void); +void dump_alias_data(void); struct canon *alias_canonicalise(const char *alias); short mibenum_from_name(const char *alias); const char *mibenum_to_name(short mibenum); |