4 #ifndef Py_STRINGOBJECT_H
5 #define Py_STRINGOBJECT_H
51 #define SSTATE_NOT_INTERNED 0
52 #define SSTATE_INTERNED_MORTAL 1
53 #define SSTATE_INTERNED_IMMORTAL 2
58 #define PyString_Check(op) \
59 PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_STRING_SUBCLASS)
60 #define PyString_CheckExact(op) (Py_TYPE(op) == &PyString_Type)
69 PyAPI_FUNC(
char *) PyString_AsString(PyObject *);
71 PyAPI_FUNC(
void) PyString_Concat(PyObject **, PyObject *);
72 PyAPI_FUNC(
void) PyString_ConcatAndDel(PyObject **, PyObject *);
73 PyAPI_FUNC(
int) _PyString_Resize(PyObject **, Py_ssize_t);
74 PyAPI_FUNC(
int) _PyString_Eq(PyObject *, PyObject*);
75 PyAPI_FUNC(PyObject *) PyString_Format(PyObject *, PyObject *);
76 PyAPI_FUNC(PyObject *) _PyString_FormatLong(PyObject*,
int,
int,
78 PyAPI_FUNC(PyObject *) PyString_DecodeEscape(const
char *, Py_ssize_t,
79 const
char *, Py_ssize_t,
82 PyAPI_FUNC(
void) PyString_InternInPlace(PyObject **);
83 PyAPI_FUNC(
void) PyString_InternImmortal(PyObject **);
84 PyAPI_FUNC(PyObject *) PyString_InternFromString(const
char *);
85 PyAPI_FUNC(
void) _Py_ReleaseInternedStrings(
void);
88 #define PyString_CHECK_INTERNED(op) (((PyStringObject *)(op))->ob_sstate)
91 #define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval)
92 #define PyString_GET_SIZE(op) Py_SIZE(op)
116 const
char *encoding,
123 PyAPI_FUNC(PyObject*) PyString_AsEncodedObject(
125 const
char *encoding,
137 PyAPI_FUNC(PyObject*) PyString_AsEncodedString(
139 const
char *encoding,
146 PyAPI_FUNC(PyObject*) PyString_AsDecodedObject(
148 const
char *encoding,
160 PyAPI_FUNC(PyObject*) PyString_AsDecodedString(
162 const
char *encoding,
173 register PyObject *
obj,
175 register Py_ssize_t *
len
184 PyAPI_FUNC(Py_ssize_t) _PyString_InsertThousandsGroupingLocale(
char *
buffer,
193 PyAPI_FUNC(Py_ssize_t) _PyString_InsertThousandsGrouping(
char *buffer,
197 Py_ssize_t min_width,
203 PyAPI_FUNC(PyObject *) _PyBytes_FormatAdvanced(PyObject *obj,