@@ -90,7 +90,7 @@ Copyright (c) Corporation for National Research Initiatives.
9090
9191#ifndef Py_LIMITED_API
9292#define PY_UNICODE_TYPE wchar_t
93- typedef wchar_t Py_UNICODE;
93+ typedef wchar_t Py_UNICODE /* Py_DEPRECATED(3.3) */ ;
9494#endif
9595
9696/* If the compiler provides a wchar_t type we try to support it
@@ -387,9 +387,11 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
387387 ((void )PyUnicode_AsUnicode((PyObject *)(op)), \
388388 assert(((PyASCIIObject *)(op))->wstr), \
389389 PyUnicode_WSTR_LENGTH(op)))
390+ /* Py_DEPRECATED(3.3) */
390391
391392#define PyUnicode_GET_DATA_SIZE (op ) \
392393 (PyUnicode_GET_SIZE(op) * Py_UNICODE_SIZE)
394+ /* Py_DEPRECATED(3.3) */
393395
394396/* Alias for PyUnicode_AsUnicode(). This will create a wchar_t/Py_UNICODE
395397 representation on demand. Using this macro is very inefficient now,
@@ -400,9 +402,11 @@ PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
400402 (assert (PyUnicode_Check(op)), \
401403 (((PyASCIIObject *)(op))->wstr) ? (((PyASCIIObject *)(op))->wstr) : \
402404 PyUnicode_AsUnicode ((PyObject *)(op)))
405+ /* Py_DEPRECATED(3.3) */
403406
404407#define PyUnicode_AS_DATA (op ) \
405408 ((const char *)(PyUnicode_AS_UNICODE(op)))
409+ /* Py_DEPRECATED(3.3) */
406410
407411
408412/* --- Flexible String Representation Helper Macros (PEP 393) -------------- */
@@ -688,7 +692,7 @@ PyAPI_FUNC(void) _PyUnicode_FastFill(
688692PyAPI_FUNC (PyObject*) PyUnicode_FromUnicode(
689693 const Py_UNICODE *u, /* Unicode buffer */
690694 Py_ssize_t size /* size of buffer */
691- );
695+ ) /* Py_DEPRECATED(3.3) */ ;
692696#endif
693697
694698/* Similar to PyUnicode_FromUnicode(), but u points to UTF-8 encoded bytes */
@@ -756,7 +760,7 @@ PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4Copy(PyObject *unicode);
756760#ifndef Py_LIMITED_API
757761PyAPI_FUNC (Py_UNICODE *) PyUnicode_AsUnicode(
758762 PyObject *unicode /* Unicode object */
759- );
763+ ) /* Py_DEPRECATED(3.3) */ ;
760764#endif
761765
762766/* Return a read-only pointer to the Unicode object's internal
@@ -768,7 +772,7 @@ PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
768772PyAPI_FUNC (Py_UNICODE *) PyUnicode_AsUnicodeAndSize(
769773 PyObject *unicode, /* Unicode object */
770774 Py_ssize_t *size /* location where to save the length */
771- );
775+ ) /* Py_DEPRECATED(3.3) */ ;
772776#endif
773777
774778/* Get the length of the Unicode object. */
@@ -782,7 +786,7 @@ PyAPI_FUNC(Py_ssize_t) PyUnicode_GetLength(
782786
783787PyAPI_FUNC (Py_ssize_t) PyUnicode_GetSize(
784788 PyObject *unicode /* Unicode object */
785- );
789+ ) Py_DEPRECATED( 3.3 ) ;
786790
787791/* Read a character from the string. */
788792
@@ -804,7 +808,7 @@ PyAPI_FUNC(int) PyUnicode_WriteChar(
804808
805809#ifndef Py_LIMITED_API
806810/* Get the maximum ordinal for a Unicode character. */
807- PyAPI_FUNC (Py_UNICODE) PyUnicode_GetMax(void );
811+ PyAPI_FUNC (Py_UNICODE) PyUnicode_GetMax(void ) Py_DEPRECATED( 3.3 ) ;
808812#endif
809813
810814/* Resize a Unicode object. The length is the number of characters, except
@@ -1205,7 +1209,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_Encode(
12051209 Py_ssize_t size, /* number of Py_UNICODE chars to encode */
12061210 const char *encoding, /* encoding */
12071211 const char *errors /* error handling */
1208- );
1212+ ) Py_DEPRECATED( 3.3 ) ;
12091213#endif
12101214
12111215/* Encodes a Unicode object and returns the result as Python
@@ -1272,7 +1276,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF7(
12721276 int base64SetO, /* Encode RFC2152 Set O characters in base64 */
12731277 int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */
12741278 const char *errors /* error handling */
1275- );
1279+ ) Py_DEPRECATED( 3.3 ) ;
12761280PyAPI_FUNC (PyObject*) _PyUnicode_EncodeUTF7(
12771281 PyObject *unicode, /* Unicode object */
12781282 int base64SetO, /* Encode RFC2152 Set O characters in base64 */
@@ -1309,7 +1313,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8(
13091313 const Py_UNICODE *data, /* Unicode char buffer */
13101314 Py_ssize_t length, /* number of Py_UNICODE chars to encode */
13111315 const char *errors /* error handling */
1312- );
1316+ ) Py_DEPRECATED( 3.3 ) ;
13131317#endif
13141318
13151319/* --- UTF-32 Codecs ------------------------------------------------------ */
@@ -1385,7 +1389,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF32(
13851389 Py_ssize_t length, /* number of Py_UNICODE chars to encode */
13861390 const char *errors, /* error handling */
13871391 int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
1388- );
1392+ ) Py_DEPRECATED( 3.3 ) ;
13891393PyAPI_FUNC (PyObject*) _PyUnicode_EncodeUTF32(
13901394 PyObject *object, /* Unicode object */
13911395 const char *errors, /* error handling */
@@ -1470,7 +1474,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF16(
14701474 Py_ssize_t length, /* number of Py_UNICODE chars to encode */
14711475 const char *errors, /* error handling */
14721476 int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
1473- );
1477+ ) Py_DEPRECATED( 3.3 ) ;
14741478PyAPI_FUNC (PyObject*) _PyUnicode_EncodeUTF16(
14751479 PyObject* unicode, /* Unicode object */
14761480 const char *errors, /* error handling */
@@ -1505,7 +1509,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString(
15051509PyAPI_FUNC (PyObject*) PyUnicode_EncodeUnicodeEscape(
15061510 const Py_UNICODE *data, /* Unicode char buffer */
15071511 Py_ssize_t length /* Number of Py_UNICODE chars to encode */
1508- );
1512+ ) Py_DEPRECATED( 3.3 ) ;
15091513#endif
15101514
15111515/* --- Raw-Unicode-Escape Codecs ------------------------------------------ */
@@ -1524,7 +1528,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_AsRawUnicodeEscapeString(
15241528PyAPI_FUNC (PyObject*) PyUnicode_EncodeRawUnicodeEscape(
15251529 const Py_UNICODE *data, /* Unicode char buffer */
15261530 Py_ssize_t length /* Number of Py_UNICODE chars to encode */
1527- );
1531+ ) Py_DEPRECATED( 3.3 ) ;
15281532#endif
15291533
15301534/* --- Unicode Internal Codec ---------------------------------------------
@@ -1564,7 +1568,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeLatin1(
15641568 const Py_UNICODE *data, /* Unicode char buffer */
15651569 Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
15661570 const char *errors /* error handling */
1567- );
1571+ ) Py_DEPRECATED( 3.3 ) ;
15681572#endif
15691573
15701574/* --- ASCII Codecs -------------------------------------------------------
@@ -1592,7 +1596,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeASCII(
15921596 const Py_UNICODE *data, /* Unicode char buffer */
15931597 Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
15941598 const char *errors /* error handling */
1595- );
1599+ ) Py_DEPRECATED( 3.3 ) ;
15961600#endif
15971601
15981602/* --- Character Map Codecs -----------------------------------------------
@@ -1638,7 +1642,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeCharmap(
16381642 PyObject *mapping, /* character mapping
16391643 (unicode ordinal -> char ordinal) */
16401644 const char *errors /* error handling */
1641- );
1645+ ) Py_DEPRECATED( 3.3 ) ;
16421646PyAPI_FUNC (PyObject*) _PyUnicode_EncodeCharmap(
16431647 PyObject *unicode, /* Unicode object */
16441648 PyObject *mapping, /* character mapping
@@ -1666,7 +1670,7 @@ PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap(
16661670 Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
16671671 PyObject *table, /* Translate table */
16681672 const char *errors /* error handling */
1669- );
1673+ ) Py_DEPRECATED( 3.3 ) ;
16701674#endif
16711675
16721676#ifdef MS_WINDOWS
@@ -1703,7 +1707,7 @@ PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS(
17031707 const Py_UNICODE *data, /* Unicode char buffer */
17041708 Py_ssize_t length, /* number of Py_UNICODE chars to encode */
17051709 const char *errors /* error handling */
1706- );
1710+ ) Py_DEPRECATED( 3.3 ) ;
17071711#endif
17081712
17091713PyAPI_FUNC (PyObject*) PyUnicode_EncodeCodePage(
@@ -1744,7 +1748,7 @@ PyAPI_FUNC(int) PyUnicode_EncodeDecimal(
17441748 Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
17451749 char *output, /* Output buffer; must have size >= length */
17461750 const char *errors /* error handling */
1747- );
1751+ ) /* Py_DEPRECATED(3.3) */ ;
17481752#endif
17491753
17501754/* Transforms code points that have decimal digit property to the
@@ -1757,7 +1761,7 @@ PyAPI_FUNC(int) PyUnicode_EncodeDecimal(
17571761PyAPI_FUNC (PyObject*) PyUnicode_TransformDecimalToASCII(
17581762 Py_UNICODE *s, /* Unicode buffer */
17591763 Py_ssize_t length /* Number of Py_UNICODE chars to transform */
1760- );
1764+ ) /* Py_DEPRECATED(3.3) */ ;
17611765#endif
17621766
17631767/* Similar to PyUnicode_TransformDecimalToASCII(), but takes a PyObject
@@ -2182,15 +2186,15 @@ PyAPI_FUNC(int) _PyUnicode_IsLinebreak(
21822186
21832187PyAPI_FUNC (Py_UCS4) _PyUnicode_ToLowercase(
21842188 Py_UCS4 ch /* Unicode character */
2185- );
2189+ ) /* Py_DEPRECATED(3.3) */ ;
21862190
21872191PyAPI_FUNC (Py_UCS4) _PyUnicode_ToUppercase(
21882192 Py_UCS4 ch /* Unicode character */
2189- );
2193+ ) /* Py_DEPRECATED(3.3) */ ;
21902194
21912195PyAPI_FUNC (Py_UCS4) _PyUnicode_ToTitlecase(
21922196 Py_UCS4 ch /* Unicode character */
2193- );
2197+ ) Py_DEPRECATED( 3.3 ) ;
21942198
21952199PyAPI_FUNC (int ) _PyUnicode_ToLowerFull(
21962200 Py_UCS4 ch, /* Unicode character */
@@ -2254,40 +2258,40 @@ PyAPI_FUNC(int) _PyUnicode_IsAlpha(
22542258
22552259PyAPI_FUNC (size_t ) Py_UNICODE_strlen(
22562260 const Py_UNICODE *u
2257- );
2261+ ) Py_DEPRECATED( 3.3 ) ;
22582262
22592263PyAPI_FUNC (Py_UNICODE*) Py_UNICODE_strcpy(
22602264 Py_UNICODE *s1,
2261- const Py_UNICODE *s2);
2265+ const Py_UNICODE *s2) Py_DEPRECATED( 3.3 ) ;
22622266
22632267PyAPI_FUNC (Py_UNICODE*) Py_UNICODE_strcat(
2264- Py_UNICODE *s1, const Py_UNICODE *s2);
2268+ Py_UNICODE *s1, const Py_UNICODE *s2) Py_DEPRECATED( 3.3 ) ;
22652269
22662270PyAPI_FUNC (Py_UNICODE*) Py_UNICODE_strncpy(
22672271 Py_UNICODE *s1,
22682272 const Py_UNICODE *s2,
2269- size_t n);
2273+ size_t n) Py_DEPRECATED( 3.3 ) ;
22702274
22712275PyAPI_FUNC (int ) Py_UNICODE_strcmp(
22722276 const Py_UNICODE *s1,
22732277 const Py_UNICODE *s2
2274- );
2278+ ) Py_DEPRECATED( 3.3 ) ;
22752279
22762280PyAPI_FUNC (int ) Py_UNICODE_strncmp(
22772281 const Py_UNICODE *s1,
22782282 const Py_UNICODE *s2,
22792283 size_t n
2280- );
2284+ ) Py_DEPRECATED( 3.3 ) ;
22812285
22822286PyAPI_FUNC (Py_UNICODE*) Py_UNICODE_strchr(
22832287 const Py_UNICODE *s,
22842288 Py_UNICODE c
2285- );
2289+ ) Py_DEPRECATED( 3.3 ) ;
22862290
22872291PyAPI_FUNC (Py_UNICODE*) Py_UNICODE_strrchr(
22882292 const Py_UNICODE *s,
22892293 Py_UNICODE c
2290- );
2294+ ) Py_DEPRECATED( 3.3 ) ;
22912295
22922296PyAPI_FUNC (PyObject*) _PyUnicode_FormatLong(PyObject *, int , int , int );
22932297
@@ -2297,7 +2301,7 @@ PyAPI_FUNC(PyObject*) _PyUnicode_FormatLong(PyObject *, int, int, int);
22972301
22982302PyAPI_FUNC (Py_UNICODE*) PyUnicode_AsUnicodeCopy(
22992303 PyObject *unicode
2300- );
2304+ ) Py_DEPRECATED( 3.3 ) ;
23012305#endif /* Py_LIMITED_API */
23022306
23032307#if defined(Py_DEBUG) && !defined(Py_LIMITED_API)
0 commit comments