blob: dd814f6c90eb3de16b5f78e023a2142147725518 [file] [log] [blame]
Eric Smitha9f7d622008-02-17 19:46:49 +00001#ifndef STRINGLIB_UNICODEDEFS_H
2#define STRINGLIB_UNICODEDEFS_H
3
4/* this is sort of a hack. there's at least one place (formatting
5 floats) where some stringlib code takes a different path if it's
6 compiled as unicode. */
7#define STRINGLIB_IS_UNICODE 1
8
9#define STRINGLIB_OBJECT PyUnicodeObject
10#define STRINGLIB_CHAR Py_UNICODE
11#define STRINGLIB_TYPE_NAME "unicode"
12#define STRINGLIB_PARSE_CODE "U"
13#define STRINGLIB_EMPTY unicode_empty
Antoine Pitrou64672132010-01-13 07:55:48 +000014#define STRINGLIB_ISSPACE Py_UNICODE_ISSPACE
15#define STRINGLIB_ISLINEBREAK BLOOM_LINEBREAK
Eric Smitha9f7d622008-02-17 19:46:49 +000016#define STRINGLIB_ISDECIMAL Py_UNICODE_ISDECIMAL
17#define STRINGLIB_TODECIMAL Py_UNICODE_TODECIMAL
18#define STRINGLIB_TOUPPER Py_UNICODE_TOUPPER
19#define STRINGLIB_TOLOWER Py_UNICODE_TOLOWER
20#define STRINGLIB_FILL Py_UNICODE_FILL
21#define STRINGLIB_STR PyUnicode_AS_UNICODE
22#define STRINGLIB_LEN PyUnicode_GET_SIZE
23#define STRINGLIB_NEW PyUnicode_FromUnicode
24#define STRINGLIB_RESIZE PyUnicode_Resize
25#define STRINGLIB_CHECK PyUnicode_Check
Antoine Pitrou64672132010-01-13 07:55:48 +000026#define STRINGLIB_CHECK_EXACT PyUnicode_CheckExact
Eric Smithcf537ff2008-05-11 19:52:48 +000027#define STRINGLIB_GROUPING _PyUnicode_InsertThousandsGrouping
Eric Smitha9f7d622008-02-17 19:46:49 +000028
29#if PY_VERSION_HEX < 0x03000000
30#define STRINGLIB_TOSTR PyObject_Unicode
31#else
32#define STRINGLIB_TOSTR PyObject_Str
33#endif
34
35#define STRINGLIB_WANT_CONTAINS_OBJ 1
36
Eric Smitha9f7d622008-02-17 19:46:49 +000037#endif /* !STRINGLIB_UNICODEDEFS_H */