- Notifications
You must be signed in to change notification settings - Fork 31.7k
/
Copy pathucs2lib.h
30 lines (28 loc) · 1.24 KB
/
ucs2lib.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* this is sort of a hack. there's at least one place (formatting
floats) where some stringlib code takes a different path if it's
compiled as unicode. */
#defineSTRINGLIB_IS_UNICODE 1
#defineFASTSEARCH ucs2lib_fastsearch
#defineSTRINGLIB(F) ucs2lib_##F
#defineSTRINGLIB_OBJECT PyUnicodeObject
#defineSTRINGLIB_SIZEOF_CHAR 2
#defineSTRINGLIB_MAX_CHAR 0xFFFFu
#defineSTRINGLIB_CHAR Py_UCS2
#defineSTRINGLIB_TYPE_NAME "unicode"
#defineSTRINGLIB_PARSE_CODE "U"
#defineSTRINGLIB_ISSPACE Py_UNICODE_ISSPACE
#defineSTRINGLIB_ISLINEBREAK BLOOM_LINEBREAK
#defineSTRINGLIB_ISDECIMAL Py_UNICODE_ISDECIMAL
#defineSTRINGLIB_TODECIMAL Py_UNICODE_TODECIMAL
#defineSTRINGLIB_STR PyUnicode_2BYTE_DATA
#defineSTRINGLIB_LEN PyUnicode_GET_LENGTH
#defineSTRINGLIB_NEW _PyUnicode_FromUCS2
#defineSTRINGLIB_CHECK PyUnicode_Check
#defineSTRINGLIB_CHECK_EXACT PyUnicode_CheckExact
#defineSTRINGLIB_MUTABLE 0
#ifSIZEOF_WCHAR_T==2
#defineSTRINGLIB_FAST_MEMCHR(s, c, n) \
(Py_UCS2 *)wmemchr((const wchar_t *)(s), c, n)
#endif
#defineSTRINGLIB_TOSTR PyObject_Str
#defineSTRINGLIB_TOASCII PyObject_ASCII