blob: ab506d60f94bbaa49dc8770ad4c78dbc4a42c855 [file] [log] [blame]
Fredrik Lundha50d2012006-05-26 17:04:58 +00001bits shared by the stringobject and unicodeobject implementations (and
2possibly other modules, in a not too distant future).
3
4the stuff in here is included into relevant places; see the individual
5source files for details.
Fredrik Lundh2d23d5b2006-05-27 10:05:10 +00006
7--------------------------------------------------------------------
8the following defines used by the different modules:
9
10STRINGLIB_CHAR
11
12 the type used to hold a character (char or Py_UNICODE)
13
14STRINGLIB_EMPTY
15
Georg Brandlaee90032010-01-17 12:14:42 +000016 a PyObject representing the empty string, only to be used if
17 STRINGLIB_MUTABLE is 0
Fredrik Lundh2d23d5b2006-05-27 10:05:10 +000018
Fredrik Lundh2d23d5b2006-05-27 10:05:10 +000019Py_ssize_t STRINGLIB_LEN(PyObject*)
20
21 returns the length of the given string object (which must be of the
22 right type)
23
24PyObject* STRINGLIB_NEW(STRINGLIB_CHAR*, Py_ssize_t)
25
26 creates a new string object
27
28STRINGLIB_CHAR* STRINGLIB_STR(PyObject*)
29
30 returns the pointer to the character data for the given string
31 object (which must be of the right type)
Antoine Pitrou64672132010-01-13 07:55:48 +000032
33int STRINGLIB_CHECK_EXACT(PyObject *)
34
Georg Brandlaee90032010-01-17 12:14:42 +000035 returns true if the object is an instance of our type, not a subclass
Antoine Pitrou64672132010-01-13 07:55:48 +000036
37STRINGLIB_MUTABLE
38
Georg Brandlaee90032010-01-17 12:14:42 +000039 must be 0 or 1 to tell the cpp macros in stringlib code if the object
40 being operated on is mutable or not