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

Side by Side Diff: Include/longobject.h

Issue 14744: Use _PyUnicodeWriter API in str.format() internals
Patch Set: Created 1 year 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:
View unified diff | Download patch
« no previous file with comments | « Include/floatobject.h ('k') | Include/unicodeobject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 /* Format the object based on the format_spec, as defined in PEP 3101 156 /* Format the object based on the format_spec, as defined in PEP 3101
157 (Advanced String Formatting). */ 157 (Advanced String Formatting). Return 0 on success, raise an exception
158 PyAPI_FUNC(PyObject *) _PyLong_FormatAdvanced(PyObject *obj, 158 and return -1 on error. */
159 PyObject *format_spec, 159 PyAPI_FUNC(int) _PyLong_FormatWriter(PyObject *obj,
160 Py_ssize_t start, 160 PyObject *format_spec,
161 Py_ssize_t end); 161 Py_ssize_t start,
162 Py_ssize_t end,
163 _PyUnicodeWriter *writer);
162 #endif /* Py_LIMITED_API */ 164 #endif /* Py_LIMITED_API */
163 165
164 /* These aren't really part of the long object, but they're handy. The 166 /* These aren't really part of the long object, but they're handy. The
165 functions are in Python/mystrtoul.c. 167 functions are in Python/mystrtoul.c.
166 */ 168 */
167 PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int); 169 PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int);
168 PyAPI_FUNC(long) PyOS_strtol(char *, char **, int); 170 PyAPI_FUNC(long) PyOS_strtol(char *, char **, int);
169 171
170 #ifdef __cplusplus 172 #ifdef __cplusplus
171 } 173 }
172 #endif 174 #endif
173 #endif /* !Py_LONGOBJECT_H */ 175 #endif /* !Py_LONGOBJECT_H */
OLDNEW
« no previous file with comments | « Include/floatobject.h ('k') | Include/unicodeobject.h » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld cbc36f91f3f7