Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/python2....
File: stringobject.h
[0] Fix | Delete
/* String (str/bytes) object interface */
[1] Fix | Delete
[2] Fix | Delete
#ifndef Py_STRINGOBJECT_H
[3] Fix | Delete
#define Py_STRINGOBJECT_H
[4] Fix | Delete
#ifdef __cplusplus
[5] Fix | Delete
extern "C" {
[6] Fix | Delete
#endif
[7] Fix | Delete
[8] Fix | Delete
#include <stdarg.h>
[9] Fix | Delete
[10] Fix | Delete
/*
[11] Fix | Delete
Type PyStringObject represents a character string. An extra zero byte is
[12] Fix | Delete
reserved at the end to ensure it is zero-terminated, but a size is
[13] Fix | Delete
present so strings with null bytes in them can be represented. This
[14] Fix | Delete
is an immutable object type.
[15] Fix | Delete
[16] Fix | Delete
There are functions to create new string objects, to test
[17] Fix | Delete
an object for string-ness, and to get the
[18] Fix | Delete
string value. The latter function returns a null pointer
[19] Fix | Delete
if the object is not of the proper type.
[20] Fix | Delete
There is a variant that takes an explicit size as well as a
[21] Fix | Delete
variant that assumes a zero-terminated string. Note that none of the
[22] Fix | Delete
functions should be applied to nil objects.
[23] Fix | Delete
*/
[24] Fix | Delete
[25] Fix | Delete
/* Caching the hash (ob_shash) saves recalculation of a string's hash value.
[26] Fix | Delete
Interning strings (ob_sstate) tries to ensure that only one string
[27] Fix | Delete
object with a given value exists, so equality tests can be one pointer
[28] Fix | Delete
comparison. This is generally restricted to strings that "look like"
[29] Fix | Delete
Python identifiers, although the intern() builtin can be used to force
[30] Fix | Delete
interning of any string.
[31] Fix | Delete
Together, these sped the interpreter by up to 20%. */
[32] Fix | Delete
[33] Fix | Delete
typedef struct {
[34] Fix | Delete
PyObject_VAR_HEAD
[35] Fix | Delete
long ob_shash;
[36] Fix | Delete
int ob_sstate;
[37] Fix | Delete
char ob_sval[1];
[38] Fix | Delete
[39] Fix | Delete
/* Invariants:
[40] Fix | Delete
* ob_sval contains space for 'ob_size+1' elements.
[41] Fix | Delete
* ob_sval[ob_size] == 0.
[42] Fix | Delete
* ob_shash is the hash of the string or -1 if not computed yet.
[43] Fix | Delete
* ob_sstate != 0 iff the string object is in stringobject.c's
[44] Fix | Delete
* 'interned' dictionary; in this case the two references
[45] Fix | Delete
* from 'interned' to this object are *not counted* in ob_refcnt.
[46] Fix | Delete
*/
[47] Fix | Delete
} PyStringObject;
[48] Fix | Delete
[49] Fix | Delete
#define SSTATE_NOT_INTERNED 0
[50] Fix | Delete
#define SSTATE_INTERNED_MORTAL 1
[51] Fix | Delete
#define SSTATE_INTERNED_IMMORTAL 2
[52] Fix | Delete
[53] Fix | Delete
PyAPI_DATA(PyTypeObject) PyBaseString_Type;
[54] Fix | Delete
PyAPI_DATA(PyTypeObject) PyString_Type;
[55] Fix | Delete
[56] Fix | Delete
#define PyString_Check(op) \
[57] Fix | Delete
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_STRING_SUBCLASS)
[58] Fix | Delete
#define PyString_CheckExact(op) (Py_TYPE(op) == &PyString_Type)
[59] Fix | Delete
[60] Fix | Delete
PyAPI_FUNC(PyObject *) PyString_FromStringAndSize(const char *, Py_ssize_t);
[61] Fix | Delete
PyAPI_FUNC(PyObject *) PyString_FromString(const char *);
[62] Fix | Delete
PyAPI_FUNC(PyObject *) PyString_FromFormatV(const char*, va_list)
[63] Fix | Delete
Py_GCC_ATTRIBUTE((format(printf, 1, 0)));
[64] Fix | Delete
PyAPI_FUNC(PyObject *) PyString_FromFormat(const char*, ...)
[65] Fix | Delete
Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
[66] Fix | Delete
PyAPI_FUNC(Py_ssize_t) PyString_Size(PyObject *);
[67] Fix | Delete
PyAPI_FUNC(char *) PyString_AsString(PyObject *);
[68] Fix | Delete
PyAPI_FUNC(PyObject *) PyString_Repr(PyObject *, int);
[69] Fix | Delete
PyAPI_FUNC(void) PyString_Concat(PyObject **, PyObject *);
[70] Fix | Delete
PyAPI_FUNC(void) PyString_ConcatAndDel(PyObject **, PyObject *);
[71] Fix | Delete
PyAPI_FUNC(int) _PyString_Resize(PyObject **, Py_ssize_t);
[72] Fix | Delete
PyAPI_FUNC(int) _PyString_Eq(PyObject *, PyObject*);
[73] Fix | Delete
PyAPI_FUNC(PyObject *) PyString_Format(PyObject *, PyObject *);
[74] Fix | Delete
PyAPI_FUNC(PyObject *) _PyString_FormatLong(PyObject*, int, int,
[75] Fix | Delete
int, char**, int*);
[76] Fix | Delete
PyAPI_FUNC(PyObject *) PyString_DecodeEscape(const char *, Py_ssize_t,
[77] Fix | Delete
const char *, Py_ssize_t,
[78] Fix | Delete
const char *);
[79] Fix | Delete
[80] Fix | Delete
PyAPI_FUNC(void) PyString_InternInPlace(PyObject **);
[81] Fix | Delete
PyAPI_FUNC(void) PyString_InternImmortal(PyObject **);
[82] Fix | Delete
PyAPI_FUNC(PyObject *) PyString_InternFromString(const char *);
[83] Fix | Delete
PyAPI_FUNC(void) _Py_ReleaseInternedStrings(void);
[84] Fix | Delete
[85] Fix | Delete
/* Use only if you know it's a string */
[86] Fix | Delete
#define PyString_CHECK_INTERNED(op) (((PyStringObject *)(op))->ob_sstate)
[87] Fix | Delete
[88] Fix | Delete
/* Macro, trading safety for speed */
[89] Fix | Delete
#define PyString_AS_STRING(op) (((PyStringObject *)(op))->ob_sval)
[90] Fix | Delete
#define PyString_GET_SIZE(op) Py_SIZE(op)
[91] Fix | Delete
[92] Fix | Delete
/* _PyString_Join(sep, x) is like sep.join(x). sep must be PyStringObject*,
[93] Fix | Delete
x must be an iterable object. */
[94] Fix | Delete
PyAPI_FUNC(PyObject *) _PyString_Join(PyObject *sep, PyObject *x);
[95] Fix | Delete
[96] Fix | Delete
/* --- Generic Codecs ----------------------------------------------------- */
[97] Fix | Delete
[98] Fix | Delete
/* Create an object by decoding the encoded string s of the
[99] Fix | Delete
given size. */
[100] Fix | Delete
[101] Fix | Delete
PyAPI_FUNC(PyObject*) PyString_Decode(
[102] Fix | Delete
const char *s, /* encoded string */
[103] Fix | Delete
Py_ssize_t size, /* size of buffer */
[104] Fix | Delete
const char *encoding, /* encoding */
[105] Fix | Delete
const char *errors /* error handling */
[106] Fix | Delete
);
[107] Fix | Delete
[108] Fix | Delete
/* Encodes a char buffer of the given size and returns a
[109] Fix | Delete
Python object. */
[110] Fix | Delete
[111] Fix | Delete
PyAPI_FUNC(PyObject*) PyString_Encode(
[112] Fix | Delete
const char *s, /* string char buffer */
[113] Fix | Delete
Py_ssize_t size, /* number of chars to encode */
[114] Fix | Delete
const char *encoding, /* encoding */
[115] Fix | Delete
const char *errors /* error handling */
[116] Fix | Delete
);
[117] Fix | Delete
[118] Fix | Delete
/* Encodes a string object and returns the result as Python
[119] Fix | Delete
object. */
[120] Fix | Delete
[121] Fix | Delete
PyAPI_FUNC(PyObject*) PyString_AsEncodedObject(
[122] Fix | Delete
PyObject *str, /* string object */
[123] Fix | Delete
const char *encoding, /* encoding */
[124] Fix | Delete
const char *errors /* error handling */
[125] Fix | Delete
);
[126] Fix | Delete
[127] Fix | Delete
/* Encodes a string object and returns the result as Python string
[128] Fix | Delete
object.
[129] Fix | Delete
[130] Fix | Delete
If the codec returns a Unicode object, the object is converted
[131] Fix | Delete
back to a string using the default encoding.
[132] Fix | Delete
[133] Fix | Delete
DEPRECATED - use PyString_AsEncodedObject() instead. */
[134] Fix | Delete
[135] Fix | Delete
PyAPI_FUNC(PyObject*) PyString_AsEncodedString(
[136] Fix | Delete
PyObject *str, /* string object */
[137] Fix | Delete
const char *encoding, /* encoding */
[138] Fix | Delete
const char *errors /* error handling */
[139] Fix | Delete
);
[140] Fix | Delete
[141] Fix | Delete
/* Decodes a string object and returns the result as Python
[142] Fix | Delete
object. */
[143] Fix | Delete
[144] Fix | Delete
PyAPI_FUNC(PyObject*) PyString_AsDecodedObject(
[145] Fix | Delete
PyObject *str, /* string object */
[146] Fix | Delete
const char *encoding, /* encoding */
[147] Fix | Delete
const char *errors /* error handling */
[148] Fix | Delete
);
[149] Fix | Delete
[150] Fix | Delete
/* Decodes a string object and returns the result as Python string
[151] Fix | Delete
object.
[152] Fix | Delete
[153] Fix | Delete
If the codec returns a Unicode object, the object is converted
[154] Fix | Delete
back to a string using the default encoding.
[155] Fix | Delete
[156] Fix | Delete
DEPRECATED - use PyString_AsDecodedObject() instead. */
[157] Fix | Delete
[158] Fix | Delete
PyAPI_FUNC(PyObject*) PyString_AsDecodedString(
[159] Fix | Delete
PyObject *str, /* string object */
[160] Fix | Delete
const char *encoding, /* encoding */
[161] Fix | Delete
const char *errors /* error handling */
[162] Fix | Delete
);
[163] Fix | Delete
[164] Fix | Delete
/* Provides access to the internal data buffer and size of a string
[165] Fix | Delete
object or the default encoded version of a Unicode object. Passing
[166] Fix | Delete
NULL as *len parameter will force the string buffer to be
[167] Fix | Delete
0-terminated (passing a string with embedded NULL characters will
[168] Fix | Delete
cause an exception). */
[169] Fix | Delete
[170] Fix | Delete
PyAPI_FUNC(int) PyString_AsStringAndSize(
[171] Fix | Delete
register PyObject *obj, /* string or Unicode object */
[172] Fix | Delete
register char **s, /* pointer to buffer variable */
[173] Fix | Delete
register Py_ssize_t *len /* pointer to length variable or NULL
[174] Fix | Delete
(only possible for 0-terminated
[175] Fix | Delete
strings) */
[176] Fix | Delete
);
[177] Fix | Delete
[178] Fix | Delete
[179] Fix | Delete
/* Using the current locale, insert the thousands grouping
[180] Fix | Delete
into the string pointed to by buffer. For the argument descriptions,
[181] Fix | Delete
see Objects/stringlib/localeutil.h */
[182] Fix | Delete
PyAPI_FUNC(Py_ssize_t) _PyString_InsertThousandsGroupingLocale(char *buffer,
[183] Fix | Delete
Py_ssize_t n_buffer,
[184] Fix | Delete
char *digits,
[185] Fix | Delete
Py_ssize_t n_digits,
[186] Fix | Delete
Py_ssize_t min_width);
[187] Fix | Delete
[188] Fix | Delete
/* Using explicit passed-in values, insert the thousands grouping
[189] Fix | Delete
into the string pointed to by buffer. For the argument descriptions,
[190] Fix | Delete
see Objects/stringlib/localeutil.h */
[191] Fix | Delete
PyAPI_FUNC(Py_ssize_t) _PyString_InsertThousandsGrouping(char *buffer,
[192] Fix | Delete
Py_ssize_t n_buffer,
[193] Fix | Delete
char *digits,
[194] Fix | Delete
Py_ssize_t n_digits,
[195] Fix | Delete
Py_ssize_t min_width,
[196] Fix | Delete
const char *grouping,
[197] Fix | Delete
const char *thousands_sep);
[198] Fix | Delete
[199] Fix | Delete
/* Format the object based on the format_spec, as defined in PEP 3101
[200] Fix | Delete
(Advanced String Formatting). */
[201] Fix | Delete
PyAPI_FUNC(PyObject *) _PyBytes_FormatAdvanced(PyObject *obj,
[202] Fix | Delete
char *format_spec,
[203] Fix | Delete
Py_ssize_t format_spec_len);
[204] Fix | Delete
[205] Fix | Delete
PyAPI_FUNC(void) _PyString_DebugMallocStats(FILE *out);
[206] Fix | Delete
[207] Fix | Delete
#ifdef __cplusplus
[208] Fix | Delete
}
[209] Fix | Delete
#endif
[210] Fix | Delete
#endif /* !Py_STRINGOBJECT_H */
[211] Fix | Delete
[212] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function