@@ -556,13 +556,13 @@ PyAPI_FUNC(void) _PyUnicode_FastFill(
556
556
Scan the string to find the maximum character. */
557
557
PyAPI_FUNC (PyObject*) PyUnicode_FromKindAndData(
558
558
int kind,
559
- const void *buffer ,
559
+ const void *str ,
560
560
Py_ssize_t size);
561
561
562
562
/* Create a new string from a buffer of ASCII characters.
563
563
WARNING: Don't check if the string contains any non-ASCII character. */
564
564
PyAPI_FUNC (PyObject*) _PyUnicode_FromASCII(
565
- const char *buffer ,
565
+ const char *str ,
566
566
Py_ssize_t size);
567
567
568
568
/* Compute the maximum character of the substring unicode[start:end].
@@ -629,8 +629,7 @@ typedef struct {
629
629
* By default, the minimum buffer size is 0 character and overallocation is
630
630
* disabled. Set min_length, min_char and overallocate attributes to control
631
631
* the allocation of the buffer. */
632
- PyAPI_FUNC (void )
633
- _PyUnicodeWriter_Init(_PyUnicodeWriter *writer);
632
+ PyAPI_FUNC (void ) _PyUnicodeWriter_Init(_PyUnicodeWriter *writer);
634
633
635
634
/* Prepare the buffer to write 'length' characters
636
635
with the specified maximum character.
@@ -646,9 +645,11 @@ _PyUnicodeWriter_Init(_PyUnicodeWriter *writer);
646
645
647
646
/* Don't call this function directly, use the _PyUnicodeWriter_Prepare() macro
648
647
instead. */
649
- PyAPI_FUNC (int )
650
- _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
651
- Py_ssize_t length, Py_UCS4 maxchar);
648
+ PyAPI_FUNC (int ) _PyUnicodeWriter_PrepareInternal(
649
+ _PyUnicodeWriter *writer,
650
+ Py_ssize_t length,
651
+ Py_UCS4 maxchar
652
+ );
652
653
653
654
/* Prepare the buffer to have at least the kind KIND.
654
655
For example, kind=PyUnicode_2BYTE_KIND ensures that the writer will
@@ -663,58 +664,61 @@ _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
663
664
664
665
/* Don't call this function directly, use the _PyUnicodeWriter_PrepareKind()
665
666
macro instead. */
666
- PyAPI_FUNC (int )
667
- _PyUnicodeWriter_PrepareKindInternal(_PyUnicodeWriter *writer,
668
- enum PyUnicode_Kind kind);
667
+ PyAPI_FUNC (int ) _PyUnicodeWriter_PrepareKindInternal(
668
+ _PyUnicodeWriter *writer,
669
+ enum PyUnicode_Kind kind
670
+ );
669
671
670
672
/* Append a Unicode character.
671
673
Return 0 on success, raise an exception and return -1 on error. */
672
- PyAPI_FUNC (int )
673
- _PyUnicodeWriter_WriteChar( _PyUnicodeWriter *writer,
674
+ PyAPI_FUNC (int ) _PyUnicodeWriter_WriteChar(
675
+ _PyUnicodeWriter *writer,
674
676
Py_UCS4 ch
675
677
);
676
678
677
679
/* Append a Unicode string.
678
680
Return 0 on success, raise an exception and return -1 on error. */
679
- PyAPI_FUNC (int )
680
- _PyUnicodeWriter_WriteStr( _PyUnicodeWriter *writer,
681
- PyObject *str /* Unicode string */
681
+ PyAPI_FUNC (int ) _PyUnicodeWriter_WriteStr(
682
+ _PyUnicodeWriter *writer,
683
+ PyObject *unicode /* Unicode string */
682
684
);
683
685
684
686
/* Append a substring of a Unicode string.
685
687
Return 0 on success, raise an exception and return -1 on error. */
686
- PyAPI_FUNC (int )
687
- _PyUnicodeWriter_WriteSubstring( _PyUnicodeWriter *writer,
688
- PyObject *str , /* Unicode string */
688
+ PyAPI_FUNC (int ) _PyUnicodeWriter_WriteSubstring(
689
+ _PyUnicodeWriter *writer,
690
+ PyObject *unicode , /* Unicode string */
689
691
Py_ssize_t start,
690
692
Py_ssize_t end
691
693
);
692
694
693
695
/* Append an ASCII-encoded byte string.
694
696
Return 0 on success, raise an exception and return -1 on error. */
695
- PyAPI_FUNC (int )
696
- _PyUnicodeWriter_WriteASCIIString( _PyUnicodeWriter *writer,
697
+ PyAPI_FUNC (int ) _PyUnicodeWriter_WriteASCIIString(
698
+ _PyUnicodeWriter *writer,
697
699
const char *str, /* ASCII-encoded byte string */
698
700
Py_ssize_t len /* number of bytes, or -1 if unknown */
699
701
);
700
702
701
703
/* Append a latin1-encoded byte string.
702
704
Return 0 on success, raise an exception and return -1 on error. */
703
- PyAPI_FUNC (int )
704
- _PyUnicodeWriter_WriteLatin1String( _PyUnicodeWriter *writer,
705
+ PyAPI_FUNC (int ) _PyUnicodeWriter_WriteLatin1String(
706
+ _PyUnicodeWriter *writer,
705
707
const char *str, /* latin1-encoded byte string */
706
708
Py_ssize_t len /* length in bytes */
707
709
);
708
710
709
711
/* Get the value of the writer as a Unicode string. Clear the
710
712
buffer of the writer. Raise an exception and return NULL
711
713
on error. */
712
- PyAPI_FUNC (PyObject *)
713
- _PyUnicodeWriter_Finish(_PyUnicodeWriter *writer);
714
+ PyAPI_FUNC (PyObject *) _PyUnicodeWriter_Finish(
715
+ _PyUnicodeWriter *writer
716
+ );
714
717
715
718
/* Deallocate memory of a writer (clear its internal buffer). */
716
- PyAPI_FUNC (void )
717
- _PyUnicodeWriter_Dealloc(_PyUnicodeWriter *writer);
719
+ PyAPI_FUNC (void ) _PyUnicodeWriter_Dealloc(
720
+ _PyUnicodeWriter *writer
721
+ );
718
722
719
723
720
724
/* Format the object based on the format_spec, as defined in PEP 3101
@@ -724,12 +728,13 @@ PyAPI_FUNC(int) _PyUnicode_FormatAdvancedWriter(
724
728
PyObject *obj,
725
729
PyObject *format_spec,
726
730
Py_ssize_t start,
727
- Py_ssize_t end);
731
+ Py_ssize_t end
732
+ );
728
733
729
734
/* --- wchar_t support for platforms which support it --------------------- */
730
735
731
736
#ifdef HAVE_WCHAR_H
732
- PyAPI_FUNC (void *) _PyUnicode_AsKind(PyObject *s , unsigned int kind);
737
+ PyAPI_FUNC (void *) _PyUnicode_AsKind(PyObject *unicode , unsigned int kind);
733
738
#endif
734
739
735
740
/* --- Manage the default encoding ---------------------------------------- */
@@ -756,7 +761,8 @@ PyAPI_FUNC(void*) _PyUnicode_AsKind(PyObject *s, unsigned int kind);
756
761
757
762
PyAPI_FUNC (const char *) PyUnicode_AsUTF8AndSize(
758
763
PyObject *unicode,
759
- Py_ssize_t *size);
764
+ Py_ssize_t *size
765
+ );
760
766
761
767
#define _PyUnicode_AsStringAndSize PyUnicode_AsUTF8AndSize
762
768
@@ -816,7 +822,8 @@ PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF7(
816
822
817
823
PyAPI_FUNC (PyObject*) _PyUnicode_AsUTF8String(
818
824
PyObject *unicode,
819
- const char *errors);
825
+ const char *errors
826
+ );
820
827
821
828
Py_DEPRECATED (3.3 ) PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8(
822
829
const Py_UNICODE *data, /* Unicode char buffer */
@@ -834,7 +841,7 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF32(
834
841
);
835
842
836
843
PyAPI_FUNC (PyObject*) _PyUnicode_EncodeUTF32(
837
- PyObject *object , /* Unicode object */
844
+ PyObject *unicode , /* Unicode object */
838
845
const char *errors, /* error handling */
839
846
int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
840
847
);
@@ -868,7 +875,7 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF16(
868
875
);
869
876
870
877
PyAPI_FUNC (PyObject*) _PyUnicode_EncodeUTF16(
871
- PyObject* unicode, /* Unicode object */
878
+ PyObject * unicode, /* Unicode object */
872
879
const char *errors, /* error handling */
873
880
int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
874
881
);
@@ -878,7 +885,7 @@ PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF16(
878
885
/* Helper for PyUnicode_DecodeUnicodeEscape that detects invalid escape
879
886
chars. */
880
887
PyAPI_FUNC (PyObject*) _PyUnicode_DecodeUnicodeEscape(
881
- const char *string, /* Unicode-Escape encoded string */
888
+ const char *str, /* Unicode-Escape encoded string */
882
889
Py_ssize_t length, /* size of string */
883
890
const char *errors, /* error handling */
884
891
const char **first_invalid_escape /* on return, points to first
@@ -952,7 +959,7 @@ PyAPI_FUNC(PyObject*) _PyUnicode_EncodeCharmap(
952
959
Py_DEPRECATED (3.3 ) PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap(
953
960
const Py_UNICODE *data, /* Unicode char buffer */
954
961
Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
955
- PyObject *table, /* Translate table */
962
+ PyObject *mapping, /* Translate table */
956
963
const char *errors /* error handling */
957
964
);
958
965
@@ -1005,7 +1012,7 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS(
1005
1012
1006
1013
/* Py_DEPRECATED(3.3) */
1007
1014
PyAPI_FUNC (PyObject*) PyUnicode_TransformDecimalToASCII(
1008
- Py_UNICODE *s, /* Unicode buffer */
1015
+ Py_UNICODE *str, /* Unicode buffer */
1009
1016
Py_ssize_t length /* Number of Py_UNICODE chars to transform */
1010
1017
);
1011
1018
@@ -1040,8 +1047,8 @@ PyAPI_FUNC(int) _PyUnicode_EqualToASCIIId(
1040
1047
0 otherwise. The right argument must be ASCII-encoded string.
1041
1048
Any error occurs inside will be cleared before return. */
1042
1049
PyAPI_FUNC (int ) _PyUnicode_EqualToASCIIString(
1043
- PyObject *left ,
1044
- const char *right /* ASCII-encoded string */
1050
+ PyObject *unicode ,
1051
+ const char *str /* ASCII-encoded string */
1045
1052
);
1046
1053
1047
1054
/* Externally visible for str.strip(unicode) */
@@ -1063,7 +1070,8 @@ PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping(
1063
1070
Py_ssize_t min_width,
1064
1071
const char *grouping,
1065
1072
PyObject *thousands_sep,
1066
- Py_UCS4 *maxchar);
1073
+ Py_UCS4 *maxchar
1074
+ );
1067
1075
1068
1076
/* === Characters Type APIs =============================================== */
1069
1077
@@ -1215,7 +1223,12 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strrchr(
1215
1223
Py_UNICODE c
1216
1224
);
1217
1225
1218
- PyAPI_FUNC (PyObject*) _PyUnicode_FormatLong(PyObject *, int , int , int );
1226
+ PyAPI_FUNC (PyObject*) _PyUnicode_FormatLong(
1227
+ PyObject *val,
1228
+ int alt,
1229
+ int prec,
1230
+ int type
1231
+ );
1219
1232
1220
1233
/* Create a copy of a unicode string ending with a nul character. Return NULL
1221
1234
and raise a MemoryError exception on memory allocation failure, otherwise
@@ -1226,13 +1239,16 @@ Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy(
1226
1239
);
1227
1240
1228
1241
/* Return an interned Unicode object for an Identifier; may fail if there is no memory.*/
1229
- PyAPI_FUNC (PyObject*) _PyUnicode_FromId(_Py_Identifier* );
1242
+ PyAPI_FUNC (PyObject*) _PyUnicode_FromId(_Py_Identifier *id );
1230
1243
/* Clear all static strings. */
1231
1244
PyAPI_FUNC (void ) _PyUnicode_ClearStaticStrings(void );
1232
1245
1233
1246
/* Fast equality check when the inputs are known to be exact unicode types
1234
1247
and where the hash values are equal (i.e. a very probable match) */
1235
- PyAPI_FUNC (int ) _PyUnicode_EQ(PyObject *, PyObject *);
1248
+ PyAPI_FUNC (int ) _PyUnicode_EQ(
1249
+ PyObject *left,
1250
+ PyObject *right
1251
+ );
1236
1252
1237
1253
#ifdef __cplusplus
1238
1254
}
0 commit comments