@@ -571,133 +571,6 @@ PyAPI_FUNC(Py_UCS4) _PyUnicode_FindMaxChar (
571
571
Py_ssize_t start ,
572
572
Py_ssize_t end );
573
573
574
- /* --- Legacy deprecated API ---------------------------------------------- */
575
-
576
- /* Create a Unicode Object from the Py_UNICODE buffer u of the given
577
- size.
578
-
579
- u may be NULL which causes the contents to be undefined. It is the
580
- user's responsibility to fill in the needed data afterwards. Note
581
- that modifying the Unicode object contents after construction is
582
- only allowed if u was set to NULL.
583
-
584
- The buffer is copied into the new object. */
585
- Py_DEPRECATED (3.3 ) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
586
- const Py_UNICODE *u, /* Unicode buffer */
587
- Py_ssize_t size /* size of buffer */
588
- );
589
-
590
- /* Return a read-only pointer to the Unicode object's internal
591
- Py_UNICODE buffer.
592
- If the wchar_t/Py_UNICODE representation is not yet available, this
593
- function will calculate it. */
594
- Py_DEPRECATED (3.3 ) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
595
- PyObject *unicode /* Unicode object */
596
- );
597
-
598
- /* Similar to PyUnicode_AsUnicode(), but raises a ValueError if the string
599
- contains null characters. */
600
- PyAPI_FUNC (const Py_UNICODE *) _PyUnicode_AsUnicode(
601
- PyObject *unicode /* Unicode object */
602
- );
603
-
604
- /* Return a read-only pointer to the Unicode object's internal
605
- Py_UNICODE buffer and save the length at size.
606
- If the wchar_t/Py_UNICODE representation is not yet available, this
607
- function will calculate it. */
608
-
609
- Py_DEPRECATED (3.3 ) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicodeAndSize(
610
- PyObject *unicode, /* Unicode object */
611
- Py_ssize_t *size /* location where to save the length */
612
- );
613
-
614
-
615
- /* Fast access macros */
616
-
617
- Py_DEPRECATED (3.3 )
618
- static inline Py_ssize_t PyUnicode_WSTR_LENGTH(PyObject *op)
619
- {
620
- if (PyUnicode_IS_COMPACT_ASCII (op)) {
621
- return _PyASCIIObject_CAST (op)->length ;
622
- }
623
- else {
624
- return _PyCompactUnicodeObject_CAST (op)->wstr_length ;
625
- }
626
- }
627
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
628
- # define PyUnicode_WSTR_LENGTH (op ) PyUnicode_WSTR_LENGTH(_PyObject_CAST(op))
629
- #endif
630
-
631
- /* Returns the deprecated Py_UNICODE representation's size in code units
632
- (this includes surrogate pairs as 2 units).
633
- If the Py_UNICODE representation is not available, it will be computed
634
- on request. Use PyUnicode_GET_LENGTH() for the length in code points. */
635
-
636
- Py_DEPRECATED (3.3 )
637
- static inline Py_ssize_t PyUnicode_GET_SIZE(PyObject *op)
638
- {
639
- _Py_COMP_DIAG_PUSH
640
- _Py_COMP_DIAG_IGNORE_DEPR_DECLS
641
- if (_PyASCIIObject_CAST (op)->wstr == _Py_NULL) {
642
- (void )PyUnicode_AsUnicode (op);
643
- assert (_PyASCIIObject_CAST (op)->wstr != _Py_NULL);
644
- }
645
- return PyUnicode_WSTR_LENGTH (op);
646
- _Py_COMP_DIAG_POP
647
- }
648
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
649
- # define PyUnicode_GET_SIZE (op ) PyUnicode_GET_SIZE(_PyObject_CAST(op))
650
- #endif
651
-
652
- Py_DEPRECATED (3.3 )
653
- static inline Py_ssize_t PyUnicode_GET_DATA_SIZE(PyObject *op)
654
- {
655
- _Py_COMP_DIAG_PUSH
656
- _Py_COMP_DIAG_IGNORE_DEPR_DECLS
657
- return PyUnicode_GET_SIZE (op) * Py_UNICODE_SIZE;
658
- _Py_COMP_DIAG_POP
659
- }
660
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
661
- # define PyUnicode_GET_DATA_SIZE (op ) PyUnicode_GET_DATA_SIZE(_PyObject_CAST(op))
662
- #endif
663
-
664
- /* Alias for PyUnicode_AsUnicode(). This will create a wchar_t/Py_UNICODE
665
- representation on demand. Using this macro is very inefficient now,
666
- try to port your code to use the new PyUnicode_*BYTE_DATA() macros or
667
- use PyUnicode_WRITE() and PyUnicode_READ(). */
668
-
669
- Py_DEPRECATED (3.3 )
670
- static inline Py_UNICODE* PyUnicode_AS_UNICODE(PyObject *op)
671
- {
672
- wchar_t *wstr = _PyASCIIObject_CAST (op)->wstr ;
673
- if (wstr != _Py_NULL) {
674
- return wstr;
675
- }
676
-
677
- _Py_COMP_DIAG_PUSH
678
- _Py_COMP_DIAG_IGNORE_DEPR_DECLS
679
- return PyUnicode_AsUnicode (op);
680
- _Py_COMP_DIAG_POP
681
- }
682
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
683
- # define PyUnicode_AS_UNICODE (op ) PyUnicode_AS_UNICODE(_PyObject_CAST(op))
684
- #endif
685
-
686
- Py_DEPRECATED (3.3 )
687
- static inline const char* PyUnicode_AS_DATA(PyObject *op)
688
- {
689
- _Py_COMP_DIAG_PUSH
690
- _Py_COMP_DIAG_IGNORE_DEPR_DECLS
691
- Py_UNICODE *data = PyUnicode_AS_UNICODE (op);
692
- // In C++, casting directly PyUnicode* to const char* is not valid
693
- return _Py_STATIC_CAST (const char *, _Py_STATIC_CAST (const void *, data));
694
- _Py_COMP_DIAG_POP
695
- }
696
- #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
697
- # define PyUnicode_AS_DATA (op ) PyUnicode_AS_DATA(_PyObject_CAST(op))
698
- #endif
699
-
700
-
701
574
/* --- _PyUnicodeWriter API ----------------------------------------------- */
702
575
703
576
typedef struct {
0 commit comments