2007-08-25 10:26:07 +08: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
|
|
|
|
|
2011-09-28 13:41:54 +08:00
|
|
|
#define FASTSEARCH fastsearch
|
|
|
|
#define STRINGLIB(F) stringlib_##F
|
2008-05-26 21:28:38 +08:00
|
|
|
#define STRINGLIB_OBJECT PyBytesObject
|
2011-10-12 05:22:22 +08:00
|
|
|
#define STRINGLIB_SIZEOF_CHAR 1
|
2007-08-25 10:26:07 +08:00
|
|
|
#define STRINGLIB_CHAR char
|
|
|
|
#define STRINGLIB_TYPE_NAME "string"
|
2007-09-01 18:56:01 +08:00
|
|
|
#define STRINGLIB_PARSE_CODE "S"
|
2008-02-18 03:48:00 +08:00
|
|
|
#define STRINGLIB_EMPTY nullstring
|
2010-01-13 16:07:53 +08:00
|
|
|
#define STRINGLIB_ISSPACE Py_ISSPACE
|
|
|
|
#define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r'))
|
2007-08-25 10:26:07 +08:00
|
|
|
#define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9'))
|
|
|
|
#define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1)
|
2008-05-26 21:28:38 +08:00
|
|
|
#define STRINGLIB_STR PyBytes_AS_STRING
|
|
|
|
#define STRINGLIB_LEN PyBytes_GET_SIZE
|
|
|
|
#define STRINGLIB_NEW PyBytes_FromStringAndSize
|
|
|
|
#define STRINGLIB_CHECK PyBytes_Check
|
2009-11-30 09:01:42 +08:00
|
|
|
#define STRINGLIB_CHECK_EXACT PyBytes_CheckExact
|
2007-08-25 10:26:07 +08:00
|
|
|
#define STRINGLIB_TOSTR PyObject_Str
|
2008-06-12 02:37:52 +08:00
|
|
|
#define STRINGLIB_TOASCII PyObject_Repr
|
2007-08-25 10:26:07 +08:00
|
|
|
#endif /* !STRINGLIB_STRINGDEFS_H */
|