annotate Objects/stringlib/ucs2lib.h @ 73798:6cde416ef03b

Credit Per Øyvind Karlsen for the initial implementation of the lzma module (issue #6715).
author Nadeem Vawda <nadeem.vawda@gmail.com>
date Thu, 01 Dec 2011 01:18:27 +0200
parents 6b3e871c003c
children c2153ce1b5dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
72475
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
1 /* this is sort of a hack. there's at least one place (formatting
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
2 floats) where some stringlib code takes a different path if it's
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
3 compiled as unicode. */
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
4 #define STRINGLIB_IS_UNICODE 1
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
5
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
6 #define FASTSEARCH ucs2lib_fastsearch
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
7 #define STRINGLIB(F) ucs2lib_##F
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
8 #define STRINGLIB_OBJECT PyUnicodeObject
72874
bfd3fcfb02f3 Fix fastsearch for UCS2 and UCS4
Victor Stinner <victor.stinner@haypocalc.com>
parents: 72500
diff changeset
9 #define STRINGLIB_SIZEOF_CHAR 2
72475
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
10 #define STRINGLIB_CHAR Py_UCS2
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
11 #define STRINGLIB_TYPE_NAME "unicode"
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
12 #define STRINGLIB_PARSE_CODE "U"
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
13 #define STRINGLIB_EMPTY unicode_empty
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
14 #define STRINGLIB_ISSPACE Py_UNICODE_ISSPACE
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
15 #define STRINGLIB_ISLINEBREAK BLOOM_LINEBREAK
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
16 #define STRINGLIB_ISDECIMAL Py_UNICODE_ISDECIMAL
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
17 #define STRINGLIB_TODECIMAL Py_UNICODE_TODECIMAL
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
18 #define STRINGLIB_TOUPPER Py_UNICODE_TOUPPER
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
19 #define STRINGLIB_TOLOWER Py_UNICODE_TOLOWER
72876
62fd915c4e0b stringlib: Fix STRINGLIB_STR for UCS2/UCS4
Victor Stinner <victor.stinner@haypocalc.com>
parents: 72874
diff changeset
20 #define STRINGLIB_STR PyUnicode_2BYTE_DATA
72475
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
21 #define STRINGLIB_LEN PyUnicode_GET_LENGTH
72500
347fb9006c6f Mark PyUnicode_FromUCS[124] as private
Victor Stinner <victor.stinner@haypocalc.com>
parents: 72475
diff changeset
22 #define STRINGLIB_NEW _PyUnicode_FromUCS2
72475
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
23 #define STRINGLIB_RESIZE not_supported
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
24 #define STRINGLIB_CHECK PyUnicode_Check
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
25 #define STRINGLIB_CHECK_EXACT PyUnicode_CheckExact
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
26 #define STRINGLIB_GROUPING _PyUnicode_InsertThousandsGrouping
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
27 #define STRINGLIB_GROUPING_LOCALE _PyUnicode_InsertThousandsGroupingLocale
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
28
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
29 #define STRINGLIB_TOSTR PyObject_Str
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
30 #define STRINGLIB_TOASCII PyObject_ASCII
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
31
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
32 #define _Py_InsertThousandsGrouping _PyUnicode_ucs2_InsertThousandsGrouping
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
33 #define _Py_InsertThousandsGroupingLocale _PyUnicode_ucs2_InsertThousandsGroupingLocale
8beaa9a37387 Implement PEP 393.
Martin v. Löwis <martin@v.loewis.de>
parents:
diff changeset
34