2007-08-24 23:26:07 -03: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 02:41:54 -03:00
|
|
|
#define FASTSEARCH fastsearch
|
|
|
|
#define STRINGLIB(F) stringlib_##F
|
2008-05-26 10:28:38 -03:00
|
|
|
#define STRINGLIB_OBJECT PyBytesObject
|
2011-10-11 18:22:22 -03:00
|
|
|
#define STRINGLIB_SIZEOF_CHAR 1
|
2007-08-24 23:26:07 -03:00
|
|
|
#define STRINGLIB_CHAR char
|
|
|
|
#define STRINGLIB_TYPE_NAME "string"
|
2007-09-01 07:56:01 -03:00
|
|
|
#define STRINGLIB_PARSE_CODE "S"
|
2010-01-13 04:07:53 -04:00
|
|
|
#define STRINGLIB_ISSPACE Py_ISSPACE
|
|
|
|
#define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r'))
|
2007-08-24 23:26:07 -03:00
|
|
|
#define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9'))
|
|
|
|
#define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1)
|
2008-05-26 10:28:38 -03: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-29 21:01:42 -04:00
|
|
|
#define STRINGLIB_CHECK_EXACT PyBytes_CheckExact
|
2007-08-24 23:26:07 -03:00
|
|
|
#define STRINGLIB_TOSTR PyObject_Str
|
2008-06-11 15:37:52 -03:00
|
|
|
#define STRINGLIB_TOASCII PyObject_Repr
|
2022-05-23 22:45:31 -03:00
|
|
|
#define STRINGLIB_FAST_MEMCHR memchr
|
2007-08-24 23:26:07 -03:00
|
|
|
#endif /* !STRINGLIB_STRINGDEFS_H */
|