blob: aec3441dfed9d53b31339753a92547ad9e0f9611 [file] [log] [blame]
Thomas Wouters477c8d52006-05-27 19:21:47 +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.
6
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
16 a PyObject representing the empty string
17
18int STRINGLIB_CMP(STRINGLIB_CHAR*, STRINGLIB_CHAR*, Py_ssize_t)
19
20 compares two strings. returns 0 if they match, and non-zero if not.
21
22Py_ssize_t STRINGLIB_LEN(PyObject*)
23
24 returns the length of the given string object (which must be of the
25 right type)
26
27PyObject* STRINGLIB_NEW(STRINGLIB_CHAR*, Py_ssize_t)
28
29 creates a new string object
30
31STRINGLIB_CHAR* STRINGLIB_STR(PyObject*)
32
33 returns the pointer to the character data for the given string
34 object (which must be of the right type)
Gregory P. Smith60d241f2007-10-16 06:31:30 +000035
36int STRINGLIB_CHECK_EXACT(PyObject *)
37
38 returns true if the object is an instance of our type, not a subclass.
39
40STRINGLIB_MUTABLE
41
42 Must be 0 or 1 to tell the cpp macros in stringlib code if the object
43 being operated on is mutable or not.