Lines Matching defs:mapping

7493     const char *reason = "No mapping for the Unicode character exists "
8108 PyObject *mapping,
8122 if (PyUnicode_READY(mapping) == -1)
8125 maplen = PyUnicode_GET_LENGTH(mapping);
8126 mapdata = PyUnicode_DATA(mapping);
8127 mapkind = PyUnicode_KIND(mapping);
8197 /* undefined mapping */
8227 PyObject *mapping,
8243 /* Get mapping (char ordinal -> integer, Unicode char or None) */
8248 item = PyObject_GetItem(mapping, key);
8252 /* No mapping found means: mapping is undefined. */
8259 /* Apply mapping */
8268 "character mapping must be in range(0x%x)",
8295 "character mapping must return integer, None or str");
8303 /* undefined mapping */
8329 PyObject *mapping,
8335 if (mapping == NULL)
8345 if (PyUnicode_CheckExact(mapping)) {
8346 if (charmap_decode_string(s, size, mapping, errors, &writer) < 0)
8350 if (charmap_decode_mapping(s, size, mapping, errors, &writer) < 0)
8429 /* If there isn't a one-to-one mapping of NULL to \0,
8431 a mapping dictionary. */
8515 encoding_map_lookup(Py_UCS4 c, PyObject *mapping)
8517 struct encoding_map *map = (struct encoding_map*)mapping;
8545 /* Lookup the character ch in the mapping. If the character
8549 charmapencode_lookup(Py_UCS4 c, PyObject *mapping)
8556 x = PyObject_GetItem(mapping, w);
8560 /* No mapping found means: mapping is undefined. */
8572 "character mapping must be in range(256)");
8583 "character mapping must return integer, bytes or None, not %.400s",
8608 was put in the output buffer, or Py_None, if the mapping was undefined
8612 charmapencode_output(Py_UCS4 c, PyObject *mapping,
8619 if (Py_IS_TYPE(mapping, &EncodingMapType)) {
8620 int res = encoding_map_lookup(c, mapping);
8632 rep = charmapencode_lookup(c, mapping);
8671 PyObject *unicode, Py_ssize_t *inpos, PyObject *mapping,
8698 if (Py_IS_TYPE(mapping, &EncodingMapType)) {
8700 val = encoding_map_lookup(ch, mapping);
8708 rep = charmapencode_lookup(ch, mapping);
8730 x = charmapencode_output('?', mapping, res, respos);
8751 x = charmapencode_output(*cp, mapping, res, respos);
8798 x = charmapencode_output(repch, mapping, res, respos);
8817 PyObject *mapping,
8840 if (mapping == NULL)
8854 charmapencode_result x = charmapencode_output(ch, mapping, &res, &respos);
8858 if (charmap_encoding_error(unicode, &inpos, mapping,
8888 PyObject *mapping)
8890 if (!PyUnicode_Check(unicode) || mapping == NULL) {
8894 return _PyUnicode_EncodeCharmap(unicode, mapping, NULL);
8977 /* Lookup the character ch in the mapping and put the result in result,
8981 charmaptranslate_lookup(Py_UCS4 c, PyObject *mapping, PyObject **result)
8988 x = PyObject_GetItem(mapping, w);
8992 /* No mapping found means: use 1:1 mapping. */
9007 "character mapping must be in range(0x%x)",
9022 "character mapping must return integer, None or str");
9029 Return 1 if the result was written into the writer, return 0 if the mapping
9032 charmaptranslate_output(Py_UCS4 ch, PyObject *mapping,
9037 if (charmaptranslate_lookup(ch, mapping, &item))
9041 /* not found => default to 1:1 mapping */
9080 unicode_fast_translate_lookup(PyObject *mapping, Py_UCS1 ch,
9086 if (charmaptranslate_lookup(ch, mapping, &item)) {
9095 /* not found => default to 1:1 mapping */
9140 unicode_fast_translate(PyObject *input, PyObject *mapping,
9165 int translate = unicode_fast_translate_lookup(mapping, ch,
9192 PyObject *mapping,
9208 if (mapping == NULL) {
9233 res = unicode_fast_translate(input, mapping, &writer, ignore, &i);
9256 translate = charmaptranslate_output(ch, mapping, &writer);
9274 if (charmaptranslate_lookup(ch, mapping, &x))
9312 PyObject *mapping,
9317 return _PyUnicode_TranslateCharmap(str, mapping, errors);
13423 If there is only one argument, it must be a dictionary mapping Unicode
13542 Translation table, which must be a mapping of Unicode ordinals to
14080 "S.format_map(mapping) -> str\n\
14082 Return a formatted version of S, using substitutions from mapping.\n\
14709 "format requires a mapping");