* 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.
1998-04-01 Ulrich Drepper <drepper@cygnus.com>
+ * 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.
+
* iconv/gconv_simple.c (__gconv_transform_ucs4_utf8): Compute
number of converted bytes correctly.
/* Table for builtin transformation mapping.
- 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.
init: Init, \
end: End, \
},
+#define BUILTIN_ALIAS(From, To)
#include <gconv_builtin.h>
};
/* Builtin transformations.
- 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.
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+BUILTIN_ALIAS ("UTF8//", "ISO-10646/UTF8/")
+BUILTIN_ALIAS ("UTF-8//", "ISO-10646/UTF8/")
+
BUILTIN_TRANSFORMATION ("([^/]+)/UCS4/([^/]*)", NULL, 0,
"\\1/UTF8/\\2", 1, "=ucs4->utf8",
__gconv_transform_ucs4_utf8,
__gconv_transform_init_rstate,
__gconv_transform_end_rstate)
-BUILTIN_TRANSFORMATION ("([^/]+)/UTF8/([^/]*)", NULL, 0,
+BUILTIN_TRANSFORMATION ("([^/]+)/UTF-?8/([^/]*)", NULL, 0,
"\\1/UCS4/\\2", 1, "=utf8->ucs4",
__gconv_transform_utf8_ucs4,
__gconv_transform_init_rstate,
/* 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.
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"
};
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. */
}
}
+ /* 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);
}