/Objects/stringlib/stringdefs.h

http://unladen-swallow.googlecode.com/ · C Header · 28 lines · 22 code · 3 blank · 3 comment · 1 complexity · 80cda04fda46303a8e2061b306294aad MD5 · raw file

  1. #ifndef STRINGLIB_STRINGDEFS_H
  2. #define STRINGLIB_STRINGDEFS_H
  3. /* this is sort of a hack. there's at least one place (formatting
  4. floats) where some stringlib code takes a different path if it's
  5. compiled as unicode. */
  6. #define STRINGLIB_IS_UNICODE 0
  7. #define STRINGLIB_OBJECT PyStringObject
  8. #define STRINGLIB_CHAR char
  9. #define STRINGLIB_TYPE_NAME "string"
  10. #define STRINGLIB_PARSE_CODE "S"
  11. #define STRINGLIB_EMPTY nullstring
  12. #define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9'))
  13. #define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1)
  14. #define STRINGLIB_TOUPPER toupper
  15. #define STRINGLIB_TOLOWER tolower
  16. #define STRINGLIB_FILL memset
  17. #define STRINGLIB_STR PyString_AS_STRING
  18. #define STRINGLIB_LEN PyString_GET_SIZE
  19. #define STRINGLIB_NEW PyString_FromStringAndSize
  20. #define STRINGLIB_RESIZE _PyString_Resize
  21. #define STRINGLIB_CHECK PyString_Check
  22. #define STRINGLIB_CMP memcmp
  23. #define STRINGLIB_TOSTR PyObject_Str
  24. #define STRINGLIB_GROUPING _PyString_InsertThousandsGrouping
  25. #endif /* !STRINGLIB_STRINGDEFS_H */