1 /* Table for builtin transformation mapping.
2 Copyright (C) 1997-2024 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
24 #include <gconv_int.h>
29 static const struct builtin_map
33 __gconv_btowc_fct btowc_fct;
35 int8_t min_needed_from;
36 int8_t max_needed_from;
42 #define BUILTIN_TRANSFORMATION(From, To, Cost, Name, Fct, BtowcFct, \
43 MinF, MaxF, MinT, MaxT) \
47 .btowc_fct = BtowcFct, \
49 .min_needed_from = MinF, \
50 .max_needed_from = MaxF, \
51 .min_needed_to = MinT, \
52 .max_needed_to = MaxT \
54 #define BUILTIN_ALIAS(From, To)
56 #include <gconv_builtin.h>
61 __gconv_get_builtin_trans (const char *name, struct __gconv_step *step)
65 for (cnt = 0; cnt < sizeof (map) / sizeof (map[0]); ++cnt)
66 if (strcmp (name, map[cnt].name) == 0)
69 assert (cnt < sizeof (map) / sizeof (map[0]));
71 step->__fct = map[cnt].fct;
72 step->__btowc_fct = map[cnt].btowc_fct;
73 step->__init_fct = NULL;
74 step->__end_fct = NULL;
75 step->__shlib_handle = NULL;
76 step->__modname = NULL;
78 step->__min_needed_from = map[cnt].min_needed_from;
79 step->__max_needed_from = map[cnt].max_needed_from;
80 step->__min_needed_to = map[cnt].min_needed_to;
81 step->__max_needed_to = map[cnt].max_needed_to;
83 /* None of the builtin converters handles stateful encoding. */