README.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. bits shared by the bytesobject and unicodeobject implementations (and
  2. possibly other modules, in a not too distant future).
  3. the stuff in here is included into relevant places; see the individual
  4. source files for details.
  5. --------------------------------------------------------------------
  6. the following defines used by the different modules:
  7. STRINGLIB_CHAR
  8. the type used to hold a character (char or Py_UNICODE)
  9. STRINGLIB_GET_EMPTY()
  10. returns a PyObject representing the empty string, only to be used if
  11. STRINGLIB_MUTABLE is 0. It must not be NULL.
  12. Py_ssize_t STRINGLIB_LEN(PyObject*)
  13. returns the length of the given string object (which must be of the
  14. right type)
  15. PyObject* STRINGLIB_NEW(STRINGLIB_CHAR*, Py_ssize_t)
  16. creates a new string object
  17. STRINGLIB_CHAR* STRINGLIB_STR(PyObject*)
  18. returns the pointer to the character data for the given string
  19. object (which must be of the right type)
  20. int STRINGLIB_CHECK_EXACT(PyObject *)
  21. returns true if the object is an instance of our type, not a subclass
  22. STRINGLIB_MUTABLE
  23. must be 0 or 1 to tell the cpp macros in stringlib code if the object
  24. being operated on is mutable or not