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
|
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"
|
2008-02-17 15:48:00 -04:00
|
|
|
#define STRINGLIB_EMPTY nullstring
|
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)
|
2009-04-27 17:39:49 -03:00
|
|
|
#define STRINGLIB_TOUPPER Py_TOUPPER
|
|
|
|
#define STRINGLIB_TOLOWER Py_TOLOWER
|
2007-08-24 23:26:07 -03:00
|
|
|
#define STRINGLIB_FILL memset
|
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_RESIZE _PyBytes_Resize
|
|
|
|
#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-05-26 10:28:38 -03:00
|
|
|
#define STRINGLIB_GROUPING _PyBytes_InsertThousandsGrouping
|
2009-04-03 11:45:06 -03:00
|
|
|
#define STRINGLIB_GROUPING_LOCALE _PyBytes_InsertThousandsGroupingLocale
|
2008-06-11 15:37:52 -03:00
|
|
|
#define STRINGLIB_TOASCII PyObject_Repr
|
2007-08-24 23:26:07 -03:00
|
|
|
#endif /* !STRINGLIB_STRINGDEFS_H */
|