@@ -24,17 +24,18 @@ extern int _PyUnicode_IsCased(Py_UCS4 ch);
2424
2525/* --- Unicode API -------------------------------------------------------- */
2626
27+ // Export for '_json' shared extension
2728PyAPI_FUNC (int ) _PyUnicode_CheckConsistency (
2829 PyObject * op ,
2930 int check_content );
3031
3132extern void _PyUnicode_ExactDealloc (PyObject * op );
3233extern Py_ssize_t _PyUnicode_InternedSize (void );
3334
34- /* Get a copy of a Unicode string. */
35+ // Get a copy of a Unicode string.
36+ // Export for '_datetime' shared extension.
3537PyAPI_FUNC (PyObject * ) _PyUnicode_Copy (
36- PyObject * unicode
37- );
38+ PyObject * unicode );
3839
3940/* Unsafe version of PyUnicode_Fill(): don't check arguments and so may crash
4041 if parameters are invalid (e.g. if length is longer than the string). */
@@ -93,11 +94,13 @@ typedef struct {
9394 unsigned char readonly ;
9495} _PyUnicodeWriter ;
9596
96- /* Initialize a Unicode writer.
97- *
98- * By default, the minimum buffer size is 0 character and overallocation is
99- * disabled. Set min_length, min_char and overallocate attributes to control
100- * the allocation of the buffer. */
97+ // Initialize a Unicode writer.
98+ //
99+ // By default, the minimum buffer size is 0 character and overallocation is
100+ // disabled. Set min_length, min_char and overallocate attributes to control
101+ // the allocation of the buffer.
102+ //
103+ // Export the _PyUnicodeWriter API for '_multibytecodec' shared extension.
101104PyAPI_FUNC (void )
102105_PyUnicodeWriter_Init (_PyUnicodeWriter * writer );
103106
@@ -204,33 +207,36 @@ extern PyObject* _PyUnicode_EncodeUTF7(
204207
205208/* --- UTF-8 Codecs ------------------------------------------------------- */
206209
210+ // Export for '_tkinter' shared extension.
207211PyAPI_FUNC (PyObject * ) _PyUnicode_AsUTF8String (
208212 PyObject * unicode ,
209213 const char * errors );
210214
211215/* --- UTF-32 Codecs ------------------------------------------------------ */
212216
217+ // Export for '_tkinter' shared extension
213218PyAPI_FUNC (PyObject * ) _PyUnicode_EncodeUTF32 (
214219 PyObject * object , /* Unicode object */
215220 const char * errors , /* error handling */
216221 int byteorder ); /* byteorder to use 0=BOM+native;-1=LE,1=BE */
217222
218223/* --- UTF-16 Codecs ------------------------------------------------------ */
219224
220- /* Returns a Python string object holding the UTF-16 encoded value of
221- the Unicode data.
222-
223- If byteorder is not 0, output is written according to the following
224- byte order:
225-
226- byteorder == -1: little endian
227- byteorder == 0: native byte order (writes a BOM mark)
228- byteorder == 1: big endian
229-
230- If byteorder is 0, the output string will always start with the
231- Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is
232- prepended.
233- */
225+ // Returns a Python string object holding the UTF-16 encoded value of
226+ // the Unicode data.
227+ //
228+ // If byteorder is not 0, output is written according to the following
229+ // byte order:
230+ //
231+ // byteorder == -1: little endian
232+ // byteorder == 0: native byte order (writes a BOM mark)
233+ // byteorder == 1: big endian
234+ //
235+ // If byteorder is 0, the output string will always start with the
236+ // Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is
237+ // prepended.
238+ //
239+ // Export for '_tkinter' shared extension
234240PyAPI_FUNC (PyObject * ) _PyUnicode_EncodeUTF16 (
235241 PyObject * unicode , /* Unicode object */
236242 const char * errors , /* error handling */
@@ -297,13 +303,14 @@ extern PyObject* _PyUnicode_EncodeCharmap(
297303
298304/* --- Decimal Encoder ---------------------------------------------------- */
299305
300- /* Coverts a Unicode object holding a decimal value to an ASCII string
301- for using in int, float and complex parsers.
302- Transforms code points that have decimal digit property to the
303- corresponding ASCII digit code points. Transforms spaces to ASCII.
304- Transforms code points starting from the first non-ASCII code point that
305- is neither a decimal digit nor a space to the end into '?'. */
306-
306+ // Coverts a Unicode object holding a decimal value to an ASCII string
307+ // for using in int, float and complex parsers.
308+ // Transforms code points that have decimal digit property to the
309+ // corresponding ASCII digit code points. Transforms spaces to ASCII.
310+ // Transforms code points starting from the first non-ASCII code point that
311+ // is neither a decimal digit nor a space to the end into '?'.
312+ //
313+ // Export for '_testinternalcapi' shared extension.
307314PyAPI_FUNC (PyObject * ) _PyUnicode_TransformDecimalAndSpaceToASCII (
308315 PyObject * unicode ); /* Unicode object */
309316
@@ -323,9 +330,10 @@ extern int _PyUnicode_EqualToASCIIId(
323330 _Py_Identifier * right /* Right identifier */
324331 );
325332
326- /* Test whether a unicode is equal to ASCII string. Return 1 if true,
327- 0 otherwise. The right argument must be ASCII-encoded string.
328- Any error occurs inside will be cleared before return. */
333+ // Test whether a unicode is equal to ASCII string. Return 1 if true,
334+ // 0 otherwise. The right argument must be ASCII-encoded string.
335+ // Any error occurs inside will be cleared before return.
336+ // Export for '_ctypes' shared extension
329337PyAPI_FUNC (int ) _PyUnicode_EqualToASCIIString (
330338 PyObject * left ,
331339 const char * right /* ASCII-encoded string */
@@ -357,14 +365,17 @@ extern Py_ssize_t _PyUnicode_InsertThousandsGrouping(
357365
358366extern PyObject * _PyUnicode_FormatLong (PyObject * , int , int , int );
359367
360- /* Return an interned Unicode object for an Identifier; may fail if there is no memory.*/
368+ // Return an interned Unicode object for an Identifier; may fail if there is no
369+ // memory.
370+ // Export for '_testembed' program.
361371PyAPI_FUNC (PyObject * ) _PyUnicode_FromId (_Py_Identifier * );
362372
363373/* Fast equality check when the inputs are known to be exact unicode types
364374 and where the hash values are equal (i.e. a very probable match) */
365375extern int _PyUnicode_EQ (PyObject * , PyObject * );
366376
367- /* Equality check. */
377+ // Equality check.
378+ // Export for '_pickle' shared extension.
368379PyAPI_FUNC (int ) _PyUnicode_Equal (PyObject * , PyObject * );
369380
370381extern int _PyUnicode_WideCharString_Converter (PyObject * , void * );
0 commit comments