Path: blob/main/Include/internal/pycore_bytes_methods.h
12 views
#ifndef Py_LIMITED_API1#ifndef Py_BYTES_CTYPE_H2#define Py_BYTES_CTYPE_H34#ifndef Py_BUILD_CORE5# error "this header requires Py_BUILD_CORE define"6#endif78/*9* The internal implementation behind PyBytes (bytes) and PyByteArray (bytearray)10* methods of the given names, they operate on ASCII byte strings.11*/12extern PyObject* _Py_bytes_isspace(const char *cptr, Py_ssize_t len);13extern PyObject* _Py_bytes_isalpha(const char *cptr, Py_ssize_t len);14extern PyObject* _Py_bytes_isalnum(const char *cptr, Py_ssize_t len);15extern PyObject* _Py_bytes_isascii(const char *cptr, Py_ssize_t len);16extern PyObject* _Py_bytes_isdigit(const char *cptr, Py_ssize_t len);17extern PyObject* _Py_bytes_islower(const char *cptr, Py_ssize_t len);18extern PyObject* _Py_bytes_isupper(const char *cptr, Py_ssize_t len);19extern PyObject* _Py_bytes_istitle(const char *cptr, Py_ssize_t len);2021/* These store their len sized answer in the given preallocated *result arg. */22extern void _Py_bytes_lower(char *result, const char *cptr, Py_ssize_t len);23extern void _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len);24extern void _Py_bytes_title(char *result, const char *s, Py_ssize_t len);25extern void _Py_bytes_capitalize(char *result, const char *s, Py_ssize_t len);26extern void _Py_bytes_swapcase(char *result, const char *s, Py_ssize_t len);2728extern PyObject *_Py_bytes_find(const char *str, Py_ssize_t len, PyObject *args);29extern PyObject *_Py_bytes_index(const char *str, Py_ssize_t len, PyObject *args);30extern PyObject *_Py_bytes_rfind(const char *str, Py_ssize_t len, PyObject *args);31extern PyObject *_Py_bytes_rindex(const char *str, Py_ssize_t len, PyObject *args);32extern PyObject *_Py_bytes_count(const char *str, Py_ssize_t len, PyObject *args);33extern int _Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg);34extern PyObject *_Py_bytes_startswith(const char *str, Py_ssize_t len, PyObject *args);35extern PyObject *_Py_bytes_endswith(const char *str, Py_ssize_t len, PyObject *args);3637/* The maketrans() static method. */38extern PyObject* _Py_bytes_maketrans(Py_buffer *frm, Py_buffer *to);3940/* Shared __doc__ strings. */41extern const char _Py_isspace__doc__[];42extern const char _Py_isalpha__doc__[];43extern const char _Py_isalnum__doc__[];44extern const char _Py_isascii__doc__[];45extern const char _Py_isdigit__doc__[];46extern const char _Py_islower__doc__[];47extern const char _Py_isupper__doc__[];48extern const char _Py_istitle__doc__[];49extern const char _Py_lower__doc__[];50extern const char _Py_upper__doc__[];51extern const char _Py_title__doc__[];52extern const char _Py_capitalize__doc__[];53extern const char _Py_swapcase__doc__[];54extern const char _Py_count__doc__[];55extern const char _Py_find__doc__[];56extern const char _Py_index__doc__[];57extern const char _Py_rfind__doc__[];58extern const char _Py_rindex__doc__[];59extern const char _Py_startswith__doc__[];60extern const char _Py_endswith__doc__[];61extern const char _Py_maketrans__doc__[];62extern const char _Py_expandtabs__doc__[];63extern const char _Py_ljust__doc__[];64extern const char _Py_rjust__doc__[];65extern const char _Py_center__doc__[];66extern const char _Py_zfill__doc__[];6768/* this is needed because some docs are shared from the .o, not static */69#define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str)7071#endif /* !Py_BYTES_CTYPE_H */72#endif /* !Py_LIMITED_API */737475