Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3924)

Delta Between Two Patch Sets: Include/longobject.h

Issue 14744: Use _PyUnicodeWriter API in str.format() internals
Left Patch Set: Created 1 year ago
Right Patch Set: Created 11 months, 4 weeks ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Include/floatobject.h ('k') | Include/unicodeobject.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #ifndef Py_LONGOBJECT_H 1 #ifndef Py_LONGOBJECT_H
2 #define Py_LONGOBJECT_H 2 #define Py_LONGOBJECT_H
3 #ifdef __cplusplus 3 #ifdef __cplusplus
4 extern "C" { 4 extern "C" {
5 #endif 5 #endif
6 6
7 7
8 /* Long (arbitrary precision) integer object interface */ 8 /* Long (arbitrary precision) integer object interface */
9 9
10 typedef struct _longobject PyLongObject; /* Revealed in longintrepr.h */ 10 typedef struct _longobject PyLongObject; /* Revealed in longintrepr.h */
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 */ 146 */
147 PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v, 147 PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
148 unsigned char* bytes, size_t n, 148 unsigned char* bytes, size_t n,
149 int little_endian, int is_signed); 149 int little_endian, int is_signed);
150 150
151 151
152 /* _PyLong_Format: Convert the long to a string object with given base, 152 /* _PyLong_Format: Convert the long to a string object with given base,
153 appending a base prefix of 0[box] if base is 2, 8 or 16. */ 153 appending a base prefix of 0[box] if base is 2, 8 or 16. */
154 PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *aa, int base); 154 PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *aa, int base);
155 155
156 PyAPI_FUNC(int) _PyLong_FormatWriter(
157 PyObject *aa,
158 int base,
159 int alternate,
160 _PyUnicodeWriter *writer);
161
156 /* Format the object based on the format_spec, as defined in PEP 3101 162 /* Format the object based on the format_spec, as defined in PEP 3101
157 (Advanced String Formatting). Return 0 on success, raise an exception 163 (Advanced String Formatting). */
158 and return -1 on error. */ 164 PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter(
159 PyAPI_FUNC(int) _PyLong_FormatWriter(PyObject *obj, 165 PyObject *obj,
160 PyObject *format_spec, 166 PyObject *format_spec,
161 Py_ssize_t start, 167 Py_ssize_t start,
162 Py_ssize_t end, 168 Py_ssize_t end,
163 _PyUnicodeWriter *writer); 169 _PyUnicodeWriter *writer);
164 #endif /* Py_LIMITED_API */ 170 #endif /* Py_LIMITED_API */
165 171
166 /* These aren't really part of the long object, but they're handy. The 172 /* These aren't really part of the long object, but they're handy. The
167 functions are in Python/mystrtoul.c. 173 functions are in Python/mystrtoul.c.
168 */ 174 */
169 PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int); 175 PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int);
170 PyAPI_FUNC(long) PyOS_strtol(char *, char **, int); 176 PyAPI_FUNC(long) PyOS_strtol(char *, char **, int);
171 177
172 #ifdef __cplusplus 178 #ifdef __cplusplus
173 } 179 }
174 #endif 180 #endif
175 #endif /* !Py_LONGOBJECT_H */ 181 #endif /* !Py_LONGOBJECT_H */
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7