You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
1.2 KiB

  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 FASTSEARCH fastsearch
  8. #define STRINGLIB(F) stringlib_##F
  9. #define STRINGLIB_OBJECT PyBytesObject
  10. #define STRINGLIB_SIZEOF_CHAR 1
  11. #define STRINGLIB_CHAR char
  12. #define STRINGLIB_TYPE_NAME "string"
  13. #define STRINGLIB_PARSE_CODE "S"
  14. #define STRINGLIB_EMPTY nullstring
  15. #define STRINGLIB_ISSPACE Py_ISSPACE
  16. #define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r'))
  17. #define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9'))
  18. #define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1)
  19. #define STRINGLIB_STR PyBytes_AS_STRING
  20. #define STRINGLIB_LEN PyBytes_GET_SIZE
  21. #define STRINGLIB_NEW PyBytes_FromStringAndSize
  22. #define STRINGLIB_CHECK PyBytes_Check
  23. #define STRINGLIB_CHECK_EXACT PyBytes_CheckExact
  24. #define STRINGLIB_TOSTR PyObject_Str
  25. #define STRINGLIB_TOASCII PyObject_Repr
  26. #endif /* !STRINGLIB_STRINGDEFS_H */