blob: a4be17fa90c218d3c82d30c15351a67c7217f0e9 [file] [log] [blame]
Eric Smith8c663262007-08-25 02:26:07 +00001#ifndef STRINGLIB_STRINGDEFS_H
2#define STRINGLIB_STRINGDEFS_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 0
8
9#define STRINGLIB_CHAR char
10#define STRINGLIB_TYPE_NAME "string"
Eric Smith37f10382007-09-01 10:56:01 +000011#define STRINGLIB_PARSE_CODE "S"
Eric Smith8c663262007-08-25 02:26:07 +000012#define STRINGLIB_EMPTY string_empty
13#define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9'))
14#define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1)
15#define STRINGLIB_FILL memset
16#define STRINGLIB_STR PyString_AS_STRING
17#define STRINGLIB_LEN PyString_GET_SIZE
18#define STRINGLIB_NEW PyString_FromStringAndSize
19#define STRINGLIB_RESIZE _PyString_Resize
20#define STRINGLIB_CHECK PyString_Check
21#define STRINGLIB_CMP memcmp
22#define STRINGLIB_TOSTR PyObject_Str
23
24#endif /* !STRINGLIB_STRINGDEFS_H */