Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/python2....
File: unicodeobject.h
#ifndef Py_UNICODEOBJECT_H
[0] Fix | Delete
#define Py_UNICODEOBJECT_H
[1] Fix | Delete
[2] Fix | Delete
#include <stdarg.h>
[3] Fix | Delete
[4] Fix | Delete
/*
[5] Fix | Delete
[6] Fix | Delete
Unicode implementation based on original code by Fredrik Lundh,
[7] Fix | Delete
modified by Marc-Andre Lemburg (mal@lemburg.com) according to the
[8] Fix | Delete
Unicode Integration Proposal (see file Misc/unicode.txt).
[9] Fix | Delete
[10] Fix | Delete
Copyright (c) Corporation for National Research Initiatives.
[11] Fix | Delete
[12] Fix | Delete
[13] Fix | Delete
Original header:
[14] Fix | Delete
--------------------------------------------------------------------
[15] Fix | Delete
[16] Fix | Delete
* Yet another Unicode string type for Python. This type supports the
[17] Fix | Delete
* 16-bit Basic Multilingual Plane (BMP) only.
[18] Fix | Delete
*
[19] Fix | Delete
* Written by Fredrik Lundh, January 1999.
[20] Fix | Delete
*
[21] Fix | Delete
* Copyright (c) 1999 by Secret Labs AB.
[22] Fix | Delete
* Copyright (c) 1999 by Fredrik Lundh.
[23] Fix | Delete
*
[24] Fix | Delete
* fredrik@pythonware.com
[25] Fix | Delete
* http://www.pythonware.com
[26] Fix | Delete
*
[27] Fix | Delete
* --------------------------------------------------------------------
[28] Fix | Delete
* This Unicode String Type is
[29] Fix | Delete
*
[30] Fix | Delete
* Copyright (c) 1999 by Secret Labs AB
[31] Fix | Delete
* Copyright (c) 1999 by Fredrik Lundh
[32] Fix | Delete
*
[33] Fix | Delete
* By obtaining, using, and/or copying this software and/or its
[34] Fix | Delete
* associated documentation, you agree that you have read, understood,
[35] Fix | Delete
* and will comply with the following terms and conditions:
[36] Fix | Delete
*
[37] Fix | Delete
* Permission to use, copy, modify, and distribute this software and its
[38] Fix | Delete
* associated documentation for any purpose and without fee is hereby
[39] Fix | Delete
* granted, provided that the above copyright notice appears in all
[40] Fix | Delete
* copies, and that both that copyright notice and this permission notice
[41] Fix | Delete
* appear in supporting documentation, and that the name of Secret Labs
[42] Fix | Delete
* AB or the author not be used in advertising or publicity pertaining to
[43] Fix | Delete
* distribution of the software without specific, written prior
[44] Fix | Delete
* permission.
[45] Fix | Delete
*
[46] Fix | Delete
* SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
[47] Fix | Delete
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
[48] Fix | Delete
* FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR
[49] Fix | Delete
* ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
[50] Fix | Delete
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
[51] Fix | Delete
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
[52] Fix | Delete
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
[53] Fix | Delete
* -------------------------------------------------------------------- */
[54] Fix | Delete
[55] Fix | Delete
#include <ctype.h>
[56] Fix | Delete
[57] Fix | Delete
/* === Internal API ======================================================= */
[58] Fix | Delete
[59] Fix | Delete
/* --- Internal Unicode Format -------------------------------------------- */
[60] Fix | Delete
[61] Fix | Delete
#ifndef Py_USING_UNICODE
[62] Fix | Delete
[63] Fix | Delete
#define PyUnicode_Check(op) 0
[64] Fix | Delete
#define PyUnicode_CheckExact(op) 0
[65] Fix | Delete
[66] Fix | Delete
#else
[67] Fix | Delete
[68] Fix | Delete
/* FIXME: MvL's new implementation assumes that Py_UNICODE_SIZE is
[69] Fix | Delete
properly set, but the default rules below doesn't set it. I'll
[70] Fix | Delete
sort this out some other day -- fredrik@pythonware.com */
[71] Fix | Delete
[72] Fix | Delete
#ifndef Py_UNICODE_SIZE
[73] Fix | Delete
#error Must define Py_UNICODE_SIZE
[74] Fix | Delete
#endif
[75] Fix | Delete
[76] Fix | Delete
/* Setting Py_UNICODE_WIDE enables UCS-4 storage. Otherwise, Unicode
[77] Fix | Delete
strings are stored as UCS-2 (with limited support for UTF-16) */
[78] Fix | Delete
[79] Fix | Delete
#if Py_UNICODE_SIZE >= 4
[80] Fix | Delete
#define Py_UNICODE_WIDE
[81] Fix | Delete
#endif
[82] Fix | Delete
[83] Fix | Delete
/* Set these flags if the platform has "wchar.h", "wctype.h" and the
[84] Fix | Delete
wchar_t type is a 16-bit unsigned type */
[85] Fix | Delete
/* #define HAVE_WCHAR_H */
[86] Fix | Delete
/* #define HAVE_USABLE_WCHAR_T */
[87] Fix | Delete
[88] Fix | Delete
/* Defaults for various platforms */
[89] Fix | Delete
#ifndef PY_UNICODE_TYPE
[90] Fix | Delete
[91] Fix | Delete
/* Windows has a usable wchar_t type (unless we're using UCS-4) */
[92] Fix | Delete
# if defined(MS_WIN32) && Py_UNICODE_SIZE == 2
[93] Fix | Delete
# define HAVE_USABLE_WCHAR_T
[94] Fix | Delete
# define PY_UNICODE_TYPE wchar_t
[95] Fix | Delete
# endif
[96] Fix | Delete
[97] Fix | Delete
# if defined(Py_UNICODE_WIDE)
[98] Fix | Delete
# define PY_UNICODE_TYPE Py_UCS4
[99] Fix | Delete
# endif
[100] Fix | Delete
[101] Fix | Delete
#endif
[102] Fix | Delete
[103] Fix | Delete
/* If the compiler provides a wchar_t type we try to support it
[104] Fix | Delete
through the interface functions PyUnicode_FromWideChar() and
[105] Fix | Delete
PyUnicode_AsWideChar(). */
[106] Fix | Delete
[107] Fix | Delete
#ifdef HAVE_USABLE_WCHAR_T
[108] Fix | Delete
# ifndef HAVE_WCHAR_H
[109] Fix | Delete
# define HAVE_WCHAR_H
[110] Fix | Delete
# endif
[111] Fix | Delete
#endif
[112] Fix | Delete
[113] Fix | Delete
#ifdef HAVE_WCHAR_H
[114] Fix | Delete
/* Work around a cosmetic bug in BSDI 4.x wchar.h; thanks to Thomas Wouters */
[115] Fix | Delete
# ifdef _HAVE_BSDI
[116] Fix | Delete
# include <time.h>
[117] Fix | Delete
# endif
[118] Fix | Delete
# include <wchar.h>
[119] Fix | Delete
#endif
[120] Fix | Delete
[121] Fix | Delete
/*
[122] Fix | Delete
* Use this typedef when you need to represent a UTF-16 surrogate pair
[123] Fix | Delete
* as single unsigned integer.
[124] Fix | Delete
*/
[125] Fix | Delete
#if SIZEOF_INT >= 4
[126] Fix | Delete
typedef unsigned int Py_UCS4;
[127] Fix | Delete
#elif SIZEOF_LONG >= 4
[128] Fix | Delete
typedef unsigned long Py_UCS4;
[129] Fix | Delete
#endif
[130] Fix | Delete
[131] Fix | Delete
/* Py_UNICODE is the native Unicode storage format (code unit) used by
[132] Fix | Delete
Python and represents a single Unicode element in the Unicode
[133] Fix | Delete
type. */
[134] Fix | Delete
[135] Fix | Delete
typedef PY_UNICODE_TYPE Py_UNICODE;
[136] Fix | Delete
[137] Fix | Delete
/* --- UCS-2/UCS-4 Name Mangling ------------------------------------------ */
[138] Fix | Delete
[139] Fix | Delete
/* Unicode API names are mangled to assure that UCS-2 and UCS-4 builds
[140] Fix | Delete
produce different external names and thus cause import errors in
[141] Fix | Delete
case Python interpreters and extensions with mixed compiled in
[142] Fix | Delete
Unicode width assumptions are combined. */
[143] Fix | Delete
[144] Fix | Delete
#ifndef Py_UNICODE_WIDE
[145] Fix | Delete
[146] Fix | Delete
# define PyUnicode_AsASCIIString PyUnicodeUCS2_AsASCIIString
[147] Fix | Delete
# define PyUnicode_AsCharmapString PyUnicodeUCS2_AsCharmapString
[148] Fix | Delete
# define PyUnicode_AsEncodedObject PyUnicodeUCS2_AsEncodedObject
[149] Fix | Delete
# define PyUnicode_AsEncodedString PyUnicodeUCS2_AsEncodedString
[150] Fix | Delete
# define PyUnicode_AsLatin1String PyUnicodeUCS2_AsLatin1String
[151] Fix | Delete
# define PyUnicode_AsRawUnicodeEscapeString PyUnicodeUCS2_AsRawUnicodeEscapeString
[152] Fix | Delete
# define PyUnicode_AsUTF32String PyUnicodeUCS2_AsUTF32String
[153] Fix | Delete
# define PyUnicode_AsUTF16String PyUnicodeUCS2_AsUTF16String
[154] Fix | Delete
# define PyUnicode_AsUTF8String PyUnicodeUCS2_AsUTF8String
[155] Fix | Delete
# define PyUnicode_AsUnicode PyUnicodeUCS2_AsUnicode
[156] Fix | Delete
# define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS2_AsUnicodeEscapeString
[157] Fix | Delete
# define PyUnicode_AsWideChar PyUnicodeUCS2_AsWideChar
[158] Fix | Delete
# define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist
[159] Fix | Delete
# define PyUnicode_Compare PyUnicodeUCS2_Compare
[160] Fix | Delete
# define PyUnicode_Concat PyUnicodeUCS2_Concat
[161] Fix | Delete
# define PyUnicode_Contains PyUnicodeUCS2_Contains
[162] Fix | Delete
# define PyUnicode_Count PyUnicodeUCS2_Count
[163] Fix | Delete
# define PyUnicode_Decode PyUnicodeUCS2_Decode
[164] Fix | Delete
# define PyUnicode_DecodeASCII PyUnicodeUCS2_DecodeASCII
[165] Fix | Delete
# define PyUnicode_DecodeCharmap PyUnicodeUCS2_DecodeCharmap
[166] Fix | Delete
# define PyUnicode_DecodeLatin1 PyUnicodeUCS2_DecodeLatin1
[167] Fix | Delete
# define PyUnicode_DecodeRawUnicodeEscape PyUnicodeUCS2_DecodeRawUnicodeEscape
[168] Fix | Delete
# define PyUnicode_DecodeUTF32 PyUnicodeUCS2_DecodeUTF32
[169] Fix | Delete
# define PyUnicode_DecodeUTF32Stateful PyUnicodeUCS2_DecodeUTF32Stateful
[170] Fix | Delete
# define PyUnicode_DecodeUTF16 PyUnicodeUCS2_DecodeUTF16
[171] Fix | Delete
# define PyUnicode_DecodeUTF16Stateful PyUnicodeUCS2_DecodeUTF16Stateful
[172] Fix | Delete
# define PyUnicode_DecodeUTF8 PyUnicodeUCS2_DecodeUTF8
[173] Fix | Delete
# define PyUnicode_DecodeUTF8Stateful PyUnicodeUCS2_DecodeUTF8Stateful
[174] Fix | Delete
# define PyUnicode_DecodeUnicodeEscape PyUnicodeUCS2_DecodeUnicodeEscape
[175] Fix | Delete
# define PyUnicode_Encode PyUnicodeUCS2_Encode
[176] Fix | Delete
# define PyUnicode_EncodeASCII PyUnicodeUCS2_EncodeASCII
[177] Fix | Delete
# define PyUnicode_EncodeCharmap PyUnicodeUCS2_EncodeCharmap
[178] Fix | Delete
# define PyUnicode_EncodeDecimal PyUnicodeUCS2_EncodeDecimal
[179] Fix | Delete
# define PyUnicode_EncodeLatin1 PyUnicodeUCS2_EncodeLatin1
[180] Fix | Delete
# define PyUnicode_EncodeRawUnicodeEscape PyUnicodeUCS2_EncodeRawUnicodeEscape
[181] Fix | Delete
# define PyUnicode_EncodeUTF32 PyUnicodeUCS2_EncodeUTF32
[182] Fix | Delete
# define PyUnicode_EncodeUTF16 PyUnicodeUCS2_EncodeUTF16
[183] Fix | Delete
# define PyUnicode_EncodeUTF8 PyUnicodeUCS2_EncodeUTF8
[184] Fix | Delete
# define PyUnicode_EncodeUnicodeEscape PyUnicodeUCS2_EncodeUnicodeEscape
[185] Fix | Delete
# define PyUnicode_Find PyUnicodeUCS2_Find
[186] Fix | Delete
# define PyUnicode_Format PyUnicodeUCS2_Format
[187] Fix | Delete
# define PyUnicode_FromEncodedObject PyUnicodeUCS2_FromEncodedObject
[188] Fix | Delete
# define PyUnicode_FromFormat PyUnicodeUCS2_FromFormat
[189] Fix | Delete
# define PyUnicode_FromFormatV PyUnicodeUCS2_FromFormatV
[190] Fix | Delete
# define PyUnicode_FromObject PyUnicodeUCS2_FromObject
[191] Fix | Delete
# define PyUnicode_FromOrdinal PyUnicodeUCS2_FromOrdinal
[192] Fix | Delete
# define PyUnicode_FromString PyUnicodeUCS2_FromString
[193] Fix | Delete
# define PyUnicode_FromStringAndSize PyUnicodeUCS2_FromStringAndSize
[194] Fix | Delete
# define PyUnicode_FromUnicode PyUnicodeUCS2_FromUnicode
[195] Fix | Delete
# define PyUnicode_FromWideChar PyUnicodeUCS2_FromWideChar
[196] Fix | Delete
# define PyUnicode_GetDefaultEncoding PyUnicodeUCS2_GetDefaultEncoding
[197] Fix | Delete
# define PyUnicode_GetMax PyUnicodeUCS2_GetMax
[198] Fix | Delete
# define PyUnicode_GetSize PyUnicodeUCS2_GetSize
[199] Fix | Delete
# define PyUnicode_Join PyUnicodeUCS2_Join
[200] Fix | Delete
# define PyUnicode_Partition PyUnicodeUCS2_Partition
[201] Fix | Delete
# define PyUnicode_RPartition PyUnicodeUCS2_RPartition
[202] Fix | Delete
# define PyUnicode_RSplit PyUnicodeUCS2_RSplit
[203] Fix | Delete
# define PyUnicode_Replace PyUnicodeUCS2_Replace
[204] Fix | Delete
# define PyUnicode_Resize PyUnicodeUCS2_Resize
[205] Fix | Delete
# define PyUnicode_RichCompare PyUnicodeUCS2_RichCompare
[206] Fix | Delete
# define PyUnicode_SetDefaultEncoding PyUnicodeUCS2_SetDefaultEncoding
[207] Fix | Delete
# define PyUnicode_Split PyUnicodeUCS2_Split
[208] Fix | Delete
# define PyUnicode_Splitlines PyUnicodeUCS2_Splitlines
[209] Fix | Delete
# define PyUnicode_Tailmatch PyUnicodeUCS2_Tailmatch
[210] Fix | Delete
# define PyUnicode_Translate PyUnicodeUCS2_Translate
[211] Fix | Delete
# define PyUnicode_TranslateCharmap PyUnicodeUCS2_TranslateCharmap
[212] Fix | Delete
# define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString
[213] Fix | Delete
# define _PyUnicode_Fini _PyUnicodeUCS2_Fini
[214] Fix | Delete
# define _PyUnicode_Init _PyUnicodeUCS2_Init
[215] Fix | Delete
# define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha
[216] Fix | Delete
# define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit
[217] Fix | Delete
# define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit
[218] Fix | Delete
# define _PyUnicode_IsLinebreak _PyUnicodeUCS2_IsLinebreak
[219] Fix | Delete
# define _PyUnicode_IsLowercase _PyUnicodeUCS2_IsLowercase
[220] Fix | Delete
# define _PyUnicode_IsNumeric _PyUnicodeUCS2_IsNumeric
[221] Fix | Delete
# define _PyUnicode_IsTitlecase _PyUnicodeUCS2_IsTitlecase
[222] Fix | Delete
# define _PyUnicode_IsUppercase _PyUnicodeUCS2_IsUppercase
[223] Fix | Delete
# define _PyUnicode_IsWhitespace _PyUnicodeUCS2_IsWhitespace
[224] Fix | Delete
# define _PyUnicode_ToDecimalDigit _PyUnicodeUCS2_ToDecimalDigit
[225] Fix | Delete
# define _PyUnicode_ToDigit _PyUnicodeUCS2_ToDigit
[226] Fix | Delete
# define _PyUnicode_ToLowercase _PyUnicodeUCS2_ToLowercase
[227] Fix | Delete
# define _PyUnicode_ToNumeric _PyUnicodeUCS2_ToNumeric
[228] Fix | Delete
# define _PyUnicode_ToTitlecase _PyUnicodeUCS2_ToTitlecase
[229] Fix | Delete
# define _PyUnicode_ToUppercase _PyUnicodeUCS2_ToUppercase
[230] Fix | Delete
[231] Fix | Delete
#else
[232] Fix | Delete
[233] Fix | Delete
# define PyUnicode_AsASCIIString PyUnicodeUCS4_AsASCIIString
[234] Fix | Delete
# define PyUnicode_AsCharmapString PyUnicodeUCS4_AsCharmapString
[235] Fix | Delete
# define PyUnicode_AsEncodedObject PyUnicodeUCS4_AsEncodedObject
[236] Fix | Delete
# define PyUnicode_AsEncodedString PyUnicodeUCS4_AsEncodedString
[237] Fix | Delete
# define PyUnicode_AsLatin1String PyUnicodeUCS4_AsLatin1String
[238] Fix | Delete
# define PyUnicode_AsRawUnicodeEscapeString PyUnicodeUCS4_AsRawUnicodeEscapeString
[239] Fix | Delete
# define PyUnicode_AsUTF32String PyUnicodeUCS4_AsUTF32String
[240] Fix | Delete
# define PyUnicode_AsUTF16String PyUnicodeUCS4_AsUTF16String
[241] Fix | Delete
# define PyUnicode_AsUTF8String PyUnicodeUCS4_AsUTF8String
[242] Fix | Delete
# define PyUnicode_AsUnicode PyUnicodeUCS4_AsUnicode
[243] Fix | Delete
# define PyUnicode_AsUnicodeEscapeString PyUnicodeUCS4_AsUnicodeEscapeString
[244] Fix | Delete
# define PyUnicode_AsWideChar PyUnicodeUCS4_AsWideChar
[245] Fix | Delete
# define PyUnicode_ClearFreeList PyUnicodeUCS4_ClearFreelist
[246] Fix | Delete
# define PyUnicode_Compare PyUnicodeUCS4_Compare
[247] Fix | Delete
# define PyUnicode_Concat PyUnicodeUCS4_Concat
[248] Fix | Delete
# define PyUnicode_Contains PyUnicodeUCS4_Contains
[249] Fix | Delete
# define PyUnicode_Count PyUnicodeUCS4_Count
[250] Fix | Delete
# define PyUnicode_Decode PyUnicodeUCS4_Decode
[251] Fix | Delete
# define PyUnicode_DecodeASCII PyUnicodeUCS4_DecodeASCII
[252] Fix | Delete
# define PyUnicode_DecodeCharmap PyUnicodeUCS4_DecodeCharmap
[253] Fix | Delete
# define PyUnicode_DecodeLatin1 PyUnicodeUCS4_DecodeLatin1
[254] Fix | Delete
# define PyUnicode_DecodeRawUnicodeEscape PyUnicodeUCS4_DecodeRawUnicodeEscape
[255] Fix | Delete
# define PyUnicode_DecodeUTF32 PyUnicodeUCS4_DecodeUTF32
[256] Fix | Delete
# define PyUnicode_DecodeUTF32Stateful PyUnicodeUCS4_DecodeUTF32Stateful
[257] Fix | Delete
# define PyUnicode_DecodeUTF16 PyUnicodeUCS4_DecodeUTF16
[258] Fix | Delete
# define PyUnicode_DecodeUTF16Stateful PyUnicodeUCS4_DecodeUTF16Stateful
[259] Fix | Delete
# define PyUnicode_DecodeUTF8 PyUnicodeUCS4_DecodeUTF8
[260] Fix | Delete
# define PyUnicode_DecodeUTF8Stateful PyUnicodeUCS4_DecodeUTF8Stateful
[261] Fix | Delete
# define PyUnicode_DecodeUnicodeEscape PyUnicodeUCS4_DecodeUnicodeEscape
[262] Fix | Delete
# define PyUnicode_Encode PyUnicodeUCS4_Encode
[263] Fix | Delete
# define PyUnicode_EncodeASCII PyUnicodeUCS4_EncodeASCII
[264] Fix | Delete
# define PyUnicode_EncodeCharmap PyUnicodeUCS4_EncodeCharmap
[265] Fix | Delete
# define PyUnicode_EncodeDecimal PyUnicodeUCS4_EncodeDecimal
[266] Fix | Delete
# define PyUnicode_EncodeLatin1 PyUnicodeUCS4_EncodeLatin1
[267] Fix | Delete
# define PyUnicode_EncodeRawUnicodeEscape PyUnicodeUCS4_EncodeRawUnicodeEscape
[268] Fix | Delete
# define PyUnicode_EncodeUTF32 PyUnicodeUCS4_EncodeUTF32
[269] Fix | Delete
# define PyUnicode_EncodeUTF16 PyUnicodeUCS4_EncodeUTF16
[270] Fix | Delete
# define PyUnicode_EncodeUTF8 PyUnicodeUCS4_EncodeUTF8
[271] Fix | Delete
# define PyUnicode_EncodeUnicodeEscape PyUnicodeUCS4_EncodeUnicodeEscape
[272] Fix | Delete
# define PyUnicode_Find PyUnicodeUCS4_Find
[273] Fix | Delete
# define PyUnicode_Format PyUnicodeUCS4_Format
[274] Fix | Delete
# define PyUnicode_FromEncodedObject PyUnicodeUCS4_FromEncodedObject
[275] Fix | Delete
# define PyUnicode_FromFormat PyUnicodeUCS4_FromFormat
[276] Fix | Delete
# define PyUnicode_FromFormatV PyUnicodeUCS4_FromFormatV
[277] Fix | Delete
# define PyUnicode_FromObject PyUnicodeUCS4_FromObject
[278] Fix | Delete
# define PyUnicode_FromOrdinal PyUnicodeUCS4_FromOrdinal
[279] Fix | Delete
# define PyUnicode_FromString PyUnicodeUCS4_FromString
[280] Fix | Delete
# define PyUnicode_FromStringAndSize PyUnicodeUCS4_FromStringAndSize
[281] Fix | Delete
# define PyUnicode_FromUnicode PyUnicodeUCS4_FromUnicode
[282] Fix | Delete
# define PyUnicode_FromWideChar PyUnicodeUCS4_FromWideChar
[283] Fix | Delete
# define PyUnicode_GetDefaultEncoding PyUnicodeUCS4_GetDefaultEncoding
[284] Fix | Delete
# define PyUnicode_GetMax PyUnicodeUCS4_GetMax
[285] Fix | Delete
# define PyUnicode_GetSize PyUnicodeUCS4_GetSize
[286] Fix | Delete
# define PyUnicode_Join PyUnicodeUCS4_Join
[287] Fix | Delete
# define PyUnicode_Partition PyUnicodeUCS4_Partition
[288] Fix | Delete
# define PyUnicode_RPartition PyUnicodeUCS4_RPartition
[289] Fix | Delete
# define PyUnicode_RSplit PyUnicodeUCS4_RSplit
[290] Fix | Delete
# define PyUnicode_Replace PyUnicodeUCS4_Replace
[291] Fix | Delete
# define PyUnicode_Resize PyUnicodeUCS4_Resize
[292] Fix | Delete
# define PyUnicode_RichCompare PyUnicodeUCS4_RichCompare
[293] Fix | Delete
# define PyUnicode_SetDefaultEncoding PyUnicodeUCS4_SetDefaultEncoding
[294] Fix | Delete
# define PyUnicode_Split PyUnicodeUCS4_Split
[295] Fix | Delete
# define PyUnicode_Splitlines PyUnicodeUCS4_Splitlines
[296] Fix | Delete
# define PyUnicode_Tailmatch PyUnicodeUCS4_Tailmatch
[297] Fix | Delete
# define PyUnicode_Translate PyUnicodeUCS4_Translate
[298] Fix | Delete
# define PyUnicode_TranslateCharmap PyUnicodeUCS4_TranslateCharmap
[299] Fix | Delete
# define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString
[300] Fix | Delete
# define _PyUnicode_Fini _PyUnicodeUCS4_Fini
[301] Fix | Delete
# define _PyUnicode_Init _PyUnicodeUCS4_Init
[302] Fix | Delete
# define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha
[303] Fix | Delete
# define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit
[304] Fix | Delete
# define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit
[305] Fix | Delete
# define _PyUnicode_IsLinebreak _PyUnicodeUCS4_IsLinebreak
[306] Fix | Delete
# define _PyUnicode_IsLowercase _PyUnicodeUCS4_IsLowercase
[307] Fix | Delete
# define _PyUnicode_IsNumeric _PyUnicodeUCS4_IsNumeric
[308] Fix | Delete
# define _PyUnicode_IsTitlecase _PyUnicodeUCS4_IsTitlecase
[309] Fix | Delete
# define _PyUnicode_IsUppercase _PyUnicodeUCS4_IsUppercase
[310] Fix | Delete
# define _PyUnicode_IsWhitespace _PyUnicodeUCS4_IsWhitespace
[311] Fix | Delete
# define _PyUnicode_ToDecimalDigit _PyUnicodeUCS4_ToDecimalDigit
[312] Fix | Delete
# define _PyUnicode_ToDigit _PyUnicodeUCS4_ToDigit
[313] Fix | Delete
# define _PyUnicode_ToLowercase _PyUnicodeUCS4_ToLowercase
[314] Fix | Delete
# define _PyUnicode_ToNumeric _PyUnicodeUCS4_ToNumeric
[315] Fix | Delete
# define _PyUnicode_ToTitlecase _PyUnicodeUCS4_ToTitlecase
[316] Fix | Delete
# define _PyUnicode_ToUppercase _PyUnicodeUCS4_ToUppercase
[317] Fix | Delete
[318] Fix | Delete
[319] Fix | Delete
#endif
[320] Fix | Delete
[321] Fix | Delete
/* --- Internal Unicode Operations ---------------------------------------- */
[322] Fix | Delete
[323] Fix | Delete
/* If you want Python to use the compiler's wctype.h functions instead
[324] Fix | Delete
of the ones supplied with Python, define WANT_WCTYPE_FUNCTIONS or
[325] Fix | Delete
configure Python using --with-wctype-functions. This reduces the
[326] Fix | Delete
interpreter's code size. */
[327] Fix | Delete
[328] Fix | Delete
#if defined(HAVE_USABLE_WCHAR_T) && defined(WANT_WCTYPE_FUNCTIONS)
[329] Fix | Delete
[330] Fix | Delete
#include <wctype.h>
[331] Fix | Delete
[332] Fix | Delete
#define Py_UNICODE_ISSPACE(ch) iswspace(ch)
[333] Fix | Delete
[334] Fix | Delete
#define Py_UNICODE_ISLOWER(ch) iswlower(ch)
[335] Fix | Delete
#define Py_UNICODE_ISUPPER(ch) iswupper(ch)
[336] Fix | Delete
#define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch)
[337] Fix | Delete
#define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch)
[338] Fix | Delete
[339] Fix | Delete
#define Py_UNICODE_TOLOWER(ch) towlower(ch)
[340] Fix | Delete
#define Py_UNICODE_TOUPPER(ch) towupper(ch)
[341] Fix | Delete
#define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch)
[342] Fix | Delete
[343] Fix | Delete
#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch)
[344] Fix | Delete
#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch)
[345] Fix | Delete
#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch)
[346] Fix | Delete
[347] Fix | Delete
#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch)
[348] Fix | Delete
#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch)
[349] Fix | Delete
#define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch)
[350] Fix | Delete
[351] Fix | Delete
#define Py_UNICODE_ISALPHA(ch) iswalpha(ch)
[352] Fix | Delete
[353] Fix | Delete
#else
[354] Fix | Delete
[355] Fix | Delete
/* Since splitting on whitespace is an important use case, and
[356] Fix | Delete
whitespace in most situations is solely ASCII whitespace, we
[357] Fix | Delete
optimize for the common case by using a quick look-up table
[358] Fix | Delete
_Py_ascii_whitespace (see below) with an inlined check.
[359] Fix | Delete
[360] Fix | Delete
*/
[361] Fix | Delete
#define Py_UNICODE_ISSPACE(ch) \
[362] Fix | Delete
((ch) < 128U ? _Py_ascii_whitespace[(ch)] : _PyUnicode_IsWhitespace(ch))
[363] Fix | Delete
[364] Fix | Delete
#define Py_UNICODE_ISLOWER(ch) _PyUnicode_IsLowercase(ch)
[365] Fix | Delete
#define Py_UNICODE_ISUPPER(ch) _PyUnicode_IsUppercase(ch)
[366] Fix | Delete
#define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch)
[367] Fix | Delete
#define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch)
[368] Fix | Delete
[369] Fix | Delete
#define Py_UNICODE_TOLOWER(ch) _PyUnicode_ToLowercase(ch)
[370] Fix | Delete
#define Py_UNICODE_TOUPPER(ch) _PyUnicode_ToUppercase(ch)
[371] Fix | Delete
#define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch)
[372] Fix | Delete
[373] Fix | Delete
#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch)
[374] Fix | Delete
#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch)
[375] Fix | Delete
#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch)
[376] Fix | Delete
[377] Fix | Delete
#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch)
[378] Fix | Delete
#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch)
[379] Fix | Delete
#define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch)
[380] Fix | Delete
[381] Fix | Delete
#define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch)
[382] Fix | Delete
[383] Fix | Delete
#endif
[384] Fix | Delete
[385] Fix | Delete
#define Py_UNICODE_ISALNUM(ch) \
[386] Fix | Delete
(Py_UNICODE_ISALPHA(ch) || \
[387] Fix | Delete
Py_UNICODE_ISDECIMAL(ch) || \
[388] Fix | Delete
Py_UNICODE_ISDIGIT(ch) || \
[389] Fix | Delete
Py_UNICODE_ISNUMERIC(ch))
[390] Fix | Delete
[391] Fix | Delete
#define Py_UNICODE_COPY(target, source, length) \
[392] Fix | Delete
Py_MEMCPY((target), (source), (length)*sizeof(Py_UNICODE))
[393] Fix | Delete
[394] Fix | Delete
#define Py_UNICODE_FILL(target, value, length) \
[395] Fix | Delete
do {Py_ssize_t i_; Py_UNICODE *t_ = (target); Py_UNICODE v_ = (value);\
[396] Fix | Delete
for (i_ = 0; i_ < (length); i_++) t_[i_] = v_;\
[397] Fix | Delete
} while (0)
[398] Fix | Delete
[399] Fix | Delete
/* Check if substring matches at given offset. the offset must be
[400] Fix | Delete
valid, and the substring must not be empty */
[401] Fix | Delete
[402] Fix | Delete
#define Py_UNICODE_MATCH(string, offset, substring) \
[403] Fix | Delete
((*((string)->str + (offset)) == *((substring)->str)) && \
[404] Fix | Delete
((*((string)->str + (offset) + (substring)->length-1) == *((substring)->str + (substring)->length-1))) && \
[405] Fix | Delete
!memcmp((string)->str + (offset), (substring)->str, (substring)->length*sizeof(Py_UNICODE)))
[406] Fix | Delete
[407] Fix | Delete
#ifdef __cplusplus
[408] Fix | Delete
extern "C" {
[409] Fix | Delete
#endif
[410] Fix | Delete
[411] Fix | Delete
/* --- Unicode Type ------------------------------------------------------- */
[412] Fix | Delete
[413] Fix | Delete
typedef struct {
[414] Fix | Delete
PyObject_HEAD
[415] Fix | Delete
Py_ssize_t length; /* Length of raw Unicode data in buffer */
[416] Fix | Delete
Py_UNICODE *str; /* Raw Unicode buffer */
[417] Fix | Delete
long hash; /* Hash value; -1 if not set */
[418] Fix | Delete
PyObject *defenc; /* (Default) Encoded version as Python
[419] Fix | Delete
string, or NULL; this is used for
[420] Fix | Delete
implementing the buffer protocol */
[421] Fix | Delete
} PyUnicodeObject;
[422] Fix | Delete
[423] Fix | Delete
PyAPI_DATA(PyTypeObject) PyUnicode_Type;
[424] Fix | Delete
[425] Fix | Delete
#define PyUnicode_Check(op) \
[426] Fix | Delete
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
[427] Fix | Delete
#define PyUnicode_CheckExact(op) (Py_TYPE(op) == &PyUnicode_Type)
[428] Fix | Delete
[429] Fix | Delete
/* Fast access macros */
[430] Fix | Delete
#define PyUnicode_GET_SIZE(op) \
[431] Fix | Delete
(((PyUnicodeObject *)(op))->length)
[432] Fix | Delete
#define PyUnicode_GET_DATA_SIZE(op) \
[433] Fix | Delete
(((PyUnicodeObject *)(op))->length * sizeof(Py_UNICODE))
[434] Fix | Delete
#define PyUnicode_AS_UNICODE(op) \
[435] Fix | Delete
(((PyUnicodeObject *)(op))->str)
[436] Fix | Delete
#define PyUnicode_AS_DATA(op) \
[437] Fix | Delete
((const char *)((PyUnicodeObject *)(op))->str)
[438] Fix | Delete
[439] Fix | Delete
/* --- Constants ---------------------------------------------------------- */
[440] Fix | Delete
[441] Fix | Delete
/* This Unicode character will be used as replacement character during
[442] Fix | Delete
decoding if the errors argument is set to "replace". Note: the
[443] Fix | Delete
Unicode character U+FFFD is the official REPLACEMENT CHARACTER in
[444] Fix | Delete
Unicode 3.0. */
[445] Fix | Delete
[446] Fix | Delete
#define Py_UNICODE_REPLACEMENT_CHARACTER ((Py_UNICODE) 0xFFFD)
[447] Fix | Delete
[448] Fix | Delete
/* === Public API ========================================================= */
[449] Fix | Delete
[450] Fix | Delete
/* --- Plain Py_UNICODE --------------------------------------------------- */
[451] Fix | Delete
[452] Fix | Delete
/* Create a Unicode Object from the Py_UNICODE buffer u of the given
[453] Fix | Delete
size.
[454] Fix | Delete
[455] Fix | Delete
u may be NULL which causes the contents to be undefined. It is the
[456] Fix | Delete
user's responsibility to fill in the needed data afterwards. Note
[457] Fix | Delete
that modifying the Unicode object contents after construction is
[458] Fix | Delete
only allowed if u was set to NULL.
[459] Fix | Delete
[460] Fix | Delete
The buffer is copied into the new object. */
[461] Fix | Delete
[462] Fix | Delete
PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
[463] Fix | Delete
const Py_UNICODE *u, /* Unicode buffer */
[464] Fix | Delete
Py_ssize_t size /* size of buffer */
[465] Fix | Delete
);
[466] Fix | Delete
[467] Fix | Delete
/* Similar to PyUnicode_FromUnicode(), but u points to Latin-1 encoded bytes */
[468] Fix | Delete
PyAPI_FUNC(PyObject*) PyUnicode_FromStringAndSize(
[469] Fix | Delete
const char *u, /* char buffer */
[470] Fix | Delete
Py_ssize_t size /* size of buffer */
[471] Fix | Delete
);
[472] Fix | Delete
[473] Fix | Delete
/* Similar to PyUnicode_FromUnicode(), but u points to null-terminated
[474] Fix | Delete
Latin-1 encoded bytes */
[475] Fix | Delete
PyAPI_FUNC(PyObject*) PyUnicode_FromString(
[476] Fix | Delete
const char *u /* string */
[477] Fix | Delete
);
[478] Fix | Delete
[479] Fix | Delete
/* Return a read-only pointer to the Unicode object's internal
[480] Fix | Delete
Py_UNICODE buffer. */
[481] Fix | Delete
[482] Fix | Delete
PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
[483] Fix | Delete
PyObject *unicode /* Unicode object */
[484] Fix | Delete
);
[485] Fix | Delete
[486] Fix | Delete
/* Get the length of the Unicode object. */
[487] Fix | Delete
[488] Fix | Delete
PyAPI_FUNC(Py_ssize_t) PyUnicode_GetSize(
[489] Fix | Delete
PyObject *unicode /* Unicode object */
[490] Fix | Delete
);
[491] Fix | Delete
[492] Fix | Delete
/* Get the maximum ordinal for a Unicode character. */
[493] Fix | Delete
PyAPI_FUNC(Py_UNICODE) PyUnicode_GetMax(void);
[494] Fix | Delete
[495] Fix | Delete
/* Resize an already allocated Unicode object to the new size length.
[496] Fix | Delete
[497] Fix | Delete
*unicode is modified to point to the new (resized) object and 0
[498] Fix | Delete
returned on success.
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function