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

Side by Side Diff: Include/unicodeobject.h

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months 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/Python.h ('k') | Lib/ast.py » ('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_UNICODEOBJECT_H 1 #ifndef Py_UNICODEOBJECT_H
2 #define Py_UNICODEOBJECT_H 2 #define Py_UNICODEOBJECT_H
3 3
4 #include <stdarg.h> 4 #include <stdarg.h>
5 5
6 /* 6 /*
7 7
8 Unicode implementation based on original code by Fredrik Lundh, 8 Unicode implementation based on original code by Fredrik Lundh,
9 modified by Marc-Andre Lemburg (mal@lemburg.com) according to the 9 modified by Marc-Andre Lemburg (mal@lemburg.com) according to the
10 Unicode Integration Proposal. (See 10 Unicode Integration Proposal. (See
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 #endif 100 #endif
101 101
102 /* If the compiler provides a wchar_t type we try to support it 102 /* If the compiler provides a wchar_t type we try to support it
103 through the interface functions PyUnicode_FromWideChar(), 103 through the interface functions PyUnicode_FromWideChar(),
104 PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). */ 104 PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). */
105 105
106 #ifdef HAVE_USABLE_WCHAR_T 106 #ifdef HAVE_USABLE_WCHAR_T
107 # ifndef HAVE_WCHAR_H 107 # ifndef HAVE_WCHAR_H
108 # define HAVE_WCHAR_H 108 # define HAVE_WCHAR_H
109 # endif 109 # endif
110 #endif
111
112 #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
113 # define HAVE_MBCS
114 #endif 110 #endif
115 111
116 #ifdef HAVE_WCHAR_H 112 #ifdef HAVE_WCHAR_H
117 /* Work around a cosmetic bug in BSDI 4.x wchar.h; thanks to Thomas Wouters */ 113 /* Work around a cosmetic bug in BSDI 4.x wchar.h; thanks to Thomas Wouters */
118 # ifdef _HAVE_BSDI 114 # ifdef _HAVE_BSDI
119 # include <time.h> 115 # include <time.h>
120 # endif 116 # endif
121 # include <wchar.h> 117 # include <wchar.h>
122 #endif 118 #endif
123 119
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 1155
1160 #ifndef Py_LIMITED_API 1156 #ifndef Py_LIMITED_API
1161 PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap( 1157 PyAPI_FUNC(PyObject *) PyUnicode_TranslateCharmap(
1162 const Py_UNICODE *data, /* Unicode char buffer */ 1158 const Py_UNICODE *data, /* Unicode char buffer */
1163 Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ 1159 Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
1164 PyObject *table, /* Translate table */ 1160 PyObject *table, /* Translate table */
1165 const char *errors /* error handling */ 1161 const char *errors /* error handling */
1166 ); 1162 );
1167 #endif 1163 #endif
1168 1164
1169 #ifdef HAVE_MBCS 1165 #ifdef MS_WIN32
1170 1166
1171 /* --- MBCS codecs for Windows -------------------------------------------- */ 1167 /* --- MBCS codecs for Windows -------------------------------------------- */
1172 1168
1173 PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCS( 1169 PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCS(
1174 const char *string, /* MBCS encoded string */ 1170 const char *string, /* MBCS encoded string */
1175 Py_ssize_t length, /* size of string */ 1171 Py_ssize_t length, /* size of string */
1176 const char *errors /* error handling */ 1172 const char *errors /* error handling */
1177 ); 1173 );
1178 1174
1179 PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCSStateful( 1175 PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCSStateful(
1180 const char *string, /* MBCS encoded string */ 1176 const char *string, /* MBCS encoded string */
1181 Py_ssize_t length, /* size of string */ 1177 Py_ssize_t length, /* size of string */
1182 const char *errors, /* error handling */ 1178 const char *errors, /* error handling */
1183 Py_ssize_t *consumed /* bytes consumed */ 1179 Py_ssize_t *consumed /* bytes consumed */
1184 ); 1180 );
1185 1181
1186 PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString( 1182 PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString(
1187 PyObject *unicode /* Unicode object */ 1183 PyObject *unicode /* Unicode object */
1188 ); 1184 );
1189 1185
1190 #ifndef Py_LIMITED_API 1186 #ifndef Py_LIMITED_API
1191 PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS( 1187 PyAPI_FUNC(PyObject*) PyUnicode_EncodeMBCS(
1192 const Py_UNICODE *data, /* Unicode char buffer */ 1188 const Py_UNICODE *data, /* Unicode char buffer */
1193 Py_ssize_t length, /* Number of Py_UNICODE chars to encode */ 1189 Py_ssize_t length, /* Number of Py_UNICODE chars to encode */
1194 const char *errors /* error handling */ 1190 const char *errors /* error handling */
1195 ); 1191 );
1196 #endif 1192 #endif
1197 1193
1198 #endif /* HAVE_MBCS */ 1194 #endif /* MS_WIN32 */
1199 1195
1200 /* --- Decimal Encoder ---------------------------------------------------- */ 1196 /* --- Decimal Encoder ---------------------------------------------------- */
1201 1197
1202 /* Takes a Unicode string holding a decimal value and writes it into 1198 /* Takes a Unicode string holding a decimal value and writes it into
1203 an output buffer using standard ASCII digit codes. 1199 an output buffer using standard ASCII digit codes.
1204 1200
1205 The output buffer has to provide at least length+1 bytes of storage 1201 The output buffer has to provide at least length+1 bytes of storage
1206 area. The output string is 0-terminated. 1202 area. The output string is 0-terminated.
1207 1203
1208 The encoder converts whitespace to ' ', decimal characters to their 1204 The encoder converts whitespace to ' ', decimal characters to their
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
1670 1666
1671 PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy( 1667 PyAPI_FUNC(Py_UNICODE*) PyUnicode_AsUnicodeCopy(
1672 PyObject *unicode 1668 PyObject *unicode
1673 ); 1669 );
1674 #endif /* Py_LIMITED_API */ 1670 #endif /* Py_LIMITED_API */
1675 1671
1676 #ifdef __cplusplus 1672 #ifdef __cplusplus
1677 } 1673 }
1678 #endif 1674 #endif
1679 #endif /* !Py_UNICODEOBJECT_H */ 1675 #endif /* !Py_UNICODEOBJECT_H */
OLDNEW
« no previous file with comments | « Include/Python.h ('k') | Lib/ast.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+