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

Side by Side Diff: Include/unicodeobject.h

Issue 767: [issue2630] repr() should not escape non-ASCII characters (Closed) SVN Base: http://svn.python.org/view/*checkout*/python/branches/py3k/
Patch Set: Created 5 months ago
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
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 file Misc/unicode.txt). 10 Unicode Integration Proposal (see file Misc/unicode.txt).
(...skipping 199 matching lines...) Show 10 above Show 10 below
210 # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString 210 # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS2_AsDefaultEncodedString
211 # define _PyUnicode_Fini _PyUnicodeUCS2_Fini 211 # define _PyUnicode_Fini _PyUnicodeUCS2_Fini
212 # define _PyUnicode_Init _PyUnicodeUCS2_Init 212 # define _PyUnicode_Init _PyUnicodeUCS2_Init
213 # define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist 213 # define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist
214 # define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha 214 # define _PyUnicode_IsAlpha _PyUnicodeUCS2_IsAlpha
215 # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit 215 # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS2_IsDecimalDigit
216 # define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit 216 # define _PyUnicode_IsDigit _PyUnicodeUCS2_IsDigit
217 # define _PyUnicode_IsLinebreak _PyUnicodeUCS2_IsLinebreak 217 # define _PyUnicode_IsLinebreak _PyUnicodeUCS2_IsLinebreak
218 # define _PyUnicode_IsLowercase _PyUnicodeUCS2_IsLowercase 218 # define _PyUnicode_IsLowercase _PyUnicodeUCS2_IsLowercase
219 # define _PyUnicode_IsNumeric _PyUnicodeUCS2_IsNumeric 219 # define _PyUnicode_IsNumeric _PyUnicodeUCS2_IsNumeric
220 # define _PyUnicode_IsHexEscaped _PyUnicodeUCS2_IsHexEscaped
220 # define _PyUnicode_IsTitlecase _PyUnicodeUCS2_IsTitlecase 221 # define _PyUnicode_IsTitlecase _PyUnicodeUCS2_IsTitlecase
221 # define _PyUnicode_IsXidStart _PyUnicodeUCS2_IsXidStart 222 # define _PyUnicode_IsXidStart _PyUnicodeUCS2_IsXidStart
222 # define _PyUnicode_IsXidContinue _PyUnicodeUCS2_IsXidContinue 223 # define _PyUnicode_IsXidContinue _PyUnicodeUCS2_IsXidContinue
223 # define _PyUnicode_IsUppercase _PyUnicodeUCS2_IsUppercase 224 # define _PyUnicode_IsUppercase _PyUnicodeUCS2_IsUppercase
224 # define _PyUnicode_IsWhitespace _PyUnicodeUCS2_IsWhitespace 225 # define _PyUnicode_IsWhitespace _PyUnicodeUCS2_IsWhitespace
225 # define _PyUnicode_ToDecimalDigit _PyUnicodeUCS2_ToDecimalDigit 226 # define _PyUnicode_ToDecimalDigit _PyUnicodeUCS2_ToDecimalDigit
226 # define _PyUnicode_ToDigit _PyUnicodeUCS2_ToDigit 227 # define _PyUnicode_ToDigit _PyUnicodeUCS2_ToDigit
227 # define _PyUnicode_ToLowercase _PyUnicodeUCS2_ToLowercase 228 # define _PyUnicode_ToLowercase _PyUnicodeUCS2_ToLowercase
228 # define _PyUnicode_ToNumeric _PyUnicodeUCS2_ToNumeric 229 # define _PyUnicode_ToNumeric _PyUnicodeUCS2_ToNumeric
229 # define _PyUnicode_ToTitlecase _PyUnicodeUCS2_ToTitlecase 230 # define _PyUnicode_ToTitlecase _PyUnicodeUCS2_ToTitlecase
(...skipping 74 matching lines...) Show 10 above Show 10 below
304 # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString 305 # define _PyUnicode_AsDefaultEncodedString _PyUnicodeUCS4_AsDefaultEncodedString
305 # define _PyUnicode_Fini _PyUnicodeUCS4_Fini 306 # define _PyUnicode_Fini _PyUnicodeUCS4_Fini
306 # define _PyUnicode_Init _PyUnicodeUCS4_Init 307 # define _PyUnicode_Init _PyUnicodeUCS4_Init
307 # define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist 308 # define PyUnicode_ClearFreeList PyUnicodeUCS2_ClearFreelist
308 # define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha 309 # define _PyUnicode_IsAlpha _PyUnicodeUCS4_IsAlpha
309 # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit 310 # define _PyUnicode_IsDecimalDigit _PyUnicodeUCS4_IsDecimalDigit
310 # define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit 311 # define _PyUnicode_IsDigit _PyUnicodeUCS4_IsDigit
311 # define _PyUnicode_IsLinebreak _PyUnicodeUCS4_IsLinebreak 312 # define _PyUnicode_IsLinebreak _PyUnicodeUCS4_IsLinebreak
312 # define _PyUnicode_IsLowercase _PyUnicodeUCS4_IsLowercase 313 # define _PyUnicode_IsLowercase _PyUnicodeUCS4_IsLowercase
313 # define _PyUnicode_IsNumeric _PyUnicodeUCS4_IsNumeric 314 # define _PyUnicode_IsNumeric _PyUnicodeUCS4_IsNumeric
315 # define _PyUnicode_IsHexEscaped _PyUnicodeUCS4_IsHexEscaped
314 # define _PyUnicode_IsTitlecase _PyUnicodeUCS4_IsTitlecase 316 # define _PyUnicode_IsTitlecase _PyUnicodeUCS4_IsTitlecase
315 # define _PyUnicode_IsXidStart _PyUnicodeUCS4_IsXidStart 317 # define _PyUnicode_IsXidStart _PyUnicodeUCS4_IsXidStart
316 # define _PyUnicode_IsXidContinue _PyUnicodeUCS4_IsXidContinue 318 # define _PyUnicode_IsXidContinue _PyUnicodeUCS4_IsXidContinue
317 # define _PyUnicode_IsUppercase _PyUnicodeUCS4_IsUppercase 319 # define _PyUnicode_IsUppercase _PyUnicodeUCS4_IsUppercase
318 # define _PyUnicode_IsWhitespace _PyUnicodeUCS4_IsWhitespace 320 # define _PyUnicode_IsWhitespace _PyUnicodeUCS4_IsWhitespace
319 # define _PyUnicode_ToDecimalDigit _PyUnicodeUCS4_ToDecimalDigit 321 # define _PyUnicode_ToDecimalDigit _PyUnicodeUCS4_ToDecimalDigit
320 # define _PyUnicode_ToDigit _PyUnicodeUCS4_ToDigit 322 # define _PyUnicode_ToDigit _PyUnicodeUCS4_ToDigit
321 # define _PyUnicode_ToLowercase _PyUnicodeUCS4_ToLowercase 323 # define _PyUnicode_ToLowercase _PyUnicodeUCS4_ToLowercase
322 # define _PyUnicode_ToNumeric _PyUnicodeUCS4_ToNumeric 324 # define _PyUnicode_ToNumeric _PyUnicodeUCS4_ToNumeric
323 # define _PyUnicode_ToTitlecase _PyUnicodeUCS4_ToTitlecase 325 # define _PyUnicode_ToTitlecase _PyUnicodeUCS4_ToTitlecase
(...skipping 20 matching lines...) Show 10 above Show 10 below
344 #define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch) 346 #define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch)
345 #define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch) 347 #define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch)
346 348
347 #define Py_UNICODE_TOLOWER(ch) towlower(ch) 349 #define Py_UNICODE_TOLOWER(ch) towlower(ch)
348 #define Py_UNICODE_TOUPPER(ch) towupper(ch) 350 #define Py_UNICODE_TOUPPER(ch) towupper(ch)
349 #define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch) 351 #define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch)
350 352
351 #define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch) 353 #define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch)
352 #define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch) 354 #define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch)
353 #define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch) 355 #define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch)
356 #define Py_UNICODE_ISHEXESCAPED(ch) _PyUnicode_IsHexEscaped(ch)
354 357
355 #define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch) 358 #define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch)
356 #define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch) 359 #define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch)
357 #define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch) 360 #define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch)
358 361
359 #define Py_UNICODE_ISALPHA(ch) iswalpha(ch) 362 #define Py_UNICODE_ISALPHA(ch) iswalpha(ch)
360 363
361 #else 364 #else
362 365
363 /* Since splitting on whitespace is an important use case, and whitespace 366 /* Since splitting on whitespace is an important use case, and whitespace
(...skipping 10 matching lines...) Show
374 #define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch) 377 #define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch)
375 #define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch) 378 #define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch)
376 379
377 #define Py_UNICODE_TOLOWER(ch) _PyUnicode_ToLowercase(ch) 380 #define Py_UNICODE_TOLOWER(ch) _PyUnicode_ToLowercase(ch)
378 #define Py_UNICODE_TOUPPER(ch) _PyUnicode_ToUppercase(ch) 381 #define Py_UNICODE_TOUPPER(ch) _PyUnicode_ToUppercase(ch)
379 #define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch) 382 #define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch)
380 383
381 #define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch) 384 #define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch)
382 #define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch) 385 #define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch)
383 #define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch) 386 #define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch)
387 #define Py_UNICODE_ISHEXESCAPED(ch) _PyUnicode_IsHexEscaped(ch)
384 388
385 #define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch) 389 #define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch)
386 #define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch) 390 #define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch)
387 #define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch) 391 #define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch)
388 392
389 #define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch) 393 #define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch)
390 394
391 #endif 395 #endif
392 396
393 #define Py_UNICODE_ISALNUM(ch) \ 397 #define Py_UNICODE_ISALNUM(ch) \
(...skipping 1078 matching lines...) Show 10 above Show 10 below
1472 1476
1473 PyAPI_FUNC(int) _PyUnicode_IsDecimalDigit( 1477 PyAPI_FUNC(int) _PyUnicode_IsDecimalDigit(
1474 Py_UNICODE ch /* Unicode character */ 1478 Py_UNICODE ch /* Unicode character */
1475 ); 1479 );
1476 1480
1477 PyAPI_FUNC(int) _PyUnicode_IsDigit( 1481 PyAPI_FUNC(int) _PyUnicode_IsDigit(
1478 Py_UNICODE ch /* Unicode character */ 1482 Py_UNICODE ch /* Unicode character */
1479 ); 1483 );
1480 1484
1481 PyAPI_FUNC(int) _PyUnicode_IsNumeric( 1485 PyAPI_FUNC(int) _PyUnicode_IsNumeric(
1486 Py_UNICODE ch /* Unicode character */
1487 );
1488
1489 PyAPI_FUNC(int) _PyUnicode_IsHexEscaped(
1482 Py_UNICODE ch /* Unicode character */ 1490 Py_UNICODE ch /* Unicode character */
1483 ); 1491 );
1484 1492
1485 PyAPI_FUNC(int) _PyUnicode_IsAlpha( 1493 PyAPI_FUNC(int) _PyUnicode_IsAlpha(
1486 Py_UNICODE ch /* Unicode character */ 1494 Py_UNICODE ch /* Unicode character */
1487 ); 1495 );
1488 1496
1489 PyAPI_FUNC(size_t) Py_UNICODE_strlen(const Py_UNICODE *u); 1497 PyAPI_FUNC(size_t) Py_UNICODE_strlen(const Py_UNICODE *u);
1490 1498
1491 PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcpy( 1499 PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strcpy(
1492 Py_UNICODE *s1, const Py_UNICODE *s2); 1500 Py_UNICODE *s1, const Py_UNICODE *s2);
1493 1501
1494 PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strncpy( 1502 PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strncpy(
1495 Py_UNICODE *s1, const Py_UNICODE *s2, size_t n); 1503 Py_UNICODE *s1, const Py_UNICODE *s2, size_t n);
1496 1504
1497 PyAPI_FUNC(int) Py_UNICODE_strcmp( 1505 PyAPI_FUNC(int) Py_UNICODE_strcmp(
1498 const Py_UNICODE *s1, const Py_UNICODE *s2); 1506 const Py_UNICODE *s1, const Py_UNICODE *s2);
1499 1507
1500 PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strchr( 1508 PyAPI_FUNC(Py_UNICODE*) Py_UNICODE_strchr(
1501 const Py_UNICODE *s, Py_UNICODE c 1509 const Py_UNICODE *s, Py_UNICODE c
1502 ); 1510 );
1503 1511
1504 #ifdef __cplusplus 1512 #ifdef __cplusplus
1505 } 1513 }
1506 #endif 1514 #endif
1507 #endif /* !Py_UNICODEOBJECT_H */ 1515 #endif /* !Py_UNICODEOBJECT_H */
OLDNEW

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld r338