2007-08-25 04:26:07 +02:00
|
|
|
#ifndef STRINGLIB_STRINGDEFS_H
|
|
|
|
#define STRINGLIB_STRINGDEFS_H
|
|
|
|
|
|
|
|
/* 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. */
|
|
|
|
#define STRINGLIB_IS_UNICODE 0
|
|
|
|
|
2008-05-26 15:28:38 +02:00
|
|
|
#define STRINGLIB_OBJECT PyBytesObject
|
2007-08-25 04:26:07 +02:00
|
|
|
#define STRINGLIB_CHAR char
|
|
|
|
#define STRINGLIB_TYPE_NAME "string"
|
2007-09-01 12:56:01 +02:00
|
|
|
#define STRINGLIB_PARSE_CODE "S"
|
2008-02-17 20:48:00 +01:00
|
|
|
#define STRINGLIB_EMPTY nullstring
|
2010-01-13 09:07:53 +01:00
|
|
|
#define STRINGLIB_ISSPACE Py_ISSPACE
|
|
|
|
#define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r'))
|
2007-08-25 04:26:07 +02:00
|
|
|
#define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9'))
|
|
|
|
#define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1)
|
2009-04-27 22:39:49 +02:00
|
|
|
#define STRINGLIB_TOUPPER Py_TOUPPER
|
|
|
|
#define STRINGLIB_TOLOWER Py_TOLOWER
|
2007-08-25 04:26:07 +02:00
|
|
|
#define STRINGLIB_FILL memset
|
2008-05-26 15:28:38 +02:00
|
|
|
#define STRINGLIB_STR PyBytes_AS_STRING
|
|
|
|
#define STRINGLIB_LEN PyBytes_GET_SIZE
|
|
|
|
#define STRINGLIB_NEW PyBytes_FromStringAndSize
|
|
|
|
#define STRINGLIB_RESIZE _PyBytes_Resize
|
|
|
|
#define STRINGLIB_CHECK PyBytes_Check
|
2009-11-30 02:01:42 +01:00
|
|
|
#define STRINGLIB_CHECK_EXACT PyBytes_CheckExact
|
2007-08-25 04:26:07 +02:00
|
|
|
#define STRINGLIB_TOSTR PyObject_Str
|
2008-05-26 15:28:38 +02:00
|
|
|
#define STRINGLIB_GROUPING _PyBytes_InsertThousandsGrouping
|
2009-04-03 16:45:06 +02:00
|
|
|
#define STRINGLIB_GROUPING_LOCALE _PyBytes_InsertThousandsGroupingLocale
|
2008-06-11 20:37:52 +02:00
|
|
|
#define STRINGLIB_TOASCII PyObject_Repr
|
2007-08-25 04:26:07 +02:00
|
|
|
#endif /* !STRINGLIB_STRINGDEFS_H */
|