Skip to content

Instantly share code, notes, and snippets.

@dmilith
Created January 7, 2024 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmilith/2d64a90aca7b149002e6d8a1ad88f207 to your computer and use it in GitHub Desktop.
Save dmilith/2d64a90aca7b149002e6d8a1ad88f207 to your computer and use it in GitHub Desktop.
token-7986e1.c
This file has been truncated, but you can view the full file.
# 1 "<built-in>"
# 1 "Parser/token.c"
/* Auto-generated by Tools/build/generate_token.py */
#if 0 /* expanded by -frewrite-includes */
#include "Python.h"
#endif /* expanded by -frewrite-includes */
# 3 "Parser/token.c"
# 1 "./Include/Python.h" 1
// Entry point of the Python C API.
// C extensions should only #include <Python.h>, and not include directly
// the other Python header files included by <Python.h>.
#ifndef Py_PYTHON_H
#define Py_PYTHON_H
// Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" {
// Include Python header files
#if 0 /* expanded by -frewrite-includes */
#include "patchlevel.h"
#endif /* expanded by -frewrite-includes */
# 11 "./Include/Python.h"
# 1 "./Include/patchlevel.h" 1
/* Python version identification scheme.
When the major or minor version changes, the VERSION variable in
configure.ac must also be changed.
There is also (independent) API version information in modsupport.h.
*/
/* Values for PY_RELEASE_LEVEL */
#define PY_RELEASE_LEVEL_ALPHA 0xA
#define PY_RELEASE_LEVEL_BETA 0xB
#define PY_RELEASE_LEVEL_GAMMA 0xC /* For release candidates */
#define PY_RELEASE_LEVEL_FINAL 0xF /* Serial should be 0 here */
/* Higher for patch releases */
/* Version parsed out into numeric values */
/*--start constants--*/
#define PY_MAJOR_VERSION 3
#define PY_MINOR_VERSION 12
#define PY_MICRO_VERSION 1
#define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL
#define PY_RELEASE_SERIAL 0
/* Version as a string */
#define PY_VERSION "3.12.1"
/*--end constants--*/
/* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
Use this for numeric comparisons, e.g. #if PY_VERSION_HEX >= ... */
#define PY_VERSION_HEX ((PY_MAJOR_VERSION << 24) | \
(PY_MINOR_VERSION << 16) | \
(PY_MICRO_VERSION << 8) | \
(PY_RELEASE_LEVEL << 4) | \
(PY_RELEASE_SERIAL << 0))
# 12 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pyconfig.h"
#endif /* expanded by -frewrite-includes */
# 12 "./Include/Python.h"
# 1 "./pyconfig.h" 1
/* pyconfig.h. Generated from pyconfig.h.in by configure. */
/* pyconfig.h.in. Generated from configure.ac by autoheader. */
#ifndef Py_PYCONFIG_H
#define Py_PYCONFIG_H
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* BUILD_GNU_TYPE + AIX_BUILDDATE are used to construct the PEP425 tag of the
build system. */
/* #undef AIX_BUILDDATE */
/* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want
support for AIX C++ shared extension modules. */
/* #undef AIX_GENUINE_CPLUSPLUS */
/* The normal alignment of `long', in bytes. */
#define ALIGNOF_LONG 8
/* The normal alignment of `max_align_t', in bytes. */
#define ALIGNOF_MAX_ALIGN_T 16
/* The normal alignment of `size_t', in bytes. */
#define ALIGNOF_SIZE_T 8
/* Alternative SOABI used in debug build to load C extensions built in release
mode */
/* #undef ALT_SOABI */
/* The Android API level. */
/* #undef ANDROID_API_LEVEL */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
mixed-endian order (byte order 45670123) */
/* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most
significant byte first */
/* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
least significant byte first */
#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
/* Define if --enable-ipv6 is specified */
#define ENABLE_IPV6 1
/* Define to 1 if your system stores words within floats with the most
significant word first */
/* #undef FLOAT_WORDS_BIGENDIAN */
/* Define if getpgrp() must be called as getpgrp(0). */
/* #undef GETPGRP_HAVE_ARG */
/* Define if you have the 'accept' function. */
#define HAVE_ACCEPT 1
/* Define to 1 if you have the `accept4' function. */
#define HAVE_ACCEPT4 1
/* Define to 1 if you have the `acosh' function. */
#define HAVE_ACOSH 1
/* struct addrinfo (netdb.h) */
#define HAVE_ADDRINFO 1
/* Define to 1 if you have the `alarm' function. */
#define HAVE_ALARM 1
/* Define if aligned memory access is required */
/* #undef HAVE_ALIGNED_REQUIRED */
/* Define to 1 if you have the <alloca.h> header file. */
/* #undef HAVE_ALLOCA_H */
/* Define this if your time.h defines altzone. */
/* #undef HAVE_ALTZONE */
/* Define to 1 if you have the `asinh' function. */
#define HAVE_ASINH 1
/* Define to 1 if you have the <asm/types.h> header file. */
/* #undef HAVE_ASM_TYPES_H */
/* Define to 1 if you have the `atanh' function. */
#define HAVE_ATANH 1
/* Define if you have the 'bind' function. */
#define HAVE_BIND 1
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
/* Define to 1 if you have the <bluetooth/bluetooth.h> header file. */
/* #undef HAVE_BLUETOOTH_BLUETOOTH_H */
/* Define to 1 if you have the <bluetooth.h> header file. */
#define HAVE_BLUETOOTH_H 1
/* Define if mbstowcs(NULL, "text", 0) does not return the number of wide
chars that would be converted. */
/* #undef HAVE_BROKEN_MBSTOWCS */
/* Define if nice() returns success/failure instead of the new priority. */
#define HAVE_BROKEN_NICE 1
/* Define if the system reports an invalid PIPE_BUF value. */
/* #undef HAVE_BROKEN_PIPE_BUF */
/* Define if poll() sets errno on invalid file descriptors. */
/* #undef HAVE_BROKEN_POLL */
/* Define if the Posix semaphores do not work on your system */
/* #undef HAVE_BROKEN_POSIX_SEMAPHORES */
/* Define if pthread_sigmask() does not work on your system. */
/* #undef HAVE_BROKEN_PTHREAD_SIGMASK */
/* define to 1 if your sem_getvalue is broken. */
/* #undef HAVE_BROKEN_SEM_GETVALUE */
/* Define if 'unsetenv' does not return an int. */
/* #undef HAVE_BROKEN_UNSETENV */
/* Has builtin __atomic_load_n() and __atomic_store_n() functions */
#define HAVE_BUILTIN_ATOMIC 1
/* Define to 1 if you have the <bzlib.h> header file. */
#define HAVE_BZLIB_H 1
/* Define to 1 if you have the 'chflags' function. */
#define HAVE_CHFLAGS 1
/* Define to 1 if you have the `chmod' function. */
#define HAVE_CHMOD 1
/* Define to 1 if you have the `chown' function. */
#define HAVE_CHOWN 1
/* Define if you have the 'chroot' function. */
#define HAVE_CHROOT 1
/* Define to 1 if you have the `clock' function. */
#define HAVE_CLOCK 1
/* Define to 1 if you have the `clock_getres' function. */
#define HAVE_CLOCK_GETRES 1
/* Define to 1 if you have the `clock_gettime' function. */
#define HAVE_CLOCK_GETTIME 1
/* Define to 1 if you have the `clock_nanosleep' function. */
#define HAVE_CLOCK_NANOSLEEP 1
/* Define to 1 if you have the `clock_settime' function. */
#define HAVE_CLOCK_SETTIME 1
/* Define to 1 if you have the `close_range' function. */
#define HAVE_CLOSE_RANGE 1
/* Define if the C compiler supports computed gotos. */
#define HAVE_COMPUTED_GOTOS 1
/* Define to 1 if you have the `confstr' function. */
#define HAVE_CONFSTR 1
/* Define to 1 if you have the <conio.h> header file. */
/* #undef HAVE_CONIO_H */
/* Define if you have the 'connect' function. */
#define HAVE_CONNECT 1
/* Define to 1 if you have the `copy_file_range' function. */
#define HAVE_COPY_FILE_RANGE 1
/* Define to 1 if you have the <crypt.h> header file. */
/* #undef HAVE_CRYPT_H */
/* Define if you have the crypt_r() function. */
#define HAVE_CRYPT_R 1
/* Define to 1 if you have the `ctermid' function. */
#define HAVE_CTERMID 1
/* Define if you have the 'ctermid_r' function. */
#define HAVE_CTERMID_R 1
/* Define if you have the 'filter' function. */
#define HAVE_CURSES_FILTER 1
/* Define to 1 if you have the <curses.h> header file. */
#define HAVE_CURSES_H 1
/* Define if you have the 'has_key' function. */
#define HAVE_CURSES_HAS_KEY 1
/* Define if you have the 'immedok' function. */
#define HAVE_CURSES_IMMEDOK 1
/* Define if you have the 'is_pad' function. */
#define HAVE_CURSES_IS_PAD 1
/* Define if you have the 'is_term_resized' function. */
#define HAVE_CURSES_IS_TERM_RESIZED 1
/* Define if you have the 'resizeterm' function. */
#define HAVE_CURSES_RESIZETERM 1
/* Define if you have the 'resize_term' function. */
#define HAVE_CURSES_RESIZE_TERM 1
/* Define if you have the 'syncok' function. */
#define HAVE_CURSES_SYNCOK 1
/* Define if you have the 'typeahead' function. */
#define HAVE_CURSES_TYPEAHEAD 1
/* Define if you have the 'use_env' function. */
#define HAVE_CURSES_USE_ENV 1
/* Define if you have the 'wchgat' function. */
#define HAVE_CURSES_WCHGAT 1
/* Define to 1 if you have the <db.h> header file. */
#define HAVE_DB_H 1
/* Define to 1 if you have the declaration of `RTLD_DEEPBIND', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_DEEPBIND 1
/* Define to 1 if you have the declaration of `RTLD_GLOBAL', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_GLOBAL 1
/* Define to 1 if you have the declaration of `RTLD_LAZY', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_LAZY 1
/* Define to 1 if you have the declaration of `RTLD_LOCAL', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_LOCAL 1
/* Define to 1 if you have the declaration of `RTLD_MEMBER', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_MEMBER 0
/* Define to 1 if you have the declaration of `RTLD_NODELETE', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_NODELETE 1
/* Define to 1 if you have the declaration of `RTLD_NOLOAD', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_NOLOAD 1
/* Define to 1 if you have the declaration of `RTLD_NOW', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_NOW 1
/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
*/
/* #undef HAVE_DECL_TZNAME */
/* Define to 1 if you have the device macros. */
#define HAVE_DEVICE_MACROS 1
/* Define to 1 if you have the /dev/ptc device file. */
/* #undef HAVE_DEV_PTC */
/* Define to 1 if you have the /dev/ptmx device file. */
/* #undef HAVE_DEV_PTMX */
/* Define to 1 if you have the <direct.h> header file. */
/* #undef HAVE_DIRECT_H */
/* Define to 1 if the dirent structure has a d_type field */
#define HAVE_DIRENT_D_TYPE 1
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define if you have the 'dirfd' function or macro. */
#define HAVE_DIRFD 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the `dlopen' function. */
#define HAVE_DLOPEN 1
/* Define to 1 if you have the `dup' function. */
#define HAVE_DUP 1
/* Define to 1 if you have the `dup2' function. */
#define HAVE_DUP2 1
/* Define to 1 if you have the `dup3' function. */
#define HAVE_DUP3 1
/* Define if you have the '_dyld_shared_cache_contains_path' function. */
/* #undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH */
/* Defined when any dynamic module loading is enabled. */
#define HAVE_DYNAMIC_LOADING 1
/* Define to 1 if you have the <editline/readline.h> header file. */
/* #undef HAVE_EDITLINE_READLINE_H */
/* Define to 1 if you have the <endian.h> header file. */
#define HAVE_ENDIAN_H 1
/* Define if you have the 'epoll_create' function. */
/* #undef HAVE_EPOLL */
/* Define if you have the 'epoll_create1' function. */
/* #undef HAVE_EPOLL_CREATE1 */
/* Define to 1 if you have the `erf' function. */
#define HAVE_ERF 1
/* Define to 1 if you have the `erfc' function. */
#define HAVE_ERFC 1
/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
/* Define if you have the 'eventfd' function. */
#define HAVE_EVENTFD 1
/* Define to 1 if you have the `execv' function. */
#define HAVE_EXECV 1
/* Define to 1 if you have the `explicit_bzero' function. */
#define HAVE_EXPLICIT_BZERO 1
/* Define to 1 if you have the `explicit_memset' function. */
/* #undef HAVE_EXPLICIT_MEMSET */
/* Define to 1 if you have the `expm1' function. */
#define HAVE_EXPM1 1
/* Define to 1 if you have the `faccessat' function. */
#define HAVE_FACCESSAT 1
/* Define if you have the 'fchdir' function. */
#define HAVE_FCHDIR 1
/* Define to 1 if you have the `fchmod' function. */
#define HAVE_FCHMOD 1
/* Define to 1 if you have the `fchmodat' function. */
#define HAVE_FCHMODAT 1
/* Define to 1 if you have the `fchown' function. */
#define HAVE_FCHOWN 1
/* Define to 1 if you have the `fchownat' function. */
#define HAVE_FCHOWNAT 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define if you have the 'fdatasync' function. */
#define HAVE_FDATASYNC 1
/* Define to 1 if you have the `fdopendir' function. */
#define HAVE_FDOPENDIR 1
/* Define to 1 if you have the `fdwalk' function. */
/* #undef HAVE_FDWALK */
/* Define to 1 if you have the `fexecve' function. */
#define HAVE_FEXECVE 1
/* Define if you have the 'ffi_closure_alloc' function. */
#define HAVE_FFI_CLOSURE_ALLOC 1
/* Define if you have the 'ffi_prep_cif_var' function. */
#define HAVE_FFI_PREP_CIF_VAR 1
/* Define if you have the 'ffi_prep_closure_loc' function. */
#define HAVE_FFI_PREP_CLOSURE_LOC 1
/* Define to 1 if you have the `flock' function. */
#define HAVE_FLOCK 1
/* Define to 1 if you have the `fork' function. */
#define HAVE_FORK 1
/* Define to 1 if you have the `fork1' function. */
/* #undef HAVE_FORK1 */
/* Define to 1 if you have the `forkpty' function. */
#define HAVE_FORKPTY 1
/* Define to 1 if you have the `fpathconf' function. */
#define HAVE_FPATHCONF 1
/* Define to 1 if you have the `fseek64' function. */
/* #undef HAVE_FSEEK64 */
/* Define to 1 if you have the `fseeko' function. */
#define HAVE_FSEEKO 1
/* Define to 1 if you have the `fstatat' function. */
#define HAVE_FSTATAT 1
/* Define to 1 if you have the `fstatvfs' function. */
#define HAVE_FSTATVFS 1
/* Define if you have the 'fsync' function. */
#define HAVE_FSYNC 1
/* Define to 1 if you have the `ftell64' function. */
/* #undef HAVE_FTELL64 */
/* Define to 1 if you have the `ftello' function. */
#define HAVE_FTELLO 1
/* Define to 1 if you have the `ftime' function. */
/* #undef HAVE_FTIME */
/* Define to 1 if you have the `ftruncate' function. */
#define HAVE_FTRUNCATE 1
/* Define to 1 if you have the `futimens' function. */
#define HAVE_FUTIMENS 1
/* Define to 1 if you have the `futimes' function. */
#define HAVE_FUTIMES 1
/* Define to 1 if you have the `futimesat' function. */
#define HAVE_FUTIMESAT 1
/* Define to 1 if you have the `gai_strerror' function. */
#define HAVE_GAI_STRERROR 1
/* Define if we can use gcc inline assembler to get and set mc68881 fpcr */
/* #undef HAVE_GCC_ASM_FOR_MC68881 */
/* Define if we can use x64 gcc inline assembler */
/* #undef HAVE_GCC_ASM_FOR_X64 */
/* Define if we can use gcc inline assembler to get and set x87 control word
*/
/* #undef HAVE_GCC_ASM_FOR_X87 */
/* Define if your compiler provides __uint128_t */
#define HAVE_GCC_UINT128_T 1
/* Define to 1 if you have the <gdbm-ndbm.h> header file. */
/* #undef HAVE_GDBM_DASH_NDBM_H */
/* Define to 1 if you have the <gdbm.h> header file. */
/* #undef HAVE_GDBM_H */
/* Define to 1 if you have the <gdbm/ndbm.h> header file. */
/* #undef HAVE_GDBM_NDBM_H */
/* Define if you have the getaddrinfo function. */
#define HAVE_GETADDRINFO 1
/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
#define HAVE_GETC_UNLOCKED 1
/* Define to 1 if you have the `getegid' function. */
#define HAVE_GETEGID 1
/* Define to 1 if you have the `getentropy' function. */
#define HAVE_GETENTROPY 1
/* Define to 1 if you have the `geteuid' function. */
#define HAVE_GETEUID 1
/* Define to 1 if you have the `getgid' function. */
#define HAVE_GETGID 1
/* Define to 1 if you have the `getgrgid' function. */
#define HAVE_GETGRGID 1
/* Define to 1 if you have the `getgrgid_r' function. */
#define HAVE_GETGRGID_R 1
/* Define to 1 if you have the `getgrnam_r' function. */
#define HAVE_GETGRNAM_R 1
/* Define to 1 if you have the `getgrouplist' function. */
#define HAVE_GETGROUPLIST 1
/* Define to 1 if you have the `getgroups' function. */
#define HAVE_GETGROUPS 1
/* Define if you have the 'gethostbyaddr' function. */
#define HAVE_GETHOSTBYADDR 1
/* Define to 1 if you have the `gethostbyname' function. */
#define HAVE_GETHOSTBYNAME 1
/* Define this if you have some version of gethostbyname_r() */
#define HAVE_GETHOSTBYNAME_R 1
/* Define this if you have the 3-arg version of gethostbyname_r(). */
/* #undef HAVE_GETHOSTBYNAME_R_3_ARG */
/* Define this if you have the 5-arg version of gethostbyname_r(). */
/* #undef HAVE_GETHOSTBYNAME_R_5_ARG */
/* Define this if you have the 6-arg version of gethostbyname_r(). */
#define HAVE_GETHOSTBYNAME_R_6_ARG 1
/* Define to 1 if you have the `gethostname' function. */
#define HAVE_GETHOSTNAME 1
/* Define to 1 if you have the `getitimer' function. */
#define HAVE_GETITIMER 1
/* Define to 1 if you have the `getloadavg' function. */
#define HAVE_GETLOADAVG 1
/* Define to 1 if you have the `getlogin' function. */
#define HAVE_GETLOGIN 1
/* Define to 1 if you have the `getnameinfo' function. */
#define HAVE_GETNAMEINFO 1
/* Define if you have the 'getpagesize' function. */
#define HAVE_GETPAGESIZE 1
/* Define if you have the 'getpeername' function. */
#define HAVE_GETPEERNAME 1
/* Define to 1 if you have the `getpgid' function. */
#define HAVE_GETPGID 1
/* Define to 1 if you have the `getpgrp' function. */
#define HAVE_GETPGRP 1
/* Define to 1 if you have the `getpid' function. */
#define HAVE_GETPID 1
/* Define to 1 if you have the `getppid' function. */
#define HAVE_GETPPID 1
/* Define to 1 if you have the `getpriority' function. */
#define HAVE_GETPRIORITY 1
/* Define if you have the 'getprotobyname' function. */
#define HAVE_GETPROTOBYNAME 1
/* Define to 1 if you have the `getpwent' function. */
#define HAVE_GETPWENT 1
/* Define to 1 if you have the `getpwnam_r' function. */
#define HAVE_GETPWNAM_R 1
/* Define to 1 if you have the `getpwuid' function. */
#define HAVE_GETPWUID 1
/* Define to 1 if you have the `getpwuid_r' function. */
#define HAVE_GETPWUID_R 1
/* Define to 1 if the getrandom() function is available */
#define HAVE_GETRANDOM 1
/* Define to 1 if the Linux getrandom() syscall is available */
/* #undef HAVE_GETRANDOM_SYSCALL */
/* Define to 1 if you have the `getresgid' function. */
#define HAVE_GETRESGID 1
/* Define to 1 if you have the `getresuid' function. */
#define HAVE_GETRESUID 1
/* Define to 1 if you have the `getrusage' function. */
#define HAVE_GETRUSAGE 1
/* Define if you have the 'getservbyname' function. */
#define HAVE_GETSERVBYNAME 1
/* Define if you have the 'getservbyport' function. */
#define HAVE_GETSERVBYPORT 1
/* Define to 1 if you have the `getsid' function. */
#define HAVE_GETSID 1
/* Define if you have the 'getsockname' function. */
#define HAVE_GETSOCKNAME 1
/* Define to 1 if you have the `getspent' function. */
/* #undef HAVE_GETSPENT */
/* Define to 1 if you have the `getspnam' function. */
/* #undef HAVE_GETSPNAM */
/* Define to 1 if you have the `getuid' function. */
#define HAVE_GETUID 1
/* Define to 1 if you have the `getwd' function. */
#define HAVE_GETWD 1
/* Define if glibc has incorrect _FORTIFY_SOURCE wrappers for memmove and
bcopy. */
/* #undef HAVE_GLIBC_MEMMOVE_BUG */
/* Define to 1 if you have the <grp.h> header file. */
#define HAVE_GRP_H 1
/* Define if you have the 'hstrerror' function. */
#define HAVE_HSTRERROR 1
/* Define this if you have le64toh() */
/* #undef HAVE_HTOLE64 */
/* Define to 1 if you have the <ieeefp.h> header file. */
#define HAVE_IEEEFP_H 1
/* Define to 1 if you have the `if_nameindex' function. */
#define HAVE_IF_NAMEINDEX 1
/* Define if you have the 'inet_aton' function. */
#define HAVE_INET_ATON 1
/* Define if you have the 'inet_ntoa' function. */
#define HAVE_INET_NTOA 1
/* Define if you have the 'inet_pton' function. */
#define HAVE_INET_PTON 1
/* Define to 1 if you have the `initgroups' function. */
#define HAVE_INITGROUPS 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <io.h> header file. */
/* #undef HAVE_IO_H */
/* Define if gcc has the ipa-pure-const bug. */
/* #undef HAVE_IPA_PURE_CONST_BUG */
/* Define to 1 if you have the `kill' function. */
#define HAVE_KILL 1
/* Define to 1 if you have the `killpg' function. */
#define HAVE_KILLPG 1
/* Define if you have the 'kqueue' function. */
#define HAVE_KQUEUE 1
/* Define to 1 if you have the <langinfo.h> header file. */
#define HAVE_LANGINFO_H 1
/* Defined to enable large file support when an off_t is bigger than a long
and long long is at least as big as an off_t. You may need to add some
flags for configuration and compilation to enable this mode. (For Solaris
and Linux, the necessary defines are already defined.) */
/* #undef HAVE_LARGEFILE_SUPPORT */
/* Define to 1 if you have the 'lchflags' function. */
#define HAVE_LCHFLAGS 1
/* Define to 1 if you have the `lchmod' function. */
#define HAVE_LCHMOD 1
/* Define to 1 if you have the `lchown' function. */
#define HAVE_LCHOWN 1
/* Define to 1 if you want to build _blake2 module with libb2 */
/* #undef HAVE_LIBB2 */
/* Define to 1 if you have the `db' library (-ldb). */
/* #undef HAVE_LIBDB */
/* Define to 1 if you have the `dl' library (-ldl). */
#define HAVE_LIBDL 1
/* Define to 1 if you have the `dld' library (-ldld). */
/* #undef HAVE_LIBDLD */
/* Define to 1 if you have the `ieee' library (-lieee). */
/* #undef HAVE_LIBIEEE */
/* Define to 1 if you have the <libintl.h> header file. */
#define HAVE_LIBINTL_H 1
/* Define to 1 if you have the `resolv' library (-lresolv). */
/* #undef HAVE_LIBRESOLV */
/* Define to 1 if you have the `sendfile' library (-lsendfile). */
/* #undef HAVE_LIBSENDFILE */
/* Define to 1 if you have the `sqlite3' library (-lsqlite3). */
#define HAVE_LIBSQLITE3 1
/* Define to 1 if you have the <libutil.h> header file. */
#define HAVE_LIBUTIL_H 1
/* Define if you have the 'link' function. */
#define HAVE_LINK 1
/* Define to 1 if you have the `linkat' function. */
#define HAVE_LINKAT 1
/* Define to 1 if you have the <linux/auxvec.h> header file. */
/* #undef HAVE_LINUX_AUXVEC_H */
/* Define to 1 if you have the <linux/can/bcm.h> header file. */
/* #undef HAVE_LINUX_CAN_BCM_H */
/* Define to 1 if you have the <linux/can.h> header file. */
/* #undef HAVE_LINUX_CAN_H */
/* Define to 1 if you have the <linux/can/j1939.h> header file. */
/* #undef HAVE_LINUX_CAN_J1939_H */
/* Define if compiling using Linux 3.6 or later. */
/* #undef HAVE_LINUX_CAN_RAW_FD_FRAMES */
/* Define to 1 if you have the <linux/can/raw.h> header file. */
/* #undef HAVE_LINUX_CAN_RAW_H */
/* Define if compiling using Linux 4.1 or later. */
/* #undef HAVE_LINUX_CAN_RAW_JOIN_FILTERS */
/* Define to 1 if you have the <linux/fs.h> header file. */
/* #undef HAVE_LINUX_FS_H */
/* Define to 1 if you have the <linux/limits.h> header file. */
/* #undef HAVE_LINUX_LIMITS_H */
/* Define to 1 if you have the <linux/memfd.h> header file. */
/* #undef HAVE_LINUX_MEMFD_H */
/* Define to 1 if you have the <linux/netlink.h> header file. */
/* #undef HAVE_LINUX_NETLINK_H */
/* Define to 1 if you have the <linux/qrtr.h> header file. */
/* #undef HAVE_LINUX_QRTR_H */
/* Define to 1 if you have the <linux/random.h> header file. */
/* #undef HAVE_LINUX_RANDOM_H */
/* Define to 1 if you have the <linux/soundcard.h> header file. */
/* #undef HAVE_LINUX_SOUNDCARD_H */
/* Define to 1 if you have the <linux/tipc.h> header file. */
/* #undef HAVE_LINUX_TIPC_H */
/* Define to 1 if you have the <linux/vm_sockets.h> header file. */
/* #undef HAVE_LINUX_VM_SOCKETS_H */
/* Define to 1 if you have the <linux/wait.h> header file. */
/* #undef HAVE_LINUX_WAIT_H */
/* Define if you have the 'listen' function. */
#define HAVE_LISTEN 1
/* Define to 1 if you have the `lockf' function. */
#define HAVE_LOCKF 1
/* Define to 1 if you have the `log1p' function. */
#define HAVE_LOG1P 1
/* Define to 1 if you have the `log2' function. */
#define HAVE_LOG2 1
/* Define to 1 if you have the `login_tty' function. */
#define HAVE_LOGIN_TTY 1
/* Define to 1 if the system has the type `long double'. */
#define HAVE_LONG_DOUBLE 1
/* Define to 1 if you have the `lstat' function. */
#define HAVE_LSTAT 1
/* Define to 1 if you have the `lutimes' function. */
#define HAVE_LUTIMES 1
/* Define to 1 if you have the <lzma.h> header file. */
/* #undef HAVE_LZMA_H */
/* Define to 1 if you have the `madvise' function. */
#define HAVE_MADVISE 1
/* Define this if you have the makedev macro. */
#define HAVE_MAKEDEV 1
/* Define to 1 if you have the `mbrtowc' function. */
#define HAVE_MBRTOWC 1
/* Define if you have the 'memfd_create' function. */
#define HAVE_MEMFD_CREATE 1
/* Define to 1 if you have the `memrchr' function. */
#define HAVE_MEMRCHR 1
/* Define to 1 if you have the <minix/config.h> header file. */
/* #undef HAVE_MINIX_CONFIG_H */
/* Define to 1 if you have the `mkdirat' function. */
#define HAVE_MKDIRAT 1
/* Define to 1 if you have the `mkfifo' function. */
#define HAVE_MKFIFO 1
/* Define to 1 if you have the `mkfifoat' function. */
#define HAVE_MKFIFOAT 1
/* Define to 1 if you have the `mknod' function. */
#define HAVE_MKNOD 1
/* Define to 1 if you have the `mknodat' function. */
#define HAVE_MKNODAT 1
/* Define to 1 if you have the `mktime' function. */
#define HAVE_MKTIME 1
/* Define to 1 if you have the `mmap' function. */
#define HAVE_MMAP 1
/* Define to 1 if you have the `mremap' function. */
/* #undef HAVE_MREMAP */
/* Define to 1 if you have the `nanosleep' function. */
#define HAVE_NANOSLEEP 1
/* Define to 1 if you have the `ncursesw' library. */
#define HAVE_NCURSESW 1
/* Define to 1 if you have the <ncurses.h> header file. */
#define HAVE_NCURSES_H 1
/* Define to 1 if you have the <ndbm.h> header file. */
#define HAVE_NDBM_H 1
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <netcan/can.h> header file. */
/* #undef HAVE_NETCAN_CAN_H */
/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* Define to 1 if you have the <netpacket/packet.h> header file. */
/* #undef HAVE_NETPACKET_PACKET_H */
/* Define to 1 if you have the <net/ethernet.h> header file. */
#define HAVE_NET_ETHERNET_H 1
/* Define to 1 if you have the <net/if.h> header file. */
#define HAVE_NET_IF_H 1
/* Define to 1 if you have the `nice' function. */
#define HAVE_NICE 1
/* Define if the internal form of wchar_t in non-Unicode locales is not
Unicode. */
/* #undef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION */
/* Define to 1 if you have the `openat' function. */
#define HAVE_OPENAT 1
/* Define to 1 if you have the `opendir' function. */
#define HAVE_OPENDIR 1
/* Define to 1 if you have the `openpty' function. */
#define HAVE_OPENPTY 1
/* Define to 1 if you have the <panel.h> header file. */
#define HAVE_PANEL_H 1
/* Define to 1 if you have the `pathconf' function. */
#define HAVE_PATHCONF 1
/* Define to 1 if you have the `pause' function. */
#define HAVE_PAUSE 1
/* Define to 1 if you have the `pipe' function. */
#define HAVE_PIPE 1
/* Define to 1 if you have the `pipe2' function. */
#define HAVE_PIPE2 1
/* Define to 1 if you have the `plock' function. */
/* #undef HAVE_PLOCK */
/* Define to 1 if you have the `poll' function. */
#define HAVE_POLL 1
/* Define to 1 if you have the <poll.h> header file. */
#define HAVE_POLL_H 1
/* Define to 1 if you have the `posix_fadvise' function. */
#define HAVE_POSIX_FADVISE 1
/* Define to 1 if you have the `posix_fallocate' function. */
#define HAVE_POSIX_FALLOCATE 1
/* Define to 1 if you have the `posix_spawn' function. */
#define HAVE_POSIX_SPAWN 1
/* Define to 1 if you have the `posix_spawnp' function. */
#define HAVE_POSIX_SPAWNP 1
/* Define to 1 if you have the `pread' function. */
#define HAVE_PREAD 1
/* Define to 1 if you have the `preadv' function. */
#define HAVE_PREADV 1
/* Define to 1 if you have the `preadv2' function. */
/* #undef HAVE_PREADV2 */
/* Define if you have the 'prlimit' function. */
/* #undef HAVE_PRLIMIT */
/* Define to 1 if you have the <process.h> header file. */
/* #undef HAVE_PROCESS_H */
/* Define if your compiler supports function prototype */
#define HAVE_PROTOTYPES 1
/* Define to 1 if you have the `pthread_condattr_setclock' function. */
#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
/* Defined for Solaris 2.6 bug in pthread header. */
/* #undef HAVE_PTHREAD_DESTRUCTOR */
/* Define to 1 if you have the `pthread_getcpuclockid' function. */
#define HAVE_PTHREAD_GETCPUCLOCKID 1
/* Define to 1 if you have the <pthread.h> header file. */
#define HAVE_PTHREAD_H 1
/* Define to 1 if you have the `pthread_init' function. */
/* #undef HAVE_PTHREAD_INIT */
/* Define to 1 if you have the `pthread_kill' function. */
#define HAVE_PTHREAD_KILL 1
/* Define to 1 if you have the `pthread_sigmask' function. */
#define HAVE_PTHREAD_SIGMASK 1
/* Define if platform requires stubbed pthreads support */
/* #undef HAVE_PTHREAD_STUBS */
/* Define to 1 if you have the <pty.h> header file. */
/* #undef HAVE_PTY_H */
/* Define to 1 if you have the `pwrite' function. */
#define HAVE_PWRITE 1
/* Define to 1 if you have the `pwritev' function. */
#define HAVE_PWRITEV 1
/* Define to 1 if you have the `pwritev2' function. */
/* #undef HAVE_PWRITEV2 */
/* Define to 1 if you have the <readline/readline.h> header file. */
/* #undef HAVE_READLINE_READLINE_H */
/* Define to 1 if you have the `readlink' function. */
#define HAVE_READLINK 1
/* Define to 1 if you have the `readlinkat' function. */
#define HAVE_READLINKAT 1
/* Define to 1 if you have the `readv' function. */
#define HAVE_READV 1
/* Define to 1 if you have the `realpath' function. */
#define HAVE_REALPATH 1
/* Define if you have the 'recvfrom' function. */
#define HAVE_RECVFROM 1
/* Define to 1 if you have the `renameat' function. */
#define HAVE_RENAMEAT 1
/* Define if readline supports append_history */
#define HAVE_RL_APPEND_HISTORY 1
/* Define if you can turn off readline's signal handling. */
#define HAVE_RL_CATCH_SIGNAL 1
/* Define if readline supports rl_compdisp_func_t */
#define HAVE_RL_COMPDISP_FUNC_T 1
/* Define if you have readline 2.2 */
#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1
/* Define if you have readline 4.0 */
#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1
/* Define if you have readline 4.2 */
#define HAVE_RL_COMPLETION_MATCHES 1
/* Define if you have rl_completion_suppress_append */
#define HAVE_RL_COMPLETION_SUPPRESS_APPEND 1
/* Define if you have readline 4.0 */
#define HAVE_RL_PRE_INPUT_HOOK 1
/* Define if you have readline 4.0 */
#define HAVE_RL_RESIZE_TERMINAL 1
/* Define to 1 if you have the <rpc/rpc.h> header file. */
#define HAVE_RPC_RPC_H 1
/* Define to 1 if you have the `rtpSpawn' function. */
/* #undef HAVE_RTPSPAWN */
/* Define to 1 if you have the `sched_get_priority_max' function. */
#define HAVE_SCHED_GET_PRIORITY_MAX 1
/* Define to 1 if you have the <sched.h> header file. */
#define HAVE_SCHED_H 1
/* Define to 1 if you have the `sched_rr_get_interval' function. */
#define HAVE_SCHED_RR_GET_INTERVAL 1
/* Define to 1 if you have the `sched_setaffinity' function. */
#define HAVE_SCHED_SETAFFINITY 1
/* Define to 1 if you have the `sched_setparam' function. */
#define HAVE_SCHED_SETPARAM 1
/* Define to 1 if you have the `sched_setscheduler' function. */
#define HAVE_SCHED_SETSCHEDULER 1
/* Define to 1 if you have the `sem_clockwait' function. */
/* #undef HAVE_SEM_CLOCKWAIT */
/* Define to 1 if you have the `sem_getvalue' function. */
#define HAVE_SEM_GETVALUE 1
/* Define to 1 if you have the `sem_open' function. */
#define HAVE_SEM_OPEN 1
/* Define to 1 if you have the `sem_timedwait' function. */
#define HAVE_SEM_TIMEDWAIT 1
/* Define to 1 if you have the `sem_unlink' function. */
#define HAVE_SEM_UNLINK 1
/* Define to 1 if you have the `sendfile' function. */
#define HAVE_SENDFILE 1
/* Define if you have the 'sendto' function. */
#define HAVE_SENDTO 1
/* Define to 1 if you have the `setegid' function. */
#define HAVE_SETEGID 1
/* Define to 1 if you have the `seteuid' function. */
#define HAVE_SETEUID 1
/* Define to 1 if you have the `setgid' function. */
#define HAVE_SETGID 1
/* Define if you have the 'setgroups' function. */
#define HAVE_SETGROUPS 1
/* Define to 1 if you have the `sethostname' function. */
#define HAVE_SETHOSTNAME 1
/* Define to 1 if you have the `setitimer' function. */
#define HAVE_SETITIMER 1
/* Define to 1 if you have the <setjmp.h> header file. */
#define HAVE_SETJMP_H 1
/* Define to 1 if you have the `setlocale' function. */
#define HAVE_SETLOCALE 1
/* Define to 1 if you have the `setns' function. */
/* #undef HAVE_SETNS */
/* Define to 1 if you have the `setpgid' function. */
#define HAVE_SETPGID 1
/* Define to 1 if you have the `setpgrp' function. */
#define HAVE_SETPGRP 1
/* Define to 1 if you have the `setpriority' function. */
#define HAVE_SETPRIORITY 1
/* Define to 1 if you have the `setregid' function. */
#define HAVE_SETREGID 1
/* Define to 1 if you have the `setresgid' function. */
#define HAVE_SETRESGID 1
/* Define to 1 if you have the `setresuid' function. */
#define HAVE_SETRESUID 1
/* Define to 1 if you have the `setreuid' function. */
#define HAVE_SETREUID 1
/* Define to 1 if you have the `setsid' function. */
#define HAVE_SETSID 1
/* Define if you have the 'setsockopt' function. */
#define HAVE_SETSOCKOPT 1
/* Define to 1 if you have the `setuid' function. */
#define HAVE_SETUID 1
/* Define to 1 if you have the `setvbuf' function. */
#define HAVE_SETVBUF 1
/* Define to 1 if you have the <shadow.h> header file. */
/* #undef HAVE_SHADOW_H */
/* Define to 1 if you have the `shm_open' function. */
#define HAVE_SHM_OPEN 1
/* Define to 1 if you have the `shm_unlink' function. */
#define HAVE_SHM_UNLINK 1
/* Define to 1 if you have the `shutdown' function. */
#define HAVE_SHUTDOWN 1
/* Define to 1 if you have the `sigaction' function. */
#define HAVE_SIGACTION 1
/* Define to 1 if you have the `sigaltstack' function. */
#define HAVE_SIGALTSTACK 1
/* Define to 1 if you have the `sigfillset' function. */
#define HAVE_SIGFILLSET 1
/* Define to 1 if `si_band' is a member of `siginfo_t'. */
#define HAVE_SIGINFO_T_SI_BAND 1
/* Define to 1 if you have the `siginterrupt' function. */
#define HAVE_SIGINTERRUPT 1
/* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1
/* Define to 1 if you have the `sigpending' function. */
#define HAVE_SIGPENDING 1
/* Define to 1 if you have the `sigrelse' function. */
#define HAVE_SIGRELSE 1
/* Define to 1 if you have the `sigtimedwait' function. */
#define HAVE_SIGTIMEDWAIT 1
/* Define to 1 if you have the `sigwait' function. */
#define HAVE_SIGWAIT 1
/* Define to 1 if you have the `sigwaitinfo' function. */
#define HAVE_SIGWAITINFO 1
/* Define to 1 if you have the `snprintf' function. */
#define HAVE_SNPRINTF 1
/* struct sockaddr_alg (linux/if_alg.h) */
/* #undef HAVE_SOCKADDR_ALG */
/* Define if sockaddr has sa_len member */
#define HAVE_SOCKADDR_SA_LEN 1
/* struct sockaddr_storage (sys/socket.h) */
#define HAVE_SOCKADDR_STORAGE 1
/* Define if you have the 'socket' function. */
#define HAVE_SOCKET 1
/* Define if you have the 'socketpair' function. */
#define HAVE_SOCKETPAIR 1
/* Define to 1 if you have the <spawn.h> header file. */
#define HAVE_SPAWN_H 1
/* Define to 1 if you have the `splice' function. */
/* #undef HAVE_SPLICE */
/* Define if your compiler provides ssize_t */
#define HAVE_SSIZE_T 1
/* Define to 1 if you have the `statvfs' function. */
#define HAVE_STATVFS 1
/* Define if you have struct stat.st_mtim.tv_nsec */
#define HAVE_STAT_TV_NSEC 1
/* Define if you have struct stat.st_mtimensec */
#define HAVE_STAT_TV_NSEC2 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Has stdatomic.h with atomic_int and atomic_uintptr_t */
#define HAVE_STD_ATOMIC 1
/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strlcpy' function. */
#define HAVE_STRLCPY 1
/* Define to 1 if you have the <stropts.h> header file. */
/* #undef HAVE_STROPTS_H */
/* Define to 1 if you have the `strsignal' function. */
#define HAVE_STRSIGNAL 1
/* Define to 1 if `pw_gecos' is a member of `struct passwd'. */
#define HAVE_STRUCT_PASSWD_PW_GECOS 1
/* Define to 1 if `pw_passwd' is a member of `struct passwd'. */
#define HAVE_STRUCT_PASSWD_PW_PASSWD 1
/* Define to 1 if `st_birthtime' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
/* Define to 1 if `st_blocks' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BLOCKS 1
/* Define to 1 if `st_flags' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_FLAGS 1
/* Define to 1 if `st_gen' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_GEN 1
/* Define to 1 if `st_rdev' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_RDEV 1
/* Define to 1 if `tm_zone' is a member of `struct tm'. */
#define HAVE_STRUCT_TM_TM_ZONE 1
/* Define if you have the 'symlink' function. */
#define HAVE_SYMLINK 1
/* Define to 1 if you have the `symlinkat' function. */
#define HAVE_SYMLINKAT 1
/* Define to 1 if you have the `sync' function. */
#define HAVE_SYNC 1
/* Define to 1 if you have the `sysconf' function. */
#define HAVE_SYSCONF 1
/* Define to 1 if you have the <sysexits.h> header file. */
#define HAVE_SYSEXITS_H 1
/* Define to 1 if you have the <syslog.h> header file. */
#define HAVE_SYSLOG_H 1
/* Define to 1 if you have the `system' function. */
#define HAVE_SYSTEM 1
/* Define to 1 if you have the <sys/audioio.h> header file. */
/* #undef HAVE_SYS_AUDIOIO_H */
/* Define to 1 if you have the <sys/auxv.h> header file. */
#define HAVE_SYS_AUXV_H 1
/* Define to 1 if you have the <sys/bsdtty.h> header file. */
/* #undef HAVE_SYS_BSDTTY_H */
/* Define to 1 if you have the <sys/devpoll.h> header file. */
/* #undef HAVE_SYS_DEVPOLL_H */
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/endian.h> header file. */
#define HAVE_SYS_ENDIAN_H 1
/* Define to 1 if you have the <sys/epoll.h> header file. */
/* #undef HAVE_SYS_EPOLL_H */
/* Define to 1 if you have the <sys/eventfd.h> header file. */
#define HAVE_SYS_EVENTFD_H 1
/* Define to 1 if you have the <sys/event.h> header file. */
#define HAVE_SYS_EVENT_H 1
/* Define to 1 if you have the <sys/file.h> header file. */
#define HAVE_SYS_FILE_H 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/kern_control.h> header file. */
/* #undef HAVE_SYS_KERN_CONTROL_H */
/* Define to 1 if you have the <sys/loadavg.h> header file. */
/* #undef HAVE_SYS_LOADAVG_H */
/* Define to 1 if you have the <sys/lock.h> header file. */
#define HAVE_SYS_LOCK_H 1
/* Define to 1 if you have the <sys/memfd.h> header file. */
/* #undef HAVE_SYS_MEMFD_H */
/* Define to 1 if you have the <sys/mkdev.h> header file. */
/* #undef HAVE_SYS_MKDEV_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the <sys/modem.h> header file. */
/* #undef HAVE_SYS_MODEM_H */
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/poll.h> header file. */
#define HAVE_SYS_POLL_H 1
/* Define to 1 if you have the <sys/random.h> header file. */
#define HAVE_SYS_RANDOM_H 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/sendfile.h> header file. */
/* #undef HAVE_SYS_SENDFILE_H */
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/soundcard.h> header file. */
#define HAVE_SYS_SOUNDCARD_H 1
/* Define to 1 if you have the <sys/statvfs.h> header file. */
#define HAVE_SYS_STATVFS_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/syscall.h> header file. */
#define HAVE_SYS_SYSCALL_H 1
/* Define to 1 if you have the <sys/sysmacros.h> header file. */
/* #undef HAVE_SYS_SYSMACROS_H */
/* Define to 1 if you have the <sys/sys_domain.h> header file. */
/* #undef HAVE_SYS_SYS_DOMAIN_H */
/* Define to 1 if you have the <sys/termio.h> header file. */
/* #undef HAVE_SYS_TERMIO_H */
/* Define to 1 if you have the <sys/times.h> header file. */
#define HAVE_SYS_TIMES_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
#define HAVE_SYS_UIO_H 1
/* Define to 1 if you have the <sys/un.h> header file. */
#define HAVE_SYS_UN_H 1
/* Define to 1 if you have the <sys/utsname.h> header file. */
#define HAVE_SYS_UTSNAME_H 1
/* Define to 1 if you have the <sys/wait.h> header file. */
#define HAVE_SYS_WAIT_H 1
/* Define to 1 if you have the <sys/xattr.h> header file. */
/* #undef HAVE_SYS_XATTR_H */
/* Define to 1 if you have the `tcgetpgrp' function. */
#define HAVE_TCGETPGRP 1
/* Define to 1 if you have the `tcsetpgrp' function. */
#define HAVE_TCSETPGRP 1
/* Define to 1 if you have the `tempnam' function. */
#define HAVE_TEMPNAM 1
/* Define to 1 if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1
/* Define to 1 if you have the <term.h> header file. */
#define HAVE_TERM_H 1
/* Define to 1 if you have the `timegm' function. */
#define HAVE_TIMEGM 1
/* Define to 1 if you have the `times' function. */
#define HAVE_TIMES 1
/* Define to 1 if you have the `tmpfile' function. */
#define HAVE_TMPFILE 1
/* Define to 1 if you have the `tmpnam' function. */
#define HAVE_TMPNAM 1
/* Define to 1 if you have the `tmpnam_r' function. */
/* #undef HAVE_TMPNAM_R */
/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
`HAVE_STRUCT_TM_TM_ZONE' instead. */
#define HAVE_TM_ZONE 1
/* Define to 1 if you have the `truncate' function. */
#define HAVE_TRUNCATE 1
/* Define to 1 if you have the `ttyname' function. */
#define HAVE_TTYNAME 1
/* Define to 1 if you don't have `tm_zone' but do have the external array
`tzname'. */
/* #undef HAVE_TZNAME */
/* Define to 1 if you have the `umask' function. */
#define HAVE_UMASK 1
/* Define to 1 if you have the `uname' function. */
#define HAVE_UNAME 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `unlinkat' function. */
#define HAVE_UNLINKAT 1
/* Define to 1 if you have the `unshare' function. */
/* #undef HAVE_UNSHARE */
/* Define if you have a useable wchar_t type defined in wchar.h; useable means
wchar_t must be an unsigned type with at least 16 bits. (see
Include/unicodeobject.h). */
#define HAVE_USABLE_WCHAR_T 1
/* Define to 1 if you have the <util.h> header file. */
/* #undef HAVE_UTIL_H */
/* Define to 1 if you have the `utimensat' function. */
#define HAVE_UTIMENSAT 1
/* Define to 1 if you have the `utimes' function. */
#define HAVE_UTIMES 1
/* Define to 1 if you have the <utime.h> header file. */
#define HAVE_UTIME_H 1
/* Define to 1 if you have the <utmp.h> header file. */
/* #undef HAVE_UTMP_H */
/* Define to 1 if you have the `uuid_create' function. */
#define HAVE_UUID_CREATE 1
/* Define to 1 if you have the `uuid_enc_be' function. */
#define HAVE_UUID_ENC_BE 1
/* Define if uuid_generate_time_safe() exists. */
/* #undef HAVE_UUID_GENERATE_TIME_SAFE */
/* Define to 1 if you have the <uuid.h> header file. */
#define HAVE_UUID_H 1
/* Define to 1 if you have the <uuid/uuid.h> header file. */
/* #undef HAVE_UUID_UUID_H */
/* Define to 1 if you have the `vfork' function. */
#define HAVE_VFORK 1
/* Define to 1 if you have the `wait' function. */
#define HAVE_WAIT 1
/* Define to 1 if you have the `wait3' function. */
#define HAVE_WAIT3 1
/* Define to 1 if you have the `wait4' function. */
#define HAVE_WAIT4 1
/* Define to 1 if you have the `waitid' function. */
#define HAVE_WAITID 1
/* Define to 1 if you have the `waitpid' function. */
#define HAVE_WAITPID 1
/* Define if the compiler provides a wchar.h header file. */
#define HAVE_WCHAR_H 1
/* Define to 1 if you have the `wcscoll' function. */
#define HAVE_WCSCOLL 1
/* Define to 1 if you have the `wcsftime' function. */
#define HAVE_WCSFTIME 1
/* Define to 1 if you have the `wcsxfrm' function. */
#define HAVE_WCSXFRM 1
/* Define to 1 if you have the `wmemcmp' function. */
#define HAVE_WMEMCMP 1
/* Define if tzset() actually switches the local timezone in a meaningful way.
*/
#define HAVE_WORKING_TZSET 1
/* Define to 1 if you have the `writev' function. */
#define HAVE_WRITEV 1
/* Define if the zlib library has inflateCopy */
#define HAVE_ZLIB_COPY 1
/* Define to 1 if you have the <zlib.h> header file. */
/* #undef HAVE_ZLIB_H */
/* Define to 1 if you have the `_getpty' function. */
/* #undef HAVE__GETPTY */
/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
*/
/* #undef MAJOR_IN_MKDEV */
/* Define to 1 if `major', `minor', and `makedev' are declared in
<sysmacros.h>. */
/* #undef MAJOR_IN_SYSMACROS */
/* Define if mvwdelch in curses.h is an expression. */
#define MVWDELCH_IS_EXPRESSION 1
/* Define to the address where bug reports for this package should be sent. */
/* #undef PACKAGE_BUGREPORT */
/* Define to the full name of this package. */
/* #undef PACKAGE_NAME */
/* Define to the full name and version of this package. */
/* #undef PACKAGE_STRING */
/* Define to the one symbol short name of this package. */
/* #undef PACKAGE_TARNAME */
/* Define to the home page for this package. */
/* #undef PACKAGE_URL */
/* Define to the version of this package. */
/* #undef PACKAGE_VERSION */
/* Define if POSIX semaphores aren't enabled on your system */
/* #undef POSIX_SEMAPHORES_NOT_ENABLED */
/* Define if pthread_key_t is compatible with int. */
#define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1
/* Defined if PTHREAD_SCOPE_SYSTEM supported. */
#define PTHREAD_SYSTEM_SCHED_SUPPORTED 1
/* Define as the preferred size in bits of long digits */
/* #undef PYLONG_BITS_IN_DIGIT */
/* enabled builtin hash modules */
#define PY_BUILTIN_HASHLIB_HASHES "md5,sha1,sha2,sha3,blake2"
/* Define if you want to coerce the C locale to a UTF-8 based locale */
#define PY_COERCE_C_LOCALE 1
/* Define to 1 if you have the perf trampoline. */
/* #undef PY_HAVE_PERF_TRAMPOLINE */
/* Define to 1 to build the sqlite module with loadable extensions support. */
#define PY_SQLITE_ENABLE_LOAD_EXTENSION 1
/* Define if SQLite was compiled with the serialize API */
#define PY_SQLITE_HAVE_SERIALIZE 1
/* Default cipher suites list for ssl module. 1: Python's preferred selection,
2: leave OpenSSL defaults untouched, 0: custom string */
#define PY_SSL_DEFAULT_CIPHERS 1
/* Cipher suite string for PY_SSL_DEFAULT_CIPHERS=0 */
/* #undef PY_SSL_DEFAULT_CIPHER_STRING */
/* PEP 11 Support tier (1, 2, 3 or 0 for unsupported) */
#define PY_SUPPORT_TIER 0
/* Define if you want to build an interpreter with many run-time checks. */
/* #undef Py_DEBUG */
/* Defined if Python is built as a shared library. */
#define Py_ENABLE_SHARED 1
/* Define hash algorithm for str, bytes and memoryview. SipHash24: 1, FNV: 2,
SipHash13: 3, externally defined: 0 */
#define Py_HASH_ALGORITHM 2
/* Define if you want to enable internal statistics gathering. */
/* #undef Py_STATS */
/* The version of SunOS/Solaris as reported by `uname -r' without the dot. */
/* #undef Py_SUNOS_VERSION */
/* Define if you want to enable tracing references for debugging purpose */
/* #undef Py_TRACE_REFS */
/* assume C89 semantics that RETSIGTYPE is always void */
#define RETSIGTYPE void
/* Define if setpgrp() must be called as setpgrp(0, 0). */
#define SETPGRP_HAVE_ARG 1
/* Define if i>>j for signed int i does not extend the sign bit when i < 0 */
/* #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS */
/* The size of `double', as computed by sizeof. */
#define SIZEOF_DOUBLE 8
/* The size of `float', as computed by sizeof. */
#define SIZEOF_FLOAT 4
/* The size of `fpos_t', as computed by sizeof. */
#define SIZEOF_FPOS_T 8
/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 8
/* The size of `long double', as computed by sizeof. */
#define SIZEOF_LONG_DOUBLE 16
/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8
/* The size of `off_t', as computed by sizeof. */
#define SIZEOF_OFF_T 8
/* The size of `pid_t', as computed by sizeof. */
#define SIZEOF_PID_T 4
/* The size of `pthread_key_t', as computed by sizeof. */
#define SIZEOF_PTHREAD_KEY_T 4
/* The size of `pthread_t', as computed by sizeof. */
#define SIZEOF_PTHREAD_T 8
/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 8
/* The size of `time_t', as computed by sizeof. */
#define SIZEOF_TIME_T 8
/* The size of `uintptr_t', as computed by sizeof. */
#define SIZEOF_UINTPTR_T 8
/* The size of `void *', as computed by sizeof. */
#define SIZEOF_VOID_P 8
/* The size of `wchar_t', as computed by sizeof. */
#define SIZEOF_WCHAR_T 4
/* The size of `_Bool', as computed by sizeof. */
#define SIZEOF__BOOL 1
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if you can safely include both <sys/select.h> and <sys/time.h>
(which you can't on SCO ODT 3.0). */
#define SYS_SELECT_WITH_SYS_TIME 1
/* Custom thread stack size depending on chosen sanitizer runtimes. */
/* #undef THREAD_STACK_SIZE */
/* Library needed by timemodule.c: librt may be needed for clock_gettime() */
/* #undef TIMEMODULE_LIB */
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
/* Define if you want to use computed gotos in ceval.c. */
/* #undef USE_COMPUTED_GOTOS */
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
# 1717 "./pyconfig.h"
/* Enable general extensions on macOS. */
#ifndef _DARWIN_C_SOURCE
# define _DARWIN_C_SOURCE 1
#endif
# 1721 "./pyconfig.h"
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
# 1725 "./pyconfig.h"
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
# 1729 "./pyconfig.h"
/* Enable X/Open compliant socket functions that do not require linking
with -lxnet on HP-UX 11.11. */
#ifndef _HPUX_ALT_XOPEN_SOCKET_API
# define _HPUX_ALT_XOPEN_SOCKET_API 1
#endif
# 1734 "./pyconfig.h"
/* Identify the host operating system as Minix.
This macro does not affect the system headers' behavior.
A future release of Autoconf may stop defining this macro. */
#ifndef _MINIX
/* # undef _MINIX */
#endif
# 1740 "./pyconfig.h"
/* Enable general extensions on NetBSD.
Enable NetBSD compatibility extensions on Minix. */
#ifndef _NETBSD_SOURCE
# define _NETBSD_SOURCE 1
#endif
# 1745 "./pyconfig.h"
/* Enable OpenBSD compatibility extensions on NetBSD.
Oddly enough, this does nothing on OpenBSD. */
#ifndef _OPENBSD_SOURCE
# define _OPENBSD_SOURCE 1
#endif
# 1750 "./pyconfig.h"
/* Define to 1 if needed for POSIX-compatible behavior. */
#ifndef _POSIX_SOURCE
/* # undef _POSIX_SOURCE */
#endif
# 1754 "./pyconfig.h"
/* Define to 2 if needed for POSIX-compatible behavior. */
#ifndef _POSIX_1_SOURCE
/* # undef _POSIX_1_SOURCE */
#endif
# 1758 "./pyconfig.h"
/* Enable POSIX-compatible threading on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
# 1762 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
# define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
#endif
# 1766 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
# define __STDC_WANT_IEC_60559_BFP_EXT__ 1
#endif
# 1770 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
# define __STDC_WANT_IEC_60559_DFP_EXT__ 1
#endif
# 1774 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
#endif
# 1778 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
#endif
# 1782 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
#ifndef __STDC_WANT_LIB_EXT2__
# define __STDC_WANT_LIB_EXT2__ 1
#endif
# 1786 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC 24747:2009. */
#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
# define __STDC_WANT_MATH_SPEC_FUNCS__ 1
#endif
# 1790 "./pyconfig.h"
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
# 1794 "./pyconfig.h"
/* Enable X/Open extensions. Define to 500 only if necessary
to make mbstate_t available. */
#ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 700
#endif
# 1799 "./pyconfig.h"
/* Define if WINDOW in curses.h offers a field _flags. */
#define WINDOW_HAS_FLAGS 1
/* Define if you want build the _decimal module using a coroutine-local rather
than a thread-local context */
#define WITH_DECIMAL_CONTEXTVAR 1
/* Define if you want documentation strings in extension modules */
#define WITH_DOC_STRINGS 1
/* Define if you want to compile in DTrace support */
/* #undef WITH_DTRACE */
/* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
Dyld is necessary to support frameworks. */
/* #undef WITH_DYLD */
/* Define to build the readline module against libedit. */
/* #undef WITH_EDITLINE */
/* Define if you want to compile in object freelists optimization */
#define WITH_FREELISTS 1
/* Define to 1 if libintl is needed for locale functions. */
#define WITH_LIBINTL 1
/* Define if you want to produce an OpenStep/Rhapsody framework (shared
library plus accessory files). */
/* #undef WITH_NEXT_FRAMEWORK */
/* Define if you want to compile in Python-specific mallocs */
#define WITH_PYMALLOC 1
/* Define if you want pymalloc to be disabled when running under valgrind */
/* #undef WITH_VALGRIND */
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if 0 /* disabled by -frewrite-includes */
#if defined AC_APPLE_UNIVERSAL_BUILD
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 1841 "./pyconfig.h"
#if 0 /* disabled by -frewrite-includes */
# if defined __BIG_ENDIAN__
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 1842 "./pyconfig.h"
# define WORDS_BIGENDIAN 1
# endif
# 1844 "./pyconfig.h"
#else
# 1845 "./pyconfig.h"
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
# 1848 "./pyconfig.h"
#endif
# 1849 "./pyconfig.h"
/* Define if arithmetic is subject to x87-style double rounding issue */
/* #undef X87_DOUBLE_ROUNDING */
/* Define on OpenBSD to activate all library features */
/* #undef _BSD_SOURCE */
/* Define on Darwin to activate all library features */
#define _DARWIN_C_SOURCE 1
/* This must be set to 64 on some systems to enable large file support. */
#define _FILE_OFFSET_BITS 64
/* Define to include mbstate_t for mbrtowc */
/* #undef _INCLUDE__STDC_A1_SOURCE */
/* This must be defined on some systems to enable large file support. */
#define _LARGEFILE_SOURCE 1
/* This must be defined on AIX systems to enable large file support. */
/* #undef _LARGE_FILES */
/* Define on NetBSD to activate all library features */
#define _NETBSD_SOURCE 1
/* Define to activate features from IEEE Stds 1003.1-2008 */
#define _POSIX_C_SOURCE 200809L
/* Define if you have POSIX threads, and your system does not define that. */
/* #undef _POSIX_THREADS */
/* framework name */
#define _PYTHONFRAMEWORK ""
/* Define to force use of thread-safe errno, h_errno, and other functions */
/* #undef _REENTRANT */
/* Define to 1 if you want to emulate getpid() on WASI */
/* #undef _WASI_EMULATED_GETPID */
/* Define to 1 if you want to emulate process clocks on WASI */
/* #undef _WASI_EMULATED_PROCESS_CLOCKS */
/* Define to 1 if you want to emulate signals on WASI */
/* #undef _WASI_EMULATED_SIGNAL */
/* Define to the level of X/Open that your system supports */
#define _XOPEN_SOURCE 700
/* Define to activate Unix95-and-earlier features */
#define _XOPEN_SOURCE_EXTENDED 1
/* Define on FreeBSD to activate all library features */
#define __BSD_VISIBLE 1
/* Define to 'long' if <time.h> doesn't define. */
/* #undef clock_t */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef mode_t */
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define as a signed integer type capable of holding a process identifier. */
/* #undef pid_t */
/* Define to empty if the keyword does not work. */
/* #undef signed */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to `int' if <sys/socket.h> does not define. */
/* #undef socklen_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define the macros needed if on a UnixWare 7.x system. */
#if 0 /* disabled by -frewrite-includes */
#if defined(__USLC__) && defined(__SCO_VERSION__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 1937 "./pyconfig.h"
#define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
#endif
# 1939 "./pyconfig.h"
#endif /*Py_PYCONFIG_H*/
# 1941 "./pyconfig.h"
#define HAVE_TIMEGM 1
# 13 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pymacconfig.h"
#endif /* expanded by -frewrite-includes */
# 13 "./Include/Python.h"
# 1 "./Include/pymacconfig.h" 1
#ifndef PYMACCONFIG_H
#define PYMACCONFIG_H
/*
* This file moves some of the autoconf magic to compile-time
* when building on MacOSX. This is needed for building 4-way
* universal binaries and for 64-bit universal binaries because
* the values redefined below aren't configure-time constant but
* only compile-time constant in these scenarios.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__APPLE__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 12 "./Include/pymacconfig.h"
# undef SIZEOF_LONG
# undef SIZEOF_PTHREAD_T
# undef SIZEOF_SIZE_T
# undef SIZEOF_TIME_T
# undef SIZEOF_VOID_P
# undef SIZEOF__BOOL
# undef SIZEOF_UINTPTR_T
# undef SIZEOF_PTHREAD_T
# undef WORDS_BIGENDIAN
# undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754
# undef DOUBLE_IS_BIG_ENDIAN_IEEE754
# undef DOUBLE_IS_LITTLE_ENDIAN_IEEE754
# undef HAVE_GCC_ASM_FOR_X87
# undef VA_LIST_IS_ARRAY
#if 0 /* disabled by -frewrite-includes */
# if defined(__LP64__) && defined(__x86_64__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 29 "./Include/pymacconfig.h"
# define VA_LIST_IS_ARRAY 1
# endif
# 31 "./Include/pymacconfig.h"
# undef HAVE_LARGEFILE_SUPPORT
# ifndef __LP64__
# define HAVE_LARGEFILE_SUPPORT 1
# endif
# 36 "./Include/pymacconfig.h"
# undef SIZEOF_LONG
# ifdef __LP64__
# define SIZEOF__BOOL 1
# define SIZEOF__BOOL 1
# define SIZEOF_LONG 8
# define SIZEOF_PTHREAD_T 8
# define SIZEOF_SIZE_T 8
# define SIZEOF_TIME_T 8
# define SIZEOF_VOID_P 8
# define SIZEOF_UINTPTR_T 8
# define SIZEOF_PTHREAD_T 8
# else
# 49 "./Include/pymacconfig.h"
# ifdef __ppc__
# define SIZEOF__BOOL 4
# else
# 52 "./Include/pymacconfig.h"
# define SIZEOF__BOOL 1
# endif
# 54 "./Include/pymacconfig.h"
# define SIZEOF_LONG 4
# define SIZEOF_PTHREAD_T 4
# define SIZEOF_SIZE_T 4
# define SIZEOF_TIME_T 4
# define SIZEOF_VOID_P 4
# define SIZEOF_UINTPTR_T 4
# define SIZEOF_PTHREAD_T 4
# endif
# 62 "./Include/pymacconfig.h"
#if 0 /* disabled by -frewrite-includes */
# if defined(__LP64__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 64 "./Include/pymacconfig.h"
/* MacOSX 10.4 (the first release to support 64-bit code
* at all) only supports 64-bit in the UNIX layer.
* Therefore suppress the toolbox-glue in 64-bit mode.
*/
/* In 64-bit mode setpgrp always has no arguments, in 32-bit
* mode that depends on the compilation environment
*/
# undef SETPGRP_HAVE_ARG
# endif
# 75 "./Include/pymacconfig.h"
#ifdef __BIG_ENDIAN__
#define WORDS_BIGENDIAN 1
#define DOUBLE_IS_BIG_ENDIAN_IEEE754
#else
# 80 "./Include/pymacconfig.h"
#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754
#endif /* __BIG_ENDIAN */
# 82 "./Include/pymacconfig.h"
#ifdef __i386__
# define HAVE_GCC_ASM_FOR_X87
#endif
# 86 "./Include/pymacconfig.h"
#endif /* defined(_APPLE__) */
# 89 "./Include/pymacconfig.h"
#endif /* PYMACCONFIG_H */
# 91 "./Include/pymacconfig.h"
# 14 "./Include/Python.h" 2
#if 0 /* disabled by -frewrite-includes */
#if defined(__sgi) && !defined(_SGI_MP_SOURCE)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 16 "./Include/Python.h"
# define _SGI_MP_SOURCE
#endif
# 18 "./Include/Python.h"
// stdlib.h, stdio.h, errno.h and string.h headers are not used by Python
// headers, but kept for backward compatibility. They are excluded from the
// limited C API of Python 3.11.
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 23 "./Include/Python.h"
#if 0 /* expanded by -frewrite-includes */
# include <stdlib.h>
#endif /* expanded by -frewrite-includes */
# 23 "./Include/Python.h"
# 1 "/usr/include/stdlib.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)stdlib.h 8.5 (Berkeley) 5/19/95
*/
#ifndef _STDLIB_H_
#define _STDLIB_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 37 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/sys/cdefs.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Berkeley Software Design, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)cdefs.h 8.8 (Berkeley) 1/9/95
*/
#ifndef _SYS_CDEFS_H_
#define _SYS_CDEFS_H_
#if 0 /* disabled by -frewrite-includes */
#if defined(_KERNEL) && defined(_STANDALONE)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 41 "/usr/include/sys/cdefs.h" 3 4
#error "_KERNEL and _STANDALONE are mutually exclusive"
#endif
# 43 "/usr/include/sys/cdefs.h" 3 4
/*
* Testing against Clang-specific extensions.
*/
#ifndef __has_attribute
#define __has_attribute(x) 0
#endif
# 50 "/usr/include/sys/cdefs.h" 3 4
#ifndef __has_extension
#define __has_extension __has_feature
#endif
# 53 "/usr/include/sys/cdefs.h" 3 4
#ifndef __has_feature
#define __has_feature(x) 0
#endif
# 56 "/usr/include/sys/cdefs.h" 3 4
#ifndef __has_include
#define __has_include(x) 0
#endif
# 59 "/usr/include/sys/cdefs.h" 3 4
#ifndef __has_builtin
#define __has_builtin(x) 0
#endif
# 62 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 64 "/usr/include/sys/cdefs.h" 3 4
#define __BEGIN_DECLS extern "C" {
#define __END_DECLS }
#else
# 67 "/usr/include/sys/cdefs.h" 3 4
#define __BEGIN_DECLS
#define __END_DECLS
#endif
# 70 "/usr/include/sys/cdefs.h" 3 4
/*
* This code has been put in place to help reduce the addition of
* compiler specific defines in FreeBSD code. It helps to aid in
* having a compiler-agnostic source tree.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 78 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC__ >= 3
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 80 "/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE_ASM 3
#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS
#else
# 83 "/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE_ASM 2
#endif
# 85 "/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE___TYPEOF 1
#define __GNUCLIKE___SECTION 1
#define __GNUCLIKE_CTOR_SECTION_HANDLING 1
#define __GNUCLIKE_BUILTIN_CONSTANT_P 1
#if 0 /* disabled by -frewrite-includes */
#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 93 "/usr/include/sys/cdefs.h" 3 4
#define __GNUCLIKE_BUILTIN_VARARGS 1
#define __GNUCLIKE_BUILTIN_STDARG 1
#define __GNUCLIKE_BUILTIN_VAALIST 1
#endif
# 97 "/usr/include/sys/cdefs.h" 3 4
#define __GNUC_VA_LIST_COMPATIBILITY 1
/*
* Compiler memory barriers, specific to gcc and clang.
*/
#define __compiler_membar() __asm __volatile(" " : : : "memory")
#define __GNUCLIKE_BUILTIN_NEXT_ARG 1
#define __GNUCLIKE_MATH_BUILTIN_RELOPS
#define __GNUCLIKE_BUILTIN_MEMCPY 1
/* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */
#define __CC_SUPPORTS_INLINE 1
#define __CC_SUPPORTS___INLINE 1
#define __CC_SUPPORTS___INLINE__ 1
#define __CC_SUPPORTS___FUNC__ 1
#define __CC_SUPPORTS_WARNING 1
#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */
#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1
#endif /* __GNUC__ */
# 123 "/usr/include/sys/cdefs.h" 3 4
/*
* Macro to test if we're using a specific version of gcc or later.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 128 "/usr/include/sys/cdefs.h" 3 4
#define __GNUC_PREREQ__(ma, mi) \
(__GNUC__ > (ma) || __GNUC__ == (ma) && __GNUC_MINOR__ >= (mi))
#else
# 131 "/usr/include/sys/cdefs.h" 3 4
#define __GNUC_PREREQ__(ma, mi) 0
#endif
# 133 "/usr/include/sys/cdefs.h" 3 4
/*
* The __CONCAT macro is used to concatenate parts of symbol names, e.g.
* with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo.
* The __CONCAT macro is a bit tricky to use if it must work in non-ANSI
* mode -- there must be no spaces between its arguments, and for nested
* __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also
* concatenate double-quoted strings produced by the __STRING macro, but
* this only works with ANSI C.
*
* __XSTRING is like __STRING, but it expands any macros in its argument
* first. It is only available with ANSI C.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__STDC__) || defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 147 "/usr/include/sys/cdefs.h" 3 4
#define __P(protos) protos /* full-blown ANSI C */
#define __CONCAT1(x,y) x ## y
#define __CONCAT(x,y) __CONCAT1(x,y)
#define __STRING(x) #x /* stringify without expanding x */
#define __XSTRING(x) __STRING(x) /* expand x, then stringify */
#define __const const /* define reserved names to standard */
#define __signed signed
#define __volatile volatile
#if 0 /* disabled by -frewrite-includes */
#if defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 157 "/usr/include/sys/cdefs.h" 3 4
#define __inline inline /* convert to C++ keyword */
#else
# 159 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if !(defined(__CC_SUPPORTS___INLINE))
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 160 "/usr/include/sys/cdefs.h" 3 4
#define __inline /* delete GCC keyword */
#endif /* ! __CC_SUPPORTS___INLINE */
# 162 "/usr/include/sys/cdefs.h" 3 4
#endif /* !__cplusplus */
# 163 "/usr/include/sys/cdefs.h" 3 4
#else /* !(__STDC__ || __cplusplus) */
# 165 "/usr/include/sys/cdefs.h" 3 4
#define __P(protos) () /* traditional C preprocessor */
#define __CONCAT(x,y) x/**/y
#define __STRING(x) "x"
#if 0 /* disabled by -frewrite-includes */
#if !defined(__CC_SUPPORTS___INLINE)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 170 "/usr/include/sys/cdefs.h" 3 4
#define __const /* delete pseudo-ANSI C keywords */
#define __inline
#define __signed
#define __volatile
/*
* In non-ANSI C environments, new programs will want ANSI-only C keywords
* deleted from the program and old programs will want them left alone.
* When using a compiler other than gcc, programs using the ANSI C keywords
* const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS.
* When using "gcc -traditional", we assume that this is the intent; if
* __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone.
*/
#ifndef NO_ANSI_KEYWORDS
#define const /* delete ANSI C keywords */
#define inline
#define signed
#define volatile
#endif /* !NO_ANSI_KEYWORDS */
# 188 "/usr/include/sys/cdefs.h" 3 4
#endif /* !__CC_SUPPORTS___INLINE */
# 189 "/usr/include/sys/cdefs.h" 3 4
#endif /* !(__STDC__ || __cplusplus) */
# 190 "/usr/include/sys/cdefs.h" 3 4
/*
* Compiler-dependent macros to help declare dead (non-returning) and
* pure (no side effects) functions, and unused variables. They are
* null except for versions of gcc that are known to support the features
* properly (old versions of gcc-2 supported the dead and pure features
* in a different (wrong) way). If we do not provide an implementation
* for a given compiler, let the compile fail if it is told to use
* a feature that we cannot live without.
*/
#define __weak_symbol __attribute__((__weak__))
#if 0 /* disabled by -frewrite-includes */
#if !__GNUC_PREREQ__(2, 5)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 202 "/usr/include/sys/cdefs.h" 3 4
#define __dead2
#define __pure2
#define __unused
#endif
# 206 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 207 "/usr/include/sys/cdefs.h" 3 4
#define __dead2 __attribute__((__noreturn__))
#define __pure2 __attribute__((__const__))
#define __unused
/* XXX Find out what to do for __packed, __aligned and __section */
#endif
# 212 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(2, 7)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 213 "/usr/include/sys/cdefs.h" 3 4
#define __dead2 __attribute__((__noreturn__))
#define __pure2 __attribute__((__const__))
#define __unused __attribute__((__unused__))
#define __used __attribute__((__used__))
#define __packed __attribute__((__packed__))
#define __aligned(x) __attribute__((__aligned__(x)))
#define __section(x) __attribute__((__section__(x)))
#endif
# 221 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(4, 3) || __has_attribute(__alloc_size__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 222 "/usr/include/sys/cdefs.h" 3 4
#define __alloc_size(x) __attribute__((__alloc_size__(x)))
#define __alloc_size2(n, x) __attribute__((__alloc_size__(n, x)))
#else
# 225 "/usr/include/sys/cdefs.h" 3 4
#define __alloc_size(x)
#define __alloc_size2(n, x)
#endif
# 228 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(4, 9) || __has_attribute(__alloc_align__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 229 "/usr/include/sys/cdefs.h" 3 4
#define __alloc_align(x) __attribute__((__alloc_align__(x)))
#else
# 231 "/usr/include/sys/cdefs.h" 3 4
#define __alloc_align(x)
#endif
# 233 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if !__GNUC_PREREQ__(2, 95)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 235 "/usr/include/sys/cdefs.h" 3 4
#define __alignof(x) __offsetof(struct { char __a; x __b; }, __b)
#endif
# 237 "/usr/include/sys/cdefs.h" 3 4
/*
* Keywords added in C11.
*/
#if 0 /* disabled by -frewrite-includes */
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 243 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if !__has_extension(c_alignas)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 245 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
__has_extension(cxx_alignas)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 247 "/usr/include/sys/cdefs.h" 3 4
#define _Alignas(x) alignas(x)
#else
# 249 "/usr/include/sys/cdefs.h" 3 4
/* XXX: Only emulates _Alignas(constant-expression); not _Alignas(type-name). */
#define _Alignas(x) __aligned(x)
#endif
# 252 "/usr/include/sys/cdefs.h" 3 4
#endif
# 253 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if defined(__cplusplus) && __cplusplus >= 201103L
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 255 "/usr/include/sys/cdefs.h" 3 4
#define _Alignof(x) alignof(x)
#else
# 257 "/usr/include/sys/cdefs.h" 3 4
#define _Alignof(x) __alignof(x)
#endif
# 259 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if !defined(__cplusplus) && !__has_extension(c_atomic) && \
!__has_extension(cxx_atomic) && !__GNUC_PREREQ__(4, 7)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 262 "/usr/include/sys/cdefs.h" 3 4
/*
* No native support for _Atomic(). Place object in structure to prevent
* most forms of direct non-atomic access.
*/
#define _Atomic(T) struct { T volatile __val; }
#endif
# 268 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if defined(__cplusplus) && __cplusplus >= 201103L
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 270 "/usr/include/sys/cdefs.h" 3 4
#define _Noreturn [[noreturn]]
#else
# 272 "/usr/include/sys/cdefs.h" 3 4
#define _Noreturn __dead2
#endif
# 274 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if !__has_extension(c_static_assert)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 276 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if (defined(__cplusplus) && __cplusplus >= 201103L) || \
__has_extension(cxx_static_assert)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 278 "/usr/include/sys/cdefs.h" 3 4
#define _Static_assert(x, y) static_assert(x, y)
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif __GNUC_PREREQ__(4,6) && !defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 280 "/usr/include/sys/cdefs.h" 3 4
/* Nothing, gcc 4.6 and higher has _Static_assert built-in */
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(__COUNTER__)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 282 "/usr/include/sys/cdefs.h" 3 4
#define _Static_assert(x, y) __Static_assert(x, __COUNTER__)
#define __Static_assert(x, y) ___Static_assert(x, y)
#define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1] \
__unused
#else
# 287 "/usr/include/sys/cdefs.h" 3 4
#define _Static_assert(x, y) struct __hack
#endif
# 289 "/usr/include/sys/cdefs.h" 3 4
#endif
# 290 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if !__has_extension(c_thread_local)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 292 "/usr/include/sys/cdefs.h" 3 4
/*
* XXX: Some compilers (Clang 3.3, GCC 4.7) falsely announce C++11 mode
* without actually supporting the thread_local keyword. Don't check for
* the presence of C++11 when defining _Thread_local.
*/
#if 0 /* disabled by -frewrite-includes */
#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \
__has_extension(cxx_thread_local)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 299 "/usr/include/sys/cdefs.h" 3 4
#define _Thread_local thread_local
#else
# 301 "/usr/include/sys/cdefs.h" 3 4
#define _Thread_local __thread
#endif
# 303 "/usr/include/sys/cdefs.h" 3 4
#endif
# 304 "/usr/include/sys/cdefs.h" 3 4
#endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */
# 306 "/usr/include/sys/cdefs.h" 3 4
/*
* Emulation of C11 _Generic(). Unlike the previously defined C11
* keywords, it is not possible to implement this using exactly the same
* syntax. Therefore implement something similar under the name
* __generic(). Unlike _Generic(), this macro can only distinguish
* between a single type, so it requires nested invocations to
* distinguish multiple cases.
*
* Note that the comma operator is used to force expr to decay in
* order to match _Generic().
*/
#if 0 /* disabled by -frewrite-includes */
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
__has_extension(c_generic_selections)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 321 "/usr/include/sys/cdefs.h" 3 4
#define __generic(expr, t, yes, no) \
_Generic(expr, t: yes, default: no)
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 324 "/usr/include/sys/cdefs.h" 3 4
#define __generic(expr, t, yes, no) \
__builtin_choose_expr( \
__builtin_types_compatible_p(__typeof((0, (expr))), t), yes, no)
#endif
# 328 "/usr/include/sys/cdefs.h" 3 4
/*
* C99 Static array indices in function parameter declarations. Syntax such as:
* void bar(int myArray[static 10]);
* is allowed in C99 but not in C++. Define __min_size appropriately so
* headers using it can be compiled in either language. Use like this:
* void bar(int myArray[__min_size(10)]);
*/
#if 0 /* disabled by -frewrite-includes */
#if !defined(__cplusplus) && \
(defined(__clang__) || __GNUC_PREREQ__(4, 6)) && \
(!defined(__STDC_VERSION__) || (__STDC_VERSION__ >= 199901))
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 339 "/usr/include/sys/cdefs.h" 3 4
#define __min_size(x) static (x)
#else
# 341 "/usr/include/sys/cdefs.h" 3 4
#define __min_size(x) (x)
#endif
# 343 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(2, 96)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 345 "/usr/include/sys/cdefs.h" 3 4
#define __malloc_like __attribute__((__malloc__))
#define __pure __attribute__((__pure__))
#else
# 348 "/usr/include/sys/cdefs.h" 3 4
#define __malloc_like
#define __pure
#endif
# 351 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(3, 1)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 353 "/usr/include/sys/cdefs.h" 3 4
#define __always_inline __attribute__((__always_inline__))
#else
# 355 "/usr/include/sys/cdefs.h" 3 4
#define __always_inline
#endif
# 357 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(3, 1)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 359 "/usr/include/sys/cdefs.h" 3 4
#define __noinline __attribute__ ((__noinline__))
#else
# 361 "/usr/include/sys/cdefs.h" 3 4
#define __noinline
#endif
# 363 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(3, 4)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 365 "/usr/include/sys/cdefs.h" 3 4
#define __fastcall __attribute__((__fastcall__))
#define __result_use_check __attribute__((__warn_unused_result__))
#else
# 368 "/usr/include/sys/cdefs.h" 3 4
#define __fastcall
#define __result_use_check
#endif
# 371 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(4, 1)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 373 "/usr/include/sys/cdefs.h" 3 4
#define __returns_twice __attribute__((__returns_twice__))
#else
# 375 "/usr/include/sys/cdefs.h" 3 4
#define __returns_twice
#endif
# 377 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(4, 6) || __has_builtin(__builtin_unreachable)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 379 "/usr/include/sys/cdefs.h" 3 4
#define __unreachable() __builtin_unreachable()
#else
# 381 "/usr/include/sys/cdefs.h" 3 4
#define __unreachable() ((void)0)
#endif
# 383 "/usr/include/sys/cdefs.h" 3 4
/* XXX: should use `#if __STDC_VERSION__ < 199901'. */
#if 0 /* disabled by -frewrite-includes */
#if !__GNUC_PREREQ__(2, 7)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 386 "/usr/include/sys/cdefs.h" 3 4
#define __func__ NULL
#endif
# 388 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if (defined(__GNUC__) && __GNUC__ >= 2) && !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 390 "/usr/include/sys/cdefs.h" 3 4
#define __LONG_LONG_SUPPORTED
#endif
# 392 "/usr/include/sys/cdefs.h" 3 4
/* C++11 exposes a load of C99 stuff */
#if 0 /* disabled by -frewrite-includes */
#if defined(__cplusplus) && __cplusplus >= 201103L
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 395 "/usr/include/sys/cdefs.h" 3 4
#define __LONG_LONG_SUPPORTED
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
# 399 "/usr/include/sys/cdefs.h" 3 4
#ifndef __STDC_CONSTANT_MACROS
#define __STDC_CONSTANT_MACROS
#endif
# 402 "/usr/include/sys/cdefs.h" 3 4
#endif
# 403 "/usr/include/sys/cdefs.h" 3 4
/*
* We use `__restrict' as a way to define the `restrict' type qualifier
* without disturbing older software that is unaware of C99 keywords.
* GCC also provides `__restrict' as an extension to support C99-style
* restricted pointers in other language modes.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 411 "/usr/include/sys/cdefs.h" 3 4
#define __restrict restrict
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif !__GNUC_PREREQ__(2, 95)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 413 "/usr/include/sys/cdefs.h" 3 4
#define __restrict
#endif
# 415 "/usr/include/sys/cdefs.h" 3 4
/*
* GNU C version 2.96 adds explicit branch prediction so that
* the CPU back-end can hint the processor and also so that
* code blocks can be reordered such that the predicted path
* sees a more linear flow, thus improving cache behavior, etc.
*
* The following two macros provide us with a way to utilize this
* compiler feature. Use __predict_true() if you expect the expression
* to evaluate to true, and __predict_false() if you expect the
* expression to evaluate to false.
*
* A few notes about usage:
*
* * Generally, __predict_false() error condition checks (unless
* you have some _strong_ reason to do otherwise, in which case
* document it), and/or __predict_true() `no-error' condition
* checks, assuming you want to optimize for the no-error case.
*
* * Other than that, if you don't know the likelihood of a test
* succeeding from empirical or other `hard' evidence, don't
* make predictions.
*
* * These are meant to be used in places that are run `a lot'.
* It is wasteful to make predictions in code that is run
* seldomly (e.g. at subsystem initialization time) as the
* basic block reordering that this affects can often generate
* larger code.
*/
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(2, 96)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 445 "/usr/include/sys/cdefs.h" 3 4
#define __predict_true(exp) __builtin_expect((exp), 1)
#define __predict_false(exp) __builtin_expect((exp), 0)
#else
# 448 "/usr/include/sys/cdefs.h" 3 4
#define __predict_true(exp) (exp)
#define __predict_false(exp) (exp)
#endif
# 451 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(4, 0)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 453 "/usr/include/sys/cdefs.h" 3 4
#define __null_sentinel __attribute__((__sentinel__))
#define __exported __attribute__((__visibility__("default")))
#define __hidden __attribute__((__visibility__("hidden")))
#else
# 457 "/usr/include/sys/cdefs.h" 3 4
#define __null_sentinel
#define __exported
#define __hidden
#endif
# 461 "/usr/include/sys/cdefs.h" 3 4
/*
* We define this here since <stddef.h>, <sys/queue.h>, and <sys/types.h>
* require it.
*/
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(4, 1)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 467 "/usr/include/sys/cdefs.h" 3 4
#define __offsetof(type, field) __builtin_offsetof(type, field)
#else
# 469 "/usr/include/sys/cdefs.h" 3 4
#ifndef __cplusplus
#define __offsetof(type, field) \
((__size_t)(__uintptr_t)((const volatile void *)&((type *)0)->field))
#else
# 473 "/usr/include/sys/cdefs.h" 3 4
#define __offsetof(type, field) \
(__offsetof__ (reinterpret_cast <__size_t> \
(&reinterpret_cast <const volatile char &> \
(static_cast<type *> (0)->field))))
#endif
# 478 "/usr/include/sys/cdefs.h" 3 4
#endif
# 479 "/usr/include/sys/cdefs.h" 3 4
#define __rangeof(type, start, end) \
(__offsetof(type, end) - __offsetof(type, start))
/*
* Given the pointer x to the member m of the struct s, return
* a pointer to the containing structure. When using GCC, we first
* assign pointer x to a local variable, to check that its type is
* compatible with member m.
*/
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(3, 1)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 489 "/usr/include/sys/cdefs.h" 3 4
#define __containerof(x, s, m) ({ \
const volatile __typeof(((s *)0)->m) *__x = (x); \
__DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\
})
#else
# 494 "/usr/include/sys/cdefs.h" 3 4
#define __containerof(x, s, m) \
__DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m))
#endif
# 497 "/usr/include/sys/cdefs.h" 3 4
/*
* Compiler-dependent macros to declare that functions take printf-like
* or scanf-like arguments. They are null except for versions of gcc
* that are known to support the features properly (old versions of gcc-2
* didn't permit keeping the keywords out of the application namespace).
*/
#if 0 /* disabled by -frewrite-includes */
#if !__GNUC_PREREQ__(2, 7)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 505 "/usr/include/sys/cdefs.h" 3 4
#define __printflike(fmtarg, firstvararg)
#define __scanflike(fmtarg, firstvararg)
#define __format_arg(fmtarg)
#define __strfmonlike(fmtarg, firstvararg)
#define __strftimelike(fmtarg, firstvararg)
#else
# 511 "/usr/include/sys/cdefs.h" 3 4
#define __printflike(fmtarg, firstvararg) \
__attribute__((__format__ (__printf__, fmtarg, firstvararg)))
#define __scanflike(fmtarg, firstvararg) \
__attribute__((__format__ (__scanf__, fmtarg, firstvararg)))
#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg)))
#define __strfmonlike(fmtarg, firstvararg) \
__attribute__((__format__ (__strfmon__, fmtarg, firstvararg)))
#define __strftimelike(fmtarg, firstvararg) \
__attribute__((__format__ (__strftime__, fmtarg, firstvararg)))
#endif
# 521 "/usr/include/sys/cdefs.h" 3 4
/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */
#if 0 /* disabled by -frewrite-includes */
#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \
defined(__GNUC__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 525 "/usr/include/sys/cdefs.h" 3 4
#define __printf0like(fmtarg, firstvararg) \
__attribute__((__format__ (__printf0__, fmtarg, firstvararg)))
#else
# 528 "/usr/include/sys/cdefs.h" 3 4
#define __printf0like(fmtarg, firstvararg)
#endif
# 530 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 532 "/usr/include/sys/cdefs.h" 3 4
#define __strong_reference(sym,aliassym) \
extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym)))
#ifdef __STDC__
#define __weak_reference(sym,alias) \
__asm__(".weak " #alias); \
__asm__(".equ " #alias ", " #sym)
#define __warn_references(sym,msg) \
__asm__(".section .gnu.warning." #sym); \
__asm__(".asciz \"" msg "\""); \
__asm__(".previous")
#define __sym_compat(sym,impl,verid) \
__asm__(".symver " #impl ", " #sym "@" #verid)
#define __sym_default(sym,impl,verid) \
__asm__(".symver " #impl ", " #sym "@@@" #verid)
#else
# 547 "/usr/include/sys/cdefs.h" 3 4
#define __weak_reference(sym,alias) \
__asm__(".weak alias"); \
__asm__(".equ alias, sym")
#define __warn_references(sym,msg) \
__asm__(".section .gnu.warning.sym"); \
__asm__(".asciz \"msg\""); \
__asm__(".previous")
#define __sym_compat(sym,impl,verid) \
__asm__(".symver impl, sym@verid")
#define __sym_default(impl,sym,verid) \
__asm__(".symver impl, sym@@@verid")
#endif /* __STDC__ */
# 559 "/usr/include/sys/cdefs.h" 3 4
#endif /* __GNUC__ */
# 560 "/usr/include/sys/cdefs.h" 3 4
#define __GLOBL(sym) __asm__(".globl " __XSTRING(sym))
#define __WEAK(sym) __asm__(".weak " __XSTRING(sym))
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 565 "/usr/include/sys/cdefs.h" 3 4
#define __IDSTRING(name,string) __asm__(".ident\t\"" string "\"")
#else
# 567 "/usr/include/sys/cdefs.h" 3 4
/*
* The following definition might not work well if used in header files,
* but it should be better than nothing. If you want a "do nothing"
* version, then it should generate some harmless declaration, such as:
* #define __IDSTRING(name,string) struct __hack
*/
#define __IDSTRING(name,string) static const char name[] __unused = string
#endif
# 575 "/usr/include/sys/cdefs.h" 3 4
/*
* Embed the rcs id of a source file in the resulting library. Note that in
* more recent ELF binutils, we use .ident allowing the ID to be stripped.
* Usage:
*/
#ifndef __FBSDID
#if 0 /* disabled by -frewrite-includes */
#if !defined(STRIP_FBSDID)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 583 "/usr/include/sys/cdefs.h" 3 4
#define __FBSDID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
#else
# 585 "/usr/include/sys/cdefs.h" 3 4
#define __FBSDID(s) struct __hack
#endif
# 587 "/usr/include/sys/cdefs.h" 3 4
#endif
# 588 "/usr/include/sys/cdefs.h" 3 4
#ifndef __RCSID
#ifndef NO__RCSID
#define __RCSID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
#else
# 593 "/usr/include/sys/cdefs.h" 3 4
#define __RCSID(s) struct __hack
#endif
# 595 "/usr/include/sys/cdefs.h" 3 4
#endif
# 596 "/usr/include/sys/cdefs.h" 3 4
#ifndef __RCSID_SOURCE
#ifndef NO__RCSID_SOURCE
#define __RCSID_SOURCE(s) __IDSTRING(__CONCAT(__rcsid_source_,__LINE__),s)
#else
# 601 "/usr/include/sys/cdefs.h" 3 4
#define __RCSID_SOURCE(s) struct __hack
#endif
# 603 "/usr/include/sys/cdefs.h" 3 4
#endif
# 604 "/usr/include/sys/cdefs.h" 3 4
#ifndef __SCCSID
#ifndef NO__SCCSID
#define __SCCSID(s) __IDSTRING(__CONCAT(__sccsid_,__LINE__),s)
#else
# 609 "/usr/include/sys/cdefs.h" 3 4
#define __SCCSID(s) struct __hack
#endif
# 611 "/usr/include/sys/cdefs.h" 3 4
#endif
# 612 "/usr/include/sys/cdefs.h" 3 4
#ifndef __COPYRIGHT
#ifndef NO__COPYRIGHT
#define __COPYRIGHT(s) __IDSTRING(__CONCAT(__copyright_,__LINE__),s)
#else
# 617 "/usr/include/sys/cdefs.h" 3 4
#define __COPYRIGHT(s) struct __hack
#endif
# 619 "/usr/include/sys/cdefs.h" 3 4
#endif
# 620 "/usr/include/sys/cdefs.h" 3 4
#ifndef __DECONST
#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var))
#endif
# 624 "/usr/include/sys/cdefs.h" 3 4
#ifndef __DEVOLATILE
#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var))
#endif
# 628 "/usr/include/sys/cdefs.h" 3 4
#ifndef __DEQUALIFY
#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var))
#endif
# 632 "/usr/include/sys/cdefs.h" 3 4
/*-
* The following definitions are an extension of the behavior originally
* implemented in <sys/_posix.h>, but with a different level of granularity.
* POSIX.1 requires that the macros we test be defined before any standard
* header file is included.
*
* Here's a quick run-down of the versions (and some informal names)
* defined(_POSIX_SOURCE) 1003.1-1988
* encoded as 198808 below
* _POSIX_C_SOURCE == 1 1003.1-1990
* encoded as 199009 below
* _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option
* encoded as 199209 below
* _POSIX_C_SOURCE == 199309 1003.1b-1993
* (1003.1 Issue 4, Single Unix Spec v1, Unix 93)
* _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995,
* and the omnibus ISO/IEC 9945-1: 1996
* (1003.1 Issue 5, Single Unix Spec v2, Unix 95)
* _POSIX_C_SOURCE == 200112 1003.1-2001 (1003.1 Issue 6, Unix 03)
* _POSIX_C_SOURCE == 200809 1003.1-2008 (1003.1 Issue 7)
* IEEE Std 1003.1-2017 (Rev of 1003.1-2008) is
* 1003.1-2008 with two TCs applied with
* _POSIX_C_SOURCE=200809 and _XOPEN_SOURCE=700
*
* In addition, the X/Open Portability Guide, which is now the Single UNIX
* Specification, defines a feature-test macro which indicates the version of
* that specification, and which subsumes _POSIX_C_SOURCE.
*
* Our macros begin with two underscores to avoid namespace screwage.
*/
/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */
#if 0 /* disabled by -frewrite-includes */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 666 "/usr/include/sys/cdefs.h" 3 4
#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */
#define _POSIX_C_SOURCE 199009
#endif
# 669 "/usr/include/sys/cdefs.h" 3 4
/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */
#if 0 /* disabled by -frewrite-includes */
#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 672 "/usr/include/sys/cdefs.h" 3 4
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199209
#endif
# 675 "/usr/include/sys/cdefs.h" 3 4
/* Deal with various X/Open Portability Guides and Single UNIX Spec. */
#ifdef _XOPEN_SOURCE
#if 0 /* disabled by -frewrite-includes */
#if _XOPEN_SOURCE - 0 >= 700
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 679 "/usr/include/sys/cdefs.h" 3 4
#define __XSI_VISIBLE 700
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200809
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif _XOPEN_SOURCE - 0 >= 600
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 683 "/usr/include/sys/cdefs.h" 3 4
#define __XSI_VISIBLE 600
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 200112
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif _XOPEN_SOURCE - 0 >= 500
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 687 "/usr/include/sys/cdefs.h" 3 4
#define __XSI_VISIBLE 500
#undef _POSIX_C_SOURCE
#define _POSIX_C_SOURCE 199506
#endif
# 691 "/usr/include/sys/cdefs.h" 3 4
#endif
# 692 "/usr/include/sys/cdefs.h" 3 4
/*
* Deal with all versions of POSIX. The ordering relative to the tests above is
* important.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 698 "/usr/include/sys/cdefs.h" 3 4
#define _POSIX_C_SOURCE 198808
#endif
# 700 "/usr/include/sys/cdefs.h" 3 4
#ifdef _POSIX_C_SOURCE
#if 0 /* disabled by -frewrite-includes */
#if _POSIX_C_SOURCE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 702 "/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 200809
#define __ISO_C_VISIBLE 1999
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif _POSIX_C_SOURCE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 705 "/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 200112
#define __ISO_C_VISIBLE 1999
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif _POSIX_C_SOURCE >= 199506
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 708 "/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199506
#define __ISO_C_VISIBLE 1990
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif _POSIX_C_SOURCE >= 199309
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 711 "/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199309
#define __ISO_C_VISIBLE 1990
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif _POSIX_C_SOURCE >= 199209
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 714 "/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199209
#define __ISO_C_VISIBLE 1990
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif _POSIX_C_SOURCE >= 199009
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 717 "/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 199009
#define __ISO_C_VISIBLE 1990
#else
# 720 "/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 198808
#define __ISO_C_VISIBLE 0
#endif /* _POSIX_C_SOURCE */
# 723 "/usr/include/sys/cdefs.h" 3 4
/*
* Both glibc and OpenBSD enable c11 features when _ISOC11_SOURCE is defined, or
* when compiling with -stdc=c11. A strict reading of the standard would suggest
* doing it only for the former. However, a strict reading also requires C99
* mode only, so building with C11 is already undefined. Follow glibc's and
* OpenBSD's lead for this non-standard configuration for maximum compatibility.
*/
#if 0 /* disabled by -frewrite-includes */
#if _ISOC11_SOURCE || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 731 "/usr/include/sys/cdefs.h" 3 4
#undef __ISO_C_VISIBLE
#define __ISO_C_VISIBLE 2011
#endif
# 734 "/usr/include/sys/cdefs.h" 3 4
#else
# 735 "/usr/include/sys/cdefs.h" 3 4
/*-
* Deal with _ANSI_SOURCE:
* If it is defined, and no other compilation environment is explicitly
* requested, then define our internal feature-test macros to zero. This
* makes no difference to the preprocessor (undefined symbols in preprocessing
* expressions are defined to have value zero), but makes it more convenient for
* a test program to print out the values.
*
* If a program mistakenly defines _ANSI_SOURCE and some other macro such as
* _POSIX_C_SOURCE, we will assume that it wants the broader compilation
* environment (and in fact we will never get here).
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(_ANSI_SOURCE) /* Hide almost everything. */
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 748 "/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 1990
#define __EXT1_VISIBLE 0
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 754 "/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 1999
#define __EXT1_VISIBLE 0
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 760 "/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 0
#define __XSI_VISIBLE 0
#define __BSD_VISIBLE 0
#define __ISO_C_VISIBLE 2011
#define __EXT1_VISIBLE 0
#else /* Default environment: show everything. */
# 766 "/usr/include/sys/cdefs.h" 3 4
#define __POSIX_VISIBLE 200809
#define __XSI_VISIBLE 700
#define __BSD_VISIBLE 1
#define __ISO_C_VISIBLE 2011
#define __EXT1_VISIBLE 1
#endif
# 772 "/usr/include/sys/cdefs.h" 3 4
#endif
# 773 "/usr/include/sys/cdefs.h" 3 4
/* User override __EXT1_VISIBLE */
#if 0 /* disabled by -frewrite-includes */
#if defined(__STDC_WANT_LIB_EXT1__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 776 "/usr/include/sys/cdefs.h" 3 4
#undef __EXT1_VISIBLE
#if 0 /* disabled by -frewrite-includes */
#if __STDC_WANT_LIB_EXT1__
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 778 "/usr/include/sys/cdefs.h" 3 4
#define __EXT1_VISIBLE 1
#else
# 780 "/usr/include/sys/cdefs.h" 3 4
#define __EXT1_VISIBLE 0
#endif
# 782 "/usr/include/sys/cdefs.h" 3 4
#endif /* __STDC_WANT_LIB_EXT1__ */
# 783 "/usr/include/sys/cdefs.h" 3 4
/*
* Old versions of GCC use non-standard ARM arch symbols; acle-compat.h
* translates them to __ARM_ARCH and the modern feature symbols defined by ARM.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__arm__) && !defined(__ARM_ARCH)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 789 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/acle-compat.h>
#endif /* expanded by -frewrite-includes */
# 789 "/usr/include/sys/cdefs.h" 3 4
# 790 "/usr/include/sys/cdefs.h" 3 4
#endif
# 791 "/usr/include/sys/cdefs.h" 3 4
/*
* Nullability qualifiers: currently only supported by Clang.
*/
#if 0 /* disabled by -frewrite-includes */
#if !(defined(__clang__) && __has_feature(nullability))
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 796 "/usr/include/sys/cdefs.h" 3 4
#define _Nonnull
#define _Nullable
#define _Null_unspecified
#define __NULLABILITY_PRAGMA_PUSH
#define __NULLABILITY_PRAGMA_POP
#else
# 802 "/usr/include/sys/cdefs.h" 3 4
#define __NULLABILITY_PRAGMA_PUSH _Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wnullability-completeness\"")
#define __NULLABILITY_PRAGMA_POP _Pragma("clang diagnostic pop")
#endif
# 806 "/usr/include/sys/cdefs.h" 3 4
/*
* Type Safety Checking
*
* Clang provides additional attributes to enable checking type safety
* properties that cannot be enforced by the C type system.
*/
#if 0 /* disabled by -frewrite-includes */
#if __has_attribute(__argument_with_type_tag__) && \
__has_attribute(__type_tag_for_datatype__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 816 "/usr/include/sys/cdefs.h" 3 4
#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx) \
__attribute__((__argument_with_type_tag__(arg_kind, arg_idx, type_tag_idx)))
#define __datatype_type_tag(kind, type) \
__attribute__((__type_tag_for_datatype__(kind, type)))
#else
# 821 "/usr/include/sys/cdefs.h" 3 4
#define __arg_type_tag(arg_kind, arg_idx, type_tag_idx)
#define __datatype_type_tag(kind, type)
#endif
# 824 "/usr/include/sys/cdefs.h" 3 4
/*
* Lock annotations.
*
* Clang provides support for doing basic thread-safety tests at
* compile-time, by marking which locks will/should be held when
* entering/leaving a functions.
*
* Furthermore, it is also possible to annotate variables and structure
* members to enforce that they are only accessed when certain locks are
* held.
*/
#if 0 /* disabled by -frewrite-includes */
#if __has_extension(c_thread_safety_attributes)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 838 "/usr/include/sys/cdefs.h" 3 4
#define __lock_annotate(x) __attribute__((x))
#else
# 840 "/usr/include/sys/cdefs.h" 3 4
#define __lock_annotate(x)
#endif
# 842 "/usr/include/sys/cdefs.h" 3 4
/* Structure implements a lock. */
#define __lockable __lock_annotate(lockable)
/* Function acquires an exclusive or shared lock. */
#define __locks_exclusive(...) \
__lock_annotate(exclusive_lock_function(__VA_ARGS__))
#define __locks_shared(...) \
__lock_annotate(shared_lock_function(__VA_ARGS__))
/* Function attempts to acquire an exclusive or shared lock. */
#define __trylocks_exclusive(...) \
__lock_annotate(exclusive_trylock_function(__VA_ARGS__))
#define __trylocks_shared(...) \
__lock_annotate(shared_trylock_function(__VA_ARGS__))
/* Function releases a lock. */
#define __unlocks(...) __lock_annotate(unlock_function(__VA_ARGS__))
/* Function asserts that an exclusive or shared lock is held. */
#define __asserts_exclusive(...) \
__lock_annotate(assert_exclusive_lock(__VA_ARGS__))
#define __asserts_shared(...) \
__lock_annotate(assert_shared_lock(__VA_ARGS__))
/* Function requires that an exclusive or shared lock is or is not held. */
#define __requires_exclusive(...) \
__lock_annotate(exclusive_locks_required(__VA_ARGS__))
#define __requires_shared(...) \
__lock_annotate(shared_locks_required(__VA_ARGS__))
#define __requires_unlocked(...) \
__lock_annotate(locks_excluded(__VA_ARGS__))
/* Function should not be analyzed. */
#define __no_lock_analysis __lock_annotate(no_thread_safety_analysis)
/*
* Function or variable should not be sanitized, e.g., by AddressSanitizer.
* GCC has the nosanitize attribute, but as a function attribute only, and
* warns on use as a variable attribute.
*/
#if 0 /* disabled by -frewrite-includes */
#if __has_attribute(no_sanitize) && defined(__clang__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 884 "/usr/include/sys/cdefs.h" 3 4
#ifdef _KERNEL
#define __nosanitizeaddress __attribute__((no_sanitize("kernel-address")))
#define __nosanitizememory __attribute__((no_sanitize("kernel-memory")))
#else
# 888 "/usr/include/sys/cdefs.h" 3 4
#define __nosanitizeaddress __attribute__((no_sanitize("address")))
#define __nosanitizememory __attribute__((no_sanitize("memory")))
#endif
# 891 "/usr/include/sys/cdefs.h" 3 4
#define __nosanitizethread __attribute__((no_sanitize("thread")))
#else
# 893 "/usr/include/sys/cdefs.h" 3 4
#define __nosanitizeaddress
#define __nosanitizememory
#define __nosanitizethread
#endif
# 897 "/usr/include/sys/cdefs.h" 3 4
/*
* Make it possible to opt out of stack smashing protection.
*/
#if 0 /* disabled by -frewrite-includes */
#if __has_attribute(no_stack_protector)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 902 "/usr/include/sys/cdefs.h" 3 4
#define __nostackprotector __attribute__((no_stack_protector))
#else
# 904 "/usr/include/sys/cdefs.h" 3 4
#define __nostackprotector \
__attribute__((__optimize__("-fno-stack-protector")))
#endif
# 907 "/usr/include/sys/cdefs.h" 3 4
/* Guard variables and structure members by lock. */
#define __guarded_by(x) __lock_annotate(guarded_by(x))
#define __pt_guarded_by(x) __lock_annotate(pt_guarded_by(x))
/* Alignment builtins for better type checking and improved code generation. */
/* Provide fallback versions for other compilers (GCC/Clang < 10): */
#if 0 /* disabled by -frewrite-includes */
#if !__has_builtin(__builtin_is_aligned)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 915 "/usr/include/sys/cdefs.h" 3 4
#define __builtin_is_aligned(x, align) \
(((__uintptr_t)x & ((align) - 1)) == 0)
#endif
# 918 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if !__has_builtin(__builtin_align_up)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 919 "/usr/include/sys/cdefs.h" 3 4
#define __builtin_align_up(x, align) \
((__typeof__(x))(((__uintptr_t)(x)+((align)-1))&(~((align)-1))))
#endif
# 922 "/usr/include/sys/cdefs.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if !__has_builtin(__builtin_align_down)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 923 "/usr/include/sys/cdefs.h" 3 4
#define __builtin_align_down(x, align) \
((__typeof__(x))((x)&(~((align)-1))))
#endif
# 926 "/usr/include/sys/cdefs.h" 3 4
#define __align_up(x, y) __builtin_align_up(x, y)
#define __align_down(x, y) __builtin_align_down(x, y)
#define __is_aligned(x, y) __builtin_is_aligned(x, y)
#endif /* !_SYS_CDEFS_H_ */
# 932 "/usr/include/sys/cdefs.h" 3 4
# 38 "/usr/include/stdlib.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 38 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/sys/_null.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2003 Marcel Moolenaar
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef NULL
#if 0 /* disabled by -frewrite-includes */
#if !defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 32 "/usr/include/sys/_null.h" 3 4
#define NULL ((void *)0)
#else
# 34 "/usr/include/sys/_null.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __cplusplus >= 201103L
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 35 "/usr/include/sys/_null.h" 3 4
#define NULL nullptr
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 37 "/usr/include/sys/_null.h" 3 4
#define NULL __null
#else
# 39 "/usr/include/sys/_null.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if defined(__LP64__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 40 "/usr/include/sys/_null.h" 3 4
#define NULL (0L)
#else
# 42 "/usr/include/sys/_null.h" 3 4
#define NULL 0
#endif /* __LP64__ */
# 44 "/usr/include/sys/_null.h" 3 4
#endif /* __GNUG__ */
# 45 "/usr/include/sys/_null.h" 3 4
#endif /* !__cplusplus */
# 46 "/usr/include/sys/_null.h" 3 4
#endif
# 48 "/usr/include/sys/_null.h" 3 4
# 39 "/usr/include/stdlib.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 39 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/sys/_types.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS__TYPES_H_
#define _SYS__TYPES_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 32 "/usr/include/sys/_types.h" 3 4
# 33 "/usr/include/sys/_types.h" 3 4
/*
* Basic types upon which most other types are built.
*
* Note: It would be nice to simply use the compiler-provided __FOO_TYPE__
* macros. However, in order to do so we have to check that those match the
* previous typedefs exactly (not just that they have the same size) since any
* change would be an ABI break. For example, changing `long` to `long long`
* results in different C++ name mangling.
*/
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
#if 0 /* disabled by -frewrite-includes */
#if __SIZEOF_LONG__ == 8
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 50 "/usr/include/sys/_types.h" 3 4
typedef long __int64_t;
typedef unsigned long __uint64_t;
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif __SIZEOF_LONG__ == 4
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 53 "/usr/include/sys/_types.h" 3 4
__extension__
typedef long long __int64_t;
__extension__
typedef unsigned long long __uint64_t;
#else
# 58 "/usr/include/sys/_types.h" 3 4
#error unsupported long size
#endif
# 60 "/usr/include/sys/_types.h" 3 4
typedef __int8_t __int_least8_t;
typedef __int16_t __int_least16_t;
typedef __int32_t __int_least32_t;
typedef __int64_t __int_least64_t;
typedef __int64_t __intmax_t;
typedef __uint8_t __uint_least8_t;
typedef __uint16_t __uint_least16_t;
typedef __uint32_t __uint_least32_t;
typedef __uint64_t __uint_least64_t;
typedef __uint64_t __uintmax_t;
#if 0 /* disabled by -frewrite-includes */
#if __SIZEOF_POINTER__ == 8
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 73 "/usr/include/sys/_types.h" 3 4
typedef __int64_t __intptr_t;
typedef __int64_t __intfptr_t;
typedef __uint64_t __uintptr_t;
typedef __uint64_t __uintfptr_t;
typedef __uint64_t __vm_offset_t;
typedef __uint64_t __vm_size_t;
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif __SIZEOF_POINTER__ == 4
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 80 "/usr/include/sys/_types.h" 3 4
typedef __int32_t __intptr_t;
typedef __int32_t __intfptr_t;
typedef __uint32_t __uintptr_t;
typedef __uint32_t __uintfptr_t;
typedef __uint32_t __vm_offset_t;
typedef __uint32_t __vm_size_t;
#else
# 87 "/usr/include/sys/_types.h" 3 4
#error unsupported pointer size
#endif
# 89 "/usr/include/sys/_types.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __SIZEOF_SIZE_T__ == 8
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 91 "/usr/include/sys/_types.h" 3 4
typedef __uint64_t __size_t; /* sizeof() */
typedef __int64_t __ssize_t; /* byte count or error */
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif __SIZEOF_SIZE_T__ == 4
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 94 "/usr/include/sys/_types.h" 3 4
typedef __uint32_t __size_t; /* sizeof() */
typedef __int32_t __ssize_t; /* byte count or error */
#else
# 97 "/usr/include/sys/_types.h" 3 4
#error unsupported size_t size
#endif
# 99 "/usr/include/sys/_types.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __SIZEOF_PTRDIFF_T__ == 8
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 101 "/usr/include/sys/_types.h" 3 4
typedef __int64_t __ptrdiff_t; /* ptr1 - ptr2 */
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif __SIZEOF_PTRDIFF_T__ == 4
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 103 "/usr/include/sys/_types.h" 3 4
typedef __int32_t __ptrdiff_t; /* ptr1 - ptr2 */
#else
# 105 "/usr/include/sys/_types.h" 3 4
#error unsupported ptrdiff_t size
#endif
# 107 "/usr/include/sys/_types.h" 3 4
/*
* Target-dependent type definitions.
*/
#if 0 /* expanded by -frewrite-includes */
#include <machine/_types.h>
#endif /* expanded by -frewrite-includes */
# 111 "/usr/include/sys/_types.h" 3 4
# 1 "/usr/include/machine/_types.h" 1 3 4
/*-
* Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* From: @(#)ansi.h 8.2 (Berkeley) 1/4/94
* From: @(#)types.h 8.3 (Berkeley) 1/5/94
*/
#ifdef __arm__
#if 0 /* expanded by -frewrite-includes */
#include <arm/_types.h>
#endif /* expanded by -frewrite-includes */
# 35 "/usr/include/machine/_types.h" 3 4
# 36 "/usr/include/machine/_types.h" 3 4
#else /* !__arm__ */
# 37 "/usr/include/machine/_types.h" 3 4
#ifndef _MACHINE__TYPES_H_
#define _MACHINE__TYPES_H_
#ifndef _SYS__TYPES_H_
#error do not include this header, use sys/_types.h
#endif
# 44 "/usr/include/machine/_types.h" 3 4
/*
* Standard type definitions.
*/
typedef __int32_t __clock_t; /* clock()... */
typedef __int64_t __critical_t;
#ifndef _STANDALONE
typedef double __double_t;
typedef float __float_t;
#endif
# 54 "/usr/include/machine/_types.h" 3 4
typedef __int32_t __int_fast8_t;
typedef __int32_t __int_fast16_t;
typedef __int32_t __int_fast32_t;
typedef __int64_t __int_fast64_t;
typedef __int64_t __register_t;
typedef __int64_t __segsz_t; /* segment size (in pages) */
typedef __int64_t __time_t; /* time()... */
typedef __uint32_t __uint_fast8_t;
typedef __uint32_t __uint_fast16_t;
typedef __uint32_t __uint_fast32_t;
typedef __uint64_t __uint_fast64_t;
typedef __uint64_t __u_register_t;
typedef __uint64_t __vm_paddr_t;
typedef unsigned int ___wchar_t;
#define __WCHAR_MIN 0 /* min value for a wchar_t */
#define __WCHAR_MAX __UINT_MAX /* max value for a wchar_t */
#endif /* !_MACHINE__TYPES_H_ */
# 73 "/usr/include/machine/_types.h" 3 4
#endif /* !__arm__ */
# 75 "/usr/include/machine/_types.h" 3 4
# 112 "/usr/include/sys/_types.h" 2 3 4
/*
* Standard type definitions.
*/
typedef __int32_t __blksize_t; /* file block size */
typedef __int64_t __blkcnt_t; /* file block count */
typedef __int32_t __clockid_t; /* clock_gettime()... */
typedef __uint32_t __fflags_t; /* file flags */
typedef __uint64_t __fsblkcnt_t;
typedef __uint64_t __fsfilcnt_t;
typedef __uint32_t __gid_t;
typedef __int64_t __id_t; /* can hold a gid_t, pid_t, or uid_t */
typedef __uint64_t __ino_t; /* inode number */
typedef long __key_t; /* IPC key (for Sys V IPC) */
typedef __int32_t __lwpid_t; /* Thread ID (a.k.a. LWP) */
typedef __uint16_t __mode_t; /* permissions */
typedef int __accmode_t; /* access permissions */
typedef int __nl_item;
typedef __uint64_t __nlink_t; /* link count */
typedef __int64_t __off_t; /* file offset */
typedef __int64_t __off64_t; /* file offset (alias) */
typedef __int32_t __pid_t; /* process [group] */
typedef __int64_t __sbintime_t;
typedef __int64_t __rlim_t; /* resource limit - intentionally */
/* signed, because of legacy code */
/* that uses -1 for RLIM_INFINITY */
typedef __uint8_t __sa_family_t;
typedef __uint32_t __socklen_t;
typedef long __suseconds_t; /* microseconds (signed) */
typedef struct __timer *__timer_t; /* timer_gettime()... */
typedef struct __mq *__mqd_t; /* mq_open()... */
typedef __uint32_t __uid_t;
typedef unsigned int __useconds_t; /* microseconds (unsigned) */
typedef int __cpuwhich_t; /* which parameter for cpuset. */
typedef int __cpulevel_t; /* level parameter for cpuset. */
typedef int __cpusetid_t; /* cpuset identifier. */
typedef __int64_t __daddr_t; /* bwrite(3), FIOBMAP2, etc */
/*
* Unusual type definitions.
*/
/*
* rune_t is declared to be an ``int'' instead of the more natural
* ``unsigned long'' or ``long''. Two things are happening here. It is not
* unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
* it looks like 10646 will be a 31 bit standard. This means that if your
* ints cannot hold 32 bits, you will be in trouble. The reason an int was
* chosen over a long is that the is*() and to*() routines take ints (says
* ANSI C), but they use __ct_rune_t instead of int.
*
* NOTE: rune_t is not covered by ANSI nor other standards, and should not
* be instantiated outside of lib/libc/locale. Use wchar_t. wint_t and
* rune_t must be the same type. Also, wint_t should be able to hold all
* members of the largest character set plus one extra value (WEOF), and
* must be at least 16 bits.
*/
typedef int __ct_rune_t; /* arg type for ctype funcs */
typedef __ct_rune_t __rune_t; /* rune_t (see above) */
typedef __ct_rune_t __wint_t; /* wint_t (see above) */
/* Clang already provides these types as built-ins, but only in C++ mode. */
#if 0 /* disabled by -frewrite-includes */
#if !defined(__clang__) || !defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 174 "/usr/include/sys/_types.h" 3 4
typedef __uint_least16_t __char16_t;
typedef __uint_least32_t __char32_t;
#endif
# 177 "/usr/include/sys/_types.h" 3 4
/* In C++11, char16_t and char32_t are built-in types. */
#if 0 /* disabled by -frewrite-includes */
#if defined(__cplusplus) && __cplusplus >= 201103L
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 179 "/usr/include/sys/_types.h" 3 4
#define _CHAR16_T_DECLARED
#define _CHAR32_T_DECLARED
#endif
# 182 "/usr/include/sys/_types.h" 3 4
typedef struct {
long long __max_align1 __aligned(_Alignof(long long));
#ifndef _STANDALONE
long double __max_align2 __aligned(_Alignof(long double));
#endif
# 188 "/usr/include/sys/_types.h" 3 4
} __max_align_t;
typedef __uint64_t __dev_t; /* device number */
typedef __uint32_t __fixpt_t; /* fixed point number */
/*
* mbstate_t is an opaque object to keep conversion state during multibyte
* stream conversions.
*/
typedef union {
char __mbstate8[128];
__int64_t _mbstateL; /* for alignment */
} __mbstate_t;
typedef __uintmax_t __rman_res_t;
/*
* Types for varargs. These are all provided by builtin types these
* days, so centralize their definition.
*/
typedef __builtin_va_list __va_list; /* internally known to gcc */
#if 0 /* disabled by -frewrite-includes */
#if !defined(__GNUC_VA_LIST) && !defined(__NO_GNUC_VA_LIST)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 211 "/usr/include/sys/_types.h" 3 4
#define __GNUC_VA_LIST
typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/
#endif
# 214 "/usr/include/sys/_types.h" 3 4
/*
* When the following macro is defined, the system uses 64-bit inode numbers.
* Programs can use this to avoid including <sys/param.h>, with its associated
* namespace pollution.
*/
#define __INO64
#endif /* !_SYS__TYPES_H_ */
# 223 "/usr/include/sys/_types.h" 3 4
# 40 "/usr/include/stdlib.h" 2 3 4
__NULLABILITY_PRAGMA_PUSH
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 44 "/usr/include/stdlib.h" 3 4
#ifndef _RUNE_T_DECLARED
typedef __rune_t rune_t;
#define _RUNE_T_DECLARED
#endif
# 48 "/usr/include/stdlib.h" 3 4
#endif
# 49 "/usr/include/stdlib.h" 3 4
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 54 "/usr/include/stdlib.h" 3 4
#ifndef __cplusplus
#ifndef _WCHAR_T_DECLARED
typedef ___wchar_t wchar_t;
#define _WCHAR_T_DECLARED
#endif
# 60 "/usr/include/stdlib.h" 3 4
#endif
# 61 "/usr/include/stdlib.h" 3 4
typedef struct {
int quot; /* quotient */
int rem; /* remainder */
} div_t;
typedef struct {
long quot;
long rem;
} ldiv_t;
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
/*
* I.e., INT_MAX; rand(3) returns a signed integer but must produce output in
* the range [0, RAND_MAX], so half of the possible output range is unused.
*/
#define RAND_MAX 0x7fffffff
__BEGIN_DECLS
#ifdef _XLOCALE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_stdlib.h>
#endif /* expanded by -frewrite-includes */
# 83 "/usr/include/stdlib.h" 3 4
# 84 "/usr/include/stdlib.h" 3 4
#endif
# 85 "/usr/include/stdlib.h" 3 4
extern int __mb_cur_max;
extern int ___mb_cur_max(void);
#define MB_CUR_MAX ((size_t)___mb_cur_max())
_Noreturn void abort(void);
int abs(int) __pure2;
int atexit(void (* _Nonnull)(void));
double atof(const char *);
int atoi(const char *);
long atol(const char *);
void *bsearch(const void *, const void *, size_t,
size_t, int (*)(const void * _Nonnull, const void *));
void *calloc(size_t, size_t) __malloc_like __result_use_check
__alloc_size2(1, 2);
div_t div(int, int) __pure2;
_Noreturn void exit(int);
void free(void *);
char *getenv(const char *);
long labs(long) __pure2;
ldiv_t ldiv(long, long) __pure2;
void *malloc(size_t) __malloc_like __result_use_check __alloc_size(1);
int mblen(const char *, size_t);
size_t mbstowcs(wchar_t * __restrict , const char * __restrict, size_t);
int mbtowc(wchar_t * __restrict, const char * __restrict, size_t);
void qsort(void *, size_t, size_t,
int (* _Nonnull)(const void *, const void *));
int rand(void);
void *realloc(void *, size_t) __result_use_check __alloc_size(2);
void srand(unsigned);
double strtod(const char * __restrict, char ** __restrict);
float strtof(const char * __restrict, char ** __restrict);
long strtol(const char * __restrict, char ** __restrict, int);
long double
strtold(const char * __restrict, char ** __restrict);
unsigned long
strtoul(const char * __restrict, char ** __restrict, int);
int system(const char *);
int wctomb(char *, wchar_t);
size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t);
/*
* Functions added in C99 which we make conditionally available in the
* BSD^C89 namespace if the compiler supports `long long'.
* The #if test is more complicated than it ought to be because
* __BSD_VISIBLE implies __ISO_C_VISIBLE == 1999 *even if* `long long'
* is not supported in the compilation environment (which therefore means
* that it can't really be ISO C99).
*
* (The only other extension made by C99 in this header is _Exit().)
*/
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 1999 || defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 136 "/usr/include/stdlib.h" 3 4
#ifdef __LONG_LONG_SUPPORTED
/* LONGLONG */
typedef struct {
long long quot;
long long rem;
} lldiv_t;
/* LONGLONG */
long long
atoll(const char *);
/* LONGLONG */
long long
llabs(long long) __pure2;
/* LONGLONG */
lldiv_t lldiv(long long, long long) __pure2;
/* LONGLONG */
long long
strtoll(const char * __restrict, char ** __restrict, int);
/* LONGLONG */
unsigned long long
strtoull(const char * __restrict, char ** __restrict, int);
#endif /* __LONG_LONG_SUPPORTED */
# 158 "/usr/include/stdlib.h" 3 4
_Noreturn void _Exit(int);
#endif /* __ISO_C_VISIBLE >= 1999 */
# 161 "/usr/include/stdlib.h" 3 4
/*
* If we're in a mode greater than C99, expose C11 functions.
*/
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 166 "/usr/include/stdlib.h" 3 4
void * aligned_alloc(size_t, size_t) __malloc_like __alloc_align(1)
__alloc_size(2);
int at_quick_exit(void (*)(void));
_Noreturn void
quick_exit(int);
#endif /* __ISO_C_VISIBLE >= 2011 */
# 172 "/usr/include/stdlib.h" 3 4
/*
* Extensions made by POSIX relative to C.
*/
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 176 "/usr/include/stdlib.h" 3 4
char *realpath(const char * __restrict, char * __restrict);
#endif
# 178 "/usr/include/stdlib.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199506
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 179 "/usr/include/stdlib.h" 3 4
int rand_r(unsigned *); /* (TSF) */
#endif
# 181 "/usr/include/stdlib.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 182 "/usr/include/stdlib.h" 3 4
int posix_memalign(void **, size_t, size_t); /* (ADV) */
int setenv(const char *, const char *, int);
int unsetenv(const char *);
#endif
# 186 "/usr/include/stdlib.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 188 "/usr/include/stdlib.h" 3 4
int getsubopt(char **, char *const *, char **);
#ifndef _MKDTEMP_DECLARED
char *mkdtemp(char *);
#define _MKDTEMP_DECLARED
#endif
# 193 "/usr/include/stdlib.h" 3 4
#ifndef _MKSTEMP_DECLARED
int mkstemp(char *);
#define _MKSTEMP_DECLARED
#endif
# 197 "/usr/include/stdlib.h" 3 4
#endif /* __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE */
# 198 "/usr/include/stdlib.h" 3 4
/*
* The only changes to the XSI namespace in revision 6 were the deletion
* of the ttyslot() and valloc() functions, which FreeBSD never declared
* in this header. For revision 7, ecvt(), fcvt(), and gcvt(), which
* FreeBSD also does not have, and mktemp(), are to be deleted.
*/
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 206 "/usr/include/stdlib.h" 3 4
/* XXX XSI requires pollution from <sys/wait.h> here. We'd rather not. */
long a64l(const char *);
double drand48(void);
/* char *ecvt(double, int, int * __restrict, int * __restrict); */
double erand48(unsigned short[3]);
/* char *fcvt(double, int, int * __restrict, int * __restrict); */
/* char *gcvt(double, int, int * __restrict, int * __restrict); */
char *initstate(unsigned int, char *, size_t);
long jrand48(unsigned short[3]);
char *l64a(long);
void lcong48(unsigned short[7]);
long lrand48(void);
#if 0 /* disabled by -frewrite-includes */
#if !defined(_MKTEMP_DECLARED) && (__BSD_VISIBLE || __XSI_VISIBLE <= 600)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 219 "/usr/include/stdlib.h" 3 4
char *mktemp(char *);
#define _MKTEMP_DECLARED
#endif
# 222 "/usr/include/stdlib.h" 3 4
long mrand48(void);
long nrand48(unsigned short[3]);
int putenv(char *);
long random(void);
unsigned short
*seed48(unsigned short[3]);
char *setstate(/* const */ char *);
void srand48(long);
void srandom(unsigned int);
#endif /* __XSI_VISIBLE */
# 232 "/usr/include/stdlib.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 234 "/usr/include/stdlib.h" 3 4
int grantpt(int);
int posix_openpt(int);
char *ptsname(int);
int unlockpt(int);
#endif /* __XSI_VISIBLE */
# 239 "/usr/include/stdlib.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 240 "/usr/include/stdlib.h" 3 4
/* ptsname_r will be included in POSIX issue 8 */
int ptsname_r(int, char *, size_t);
#endif
# 243 "/usr/include/stdlib.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 245 "/usr/include/stdlib.h" 3 4
extern const char *malloc_conf;
extern void (*malloc_message)(void *, const char *);
/*
* The alloca() function can't be implemented in C, and on some
* platforms it can't be implemented at all as a callable function.
* The GNU C compiler provides a built-in alloca() which we can use.
* On platforms where alloca() is not in libc, programs which use it
* will fail to link when compiled with non-GNU compilers.
*/
#if 0 /* disabled by -frewrite-includes */
#if __GNUC__ >= 2
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 256 "/usr/include/stdlib.h" 3 4
#undef alloca /* some GNU bits try to get cute and define this on their own */
#define alloca(sz) __builtin_alloca(sz)
#endif
# 259 "/usr/include/stdlib.h" 3 4
void abort2(const char *, int, void **) __dead2;
__uint32_t
arc4random(void);
void arc4random_buf(void *, size_t);
__uint32_t
arc4random_uniform(__uint32_t);
#ifdef __BLOCKS__
int atexit_b(void (^ _Nonnull)(void));
void *bsearch_b(const void *, const void *, size_t,
size_t, int (^ _Nonnull)(const void *, const void *));
#endif
# 272 "/usr/include/stdlib.h" 3 4
char *getbsize(int *, long *);
/* getcap(3) functions */
char *cgetcap(char *, const char *, int);
int cgetclose(void);
int cgetent(char **, char **, const char *);
int cgetfirst(char **, char **);
int cgetmatch(const char *, const char *);
int cgetnext(char **, char **);
int cgetnum(char *, const char *, long *);
int cgetset(const char *);
int cgetstr(char *, const char *, char **);
int cgetustr(char *, const char *, char **);
int clearenv(void);
int daemon(int, int);
int daemonfd(int, int);
char *devname(__dev_t, __mode_t);
char *devname_r(__dev_t, __mode_t, char *, int);
char *fdevname(int);
char *fdevname_r(int, char *, int);
int getloadavg(double [], int);
const char *
getprogname(void);
int heapsort(void *, size_t, size_t,
int (* _Nonnull)(const void *, const void *));
#ifdef __BLOCKS__
int heapsort_b(void *, size_t, size_t,
int (^ _Nonnull)(const void *, const void *));
void qsort_b(void *, size_t, size_t,
int (^ _Nonnull)(const void *, const void *));
#endif
# 305 "/usr/include/stdlib.h" 3 4
int l64a_r(long, char *, int);
int mergesort(void *, size_t, size_t, int (*)(const void *, const void *));
#ifdef __BLOCKS__
int mergesort_b(void *, size_t, size_t, int (^)(const void *, const void *));
#endif
# 310 "/usr/include/stdlib.h" 3 4
int mkostemp(char *, int);
int mkostemps(char *, int, int);
int mkostempsat(int, char *, int, int);
void qsort_r(void *, size_t, size_t,
int (*)(const void *, const void *, void *), void *);
int radixsort(const unsigned char **, int, const unsigned char *,
unsigned);
void *reallocarray(void *, size_t, size_t) __result_use_check
__alloc_size2(2, 3);
void *reallocf(void *, size_t) __result_use_check __alloc_size(2);
int rpmatch(const char *);
char *secure_getenv(const char *);
void setprogname(const char *);
int sradixsort(const unsigned char **, int, const unsigned char *,
unsigned);
void srandomdev(void);
long long
strtonum(const char *, long long, long long, const char **);
/* Deprecated interfaces, to be removed. */
__int64_t
strtoq(const char *, char **, int);
__uint64_t
strtouq(const char *, char **, int);
/*
* In FreeBSD 14, the prototype of qsort_r() was modified to comply with
* POSIX. The standardized qsort_r()'s order of last two parameters was
* changed, and the comparator function is now taking thunk as its last
* parameter, and both are different from the ones expected by the historical
* FreeBSD qsort_r() interface.
*
* Apply a workaround where we explicitly link against the historical
* interface, qsort_r@FBSD_1.0, in case when qsort_r() is called with
* the last parameter with a function pointer that exactly matches the
* historical FreeBSD qsort_r() comparator signature, so applications
* written for the historical interface can continue to work without
* modification.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__generic) || defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 350 "/usr/include/stdlib.h" 3 4
void __qsort_r_compat(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *));
__sym_compat(qsort_r, __qsort_r_compat, FBSD_1.0);
#endif
# 354 "/usr/include/stdlib.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if defined(__generic) && !defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 355 "/usr/include/stdlib.h" 3 4
#define qsort_r(base, nel, width, arg4, arg5) \
__generic(arg5, int (*)(void *, const void *, const void *), \
__qsort_r_compat, qsort_r)(base, nel, width, arg4, arg5)
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 359 "/usr/include/stdlib.h" 3 4
__END_DECLS
extern "C++" {
static inline void qsort_r(void *base, size_t nmemb, size_t size,
void *thunk, int (*compar)(void *, const void *, const void *)) {
__qsort_r_compat(base, nmemb, size, thunk, compar);
}
}
__BEGIN_DECLS
#endif
# 368 "/usr/include/stdlib.h" 3 4
extern char *suboptarg; /* getsubopt(3) external variable */
#endif /* __BSD_VISIBLE */
# 371 "/usr/include/stdlib.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __EXT1_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 373 "/usr/include/stdlib.h" 3 4
#ifndef _RSIZE_T_DEFINED
#define _RSIZE_T_DEFINED
typedef size_t rsize_t;
#endif
# 378 "/usr/include/stdlib.h" 3 4
#ifndef _ERRNO_T_DEFINED
#define _ERRNO_T_DEFINED
typedef int errno_t;
#endif
# 383 "/usr/include/stdlib.h" 3 4
/* K.3.6 */
typedef void (*constraint_handler_t)(const char * __restrict,
void * __restrict, errno_t);
/* K.3.6.1.1 */
constraint_handler_t set_constraint_handler_s(constraint_handler_t handler);
/* K.3.6.1.2 */
_Noreturn void abort_handler_s(const char * __restrict, void * __restrict,
errno_t);
/* K3.6.1.3 */
void ignore_handler_s(const char * __restrict, void * __restrict, errno_t);
/* K.3.6.3.2 */
errno_t qsort_s(void *, rsize_t, rsize_t,
int (*)(const void *, const void *, void *), void *);
#endif /* __EXT1_VISIBLE */
# 398 "/usr/include/stdlib.h" 3 4
__END_DECLS
__NULLABILITY_PRAGMA_POP
#endif /* !_STDLIB_H_ */
# 403 "/usr/include/stdlib.h" 3 4
# 24 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
# include <stdio.h> // FILE*
#endif /* expanded by -frewrite-includes */
# 24 "./Include/Python.h"
# 1 "/usr/include/stdio.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Chris Torek.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)stdio.h 8.5 (Berkeley) 4/29/95
*/
#ifndef _STDIO_H_
#define _STDIO_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 40 "/usr/include/stdio.h" 3 4
# 41 "/usr/include/stdio.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 41 "/usr/include/stdio.h" 3 4
# 42 "/usr/include/stdio.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 42 "/usr/include/stdio.h" 3 4
# 43 "/usr/include/stdio.h" 3 4
__NULLABILITY_PRAGMA_PUSH
typedef __off_t fpos_t;
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 52 "/usr/include/stdio.h" 3 4
#ifndef _RSIZE_T_DEFINED
#define _RSIZE_T_DEFINED
typedef size_t rsize_t;
#endif
# 57 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 59 "/usr/include/stdio.h" 3 4
#ifndef _OFF_T_DECLARED
#define _OFF_T_DECLARED
typedef __off_t off_t;
#endif
# 63 "/usr/include/stdio.h" 3 4
#ifndef _SSIZE_T_DECLARED
#define _SSIZE_T_DECLARED
typedef __ssize_t ssize_t;
#endif
# 67 "/usr/include/stdio.h" 3 4
#endif
# 68 "/usr/include/stdio.h" 3 4
#ifndef _OFF64_T_DECLARED
#define _OFF64_T_DECLARED
typedef __off64_t off64_t;
#endif
# 73 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 75 "/usr/include/stdio.h" 3 4
#ifndef _VA_LIST_DECLARED
typedef __va_list va_list;
#define _VA_LIST_DECLARED
#endif
# 79 "/usr/include/stdio.h" 3 4
#endif
# 80 "/usr/include/stdio.h" 3 4
#define _FSTDIO /* Define for new stdio with functions. */
/*
* NB: to fit things in six character monocase externals, the stdio
* code uses the prefix `__s' for stdio objects, typically followed
* by a three-character attempt at a mnemonic.
*/
/* stdio buffers */
struct __sbuf {
unsigned char *_base;
int _size;
};
/*
* stdio state variables.
*
* The following always hold:
*
* if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
* _lbfsize is -_bf._size, else _lbfsize is 0
* if _flags&__SRD, _w is 0
* if _flags&__SWR, _r is 0
*
* This ensures that the getc and putc macros (or inline functions) never
* try to write or read from a file that is in `read' or `write' mode.
* (Moreover, they can, and do, automatically switch from read mode to
* write mode, and back, on "r+" and "w+" files.)
*
* _lbfsize is used only to make the inline line-buffered output stream
* code as compact as possible.
*
* _ub, _up, and _ur are used when ungetc() pushes back more characters
* than fit in the current _bf, or when ungetc() pushes back a character
* that does not match the previous one in _bf. When this happens,
* _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
* _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
*
* Certain members of __sFILE are accessed directly via macros or
* inline functions. To preserve ABI compat, these members must not
* be disturbed. These members are marked below with (*).
*/
struct __sFILE {
unsigned char *_p; /* (*) current position in (some) buffer */
int _r; /* (*) read space left for getc() */
int _w; /* (*) write space left for putc() */
short _flags; /* (*) flags, below; this FILE is free if 0 */
short _file; /* (*) fileno, if Unix descriptor, else -1 */
struct __sbuf _bf; /* (*) the buffer (at least 1 byte, if !NULL) */
int _lbfsize; /* (*) 0 or -_bf._size, for inline putc */
/* operations */
void *_cookie; /* (*) cookie passed to io functions */
int (* _Nullable _close)(void *);
int (* _Nullable _read)(void *, char *, int);
fpos_t (* _Nullable _seek)(void *, fpos_t, int);
int (* _Nullable _write)(void *, const char *, int);
/* separate buffer for long sequences of ungetc() */
struct __sbuf _ub; /* ungetc buffer */
unsigned char *_up; /* saved _p when _p is doing ungetc data */
int _ur; /* saved _r when _r is counting ungetc data */
/* tricks to meet minimum requirements even when malloc() fails */
unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */
unsigned char _nbuf[1]; /* guarantee a getc() buffer */
/* separate buffer for fgetln() when line crosses buffer boundary */
struct __sbuf _lb; /* buffer for fgetln() */
/* Unix stdio files get aligned to block boundaries on fseek() */
int _blksize; /* stat.st_blksize (may be != _bf._size) */
fpos_t _offset; /* current lseek offset */
struct pthread_mutex *_fl_mutex; /* used for MT-safety */
struct pthread *_fl_owner; /* current owner */
int _fl_count; /* recursive lock count */
int _orientation; /* orientation for fwide() */
__mbstate_t _mbstate; /* multibyte conversion state */
int _flags2; /* additional flags */
};
#ifndef _STDFILE_DECLARED
#define _STDFILE_DECLARED
typedef struct __sFILE FILE;
#endif
# 166 "/usr/include/stdio.h" 3 4
#ifndef _STDSTREAM_DECLARED
__BEGIN_DECLS
extern FILE *__stdinp;
extern FILE *__stdoutp;
extern FILE *__stderrp;
__END_DECLS
#define _STDSTREAM_DECLARED
#endif
# 174 "/usr/include/stdio.h" 3 4
#define __SLBF 0x0001 /* line buffered */
#define __SNBF 0x0002 /* unbuffered */
#define __SRD 0x0004 /* OK to read */
#define __SWR 0x0008 /* OK to write */
/* RD and WR are never simultaneously asserted */
#define __SRW 0x0010 /* open for reading & writing */
#define __SEOF 0x0020 /* found EOF */
#define __SERR 0x0040 /* found error */
#define __SMBF 0x0080 /* _bf._base is from malloc */
#define __SAPP 0x0100 /* fdopen()ed in append mode */
#define __SSTR 0x0200 /* this is an sprintf/snprintf string */
#define __SOPT 0x0400 /* do fseek() optimization */
#define __SNPT 0x0800 /* do not do fseek() optimization */
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
#define __SMOD 0x2000 /* true => fgetln modified _p text */
#define __SALC 0x4000 /* allocate string space dynamically */
#define __SIGN 0x8000 /* ignore this file in _fwalk */
#define __S2OAP 0x0001 /* O_APPEND mode is set */
/*
* The following three definitions are for ANSI C, which took them
* from System V, which brilliantly took internal interface macros and
* made them official arguments to setvbuf(), without renaming them.
* Hence, these ugly _IOxxx names are *supposed* to appear in user code.
*
* Although numbered as their counterparts above, the implementation
* does not rely on this.
*/
#define _IOFBF 0 /* setvbuf should set fully buffered */
#define _IOLBF 1 /* setvbuf should set line buffered */
#define _IONBF 2 /* setvbuf should set unbuffered */
#define BUFSIZ 1024 /* size of buffer used by setbuf */
#define EOF (-1)
/*
* FOPEN_MAX is a minimum maximum, and is the number of streams that
* stdio can provide without attempting to allocate further resources
* (which could fail). Do not use this for anything.
*/
/* must be == _POSIX_STREAM_MAX <limits.h> */
#ifndef FOPEN_MAX
#define FOPEN_MAX 20 /* must be <= OPEN_MAX <sys/syslimits.h> */
#endif
# 220 "/usr/include/stdio.h" 3 4
#define FILENAME_MAX 1024 /* must be <= PATH_MAX <sys/syslimits.h> */
/* System V/ANSI C; this is the wrong way to do this, do *not* use these. */
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 224 "/usr/include/stdio.h" 3 4
#define P_tmpdir "/tmp/"
#endif
# 226 "/usr/include/stdio.h" 3 4
#define L_tmpnam 1024 /* XXX must be == PATH_MAX */
#define TMP_MAX 308915776
#ifndef SEEK_SET
#define SEEK_SET 0 /* set file offset to offset */
#endif
# 232 "/usr/include/stdio.h" 3 4
#ifndef SEEK_CUR
#define SEEK_CUR 1 /* set file offset to current plus offset */
#endif
# 235 "/usr/include/stdio.h" 3 4
#ifndef SEEK_END
#define SEEK_END 2 /* set file offset to EOF plus offset */
#endif
# 238 "/usr/include/stdio.h" 3 4
#define stdin __stdinp
#define stdout __stdoutp
#define stderr __stderrp
__BEGIN_DECLS
#ifdef _XLOCALE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_stdio.h>
#endif /* expanded by -frewrite-includes */
# 245 "/usr/include/stdio.h" 3 4
# 246 "/usr/include/stdio.h" 3 4
#endif
# 247 "/usr/include/stdio.h" 3 4
/*
* Functions defined in ANSI C standard.
*/
void clearerr(FILE *);
int fclose(FILE *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE * __restrict, fpos_t * __restrict);
char *fgets(char * __restrict, int, FILE * __restrict);
FILE *fopen(const char * __restrict, const char * __restrict);
int fprintf(FILE * __restrict, const char * __restrict, ...);
int fputc(int, FILE *);
int fputs(const char * __restrict, FILE * __restrict);
size_t fread(void * __restrict, size_t, size_t, FILE * __restrict);
FILE *freopen(const char * __restrict, const char * __restrict, FILE * __restrict);
int fscanf(FILE * __restrict, const char * __restrict, ...);
int fseek(FILE *, long, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict);
int getc(FILE *);
int getchar(void);
#if 0 /* disabled by -frewrite-includes */
#if __EXT1_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 272 "/usr/include/stdio.h" 3 4
char *gets_s(char *, rsize_t);
#endif
# 274 "/usr/include/stdio.h" 3 4
void perror(const char *);
int printf(const char * __restrict, ...);
int putc(int, FILE *);
int putchar(int);
int puts(const char *);
int remove(const char *);
int rename(const char *, const char *);
void rewind(FILE *);
int scanf(const char * __restrict, ...);
void setbuf(FILE * __restrict, char * __restrict);
int setvbuf(FILE * __restrict, char * __restrict, int, size_t);
int sprintf(char * __restrict, const char * __restrict, ...);
int sscanf(const char * __restrict, const char * __restrict, ...);
FILE *tmpfile(void);
char *tmpnam(char *);
int ungetc(int, FILE *);
int vfprintf(FILE * __restrict, const char * __restrict,
__va_list);
int vprintf(const char * __restrict, __va_list);
int vsprintf(char * __restrict, const char * __restrict,
__va_list);
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 1999 || __POSIX_VISIBLE >= 199506
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 297 "/usr/include/stdio.h" 3 4
int snprintf(char * __restrict, size_t, const char * __restrict,
...) __printflike(3, 4);
int vsnprintf(char * __restrict, size_t, const char * __restrict,
__va_list) __printflike(3, 0);
#endif
# 302 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 1999
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 303 "/usr/include/stdio.h" 3 4
int vfscanf(FILE * __restrict, const char * __restrict, __va_list)
__scanflike(2, 0);
int vscanf(const char * __restrict, __va_list) __scanflike(1, 0);
int vsscanf(const char * __restrict, const char * __restrict, __va_list)
__scanflike(2, 0);
#endif
# 309 "/usr/include/stdio.h" 3 4
/*
* Functions defined in all versions of POSIX 1003.1.
*/
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE || (__POSIX_VISIBLE && __POSIX_VISIBLE <= 199506)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 314 "/usr/include/stdio.h" 3 4
#define L_cuserid 17 /* size for cuserid(3); MAXLOGNAME, legacy */
#endif
# 316 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 318 "/usr/include/stdio.h" 3 4
#define L_ctermid 1024 /* size for ctermid(3); PATH_MAX */
char *ctermid(char *);
FILE *fdopen(int, const char *);
int fileno(FILE *);
#endif /* __POSIX_VISIBLE */
# 324 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199209
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 326 "/usr/include/stdio.h" 3 4
int pclose(FILE *);
FILE *popen(const char *, const char *);
#endif
# 329 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199506
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 331 "/usr/include/stdio.h" 3 4
int ftrylockfile(FILE *);
void flockfile(FILE *);
void funlockfile(FILE *);
/*
* These are normally used through macros as defined below, but POSIX
* requires functions as well.
*/
int getc_unlocked(FILE *);
int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
#endif
# 344 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 345 "/usr/include/stdio.h" 3 4
void clearerr_unlocked(FILE *);
int feof_unlocked(FILE *);
int ferror_unlocked(FILE *);
int fflush_unlocked(FILE *);
int fileno_unlocked(FILE *);
int fputc_unlocked(int, FILE *);
int fputs_unlocked(const char * __restrict, FILE * __restrict);
size_t fread_unlocked(void * __restrict, size_t, size_t, FILE * __restrict);
size_t fwrite_unlocked(const void * __restrict, size_t, size_t,
FILE * __restrict);
#endif
# 356 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 358 "/usr/include/stdio.h" 3 4
int fseeko(FILE *, __off_t, int);
__off_t ftello(FILE *);
#endif
# 361 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE || __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 363 "/usr/include/stdio.h" 3 4
int getw(FILE *);
int putw(int, FILE *);
#endif /* BSD or X/Open before issue 6 */
# 366 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 368 "/usr/include/stdio.h" 3 4
char *tempnam(const char *, const char *);
#endif
# 370 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 372 "/usr/include/stdio.h" 3 4
FILE *fmemopen(void * __restrict, size_t, const char * __restrict);
ssize_t getdelim(char ** __restrict, size_t * __restrict, int,
FILE * __restrict);
FILE *open_memstream(char **, size_t *);
int renameat(int, const char *, int, const char *);
int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0);
/* _WITH_GETLINE to allow pre 11 sources to build on 11+ systems */
ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict);
int dprintf(int, const char * __restrict, ...) __printflike(2, 3);
#endif /* __POSIX_VISIBLE >= 200809 */
# 382 "/usr/include/stdio.h" 3 4
/*
* Routines that are purely local.
*/
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 387 "/usr/include/stdio.h" 3 4
int asprintf(char **, const char *, ...) __printflike(2, 3);
char *ctermid_r(char *);
void fcloseall(void);
int fdclose(FILE *, int *);
char *fgetln(FILE *, size_t *);
const char *fmtcheck(const char *, const char *) __format_arg(2);
int fpurge(FILE *);
void setbuffer(FILE *, char *, int);
int setlinebuf(FILE *);
int vasprintf(char **, const char *, __va_list)
__printflike(2, 0);
/*
* The system error table contains messages for the first sys_nerr
* positive errno values. Use strerror() or strerror_r() from <string.h>
* instead.
*/
extern const int sys_nerr;
extern const char * const sys_errlist[];
/*
* Stdio function-access interface.
*/
FILE *funopen(const void *,
int (* _Nullable)(void *, char *, int),
int (* _Nullable)(void *, const char *, int),
fpos_t (* _Nullable)(void *, fpos_t, int),
int (* _Nullable)(void *));
#define fropen(cookie, fn) funopen(cookie, fn, 0, 0, 0)
#define fwopen(cookie, fn) funopen(cookie, 0, fn, 0, 0)
typedef __ssize_t cookie_read_function_t(void *, char *, size_t);
typedef __ssize_t cookie_write_function_t(void *, const char *, size_t);
typedef int cookie_seek_function_t(void *, off64_t *, int);
typedef int cookie_close_function_t(void *);
typedef struct {
cookie_read_function_t *read;
cookie_write_function_t *write;
cookie_seek_function_t *seek;
cookie_close_function_t *close;
} cookie_io_functions_t;
FILE *fopencookie(void *, const char *, cookie_io_functions_t);
/*
* Portability hacks. See <sys/types.h>.
*/
#ifndef _FTRUNCATE_DECLARED
#define _FTRUNCATE_DECLARED
int ftruncate(int, __off_t);
#endif
# 437 "/usr/include/stdio.h" 3 4
#ifndef _LSEEK_DECLARED
#define _LSEEK_DECLARED
__off_t lseek(int, __off_t, int);
#endif
# 441 "/usr/include/stdio.h" 3 4
#ifndef _MMAP_DECLARED
#define _MMAP_DECLARED
void *mmap(void *, size_t, int, int, int, __off_t);
#endif
# 445 "/usr/include/stdio.h" 3 4
#ifndef _TRUNCATE_DECLARED
#define _TRUNCATE_DECLARED
int truncate(const char *, __off_t);
#endif
# 449 "/usr/include/stdio.h" 3 4
#endif /* __BSD_VISIBLE */
# 450 "/usr/include/stdio.h" 3 4
/*
* Functions internal to the implementation.
*/
int __srget(FILE *);
int __swbuf(int, FILE *);
/*
* The __sfoo macros are here so that we can
* define function versions in the C library.
*/
#define __sgetc(p) (--(p)->_r < 0 ? __srget(p) : (int)(*(p)->_p++))
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__) && defined(__STDC__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 463 "/usr/include/stdio.h" 3 4
static __inline int __sputc(int _c, FILE *_p) {
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
return (*_p->_p++ = _c);
else
return (__swbuf(_c, _p));
}
#else
# 470 "/usr/include/stdio.h" 3 4
/*
* This has been tuned to generate reasonable code on the vax using pcc.
*/
#define __sputc(c, p) \
(--(p)->_w < 0 ? \
(p)->_w >= (p)->_lbfsize ? \
(*(p)->_p = (c)), *(p)->_p != '\n' ? \
(int)*(p)->_p++ : \
__swbuf('\n', p) : \
__swbuf((int)(c), p) : \
(*(p)->_p = (c), (int)*(p)->_p++))
#endif
# 482 "/usr/include/stdio.h" 3 4
#ifndef __LIBC_ISTHREADED_DECLARED
#define __LIBC_ISTHREADED_DECLARED
extern int __isthreaded;
#endif
# 487 "/usr/include/stdio.h" 3 4
#ifndef __cplusplus
#define __sfeof(p) (((p)->_flags & __SEOF) != 0)
#define __sferror(p) (((p)->_flags & __SERR) != 0)
#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF)))
#define __sfileno(p) ((p)->_file)
#define feof(p) (!__isthreaded ? __sfeof(p) : (feof)(p))
#define ferror(p) (!__isthreaded ? __sferror(p) : (ferror)(p))
#define clearerr(p) (!__isthreaded ? __sclearerr(p) : (clearerr)(p))
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 501 "/usr/include/stdio.h" 3 4
#define fileno(p) (!__isthreaded ? __sfileno(p) : (fileno)(p))
#endif
# 503 "/usr/include/stdio.h" 3 4
#define getc(fp) (!__isthreaded ? __sgetc(fp) : (getc)(fp))
#define putc(x, fp) (!__isthreaded ? __sputc(x, fp) : (putc)(x, fp))
#define getchar() getc(stdin)
#define putchar(x) putc(x, stdout)
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 511 "/usr/include/stdio.h" 3 4
/*
* See ISO/IEC 9945-1 ANSI/IEEE Std 1003.1 Second Edition 1996-07-12
* B.8.2.7 for the rationale behind the *_unlocked() macros.
*/
#define clearerr_unlocked(p) __sclearerr(p)
#define feof_unlocked(p) __sfeof(p)
#define ferror_unlocked(p) __sferror(p)
#define fileno_unlocked(p) __sfileno(p)
#define fputc_unlocked(s, p) __sputc(s, p)
#endif
# 521 "/usr/include/stdio.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199506
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 522 "/usr/include/stdio.h" 3 4
#define getc_unlocked(fp) __sgetc(fp)
#define putc_unlocked(x, fp) __sputc(x, fp)
#define getchar_unlocked() getc_unlocked(stdin)
#define putchar_unlocked(x) putc_unlocked(x, stdout)
#endif
# 528 "/usr/include/stdio.h" 3 4
#endif /* __cplusplus */
# 529 "/usr/include/stdio.h" 3 4
__END_DECLS
__NULLABILITY_PRAGMA_POP
#endif /* !_STDIO_H_ */
# 534 "/usr/include/stdio.h" 3 4
# 25 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
# include <errno.h> // errno
#endif /* expanded by -frewrite-includes */
# 25 "./Include/Python.h"
# 1 "/usr/include/errno.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1982, 1986, 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)errno.h 8.5 (Berkeley) 1/21/94
*/
#ifndef _SYS_ERRNO_H_
#define _SYS_ERRNO_H_
#if 0 /* disabled by -frewrite-includes */
#if !defined(_KERNEL) && !defined(_STANDALONE)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 43 "/usr/include/errno.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 43 "/usr/include/errno.h" 3 4
# 44 "/usr/include/errno.h" 3 4
__BEGIN_DECLS
int * __error(void);
__END_DECLS
#define errno (* __error())
#endif
# 49 "/usr/include/errno.h" 3 4
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define ESRCH 3 /* No such process */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* Input/output error */
#define ENXIO 6 /* Device not configured */
#define E2BIG 7 /* Argument list too long */
#define ENOEXEC 8 /* Exec format error */
#define EBADF 9 /* Bad file descriptor */
#define ECHILD 10 /* No child processes */
#define EDEADLK 11 /* Resource deadlock avoided */
/* 11 was EAGAIN */
#define ENOMEM 12 /* Cannot allocate memory */
#define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */
#ifndef _POSIX_SOURCE
#define ENOTBLK 15 /* Block device required */
#endif
# 68 "/usr/include/errno.h" 3 4
#define EBUSY 16 /* Device busy */
#define EEXIST 17 /* File exists */
#define EXDEV 18 /* Cross-device link */
#define ENODEV 19 /* Operation not supported by device */
#define ENOTDIR 20 /* Not a directory */
#define EISDIR 21 /* Is a directory */
#define EINVAL 22 /* Invalid argument */
#define ENFILE 23 /* Too many open files in system */
#define EMFILE 24 /* Too many open files */
#define ENOTTY 25 /* Inappropriate ioctl for device */
#ifndef _POSIX_SOURCE
#define ETXTBSY 26 /* Text file busy */
#endif
# 81 "/usr/include/errno.h" 3 4
#define EFBIG 27 /* File too large */
#define ENOSPC 28 /* No space left on device */
#define ESPIPE 29 /* Illegal seek */
#define EROFS 30 /* Read-only filesystem */
#define EMLINK 31 /* Too many links */
#define EPIPE 32 /* Broken pipe */
/* math software */
#define EDOM 33 /* Numerical argument out of domain */
#define ERANGE 34 /* Result too large */
/* non-blocking and interrupt i/o */
#define EAGAIN 35 /* Resource temporarily unavailable */
#ifndef _POSIX_SOURCE
#define EWOULDBLOCK EAGAIN /* Operation would block */
#define EINPROGRESS 36 /* Operation now in progress */
#define EALREADY 37 /* Operation already in progress */
/* ipc/network software -- argument errors */
#define ENOTSOCK 38 /* Socket operation on non-socket */
#define EDESTADDRREQ 39 /* Destination address required */
#define EMSGSIZE 40 /* Message too long */
#define EPROTOTYPE 41 /* Protocol wrong type for socket */
#define ENOPROTOOPT 42 /* Protocol not available */
#define EPROTONOSUPPORT 43 /* Protocol not supported */
#define ESOCKTNOSUPPORT 44 /* Socket type not supported */
#define EOPNOTSUPP 45 /* Operation not supported */
#define ENOTSUP EOPNOTSUPP /* Operation not supported */
#define EPFNOSUPPORT 46 /* Protocol family not supported */
#define EAFNOSUPPORT 47 /* Address family not supported by protocol family */
#define EADDRINUSE 48 /* Address already in use */
#define EADDRNOTAVAIL 49 /* Can't assign requested address */
/* ipc/network software -- operational errors */
#define ENETDOWN 50 /* Network is down */
#define ENETUNREACH 51 /* Network is unreachable */
#define ENETRESET 52 /* Network dropped connection on reset */
#define ECONNABORTED 53 /* Software caused connection abort */
#define ECONNRESET 54 /* Connection reset by peer */
#define ENOBUFS 55 /* No buffer space available */
#define EISCONN 56 /* Socket is already connected */
#define ENOTCONN 57 /* Socket is not connected */
#define ESHUTDOWN 58 /* Can't send after socket shutdown */
#define ETOOMANYREFS 59 /* Too many references: can't splice */
#define ETIMEDOUT 60 /* Operation timed out */
#define ECONNREFUSED 61 /* Connection refused */
#define ELOOP 62 /* Too many levels of symbolic links */
#endif /* _POSIX_SOURCE */
# 130 "/usr/include/errno.h" 3 4
#define ENAMETOOLONG 63 /* File name too long */
/* should be rearranged */
#ifndef _POSIX_SOURCE
#define EHOSTDOWN 64 /* Host is down */
#define EHOSTUNREACH 65 /* No route to host */
#endif /* _POSIX_SOURCE */
# 137 "/usr/include/errno.h" 3 4
#define ENOTEMPTY 66 /* Directory not empty */
/* quotas & mush */
#ifndef _POSIX_SOURCE
#define EPROCLIM 67 /* Too many processes */
#define EUSERS 68 /* Too many users */
#define EDQUOT 69 /* Disc quota exceeded */
/* Network File System */
#define ESTALE 70 /* Stale NFS file handle */
#define EREMOTE 71 /* Too many levels of remote in path */
#define EBADRPC 72 /* RPC struct is bad */
#define ERPCMISMATCH 73 /* RPC version wrong */
#define EPROGUNAVAIL 74 /* RPC prog. not avail */
#define EPROGMISMATCH 75 /* Program version wrong */
#define EPROCUNAVAIL 76 /* Bad procedure for program */
#endif /* _POSIX_SOURCE */
# 154 "/usr/include/errno.h" 3 4
#define ENOLCK 77 /* No locks available */
#define ENOSYS 78 /* Function not implemented */
#ifndef _POSIX_SOURCE
#define EFTYPE 79 /* Inappropriate file type or format */
#define EAUTH 80 /* Authentication error */
#define ENEEDAUTH 81 /* Need authenticator */
#define EIDRM 82 /* Identifier removed */
#define ENOMSG 83 /* No message of desired type */
#define EOVERFLOW 84 /* Value too large to be stored in data type */
#define ECANCELED 85 /* Operation canceled */
#define EILSEQ 86 /* Illegal byte sequence */
#define ENOATTR 87 /* Attribute not found */
#define EDOOFUS 88 /* Programming error */
#endif /* _POSIX_SOURCE */
# 171 "/usr/include/errno.h" 3 4
#define EBADMSG 89 /* Bad message */
#define EMULTIHOP 90 /* Multihop attempted */
#define ENOLINK 91 /* Link has been severed */
#define EPROTO 92 /* Protocol error */
#ifndef _POSIX_SOURCE
#define ENOTCAPABLE 93 /* Capabilities insufficient */
#define ECAPMODE 94 /* Not permitted in capability mode */
#define ENOTRECOVERABLE 95 /* State not recoverable */
#define EOWNERDEAD 96 /* Previous owner died */
#define EINTEGRITY 97 /* Integrity check failed */
#endif /* _POSIX_SOURCE */
# 184 "/usr/include/errno.h" 3 4
#ifndef _POSIX_SOURCE
#define ELAST 97 /* Must be equal largest errno */
#endif /* _POSIX_SOURCE */
# 188 "/usr/include/errno.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if defined(_KERNEL) || defined(_WANT_KERNEL_ERRNO) || defined(_STANDALONE)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 190 "/usr/include/errno.h" 3 4
/* pseudo-errors returned inside kernel to modify return to process */
#define ERESTART (-1) /* restart syscall */
#define EJUSTRETURN (-2) /* don't modify regs, just return */
#define ENOIOCTL (-3) /* ioctl not handled by this layer */
#define EDIRIOCTL (-4) /* do direct ioctl in GEOM */
#define ERELOOKUP (-5) /* retry the directory lookup */
#endif
# 197 "/usr/include/errno.h" 3 4
#ifndef _KERNEL
#if 0 /* disabled by -frewrite-includes */
#if __EXT1_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 200 "/usr/include/errno.h" 3 4
/* ISO/IEC 9899:2011 K.3.2.2 */
#ifndef _ERRNO_T_DEFINED
#define _ERRNO_T_DEFINED
typedef int errno_t;
#endif
# 205 "/usr/include/errno.h" 3 4
#endif /* __EXT1_VISIBLE */
# 206 "/usr/include/errno.h" 3 4
#endif
# 207 "/usr/include/errno.h" 3 4
#endif
# 209 "/usr/include/errno.h" 3 4
# 26 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
# include <string.h> // memcpy()
#endif /* expanded by -frewrite-includes */
# 26 "./Include/Python.h"
# 1 "/usr/include/string.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)string.h 8.1 (Berkeley) 6/2/93
*/
#ifndef _STRING_H_
#define _STRING_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 37 "/usr/include/string.h" 3 4
# 38 "/usr/include/string.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 38 "/usr/include/string.h" 3 4
# 39 "/usr/include/string.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 39 "/usr/include/string.h" 3 4
# 40 "/usr/include/string.h" 3 4
/*
* Prototype functions which were historically defined in <string.h>, but
* are required by POSIX to be prototyped in <strings.h>.
*/
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 46 "/usr/include/string.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <strings.h>
#endif /* expanded by -frewrite-includes */
# 46 "/usr/include/string.h" 3 4
# 1 "/usr/include/strings.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _STRINGS_H_
#define _STRINGS_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 32 "/usr/include/strings.h" 3 4
# 33 "/usr/include/strings.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 33 "/usr/include/strings.h" 3 4
# 34 "/usr/include/strings.h" 3 4
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 39 "/usr/include/strings.h" 3 4
__BEGIN_DECLS
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 42 "/usr/include/strings.h" 3 4
int bcmp(const void *, const void *, size_t) __pure; /* LEGACY */
void bcopy(const void *, void *, size_t); /* LEGACY */
void bzero(void *, size_t); /* LEGACY */
#endif
# 46 "/usr/include/strings.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 47 "/usr/include/strings.h" 3 4
void explicit_bzero(void *, size_t);
#endif
# 49 "/usr/include/strings.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 50 "/usr/include/strings.h" 3 4
int ffs(int) __pure2;
#endif
# 52 "/usr/include/strings.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 53 "/usr/include/strings.h" 3 4
int ffsl(long) __pure2;
int ffsll(long long) __pure2;
int fls(int) __pure2;
int flsl(long) __pure2;
int flsll(long long) __pure2;
#endif
# 59 "/usr/include/strings.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE || __POSIX_VISIBLE <= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 60 "/usr/include/strings.h" 3 4
char *index(const char *, int) __pure; /* LEGACY */
char *rindex(const char *, int) __pure; /* LEGACY */
#endif
# 63 "/usr/include/strings.h" 3 4
int strcasecmp(const char *, const char *) __pure;
int strncasecmp(const char *, const char *, size_t) __pure;
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 67 "/usr/include/strings.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_strings.h>
#endif /* expanded by -frewrite-includes */
# 67 "/usr/include/strings.h" 3 4
# 1 "/usr/include/xlocale/_strings.h" 1 3 4
/*-
* Copyright (c) 2011, 2012 The FreeBSD Foundation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 30 "/usr/include/xlocale/_strings.h" 3 4
/*
* This file is included from both strings.h and xlocale.h. We need to expose
* the declarations unconditionally if we are included from xlocale.h, but only
* if we are in POSIX2008 mode if included from string.h.
*/
#ifndef _XLOCALE_STRINGS1_H
#define _XLOCALE_STRINGS1_H
/*
* POSIX2008 functions
*/
int strcasecmp_l(const char *, const char *, locale_t);
int strncasecmp_l(const char *, const char *, size_t, locale_t);
#endif /* _XLOCALE_STRINGS1_H */
# 46 "/usr/include/xlocale/_strings.h" 3 4
# 68 "/usr/include/strings.h" 2 3 4
#endif
# 69 "/usr/include/strings.h" 3 4
__END_DECLS
#endif /* _STRINGS_H_ */
# 72 "/usr/include/strings.h" 3 4
# 47 "/usr/include/string.h" 2 3 4
#endif
# 48 "/usr/include/string.h" 3 4
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 53 "/usr/include/string.h" 3 4
__BEGIN_DECLS
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE >= 600
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 56 "/usr/include/string.h" 3 4
void *memccpy(void * __restrict, const void * __restrict, int, size_t);
#endif
# 58 "/usr/include/string.h" 3 4
void *memchr(const void *, int, size_t) __pure;
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 60 "/usr/include/string.h" 3 4
void *memrchr(const void *, int, size_t) __pure;
#endif
# 62 "/usr/include/string.h" 3 4
int memcmp(const void *, const void *, size_t) __pure;
void *memcpy(void * __restrict, const void * __restrict, size_t);
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 65 "/usr/include/string.h" 3 4
void *memmem(const void *, size_t, const void *, size_t) __pure;
#endif
# 67 "/usr/include/string.h" 3 4
void *memmove(void *, const void *, size_t);
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 69 "/usr/include/string.h" 3 4
void *mempcpy(void * __restrict, const void * __restrict, size_t);
#endif
# 71 "/usr/include/string.h" 3 4
void *memset(void *, int, size_t);
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 73 "/usr/include/string.h" 3 4
char *stpcpy(char * __restrict, const char * __restrict);
char *stpncpy(char * __restrict, const char * __restrict, size_t);
#endif
# 76 "/usr/include/string.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 77 "/usr/include/string.h" 3 4
char *strcasestr(const char *, const char *) __pure;
#endif
# 79 "/usr/include/string.h" 3 4
char *strcat(char * __restrict, const char * __restrict);
char *strchr(const char *, int) __pure;
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 82 "/usr/include/string.h" 3 4
char *strchrnul(const char*, int) __pure;
int strverscmp(const char *, const char *) __pure;
#endif
# 85 "/usr/include/string.h" 3 4
int strcmp(const char *, const char *) __pure;
int strcoll(const char *, const char *);
char *strcpy(char * __restrict, const char * __restrict);
size_t strcspn(const char *, const char *) __pure;
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 90 "/usr/include/string.h" 3 4
char *strdup(const char *) __malloc_like;
#endif
# 92 "/usr/include/string.h" 3 4
char *strerror(int);
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 94 "/usr/include/string.h" 3 4
int strerror_r(int, char *, size_t);
#endif
# 96 "/usr/include/string.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 97 "/usr/include/string.h" 3 4
size_t strlcat(char * __restrict, const char * __restrict, size_t);
size_t strlcpy(char * __restrict, const char * __restrict, size_t);
#endif
# 100 "/usr/include/string.h" 3 4
size_t strlen(const char *) __pure;
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 102 "/usr/include/string.h" 3 4
#ifndef _MODE_T_DECLARED
typedef __mode_t mode_t;
#define _MODE_T_DECLARED
#endif
# 107 "/usr/include/string.h" 3 4
void strmode(mode_t, char *);
#endif
# 110 "/usr/include/string.h" 3 4
char *strncat(char * __restrict, const char * __restrict, size_t);
int strncmp(const char *, const char *, size_t) __pure;
char *strncpy(char * __restrict, const char * __restrict, size_t);
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 114 "/usr/include/string.h" 3 4
char *strndup(const char *, size_t) __malloc_like;
size_t strnlen(const char *, size_t) __pure;
#endif
# 117 "/usr/include/string.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 118 "/usr/include/string.h" 3 4
char *strnstr(const char *, const char *, size_t) __pure;
#endif
# 120 "/usr/include/string.h" 3 4
char *strpbrk(const char *, const char *) __pure;
char *strrchr(const char *, int) __pure;
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 123 "/usr/include/string.h" 3 4
char *strsep(char **, const char *);
#endif
# 125 "/usr/include/string.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 126 "/usr/include/string.h" 3 4
char *strsignal(int);
#endif
# 128 "/usr/include/string.h" 3 4
size_t strspn(const char *, const char *) __pure;
char *strstr(const char *, const char *) __pure;
char *strtok(char * __restrict, const char * __restrict);
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE >= 500
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 132 "/usr/include/string.h" 3 4
char *strtok_r(char *, const char *, char **);
#endif
# 134 "/usr/include/string.h" 3 4
size_t strxfrm(char * __restrict, const char * __restrict, size_t);
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 136 "/usr/include/string.h" 3 4
#ifndef _SWAB_DECLARED
#define _SWAB_DECLARED
#ifndef _SSIZE_T_DECLARED
typedef __ssize_t ssize_t;
#define _SSIZE_T_DECLARED
#endif /* _SIZE_T_DECLARED */
# 144 "/usr/include/string.h" 3 4
void swab(const void * __restrict, void * __restrict, ssize_t);
#endif /* _SWAB_DECLARED */
# 147 "/usr/include/string.h" 3 4
int timingsafe_bcmp(const void *, const void *, size_t);
int timingsafe_memcmp(const void *, const void *, size_t);
#endif /* __BSD_VISIBLE */
# 151 "/usr/include/string.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112 || defined(_XLOCALE_H_)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 153 "/usr/include/string.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_string.h>
#endif /* expanded by -frewrite-includes */
# 153 "/usr/include/string.h" 3 4
# 1 "/usr/include/xlocale/_string.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011, 2012 The FreeBSD Foundation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 32 "/usr/include/xlocale/_string.h" 3 4
/*
* This file is included from both string.h and xlocale.h. We need to expose
* the declarations unconditionally if we are included from xlocale.h, but only
* if we are in POSIX2008 mode if included from string.h.
*/
#ifndef _XLOCALE_STRING1_H
#define _XLOCALE_STRING1_H
/*
* POSIX2008 functions
*/
int strcoll_l(const char *, const char *, locale_t);
char *strerror_l(int num, locale_t);
size_t strxfrm_l(char *, const char *, size_t, locale_t);
#endif /* _XLOCALE_STRING1_H */
# 49 "/usr/include/xlocale/_string.h" 3 4
/*
* xlocale extensions
*/
#ifdef _XLOCALE_H_
#ifndef _XLOCALE_STRING2_H
#define _XLOCALE_STRING2_H
char *strcasestr_l(const char *, const char *, locale_t);
#endif /* _XLOCALE_STRING2_H */
# 59 "/usr/include/xlocale/_string.h" 3 4
#endif /* _XLOCALE_H_ */
# 60 "/usr/include/xlocale/_string.h" 3 4
# 154 "/usr/include/string.h" 2 3 4
#endif
# 155 "/usr/include/string.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __EXT1_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 157 "/usr/include/string.h" 3 4
#ifndef _RSIZE_T_DEFINED
#define _RSIZE_T_DEFINED
typedef size_t rsize_t;
#endif
# 162 "/usr/include/string.h" 3 4
#ifndef _ERRNO_T_DEFINED
#define _ERRNO_T_DEFINED
typedef int errno_t;
#endif
# 167 "/usr/include/string.h" 3 4
/* ISO/IEC 9899:2011 K.3.7.4.1.1 */
errno_t memset_s(void *, rsize_t, int, rsize_t);
#endif /* __EXT1_VISIBLE */
# 171 "/usr/include/string.h" 3 4
__END_DECLS
#endif /* _STRING_H_ */
# 174 "/usr/include/string.h" 3 4
# 27 "./Include/Python.h" 2
#endif
# 28 "./Include/Python.h"
#ifndef MS_WINDOWS
#if 0 /* expanded by -frewrite-includes */
# include <unistd.h>
#endif /* expanded by -frewrite-includes */
# 29 "./Include/Python.h"
# 1 "/usr/include/unistd.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)unistd.h 8.12 (Berkeley) 4/27/95
*/
#ifndef _UNISTD_H_
#define _UNISTD_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 37 "/usr/include/unistd.h" 3 4
# 38 "/usr/include/unistd.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h> /* XXX adds too much pollution. */
#endif /* expanded by -frewrite-includes */
# 38 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/sys/types.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1982, 1986, 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)types.h 8.6 (Berkeley) 2/19/95
*/
#ifndef _SYS_TYPES_H_
#define _SYS_TYPES_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 42 "/usr/include/sys/types.h" 3 4
# 43 "/usr/include/sys/types.h" 3 4
/* Machine type dependent parameters. */
#if 0 /* expanded by -frewrite-includes */
#include <machine/endian.h>
#endif /* expanded by -frewrite-includes */
# 45 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/machine/endian.h" 1 3 4
/*-
* Copyright (c) 2001 David E. O'Brien
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)endian.h 8.1 (Berkeley) 6/10/93
* $NetBSD: endian.h,v 1.7 1999/08/21 05:53:51 simonb Exp $
*/
#ifndef _MACHINE_ENDIAN_H_
#define _MACHINE_ENDIAN_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 35 "/usr/include/machine/endian.h" 3 4
# 36 "/usr/include/machine/endian.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_endian.h>
#endif /* expanded by -frewrite-includes */
# 36 "/usr/include/machine/endian.h" 3 4
# 1 "/usr/include/sys/_endian.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1987, 1991 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS__ENDIAN_H_
#define _SYS__ENDIAN_H_
#if 0 /* disabled by -frewrite-includes */
#if !defined(_MACHINE_ENDIAN_H_) && !defined(_BYTESWAP_H_) && !defined(_ENDIAN_H_)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 36 "/usr/include/sys/_endian.h" 3 4
#error "sys/_endian.h should not be included directly"
#endif
# 38 "/usr/include/sys/_endian.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h> /* visibility macros */
#endif /* expanded by -frewrite-includes */
# 39 "/usr/include/sys/_endian.h" 3 4
# 40 "/usr/include/sys/_endian.h" 3 4
/* BSD Compatibility */
#define _BYTE_ORDER __BYTE_ORDER__
/*
* Definitions for byte order, according to byte significance from low
* address to high. We undefine any prior definition of them because
* powerpc compilers define _LITTLE_ENDIAN and _BIG_ENDIAN to mean
* something else.
*/
#undef _LITTLE_ENDIAN
#define _LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ /* LSB first: 1234 */
#undef _BIG_ENDIAN
#define _BIG_ENDIAN __ORDER_BIG_ENDIAN__ /* MSB first: 4321 */
#define _PDP_ENDIAN __ORDER_PDP_ENDIAN__ /* LSB first in word,
* MSW first in long: 3412 */
/*
* Define the order of 32-bit words in 64-bit words.
*/
#if 0 /* disabled by -frewrite-includes */
#if _BYTE_ORDER == _LITTLE_ENDIAN
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 61 "/usr/include/sys/_endian.h" 3 4
#define _QUAD_HIGHWORD 1
#define _QUAD_LOWWORD 0
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif _BYTE_ORDER == _BIG_ENDIAN
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 64 "/usr/include/sys/_endian.h" 3 4
#define _QUAD_HIGHWORD 0
#define _QUAD_LOWWORD 1
#else
# 67 "/usr/include/sys/_endian.h" 3 4
#error "Unsupported endian"
#endif
# 69 "/usr/include/sys/_endian.h" 3 4
/*
* POSIX Issue 8 will require these for endian.h. Define them there and in the
* traditional BSD compilation environment. Since issue 8 doesn't yet have an
* assigned date, use strictly greater than issue 7's date.
*/
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE || _POSIX_C_SOURCE > 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 76 "/usr/include/sys/_endian.h" 3 4
#define LITTLE_ENDIAN _LITTLE_ENDIAN
#define BIG_ENDIAN _BIG_ENDIAN
#define PDP_ENDIAN _PDP_ENDIAN
#define BYTE_ORDER _BYTE_ORDER
#endif
# 81 "/usr/include/sys/_endian.h" 3 4
/* bswap primitives, based on compiler builtins */
#define __bswap16(x) __builtin_bswap16(x)
#define __bswap32(x) __builtin_bswap32(x)
#define __bswap64(x) __builtin_bswap64(x)
#if 0 /* disabled by -frewrite-includes */
#if _BYTE_ORDER == _LITTLE_ENDIAN
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 88 "/usr/include/sys/_endian.h" 3 4
#define __ntohl(x) (__bswap32(x))
#define __ntohs(x) (__bswap16(x))
#define __htonl(x) (__bswap32(x))
#define __htons(x) (__bswap16(x))
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif _BYTE_ORDER == _BIG_ENDIAN
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 93 "/usr/include/sys/_endian.h" 3 4
#define __htonl(x) ((__uint32_t)(x))
#define __htons(x) ((__uint16_t)(x))
#define __ntohl(x) ((__uint32_t)(x))
#define __ntohs(x) ((__uint16_t)(x))
#endif
# 98 "/usr/include/sys/_endian.h" 3 4
/*
* Host to big endian, host to little endian, big endian to host, and little
* endian to host byte order functions as detailed in byteorder(9).
*/
#if 0 /* disabled by -frewrite-includes */
#if _BYTE_ORDER == _LITTLE_ENDIAN
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 104 "/usr/include/sys/_endian.h" 3 4
#define htobe16(x) __bswap16((x))
#define htobe32(x) __bswap32((x))
#define htobe64(x) __bswap64((x))
#define htole16(x) ((uint16_t)(x))
#define htole32(x) ((uint32_t)(x))
#define htole64(x) ((uint64_t)(x))
#define be16toh(x) __bswap16((x))
#define be32toh(x) __bswap32((x))
#define be64toh(x) __bswap64((x))
#define le16toh(x) ((uint16_t)(x))
#define le32toh(x) ((uint32_t)(x))
#define le64toh(x) ((uint64_t)(x))
#else /* _BYTE_ORDER != _LITTLE_ENDIAN */
# 118 "/usr/include/sys/_endian.h" 3 4
#define htobe16(x) ((uint16_t)(x))
#define htobe32(x) ((uint32_t)(x))
#define htobe64(x) ((uint64_t)(x))
#define htole16(x) __bswap16((x))
#define htole32(x) __bswap32((x))
#define htole64(x) __bswap64((x))
#define be16toh(x) ((uint16_t)(x))
#define be32toh(x) ((uint32_t)(x))
#define be64toh(x) ((uint64_t)(x))
#define le16toh(x) __bswap16((x))
#define le32toh(x) __bswap32((x))
#define le64toh(x) __bswap64((x))
#endif /* _BYTE_ORDER == _LITTLE_ENDIAN */
# 132 "/usr/include/sys/_endian.h" 3 4
#endif /* _SYS__ENDIAN_H_ */
# 134 "/usr/include/sys/_endian.h" 3 4
# 37 "/usr/include/machine/endian.h" 2 3 4
#endif /* !_MACHINE_ENDIAN_H_ */
# 39 "/usr/include/machine/endian.h" 3 4
# 46 "/usr/include/sys/types.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 46 "/usr/include/sys/types.h" 3 4
# 47 "/usr/include/sys/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_pthreadtypes.h>
#endif /* expanded by -frewrite-includes */
# 48 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/sys/_pthreadtypes.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1993, 1994 by Chris Provenzano, proven@mit.edu
* Copyright (c) 1995-1998 by John Birrell <jb@cimlogic.com.au>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Chris Provenzano.
* 4. The name of Chris Provenzano may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY CHRIS PROVENZANO ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL CHRIS PROVENZANO BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS__PTHREADTYPES_H_
#define _SYS__PTHREADTYPES_H_
/*
* Forward structure definitions.
*
* These are mostly opaque to the user.
*/
struct pthread;
struct pthread_attr;
struct pthread_cond;
struct pthread_cond_attr;
struct pthread_mutex;
struct pthread_mutex_attr;
struct pthread_once;
struct pthread_rwlock;
struct pthread_rwlockattr;
struct pthread_barrier;
struct pthread_barrier_attr;
struct pthread_spinlock;
/*
* Primitive system data type definitions required by P1003.1c.
*
* Note that P1003.1c specifies that there are no defined comparison
* or assignment operators for the types pthread_attr_t, pthread_cond_t,
* pthread_condattr_t, pthread_mutex_t, pthread_mutexattr_t.
*/
#ifndef _PTHREAD_T_DECLARED
typedef struct pthread *pthread_t;
#define _PTHREAD_T_DECLARED
#endif
# 68 "/usr/include/sys/_pthreadtypes.h" 3 4
typedef struct pthread_attr *pthread_attr_t;
typedef struct pthread_mutex *pthread_mutex_t;
typedef struct pthread_mutex_attr *pthread_mutexattr_t;
typedef struct pthread_cond *pthread_cond_t;
typedef struct pthread_cond_attr *pthread_condattr_t;
typedef int pthread_key_t;
typedef struct pthread_once pthread_once_t;
typedef struct pthread_rwlock *pthread_rwlock_t;
typedef struct pthread_rwlockattr *pthread_rwlockattr_t;
typedef struct pthread_barrier *pthread_barrier_t;
typedef struct pthread_barrierattr *pthread_barrierattr_t;
typedef struct pthread_spinlock *pthread_spinlock_t;
/*
* Additional type definitions:
*
* Note that P1003.1c reserves the prefixes pthread_ and PTHREAD_ for
* use in header symbols.
*/
typedef void *pthread_addr_t;
typedef void *(*pthread_startroutine_t)(void *);
/*
* Once definitions.
*/
struct pthread_once {
int state;
pthread_mutex_t mutex;
};
#endif /* ! _SYS__PTHREADTYPES_H_ */
# 99 "/usr/include/sys/_pthreadtypes.h" 3 4
# 49 "/usr/include/sys/types.h" 2 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 51 "/usr/include/sys/types.h" 3 4
typedef unsigned char u_char;
typedef unsigned short u_short;
typedef unsigned int u_int;
typedef unsigned long u_long;
#ifndef _KERNEL
typedef unsigned short ushort; /* Sys V compatibility */
typedef unsigned int uint; /* Sys V compatibility */
#endif
# 59 "/usr/include/sys/types.h" 3 4
#endif
# 60 "/usr/include/sys/types.h" 3 4
/*
* XXX POSIX sized integrals that should appear only in <sys/stdint.h>.
*/
#if 0 /* expanded by -frewrite-includes */
#include <sys/_stdint.h>
#endif /* expanded by -frewrite-includes */
# 64 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/sys/_stdint.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011 David E. O'Brien <obrien@FreeBSD.org>
* Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS__STDINT_H_
#define _SYS__STDINT_H_
#ifndef _INT8_T_DECLARED
typedef __int8_t int8_t;
#define _INT8_T_DECLARED
#endif
# 37 "/usr/include/sys/_stdint.h" 3 4
#ifndef _INT16_T_DECLARED
typedef __int16_t int16_t;
#define _INT16_T_DECLARED
#endif
# 42 "/usr/include/sys/_stdint.h" 3 4
#ifndef _INT32_T_DECLARED
typedef __int32_t int32_t;
#define _INT32_T_DECLARED
#endif
# 47 "/usr/include/sys/_stdint.h" 3 4
#ifndef _INT64_T_DECLARED
typedef __int64_t int64_t;
#define _INT64_T_DECLARED
#endif
# 52 "/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT8_T_DECLARED
typedef __uint8_t uint8_t;
#define _UINT8_T_DECLARED
#endif
# 57 "/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT16_T_DECLARED
typedef __uint16_t uint16_t;
#define _UINT16_T_DECLARED
#endif
# 62 "/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT32_T_DECLARED
typedef __uint32_t uint32_t;
#define _UINT32_T_DECLARED
#endif
# 67 "/usr/include/sys/_stdint.h" 3 4
#ifndef _UINT64_T_DECLARED
typedef __uint64_t uint64_t;
#define _UINT64_T_DECLARED
#endif
# 72 "/usr/include/sys/_stdint.h" 3 4
#ifndef _INTPTR_T_DECLARED
typedef __intptr_t intptr_t;
#define _INTPTR_T_DECLARED
#endif
# 77 "/usr/include/sys/_stdint.h" 3 4
#ifndef _UINTPTR_T_DECLARED
typedef __uintptr_t uintptr_t;
#define _UINTPTR_T_DECLARED
#endif
# 81 "/usr/include/sys/_stdint.h" 3 4
#ifndef _INTMAX_T_DECLARED
typedef __intmax_t intmax_t;
#define _INTMAX_T_DECLARED
#endif
# 85 "/usr/include/sys/_stdint.h" 3 4
#ifndef _UINTMAX_T_DECLARED
typedef __uintmax_t uintmax_t;
#define _UINTMAX_T_DECLARED
#endif
# 89 "/usr/include/sys/_stdint.h" 3 4
#endif /* !_SYS__STDINT_H_ */
# 91 "/usr/include/sys/_stdint.h" 3 4
# 65 "/usr/include/sys/types.h" 2 3 4
typedef __uint8_t u_int8_t; /* unsigned integrals (deprecated) */
typedef __uint16_t u_int16_t;
typedef __uint32_t u_int32_t;
typedef __uint64_t u_int64_t;
typedef __uint64_t u_quad_t; /* quads (deprecated) */
typedef __int64_t quad_t;
typedef quad_t * qaddr_t;
typedef char * caddr_t; /* core address */
typedef const char * c_caddr_t; /* core address, pointer to const */
#ifndef _BLKSIZE_T_DECLARED
typedef __blksize_t blksize_t;
#define _BLKSIZE_T_DECLARED
#endif
# 82 "/usr/include/sys/types.h" 3 4
typedef __cpuwhich_t cpuwhich_t;
typedef __cpulevel_t cpulevel_t;
typedef __cpusetid_t cpusetid_t;
#ifndef _BLKCNT_T_DECLARED
typedef __blkcnt_t blkcnt_t;
#define _BLKCNT_T_DECLARED
#endif
# 91 "/usr/include/sys/types.h" 3 4
#ifndef _CLOCK_T_DECLARED
typedef __clock_t clock_t;
#define _CLOCK_T_DECLARED
#endif
# 96 "/usr/include/sys/types.h" 3 4
#ifndef _CLOCKID_T_DECLARED
typedef __clockid_t clockid_t;
#define _CLOCKID_T_DECLARED
#endif
# 101 "/usr/include/sys/types.h" 3 4
typedef __critical_t critical_t; /* Critical section value */
typedef __daddr_t daddr_t; /* disk address */
#ifndef _DEV_T_DECLARED
typedef __dev_t dev_t; /* device number or struct cdev */
#define _DEV_T_DECLARED
#endif
# 109 "/usr/include/sys/types.h" 3 4
#ifndef _FFLAGS_T_DECLARED
typedef __fflags_t fflags_t; /* file flags */
#define _FFLAGS_T_DECLARED
#endif
# 114 "/usr/include/sys/types.h" 3 4
typedef __fixpt_t fixpt_t; /* fixed point number */
#ifndef _FSBLKCNT_T_DECLARED /* for statvfs() */
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
#define _FSBLKCNT_T_DECLARED
#endif
# 122 "/usr/include/sys/types.h" 3 4
#ifndef _GID_T_DECLARED
typedef __gid_t gid_t; /* group id */
#define _GID_T_DECLARED
#endif
# 127 "/usr/include/sys/types.h" 3 4
#ifndef _IN_ADDR_T_DECLARED
typedef __uint32_t in_addr_t; /* base type for internet address */
#define _IN_ADDR_T_DECLARED
#endif
# 132 "/usr/include/sys/types.h" 3 4
#ifndef _IN_PORT_T_DECLARED
typedef __uint16_t in_port_t;
#define _IN_PORT_T_DECLARED
#endif
# 137 "/usr/include/sys/types.h" 3 4
#ifndef _ID_T_DECLARED
typedef __id_t id_t; /* can hold a uid_t or pid_t */
#define _ID_T_DECLARED
#endif
# 142 "/usr/include/sys/types.h" 3 4
#ifndef _INO_T_DECLARED
typedef __ino_t ino_t; /* inode number */
#define _INO_T_DECLARED
#endif
# 147 "/usr/include/sys/types.h" 3 4
#ifndef _KEY_T_DECLARED
typedef __key_t key_t; /* IPC key (for Sys V IPC) */
#define _KEY_T_DECLARED
#endif
# 152 "/usr/include/sys/types.h" 3 4
#ifndef _LWPID_T_DECLARED
typedef __lwpid_t lwpid_t; /* Thread ID (a.k.a. LWP) */
#define _LWPID_T_DECLARED
#endif
# 157 "/usr/include/sys/types.h" 3 4
#ifndef _MODE_T_DECLARED
typedef __mode_t mode_t; /* permissions */
#define _MODE_T_DECLARED
#endif
# 162 "/usr/include/sys/types.h" 3 4
#ifndef _ACCMODE_T_DECLARED
typedef __accmode_t accmode_t; /* access permissions */
#define _ACCMODE_T_DECLARED
#endif
# 167 "/usr/include/sys/types.h" 3 4
#ifndef _NLINK_T_DECLARED
typedef __nlink_t nlink_t; /* link count */
#define _NLINK_T_DECLARED
#endif
# 172 "/usr/include/sys/types.h" 3 4
#ifndef _OFF_T_DECLARED
typedef __off_t off_t; /* file offset */
#define _OFF_T_DECLARED
#endif
# 177 "/usr/include/sys/types.h" 3 4
#ifndef _OFF64_T_DECLARED
typedef __off64_t off64_t; /* file offset (alias) */
#define _OFF64_T_DECLARED
#endif
# 182 "/usr/include/sys/types.h" 3 4
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t; /* process id */
#define _PID_T_DECLARED
#endif
# 187 "/usr/include/sys/types.h" 3 4
typedef __register_t register_t;
#ifndef _RLIM_T_DECLARED
typedef __rlim_t rlim_t; /* resource limit */
#define _RLIM_T_DECLARED
#endif
# 194 "/usr/include/sys/types.h" 3 4
typedef __sbintime_t sbintime_t;
typedef __segsz_t segsz_t; /* segment size (in pages) */
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 203 "/usr/include/sys/types.h" 3 4
#ifndef _SSIZE_T_DECLARED
typedef __ssize_t ssize_t;
#define _SSIZE_T_DECLARED
#endif
# 208 "/usr/include/sys/types.h" 3 4
#ifndef _SUSECONDS_T_DECLARED
typedef __suseconds_t suseconds_t; /* microseconds (signed) */
#define _SUSECONDS_T_DECLARED
#endif
# 213 "/usr/include/sys/types.h" 3 4
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 218 "/usr/include/sys/types.h" 3 4
#ifndef _TIMER_T_DECLARED
typedef __timer_t timer_t;
#define _TIMER_T_DECLARED
#endif
# 223 "/usr/include/sys/types.h" 3 4
#ifndef _MQD_T_DECLARED
typedef __mqd_t mqd_t;
#define _MQD_T_DECLARED
#endif
# 228 "/usr/include/sys/types.h" 3 4
typedef __u_register_t u_register_t;
#ifndef _UID_T_DECLARED
typedef __uid_t uid_t; /* user id */
#define _UID_T_DECLARED
#endif
# 235 "/usr/include/sys/types.h" 3 4
#ifndef _USECONDS_T_DECLARED
typedef __useconds_t useconds_t; /* microseconds (unsigned) */
#define _USECONDS_T_DECLARED
#endif
# 240 "/usr/include/sys/types.h" 3 4
#ifndef _CAP_IOCTL_T_DECLARED
#define _CAP_IOCTL_T_DECLARED
typedef unsigned long cap_ioctl_t;
#endif
# 245 "/usr/include/sys/types.h" 3 4
#ifndef _CAP_RIGHTS_T_DECLARED
#define _CAP_RIGHTS_T_DECLARED
struct cap_rights;
typedef struct cap_rights cap_rights_t;
#endif
# 252 "/usr/include/sys/types.h" 3 4
/*
* Types suitable for exporting physical addresses, virtual addresses
* (pointers), and memory object sizes from the kernel independent of native
* word size. These should be used in place of vm_paddr_t, (u)intptr_t, and
* size_t in structs which contain such types that are shared with userspace.
*/
typedef __uint64_t kpaddr_t;
typedef __uint64_t kvaddr_t;
typedef __uint64_t ksize_t;
typedef __int64_t kssize_t;
typedef __vm_offset_t vm_offset_t;
typedef __uint64_t vm_ooffset_t;
typedef __vm_paddr_t vm_paddr_t;
typedef __uint64_t vm_pindex_t;
typedef __vm_size_t vm_size_t;
typedef __rman_res_t rman_res_t;
typedef __register_t syscallarg_t;
#ifdef _KERNEL
typedef unsigned int boolean_t;
typedef struct _device *device_t;
typedef __intfptr_t intfptr_t;
/*
* XXX this is fixed width for historical reasons. It should have had type
* __int_fast32_t. Fixed-width types should not be used unless binary
* compatibility is essential. Least-width types should be used even less
* since they provide smaller benefits.
*
* XXX should be MD.
*
* XXX this is bogus in -current, but still used for spl*().
*/
typedef __uint32_t intrmask_t; /* Interrupt mask (spl, xxx_imask...) */
typedef __uintfptr_t uintfptr_t;
typedef __uint64_t uoff_t;
typedef char vm_memattr_t; /* memory attribute codes */
typedef struct vm_page *vm_page_t;
#define offsetof(type, field) __offsetof(type, field)
#endif /* _KERNEL */
# 298 "/usr/include/sys/types.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if defined(_KERNEL) || defined(_STANDALONE)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 300 "/usr/include/sys/types.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if !defined(__bool_true_false_are_defined) && !defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 301 "/usr/include/sys/types.h" 3 4
#define __bool_true_false_are_defined 1
#define false 0
#define true 1
typedef _Bool bool;
#endif /* !__bool_true_false_are_defined && !__cplusplus */
# 306 "/usr/include/sys/types.h" 3 4
#endif /* KERNEL || _STANDALONE */
# 307 "/usr/include/sys/types.h" 3 4
/*
* The following are all things that really shouldn't exist in this header,
* since its purpose is to provide typedefs, not miscellaneous doodads.
*/
#if 0 /* expanded by -frewrite-includes */
#include <sys/bitcount.h>
#endif /* expanded by -frewrite-includes */
# 312 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/sys/bitcount.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1982, 1986, 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)types.h 8.6 (Berkeley) 2/19/95
*/
#ifndef _SYS_BITCOUNT_H_
#define _SYS_BITCOUNT_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 42 "/usr/include/sys/bitcount.h" 3 4
# 43 "/usr/include/sys/bitcount.h" 3 4
#ifdef __POPCNT__
#define __bitcount64(x) __builtin_popcountll((__uint64_t)(x))
#define __bitcount32(x) __builtin_popcount((__uint32_t)(x))
#define __bitcount16(x) __builtin_popcount((__uint16_t)(x))
#define __bitcountl(x) __builtin_popcountl((unsigned long)(x))
#define __bitcount(x) __builtin_popcount((unsigned int)(x))
#else
# 51 "/usr/include/sys/bitcount.h" 3 4
/*
* Population count algorithm using SWAR approach
* - "SIMD Within A Register".
*/
static __inline __uint16_t
__bitcount16(__uint16_t _x)
{
_x = (_x & 0x5555) + ((_x & 0xaaaa) >> 1);
_x = (_x & 0x3333) + ((_x & 0xcccc) >> 2);
_x = (_x + (_x >> 4)) & 0x0f0f;
_x = (_x + (_x >> 8)) & 0x00ff;
return (_x);
}
static __inline __uint32_t
__bitcount32(__uint32_t _x)
{
_x = (_x & 0x55555555) + ((_x & 0xaaaaaaaa) >> 1);
_x = (_x & 0x33333333) + ((_x & 0xcccccccc) >> 2);
_x = (_x + (_x >> 4)) & 0x0f0f0f0f;
_x = (_x + (_x >> 8));
_x = (_x + (_x >> 16)) & 0x000000ff;
return (_x);
}
#ifdef __LP64__
static __inline __uint64_t
__bitcount64(__uint64_t _x)
{
_x = (_x & 0x5555555555555555) + ((_x & 0xaaaaaaaaaaaaaaaa) >> 1);
_x = (_x & 0x3333333333333333) + ((_x & 0xcccccccccccccccc) >> 2);
_x = (_x + (_x >> 4)) & 0x0f0f0f0f0f0f0f0f;
_x = (_x + (_x >> 8));
_x = (_x + (_x >> 16));
_x = (_x + (_x >> 32)) & 0x000000ff;
return (_x);
}
#define __bitcountl(x) __bitcount64((unsigned long)(x))
#else
# 94 "/usr/include/sys/bitcount.h" 3 4
static __inline __uint64_t
__bitcount64(__uint64_t _x)
{
return (__bitcount32(_x >> 32) + __bitcount32(_x));
}
#define __bitcountl(x) __bitcount32((unsigned long)(x))
#endif
# 103 "/usr/include/sys/bitcount.h" 3 4
#define __bitcount(x) __bitcount32((unsigned int)(x))
#endif
# 105 "/usr/include/sys/bitcount.h" 3 4
#endif /* !_SYS_BITCOUNT_H_ */
# 107 "/usr/include/sys/bitcount.h" 3 4
# 313 "/usr/include/sys/types.h" 2 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 315 "/usr/include/sys/types.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/select.h>
#endif /* expanded by -frewrite-includes */
# 316 "/usr/include/sys/types.h" 3 4
# 1 "/usr/include/sys/select.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS_SELECT_H_
#define _SYS_SELECT_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 35 "/usr/include/sys/select.h" 3 4
# 36 "/usr/include/sys/select.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 36 "/usr/include/sys/select.h" 3 4
# 37 "/usr/include/sys/select.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_sigset.h>
#endif /* expanded by -frewrite-includes */
# 38 "/usr/include/sys/select.h" 3 4
# 1 "/usr/include/sys/_sigset.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1982, 1986, 1989, 1991, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)signal.h 8.4 (Berkeley) 5/4/95
*/
#ifndef _SYS__SIGSET_H_
#define _SYS__SIGSET_H_
/*
* sigset_t macros.
*/
#define _SIG_WORDS 4
#define _SIG_MAXSIG 128
#define _SIG_IDX(sig) ((sig) - 1)
#define _SIG_WORD(sig) (_SIG_IDX(sig) >> 5)
#define _SIG_BIT(sig) (1U << (_SIG_IDX(sig) & 31))
#define _SIG_VALID(sig) ((sig) <= _SIG_MAXSIG && (sig) > 0)
typedef struct __sigset {
__uint32_t __bits[_SIG_WORDS];
} __sigset_t;
#if 0 /* disabled by -frewrite-includes */
#if defined(_KERNEL) && defined(COMPAT_43)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 57 "/usr/include/sys/_sigset.h" 3 4
typedef unsigned int osigset_t;
#endif
# 59 "/usr/include/sys/_sigset.h" 3 4
#endif /* !_SYS__SIGSET_H_ */
# 61 "/usr/include/sys/_sigset.h" 3 4
# 39 "/usr/include/sys/select.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_timeval.h>
#endif /* expanded by -frewrite-includes */
# 39 "/usr/include/sys/select.h" 3 4
# 1 "/usr/include/sys/_timeval.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS__TIMEVAL_H_
#define _SYS__TIMEVAL_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 32 "/usr/include/sys/_timeval.h" 3 4
# 33 "/usr/include/sys/_timeval.h" 3 4
#ifndef _SUSECONDS_T_DECLARED
typedef __suseconds_t suseconds_t;
#define _SUSECONDS_T_DECLARED
#endif
# 38 "/usr/include/sys/_timeval.h" 3 4
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 43 "/usr/include/sys/_timeval.h" 3 4
/*
* Structure returned by gettimeofday(2) system call, and used in other calls.
*/
struct timeval {
time_t tv_sec; /* seconds */
suseconds_t tv_usec; /* and microseconds */
};
#endif /* !_SYS__TIMEVAL_H_ */
# 53 "/usr/include/sys/_timeval.h" 3 4
# 40 "/usr/include/sys/select.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/timespec.h>
#endif /* expanded by -frewrite-includes */
# 40 "/usr/include/sys/select.h" 3 4
# 1 "/usr/include/sys/timespec.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)time.h 8.5 (Berkeley) 5/4/95
* from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp
*/
#ifndef _SYS_TIMESPEC_H_
#define _SYS_TIMESPEC_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 38 "/usr/include/sys/timespec.h" 3 4
# 39 "/usr/include/sys/timespec.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_timespec.h>
#endif /* expanded by -frewrite-includes */
# 39 "/usr/include/sys/timespec.h" 3 4
# 1 "/usr/include/sys/_timespec.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)time.h 8.5 (Berkeley) 5/4/95
* from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp
*/
#ifndef _SYS__TIMESPEC_H_
#define _SYS__TIMESPEC_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 38 "/usr/include/sys/_timespec.h" 3 4
# 39 "/usr/include/sys/_timespec.h" 3 4
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 44 "/usr/include/sys/_timespec.h" 3 4
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* and nanoseconds */
};
#endif /* !_SYS__TIMESPEC_H_ */
# 51 "/usr/include/sys/_timespec.h" 3 4
# 40 "/usr/include/sys/timespec.h" 2 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 42 "/usr/include/sys/timespec.h" 3 4
#define TIMEVAL_TO_TIMESPEC(tv, ts) \
do { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
} while (0)
#define TIMESPEC_TO_TIMEVAL(tv, ts) \
do { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
} while (0)
#endif /* __BSD_VISIBLE */
# 54 "/usr/include/sys/timespec.h" 3 4
/*
* Structure defined by POSIX.1b to be like a itimerval, but with
* timespecs. Used in the timer_*() system calls.
*/
struct itimerspec {
struct timespec it_interval;
struct timespec it_value;
};
#endif /* _SYS_TIMESPEC_H_ */
# 65 "/usr/include/sys/timespec.h" 3 4
# 41 "/usr/include/sys/select.h" 2 3 4
typedef unsigned long __fd_mask;
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 44 "/usr/include/sys/select.h" 3 4
typedef __fd_mask fd_mask;
#endif
# 46 "/usr/include/sys/select.h" 3 4
#ifndef _SIGSET_T_DECLARED
#define _SIGSET_T_DECLARED
typedef __sigset_t sigset_t;
#endif
# 51 "/usr/include/sys/select.h" 3 4
/*
* Select uses bit masks of file descriptors in longs. These macros
* manipulate such bit fields (the filesystem macros use chars).
* FD_SETSIZE may be defined by the user, but the default here should
* be enough for most uses.
*/
#ifndef FD_SETSIZE
#define FD_SETSIZE 1024
#endif
# 61 "/usr/include/sys/select.h" 3 4
#define _NFDBITS (sizeof(__fd_mask) * 8) /* bits per mask */
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 64 "/usr/include/sys/select.h" 3 4
#define NFDBITS _NFDBITS
#endif
# 66 "/usr/include/sys/select.h" 3 4
#ifndef _howmany
#define _howmany(x, y) (((x) + ((y) - 1)) / (y))
#endif
# 70 "/usr/include/sys/select.h" 3 4
typedef struct fd_set {
__fd_mask __fds_bits[_howmany(FD_SETSIZE, _NFDBITS)];
} fd_set;
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 75 "/usr/include/sys/select.h" 3 4
#define fds_bits __fds_bits
#endif
# 77 "/usr/include/sys/select.h" 3 4
#define __fdset_mask(n) ((__fd_mask)1 << ((n) % _NFDBITS))
#define FD_CLR(n, p) ((p)->__fds_bits[(n)/_NFDBITS] &= ~__fdset_mask(n))
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 81 "/usr/include/sys/select.h" 3 4
#define FD_COPY(f, t) (void)(*(t) = *(f))
#endif
# 83 "/usr/include/sys/select.h" 3 4
#define FD_ISSET(n, p) (((p)->__fds_bits[(n)/_NFDBITS] & __fdset_mask(n)) != 0)
#define FD_SET(n, p) ((p)->__fds_bits[(n)/_NFDBITS] |= __fdset_mask(n))
#define FD_ZERO(p) do { \
fd_set *_p; \
__size_t _n; \
\
_p = (p); \
_n = _howmany(FD_SETSIZE, _NFDBITS); \
while (_n > 0) \
_p->__fds_bits[--_n] = 0; \
} while (0)
#ifndef _KERNEL
__BEGIN_DECLS
int pselect(int, fd_set *__restrict, fd_set *__restrict, fd_set *__restrict,
const struct timespec *__restrict, const sigset_t *__restrict);
#ifndef _SELECT_DECLARED
#define _SELECT_DECLARED
/* XXX missing restrict type-qualifier */
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
#endif
# 105 "/usr/include/sys/select.h" 3 4
__END_DECLS
#endif /* !_KERNEL */
# 107 "/usr/include/sys/select.h" 3 4
#endif /* _SYS_SELECT_H_ */
# 109 "/usr/include/sys/select.h" 3 4
# 317 "/usr/include/sys/types.h" 2 3 4
/*
* The major and minor numbers are encoded in dev_t as MMMmmmMm (where
* letters correspond to bytes). The encoding of the lower 4 bytes is
* constrained by compatibility with 16-bit and 32-bit dev_t's. The
* encoding of of the upper 4 bytes is the least unnatural one consistent
* with this and other constraints. Also, the decoding of the m bytes by
* minor() is unnatural to maximize compatibility subject to not discarding
* bits. The upper m byte is shifted into the position of the lower M byte
* instead of shifting 3 upper m bytes to close the gap. Compatibility for
* minor() is achieved iff the upper m byte is 0.
*/
#define major(d) __major(d)
static __inline int
__major(dev_t _d)
{
return (((_d >> 32) & 0xffffff00) | ((_d >> 8) & 0xff));
}
#define minor(d) __minor(d)
static __inline int
__minor(dev_t _d)
{
return (((_d >> 24) & 0xff00) | (_d & 0xffff00ff));
}
#define makedev(M, m) __makedev((M), (m))
static __inline dev_t
__makedev(int _Major, int _Minor)
{
return (((dev_t)(_Major & 0xffffff00) << 32) | ((_Major & 0xff) << 8) |
((dev_t)(_Minor & 0xff00) << 24) | (_Minor & 0xffff00ff));
}
#if 0 /* disabled by -frewrite-includes */
#if (defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 13))
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 350 "/usr/include/sys/types.h" 3 4
#define __enum_uint8_decl(name) enum enum_ ## name ## _uint8 : uint8_t
#define __enum_uint8(name) enum enum_ ## name ## _uint8
#else
# 353 "/usr/include/sys/types.h" 3 4
/*
* Note: there is no real size checking here, but the code below can be
* removed once we require GCC 13.
*/
#define __enum_uint8_decl(name) enum __attribute__((packed)) enum_ ## name ## _uint8
#define __enum_uint8(name) enum __attribute__((packed)) enum_ ## name ## _uint8
#endif
# 360 "/usr/include/sys/types.h" 3 4
/*
* These declarations belong elsewhere, but are repeated here and in
* <stdio.h> to give broken programs a better chance of working with
* 64-bit off_t's.
*/
#ifndef _KERNEL
__BEGIN_DECLS
#ifndef _FTRUNCATE_DECLARED
#define _FTRUNCATE_DECLARED
int ftruncate(int, off_t);
#endif
# 372 "/usr/include/sys/types.h" 3 4
#ifndef _LSEEK_DECLARED
#define _LSEEK_DECLARED
off_t lseek(int, off_t, int);
#endif
# 376 "/usr/include/sys/types.h" 3 4
#ifndef _MMAP_DECLARED
#define _MMAP_DECLARED
void * mmap(void *, size_t, int, int, int, off_t);
#endif
# 380 "/usr/include/sys/types.h" 3 4
#ifndef _TRUNCATE_DECLARED
#define _TRUNCATE_DECLARED
int truncate(const char *, off_t);
#endif
# 384 "/usr/include/sys/types.h" 3 4
__END_DECLS
#endif /* !_KERNEL */
# 386 "/usr/include/sys/types.h" 3 4
#endif /* __BSD_VISIBLE */
# 388 "/usr/include/sys/types.h" 3 4
#endif /* !_SYS_TYPES_H_ */
# 390 "/usr/include/sys/types.h" 3 4
# 39 "/usr/include/unistd.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/unistd.h>
#endif /* expanded by -frewrite-includes */
# 39 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/sys/unistd.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)unistd.h 8.2 (Berkeley) 1/7/94
*/
#ifndef _SYS_UNISTD_H_
#define _SYS_UNISTD_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 37 "/usr/include/sys/unistd.h" 3 4
# 38 "/usr/include/sys/unistd.h" 3 4
/*
* POSIX options and option groups we unconditionally do or don't
* implement. Those options which are implemented (or not) entirely
* in user mode are defined in <unistd.h>. Please keep this list in
* alphabetical order.
*
* Anything which is defined as zero below **must** have an
* implementation for the corresponding sysconf() which is able to
* determine conclusively whether or not the feature is supported.
* Anything which is defined as other than -1 below **must** have
* complete headers, types, and function declarations as specified by
* the POSIX standard; however, if the relevant sysconf() function
* returns -1, the functions may be stubbed out.
*/
#define _POSIX_ADVISORY_INFO 200112L
#define _POSIX_ASYNCHRONOUS_IO 200112L
#define _POSIX_CHOWN_RESTRICTED 1
#define _POSIX_CLOCK_SELECTION (-1)
#define _POSIX_CPUTIME 200112L
#define _POSIX_FSYNC 200112L
#define _POSIX_IPV6 0
#define _POSIX_JOB_CONTROL 1
#define _POSIX_MAPPED_FILES 200112L
#define _POSIX_MEMLOCK (-1)
#define _POSIX_MEMLOCK_RANGE 200112L
#define _POSIX_MEMORY_PROTECTION 200112L
#define _POSIX_MESSAGE_PASSING 200112L
#define _POSIX_MONOTONIC_CLOCK 200112L
#define _POSIX_NO_TRUNC 1
#define _POSIX_PRIORITIZED_IO (-1)
#define _POSIX_PRIORITY_SCHEDULING 0
#define _POSIX_RAW_SOCKETS 200112L
#define _POSIX_REALTIME_SIGNALS 200112L
#define _POSIX_SEMAPHORES 200112L
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
#define _POSIX_SPORADIC_SERVER (-1)
#define _POSIX_SYNCHRONIZED_IO (-1)
#define _POSIX_TIMEOUTS 200112L
#define _POSIX_TIMERS 200112L
#define _POSIX_TYPED_MEMORY_OBJECTS (-1)
#define _POSIX_VDISABLE 0xff
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 82 "/usr/include/sys/unistd.h" 3 4
#define _XOPEN_SHM 1
#define _XOPEN_STREAMS (-1)
#endif
# 85 "/usr/include/sys/unistd.h" 3 4
/*
* Although we have saved user/group IDs, we do not use them in setuid
* as described in POSIX 1003.1, because the feature does not work for
* root. We use the saved IDs in seteuid/setegid, which are not currently
* part of the POSIX 1003.1 specification. XXX revisit for 1003.1-2001
* as this is now mandatory.
*/
#ifdef _NOT_AVAILABLE
#define _POSIX_SAVED_IDS 1 /* saved set-user-ID and set-group-ID */
#endif
# 96 "/usr/include/sys/unistd.h" 3 4
/* Define the POSIX.1 version we target for compliance. */
#define _POSIX_VERSION 200112L
/* access function */
#define F_OK 0 /* test for existence of file */
#define X_OK 0x01 /* test for execute or search permission */
#define W_OK 0x02 /* test for write permission */
#define R_OK 0x04 /* test for read permission */
/* whence values for lseek(2) */
#ifndef SEEK_SET
#define SEEK_SET 0 /* set file offset to offset */
#define SEEK_CUR 1 /* set file offset to current plus offset */
#define SEEK_END 2 /* set file offset to EOF plus offset */
#endif
# 112 "/usr/include/sys/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 113 "/usr/include/sys/unistd.h" 3 4
#define SEEK_DATA 3 /* set file offset to next data past offset */
#define SEEK_HOLE 4 /* set file offset to next hole past offset */
#endif
# 116 "/usr/include/sys/unistd.h" 3 4
#ifndef _POSIX_SOURCE
/* whence values for lseek(2); renamed by POSIX 1003.1 */
#define L_SET SEEK_SET
#define L_INCR SEEK_CUR
#define L_XTND SEEK_END
#endif
# 123 "/usr/include/sys/unistd.h" 3 4
/* configurable pathname variables */
#define _PC_LINK_MAX 1
#define _PC_MAX_CANON 2
#define _PC_MAX_INPUT 3
#define _PC_NAME_MAX 4
#define _PC_PATH_MAX 5
#define _PC_PIPE_BUF 6
#define _PC_CHOWN_RESTRICTED 7
#define _PC_NO_TRUNC 8
#define _PC_VDISABLE 9
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199309
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 136 "/usr/include/sys/unistd.h" 3 4
#define _PC_ASYNC_IO 53
#define _PC_PRIO_IO 54
#define _PC_SYNC_IO 55
#endif
# 140 "/usr/include/sys/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 142 "/usr/include/sys/unistd.h" 3 4
#define _PC_ALLOC_SIZE_MIN 10
#define _PC_FILESIZEBITS 12
#define _PC_REC_INCR_XFER_SIZE 14
#define _PC_REC_MAX_XFER_SIZE 15
#define _PC_REC_MIN_XFER_SIZE 16
#define _PC_REC_XFER_ALIGN 17
#define _PC_SYMLINK_MAX 18
#endif
# 150 "/usr/include/sys/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 152 "/usr/include/sys/unistd.h" 3 4
#define _PC_ACL_EXTENDED 59
#define _PC_ACL_PATH_MAX 60
#define _PC_CAP_PRESENT 61
#define _PC_INF_PRESENT 62
#define _PC_MAC_PRESENT 63
#define _PC_ACL_NFS4 64
#define _PC_DEALLOC_PRESENT 65
#endif
# 160 "/usr/include/sys/unistd.h" 3 4
/* From OpenSolaris, used by SEEK_DATA/SEEK_HOLE. */
#define _PC_MIN_HOLE_SIZE 21
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 165 "/usr/include/sys/unistd.h" 3 4
/*
* rfork() options.
*
* XXX currently, some operations without RFPROC set are not supported.
*/
#define RFNAMEG (1<<0) /* UNIMPL new plan9 `name space' */
#define RFENVG (1<<1) /* UNIMPL copy plan9 `env space' */
#define RFFDG (1<<2) /* copy fd table */
#define RFNOTEG (1<<3) /* UNIMPL create new plan9 `note group' */
#define RFPROC (1<<4) /* change child (else changes curproc) */
#define RFMEM (1<<5) /* share `address space' */
#define RFNOWAIT (1<<6) /* give child to init */
#define RFCNAMEG (1<<10) /* UNIMPL zero plan9 `name space' */
#define RFCENVG (1<<11) /* UNIMPL zero plan9 `env space' */
#define RFCFDG (1<<12) /* close all fds, zero fd table */
#define RFTHREAD (1<<13) /* enable kernel thread support */
#define RFSIGSHARE (1<<14) /* share signal handlers */
#define RFLINUXTHPN (1<<16) /* do linux clone exit parent notification */
#define RFSTOPPED (1<<17) /* leave child in a stopped state */
#define RFHIGHPID (1<<18) /* use a pid higher than 10 (idleproc) */
#define RFTSIGZMB (1<<19) /* select signal for exit parent notification */
#define RFTSIGSHIFT 20 /* selected signal number is in bits 20-27 */
#define RFTSIGMASK 0xFF
#define RFTSIGNUM(flags) (((flags) >> RFTSIGSHIFT) & RFTSIGMASK)
#define RFTSIGFLAGS(signum) ((signum) << RFTSIGSHIFT)
#define RFPROCDESC (1<<28) /* return a process descriptor */
/* kernel: parent sleeps until child exits (vfork) */
#define RFPPWAIT (1<<31)
/* user: vfork(2) semantics, clear signals */
#define RFSPAWN (1U<<31)
#define RFFLAGS (RFFDG | RFPROC | RFMEM | RFNOWAIT | RFCFDG | \
RFTHREAD | RFSIGSHARE | RFLINUXTHPN | RFSTOPPED | RFHIGHPID | RFTSIGZMB | \
RFPROCDESC | RFSPAWN | RFPPWAIT)
#define RFKERNELONLY (RFSTOPPED | RFHIGHPID | RFPROCDESC)
#define SWAPOFF_FORCE 0x00000001
/*
* close_range() options.
*/
#define CLOSE_RANGE_CLOEXEC (1<<2)
#endif /* __BSD_VISIBLE */
# 208 "/usr/include/sys/unistd.h" 3 4
#endif /* !_SYS_UNISTD_H_ */
# 210 "/usr/include/sys/unistd.h" 3 4
# 40 "/usr/include/unistd.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 40 "/usr/include/unistd.h" 3 4
# 41 "/usr/include/unistd.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 41 "/usr/include/unistd.h" 3 4
# 42 "/usr/include/unistd.h" 3 4
#ifndef _GID_T_DECLARED
typedef __gid_t gid_t;
#define _GID_T_DECLARED
#endif
# 47 "/usr/include/unistd.h" 3 4
#ifndef _OFF_T_DECLARED
typedef __off_t off_t;
#define _OFF_T_DECLARED
#endif
# 52 "/usr/include/unistd.h" 3 4
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t;
#define _PID_T_DECLARED
#endif
# 57 "/usr/include/unistd.h" 3 4
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 62 "/usr/include/unistd.h" 3 4
#ifndef _SSIZE_T_DECLARED
typedef __ssize_t ssize_t;
#define _SSIZE_T_DECLARED
#endif
# 67 "/usr/include/unistd.h" 3 4
#ifndef _UID_T_DECLARED
typedef __uid_t uid_t;
#define _UID_T_DECLARED
#endif
# 72 "/usr/include/unistd.h" 3 4
#ifndef _USECONDS_T_DECLARED
typedef __useconds_t useconds_t;
#define _USECONDS_T_DECLARED
#endif
# 77 "/usr/include/unistd.h" 3 4
#define STDIN_FILENO 0 /* standard input file descriptor */
#define STDOUT_FILENO 1 /* standard output file descriptor */
#define STDERR_FILENO 2 /* standard error file descriptor */
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 83 "/usr/include/unistd.h" 3 4
#define F_ULOCK 0 /* unlock locked section */
#define F_LOCK 1 /* lock a section for exclusive use */
#define F_TLOCK 2 /* test and lock a section for exclusive use */
#define F_TEST 3 /* test a section for locks by other procs */
#endif
# 88 "/usr/include/unistd.h" 3 4
/*
* POSIX options and option groups we unconditionally do or don't
* implement. This list includes those options which are exclusively
* implemented (or not) in user mode. Please keep this list in
* alphabetical order.
*
* Anything which is defined as zero below **must** have an
* implementation for the corresponding sysconf() which is able to
* determine conclusively whether or not the feature is supported.
* Anything which is defined as other than -1 below **must** have
* complete headers, types, and function declarations as specified by
* the POSIX standard; however, if the relevant sysconf() function
* returns -1, the functions may be stubbed out.
*/
#define _POSIX_BARRIERS 200112L
#define _POSIX_CPUTIME 200112L
#define _POSIX_READER_WRITER_LOCKS 200112L
#define _POSIX_REGEXP 1
#define _POSIX_SHELL 1
#define _POSIX_SPAWN 200112L
#define _POSIX_SPIN_LOCKS 200112L
#define _POSIX_THREAD_ATTR_STACKADDR 200112L
#define _POSIX_THREAD_ATTR_STACKSIZE 200112L
#define _POSIX_THREAD_CPUTIME 200112L
#define _POSIX_THREAD_PRIO_INHERIT 200112L
#define _POSIX_THREAD_PRIO_PROTECT 200112L
#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L
#define _POSIX_THREAD_PROCESS_SHARED 200112L
#define _POSIX_THREAD_SAFE_FUNCTIONS -1
#define _POSIX_THREAD_SPORADIC_SERVER -1
#define _POSIX_THREADS 200112L
#define _POSIX_TRACE -1
#define _POSIX_TRACE_EVENT_FILTER -1
#define _POSIX_TRACE_INHERIT -1
#define _POSIX_TRACE_LOG -1
#define _POSIX2_C_BIND 200112L /* mandatory */
#define _POSIX2_C_DEV -1 /* need c99 utility */
#define _POSIX2_CHAR_TERM 1
#define _POSIX2_FORT_DEV -1 /* need fort77 utility */
#define _POSIX2_FORT_RUN 200112L
#define _POSIX2_LOCALEDEF -1
#define _POSIX2_PBS -1
#define _POSIX2_PBS_ACCOUNTING -1
#define _POSIX2_PBS_CHECKPOINT -1
#define _POSIX2_PBS_LOCATE -1
#define _POSIX2_PBS_MESSAGE -1
#define _POSIX2_PBS_TRACK -1
#define _POSIX2_SW_DEV -1 /* XXX ??? */
#define _POSIX2_UPE 200112L
#define _V6_ILP32_OFF32 -1
#define _V6_ILP32_OFFBIG 0
#define _V6_LP64_OFF64 0
#define _V6_LPBIG_OFFBIG -1
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 144 "/usr/include/unistd.h" 3 4
#define _XOPEN_CRYPT -1 /* XXX ??? */
#define _XOPEN_ENH_I18N -1 /* mandatory in XSI */
#define _XOPEN_LEGACY -1
#define _XOPEN_REALTIME -1
#define _XOPEN_REALTIME_THREADS -1
#define _XOPEN_UNIX -1
#endif
# 151 "/usr/include/unistd.h" 3 4
/* Define the POSIX.2 version we target for compliance. */
#define _POSIX2_VERSION 199212L
/*
* POSIX-style system configuration variable accessors (for the
* sysconf function). The kernel does not directly implement the
* sysconf() interface; rather, a C library stub translates references
* to sysconf() into calls to sysctl() using a giant switch statement.
* Those that are marked `user' are implemented entirely in the C
* library and never query the kernel. pathconf() is implemented
* directly by the kernel so those are not defined here.
*/
#define _SC_ARG_MAX 1
#define _SC_CHILD_MAX 2
#define _SC_CLK_TCK 3
#define _SC_NGROUPS_MAX 4
#define _SC_OPEN_MAX 5
#define _SC_JOB_CONTROL 6
#define _SC_SAVED_IDS 7
#define _SC_VERSION 8
#define _SC_BC_BASE_MAX 9 /* user */
#define _SC_BC_DIM_MAX 10 /* user */
#define _SC_BC_SCALE_MAX 11 /* user */
#define _SC_BC_STRING_MAX 12 /* user */
#define _SC_COLL_WEIGHTS_MAX 13 /* user */
#define _SC_EXPR_NEST_MAX 14 /* user */
#define _SC_LINE_MAX 15 /* user */
#define _SC_RE_DUP_MAX 16 /* user */
#define _SC_2_VERSION 17 /* user */
#define _SC_2_C_BIND 18 /* user */
#define _SC_2_C_DEV 19 /* user */
#define _SC_2_CHAR_TERM 20 /* user */
#define _SC_2_FORT_DEV 21 /* user */
#define _SC_2_FORT_RUN 22 /* user */
#define _SC_2_LOCALEDEF 23 /* user */
#define _SC_2_SW_DEV 24 /* user */
#define _SC_2_UPE 25 /* user */
#define _SC_STREAM_MAX 26 /* user */
#define _SC_TZNAME_MAX 27 /* user */
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199309
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 193 "/usr/include/unistd.h" 3 4
#define _SC_ASYNCHRONOUS_IO 28
#define _SC_MAPPED_FILES 29
#define _SC_MEMLOCK 30
#define _SC_MEMLOCK_RANGE 31
#define _SC_MEMORY_PROTECTION 32
#define _SC_MESSAGE_PASSING 33
#define _SC_PRIORITIZED_IO 34
#define _SC_PRIORITY_SCHEDULING 35
#define _SC_REALTIME_SIGNALS 36
#define _SC_SEMAPHORES 37
#define _SC_FSYNC 38
#define _SC_SHARED_MEMORY_OBJECTS 39
#define _SC_SYNCHRONIZED_IO 40
#define _SC_TIMERS 41
#define _SC_AIO_LISTIO_MAX 42
#define _SC_AIO_MAX 43
#define _SC_AIO_PRIO_DELTA_MAX 44
#define _SC_DELAYTIMER_MAX 45
#define _SC_MQ_OPEN_MAX 46
#define _SC_PAGESIZE 47
#define _SC_RTSIG_MAX 48
#define _SC_SEM_NSEMS_MAX 49
#define _SC_SEM_VALUE_MAX 50
#define _SC_SIGQUEUE_MAX 51
#define _SC_TIMER_MAX 52
#endif
# 219 "/usr/include/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 221 "/usr/include/unistd.h" 3 4
#define _SC_2_PBS 59 /* user */
#define _SC_2_PBS_ACCOUNTING 60 /* user */
#define _SC_2_PBS_CHECKPOINT 61 /* user */
#define _SC_2_PBS_LOCATE 62 /* user */
#define _SC_2_PBS_MESSAGE 63 /* user */
#define _SC_2_PBS_TRACK 64 /* user */
#define _SC_ADVISORY_INFO 65
#define _SC_BARRIERS 66 /* user */
#define _SC_CLOCK_SELECTION 67
#define _SC_CPUTIME 68
#define _SC_FILE_LOCKING 69
#define _SC_GETGR_R_SIZE_MAX 70 /* user */
#define _SC_GETPW_R_SIZE_MAX 71 /* user */
#define _SC_HOST_NAME_MAX 72
#define _SC_LOGIN_NAME_MAX 73
#define _SC_MONOTONIC_CLOCK 74
#define _SC_MQ_PRIO_MAX 75
#define _SC_READER_WRITER_LOCKS 76 /* user */
#define _SC_REGEXP 77 /* user */
#define _SC_SHELL 78 /* user */
#define _SC_SPAWN 79 /* user */
#define _SC_SPIN_LOCKS 80 /* user */
#define _SC_SPORADIC_SERVER 81
#define _SC_THREAD_ATTR_STACKADDR 82 /* user */
#define _SC_THREAD_ATTR_STACKSIZE 83 /* user */
#define _SC_THREAD_CPUTIME 84 /* user */
#define _SC_THREAD_DESTRUCTOR_ITERATIONS 85 /* user */
#define _SC_THREAD_KEYS_MAX 86 /* user */
#define _SC_THREAD_PRIO_INHERIT 87 /* user */
#define _SC_THREAD_PRIO_PROTECT 88 /* user */
#define _SC_THREAD_PRIORITY_SCHEDULING 89 /* user */
#define _SC_THREAD_PROCESS_SHARED 90 /* user */
#define _SC_THREAD_SAFE_FUNCTIONS 91 /* user */
#define _SC_THREAD_SPORADIC_SERVER 92 /* user */
#define _SC_THREAD_STACK_MIN 93 /* user */
#define _SC_THREAD_THREADS_MAX 94 /* user */
#define _SC_TIMEOUTS 95 /* user */
#define _SC_THREADS 96 /* user */
#define _SC_TRACE 97 /* user */
#define _SC_TRACE_EVENT_FILTER 98 /* user */
#define _SC_TRACE_INHERIT 99 /* user */
#define _SC_TRACE_LOG 100 /* user */
#define _SC_TTY_NAME_MAX 101 /* user */
#define _SC_TYPED_MEMORY_OBJECTS 102
#define _SC_V6_ILP32_OFF32 103 /* user */
#define _SC_V6_ILP32_OFFBIG 104 /* user */
#define _SC_V6_LP64_OFF64 105 /* user */
#define _SC_V6_LPBIG_OFFBIG 106 /* user */
#define _SC_IPV6 118
#define _SC_RAW_SOCKETS 119
#define _SC_SYMLOOP_MAX 120
#endif
# 273 "/usr/include/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 275 "/usr/include/unistd.h" 3 4
#define _SC_ATEXIT_MAX 107 /* user */
#define _SC_IOV_MAX 56
#define _SC_PAGE_SIZE _SC_PAGESIZE
#define _SC_XOPEN_CRYPT 108 /* user */
#define _SC_XOPEN_ENH_I18N 109 /* user */
#define _SC_XOPEN_LEGACY 110 /* user */
#define _SC_XOPEN_REALTIME 111
#define _SC_XOPEN_REALTIME_THREADS 112
#define _SC_XOPEN_SHM 113
#define _SC_XOPEN_STREAMS 114
#define _SC_XOPEN_UNIX 115
#define _SC_XOPEN_VERSION 116
#define _SC_XOPEN_XCU_VERSION 117 /* user */
#endif
# 289 "/usr/include/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 291 "/usr/include/unistd.h" 3 4
#define _SC_NPROCESSORS_CONF 57
#define _SC_NPROCESSORS_ONLN 58
#define _SC_CPUSET_SIZE 122
#endif
# 295 "/usr/include/unistd.h" 3 4
/* Extensions found in Solaris and Linux. */
#define _SC_PHYS_PAGES 121
/* Keys for the confstr(3) function. */
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199209
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 301 "/usr/include/unistd.h" 3 4
#define _CS_PATH 1 /* default value of PATH */
#endif
# 303 "/usr/include/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 305 "/usr/include/unistd.h" 3 4
#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS 2
#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS 3
#define _CS_POSIX_V6_ILP32_OFF32_LIBS 4
#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS 5
#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS 6
#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS 7
#define _CS_POSIX_V6_LP64_OFF64_CFLAGS 8
#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS 9
#define _CS_POSIX_V6_LP64_OFF64_LIBS 10
#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS 11
#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS 12
#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS 13
#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS 14
#endif
# 319 "/usr/include/unistd.h" 3 4
__BEGIN_DECLS
/* 1003.1-1990 */
void _exit(int) __dead2;
int access(const char *, int);
unsigned int alarm(unsigned int);
int chdir(const char *);
int chown(const char *, uid_t, gid_t);
int close(int);
void closefrom(int);
int dup(int);
int dup2(int, int);
int execl(const char *, const char *, ...) __null_sentinel;
int execle(const char *, const char *, ...);
int execlp(const char *, const char *, ...) __null_sentinel;
int execv(const char *, char * const *);
int execve(const char *, char * const *, char * const *);
int execvp(const char *, char * const *);
pid_t fork(void);
long fpathconf(int, int);
char *getcwd(char *, size_t);
gid_t getegid(void);
uid_t geteuid(void);
gid_t getgid(void);
int getgroups(int, gid_t []);
char *getlogin(void);
pid_t getpgrp(void);
pid_t getpid(void);
pid_t getppid(void);
uid_t getuid(void);
int isatty(int);
int link(const char *, const char *);
#ifndef _LSEEK_DECLARED
#define _LSEEK_DECLARED
off_t lseek(int, off_t, int);
#endif
# 355 "/usr/include/unistd.h" 3 4
long pathconf(const char *, int);
int pause(void);
int pipe(int *);
ssize_t read(int, void *, size_t);
int rmdir(const char *);
int setgid(gid_t);
int setpgid(pid_t, pid_t);
pid_t setsid(void);
int setuid(uid_t);
unsigned int sleep(unsigned int);
long sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
char *ttyname(int);
int ttyname_r(int, char *, size_t);
int unlink(const char *);
ssize_t write(int, const void *, size_t);
/* 1003.2-1992 */
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199209 || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 375 "/usr/include/unistd.h" 3 4
size_t confstr(int, char *, size_t);
#ifndef _GETOPT_DECLARED
#define _GETOPT_DECLARED
int getopt(int, char * const [], const char *);
extern char *optarg; /* getopt(3) external variables */
extern int optind, opterr, optopt;
#endif /* _GETOPT_DECLARED */
# 383 "/usr/include/unistd.h" 3 4
#endif
# 384 "/usr/include/unistd.h" 3 4
/* ISO/IEC 9945-1: 1996 */
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 387 "/usr/include/unistd.h" 3 4
int fsync(int);
int fdatasync(int);
/*
* ftruncate() was in the POSIX Realtime Extension (it's used for shared
* memory), but truncate() was not.
*/
#ifndef _FTRUNCATE_DECLARED
#define _FTRUNCATE_DECLARED
int ftruncate(int, off_t);
#endif
# 398 "/usr/include/unistd.h" 3 4
#endif
# 399 "/usr/include/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199506
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 401 "/usr/include/unistd.h" 3 4
int getlogin_r(char *, size_t);
#endif
# 403 "/usr/include/unistd.h" 3 4
/* 1003.1-2001 */
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 406 "/usr/include/unistd.h" 3 4
int fchown(int, uid_t, gid_t);
ssize_t readlink(const char * __restrict, char * __restrict, size_t);
#endif
# 409 "/usr/include/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 410 "/usr/include/unistd.h" 3 4
int gethostname(char *, size_t);
int setegid(gid_t);
int seteuid(uid_t);
#endif
# 414 "/usr/include/unistd.h" 3 4
/* 1003.1-2008 */
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 417 "/usr/include/unistd.h" 3 4
int getsid(pid_t _pid);
int fchdir(int);
int getpgid(pid_t _pid);
int lchown(const char *, uid_t, gid_t);
ssize_t pread(int, void *, size_t, off_t);
ssize_t pwrite(int, const void *, size_t, off_t);
/* See comment at ftruncate() above. */
#ifndef _TRUNCATE_DECLARED
#define _TRUNCATE_DECLARED
int truncate(const char *, off_t);
#endif
# 429 "/usr/include/unistd.h" 3 4
#endif /* __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE */
# 430 "/usr/include/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 432 "/usr/include/unistd.h" 3 4
int faccessat(int, const char *, int, int);
int fchownat(int, const char *, uid_t, gid_t, int);
int fexecve(int, char *const [], char *const []);
int linkat(int, const char *, int, const char *, int);
ssize_t readlinkat(int, const char * __restrict, char * __restrict, size_t);
int symlinkat(const char *, int, const char *);
int unlinkat(int, const char *, int);
#endif /* __POSIX_VISIBLE >= 200809 */
# 440 "/usr/include/unistd.h" 3 4
/*
* symlink() was originally in POSIX.1a, which was withdrawn after
* being overtaken by events (1003.1-2001). It was in XPG4.2, and of
* course has been in BSD since 4.2.
*/
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 402
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 447 "/usr/include/unistd.h" 3 4
int symlink(const char * __restrict, const char * __restrict);
#endif
# 449 "/usr/include/unistd.h" 3 4
/* X/Open System Interfaces */
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 452 "/usr/include/unistd.h" 3 4
char *crypt(const char *, const char *);
long gethostid(void);
int lockf(int, int, off_t);
int nice(int);
int setregid(gid_t, gid_t);
int setreuid(uid_t, uid_t);
#ifndef _SWAB_DECLARED
#define _SWAB_DECLARED
void swab(const void * __restrict, void * __restrict, ssize_t);
#endif /* _SWAB_DECLARED */
# 463 "/usr/include/unistd.h" 3 4
void sync(void);
#endif /* __XSI_VISIBLE */
# 467 "/usr/include/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if (__XSI_VISIBLE && __XSI_VISIBLE <= 500) || __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 469 "/usr/include/unistd.h" 3 4
int brk(const void *);
int chroot(const char *);
int getdtablesize(void);
int getpagesize(void) __pure2;
char *getpass(const char *);
void *sbrk(intptr_t);
#endif
# 476 "/usr/include/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if (__XSI_VISIBLE && __XSI_VISIBLE <= 600) || __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 478 "/usr/include/unistd.h" 3 4
char *getwd(char *); /* obsoleted by getcwd() */
useconds_t
ualarm(useconds_t, useconds_t);
int usleep(useconds_t);
pid_t vfork(void) __returns_twice;
#endif
# 484 "/usr/include/unistd.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 486 "/usr/include/unistd.h" 3 4
struct timeval; /* select(2) */
struct crypt_data {
int initialized; /* For compatibility with glibc. */
char __buf[256]; /* Buffer returned by crypt_r(). */
};
int acct(const char *);
int async_daemon(void);
int check_utility_compat(const char *);
int close_range(unsigned int, unsigned int, int);
ssize_t copy_file_range(int, off_t *, int, off_t *, size_t, unsigned int);
const char *
crypt_get_format(void);
char *crypt_r(const char *, const char *, struct crypt_data *);
int crypt_set_format(const char *);
int dup3(int, int, int);
int eaccess(const char *, int);
void endusershell(void);
int exect(const char *, char * const *, char * const *);
int execvP(const char *, const char *, char * const *);
int feature_present(const char *);
char *fflagstostr(u_long);
int getdomainname(char *, int);
int getentropy(void *, size_t);
int getgrouplist(const char *, gid_t, gid_t *, int *);
int getloginclass(char *, size_t);
mode_t getmode(const void *, mode_t);
int getosreldate(void);
int getpeereid(int, uid_t *, gid_t *);
int getresgid(gid_t *, gid_t *, gid_t *);
int getresuid(uid_t *, uid_t *, uid_t *);
char *getusershell(void);
int initgroups(const char *, gid_t);
int iruserok(unsigned long, int, const char *, const char *);
int iruserok_sa(const void *, int, int, const char *, const char *);
int issetugid(void);
void __FreeBSD_libc_enter_restricted_mode(void);
long lpathconf(const char *, int);
#ifndef _MKDTEMP_DECLARED
char *mkdtemp(char *);
#define _MKDTEMP_DECLARED
#endif
# 529 "/usr/include/unistd.h" 3 4
#ifndef _MKNOD_DECLARED
int mknod(const char *, mode_t, dev_t);
#define _MKNOD_DECLARED
#endif
# 533 "/usr/include/unistd.h" 3 4
#ifndef _MKSTEMP_DECLARED
int mkstemp(char *);
#define _MKSTEMP_DECLARED
#endif
# 537 "/usr/include/unistd.h" 3 4
int mkstemps(char *, int);
#ifndef _MKTEMP_DECLARED
char *mktemp(char *);
#define _MKTEMP_DECLARED
#endif
# 542 "/usr/include/unistd.h" 3 4
int nfssvc(int, void *);
int nlm_syscall(int, int, int, char **);
int pipe2(int *, int);
int profil(char *, size_t, vm_offset_t, int);
int rcmd(char **, int, const char *, const char *, const char *, int *);
int rcmd_af(char **, int, const char *,
const char *, const char *, int *, int);
int rcmdsh(char **, int, const char *,
const char *, const char *, const char *);
char *re_comp(const char *);
int re_exec(const char *);
int reboot(int);
int revoke(const char *);
pid_t rfork(int) __returns_twice;
pid_t rfork_thread(int, void *, int (*)(void *), void *);
int rresvport(int *);
int rresvport_af(int *, int);
int ruserok(const char *, int, const char *, const char *);
#ifndef _SELECT_DECLARED
#define _SELECT_DECLARED
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
#endif
# 564 "/usr/include/unistd.h" 3 4
int setdomainname(const char *, int);
int setgroups(int, const gid_t *);
void sethostid(long);
int sethostname(const char *, int);
int setlogin(const char *);
int setloginclass(const char *);
void *setmode(const char *);
int setpgrp(pid_t, pid_t); /* obsoleted by setpgid() */
void setproctitle(const char *_fmt, ...) __printf0like(1, 2);
void setproctitle_fast(const char *_fmt, ...) __printf0like(1, 2);
int setresgid(gid_t, gid_t, gid_t);
int setresuid(uid_t, uid_t, uid_t);
int setrgid(gid_t);
int setruid(uid_t);
void setusershell(void);
int strtofflags(char **, u_long *, u_long *);
int swapon(const char *);
int swapoff(const char *, u_int);
int syscall(int, ...);
off_t __syscall(quad_t, ...);
int undelete(const char *);
int unwhiteout(const char *);
void *valloc(size_t); /* obsoleted by malloc() */
int funlinkat(int, const char *, int, int);
pid_t _Fork(void);
#ifndef _OPTRESET_DECLARED
#define _OPTRESET_DECLARED
extern int optreset; /* getopt(3) external variable */
#endif
# 594 "/usr/include/unistd.h" 3 4
#endif /* __BSD_VISIBLE */
# 595 "/usr/include/unistd.h" 3 4
__END_DECLS
#endif /* !_UNISTD_H_ */
# 598 "/usr/include/unistd.h" 3 4
# 30 "./Include/Python.h" 2
#endif
# 31 "./Include/Python.h"
#ifdef HAVE_STDDEF_H
#if 0 /* expanded by -frewrite-includes */
# include <stddef.h> // size_t
#endif /* expanded by -frewrite-includes */
# 32 "./Include/Python.h"
# 33 "./Include/Python.h"
#endif
# 34 "./Include/Python.h"
#if 0 /* expanded by -frewrite-includes */
#include <assert.h> // assert()
#endif /* expanded by -frewrite-includes */
# 35 "./Include/Python.h"
# 1 "/usr/include/assert.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)assert.h 8.2 (Berkeley) 1/21/94
*/
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 39 "/usr/include/assert.h" 3 4
# 40 "/usr/include/assert.h" 3 4
/*
* Unlike other ANSI header files, <assert.h> may usefully be included
* multiple times, with and without NDEBUG defined.
*/
#undef assert
#undef _assert
#ifdef NDEBUG
#define assert(e) ((void)0)
#define _assert(e) ((void)0)
#else
# 53 "/usr/include/assert.h" 3 4
#define _assert(e) assert(e)
#define assert(e) ((e) ? (void)0 : __assert(__func__, __FILE__, \
__LINE__, #e))
#endif /* NDEBUG */
# 58 "/usr/include/assert.h" 3 4
#ifndef _ASSERT_H_
#define _ASSERT_H_
/*
* Static assertions. In principle we could define static_assert for
* C++ older than C++11, but this breaks if _Static_assert is
* implemented as a macro.
*
* C++ template parameters may contain commas, even if not enclosed in
* parentheses, causing the _Static_assert macro to be invoked with more
* than two parameters.
*/
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 2011 && !defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 72 "/usr/include/assert.h" 3 4
#define static_assert _Static_assert
#endif
# 74 "/usr/include/assert.h" 3 4
__BEGIN_DECLS
void __assert(const char *, const char *, int, const char *) __dead2;
__END_DECLS
#endif /* !_ASSERT_H_ */
# 80 "/usr/include/assert.h" 3 4
# 36 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <wchar.h> // wchar_t
#endif /* expanded by -frewrite-includes */
# 36 "./Include/Python.h"
# 1 "/usr/include/wchar.h" 1 3 4
/*-
* SPDX-License-Identifier: (BSD-2-Clause)
*
* Copyright (c)1999 Citrus Project,
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Julian Coleman.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* $NetBSD: wchar.h,v 1.8 2000/12/22 05:31:42 itojun Exp $
*/
#ifndef _WCHAR_H_
#define _WCHAR_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 63 "/usr/include/wchar.h" 3 4
# 64 "/usr/include/wchar.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 64 "/usr/include/wchar.h" 3 4
# 65 "/usr/include/wchar.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 65 "/usr/include/wchar.h" 3 4
# 66 "/usr/include/wchar.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/_limits.h>
#endif /* expanded by -frewrite-includes */
# 66 "/usr/include/wchar.h" 3 4
# 1 "/usr/include/machine/_limits.h" 1 3 4
/*-
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)limits.h 8.3 (Berkeley) 1/4/94
*/
#ifdef __arm__
#if 0 /* expanded by -frewrite-includes */
#include <arm/_limits.h>
#endif /* expanded by -frewrite-includes */
# 30 "/usr/include/machine/_limits.h" 3 4
# 31 "/usr/include/machine/_limits.h" 3 4
#else /* !__arm__ */
# 32 "/usr/include/machine/_limits.h" 3 4
#ifndef _MACHINE__LIMITS_H_
#define _MACHINE__LIMITS_H_
/*
* According to ANSI (section 2.2.4.2), the values below must be usable by
* #if preprocessing directives. Additionally, the expression must have the
* same type as would an expression that is an object of the corresponding
* type converted according to the integral promotions. The subtraction for
* INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
* unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
*/
#define __CHAR_BIT 8 /* number of bits in a char */
#define __SCHAR_MAX 0x7f /* max value for a signed char */
#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */
#define __UCHAR_MAX 0xff /* max value for an unsigned char */
#define __USHRT_MAX 0xffff /* max value for an unsigned short */
#define __SHRT_MAX 0x7fff /* max value for a short */
#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */
#define __UINT_MAX 0xffffffff /* max value for an unsigned int */
#define __INT_MAX 0x7fffffff /* max value for an int */
#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */
#define __ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */
#define __LONG_MAX 0x7fffffffffffffffL /* max for a long */
#define __LONG_MIN (-0x7fffffffffffffffL - 1) /* min for a long */
/* Long longs have the same size but not the same type as longs. */
/* max for an unsigned long long */
#define __ULLONG_MAX 0xffffffffffffffffULL
#define __LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */
#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */
#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */
#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */
#define __OFF_MAX __LONG_MAX /* max value for an off_t */
#define __OFF_MIN __LONG_MIN /* min value for an off_t */
/* Quads and longs are the same size. Ensure they stay in sync. */
#define __UQUAD_MAX (__ULONG_MAX) /* max value for a uquad_t */
#define __QUAD_MAX (__LONG_MAX) /* max value for a quad_t */
#define __QUAD_MIN (__LONG_MIN) /* min value for a quad_t */
#define __LONG_BIT 64
#define __WORD_BIT 32
/* Minimum signal stack size. */
#define __MINSIGSTKSZ (1024 * 4)
#endif /* !_MACHINE__LIMITS_H_ */
# 89 "/usr/include/machine/_limits.h" 3 4
#endif /* !__arm__ */
# 91 "/usr/include/machine/_limits.h" 3 4
# 67 "/usr/include/wchar.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_ctype.h>
#endif /* expanded by -frewrite-includes */
# 67 "/usr/include/wchar.h" 3 4
# 1 "/usr/include/_ctype.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* This code is derived from software contributed to Berkeley by
* Paul Borman at Krystal Technologies.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* From @(#)ctype.h 8.4 (Berkeley) 1/21/94
* From FreeBSD: src/include/ctype.h,v 1.27 2004/06/23 07:11:39 tjr Exp
*/
#ifndef __CTYPE_H_
#define __CTYPE_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 46 "/usr/include/_ctype.h" 3 4
# 47 "/usr/include/_ctype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 47 "/usr/include/_ctype.h" 3 4
# 48 "/usr/include/_ctype.h" 3 4
#define _CTYPE_A 0x00000100L /* Alpha */
#define _CTYPE_C 0x00000200L /* Control */
#define _CTYPE_D 0x00000400L /* Digit */
#define _CTYPE_G 0x00000800L /* Graph */
#define _CTYPE_L 0x00001000L /* Lower */
#define _CTYPE_P 0x00002000L /* Punct */
#define _CTYPE_S 0x00004000L /* Space */
#define _CTYPE_U 0x00008000L /* Upper */
#define _CTYPE_X 0x00010000L /* X digit */
#define _CTYPE_B 0x00020000L /* Blank */
#define _CTYPE_R 0x00040000L /* Print */
#define _CTYPE_I 0x00080000L /* Ideogram */
#define _CTYPE_T 0x00100000L /* Special */
#define _CTYPE_Q 0x00200000L /* Phonogram */
#define _CTYPE_N 0x00400000L /* Number (superset of digit) */
#define _CTYPE_SW0 0x20000000L /* 0 width character */
#define _CTYPE_SW1 0x40000000L /* 1 width character */
#define _CTYPE_SW2 0x80000000L /* 2 width character */
#define _CTYPE_SW3 0xc0000000L /* 3 width character */
#define _CTYPE_SWM 0xe0000000L /* Mask for screen width data */
#define _CTYPE_SWS 30 /* Bits to shift to get width */
/* See comments in <sys/_types.h> about __ct_rune_t. */
__BEGIN_DECLS
unsigned long ___runetype(__ct_rune_t) __pure;
__ct_rune_t ___tolower(__ct_rune_t) __pure;
__ct_rune_t ___toupper(__ct_rune_t) __pure;
__END_DECLS
/*
* _EXTERNALIZE_CTYPE_INLINES_ is defined in locale/nomacros.c to tell us
* to generate code for extern versions of all our inline functions.
*/
#ifdef _EXTERNALIZE_CTYPE_INLINES_
#define _USE_CTYPE_INLINE_
#define static
#define __inline
#endif
# 87 "/usr/include/_ctype.h" 3 4
extern int __mb_sb_limit;
/*
* Use inline functions if we are allowed to and the compiler supports them.
*/
#if 0 /* disabled by -frewrite-includes */
#if !defined(_DONT_USE_CTYPE_INLINE_) && \
(defined(_USE_CTYPE_INLINE_) || defined(__GNUC__) || defined(__cplusplus))
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 95 "/usr/include/_ctype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <runetype.h>
#endif /* expanded by -frewrite-includes */
# 96 "/usr/include/_ctype.h" 3 4
# 1 "/usr/include/runetype.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Paul Borman at Krystal Technologies.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)runetype.h 8.1 (Berkeley) 6/2/93
*/
#ifndef _RUNETYPE_H_
#define _RUNETYPE_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 40 "/usr/include/runetype.h" 3 4
# 41 "/usr/include/runetype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 41 "/usr/include/runetype.h" 3 4
# 42 "/usr/include/runetype.h" 3 4
#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */
#define _CRMASK (~(_CACHED_RUNES - 1))
/*
* The lower 8 bits of runetype[] contain the digit value of the rune.
*/
typedef struct {
__rune_t __min; /* First rune of the range */
__rune_t __max; /* Last rune (inclusive) of the range */
__rune_t __map; /* What first maps to in maps */
unsigned long *__types; /* Array of types in range */
} _RuneEntry;
typedef struct {
int __nranges; /* Number of ranges stored */
_RuneEntry *__ranges; /* Pointer to the ranges */
} _RuneRange;
typedef struct {
char __magic[8]; /* Magic saying what version we are */
char __encoding[32]; /* ASCII name of this encoding */
__rune_t (*__sgetrune)(const char *, __size_t, char const **);
int (*__sputrune)(__rune_t, char *, __size_t, char **);
__rune_t __invalid_rune;
unsigned long __runetype[_CACHED_RUNES];
__rune_t __maplower[_CACHED_RUNES];
__rune_t __mapupper[_CACHED_RUNES];
/*
* The following are to deal with Runes larger than _CACHED_RUNES - 1.
* Their data is actually contiguous with this structure so as to make
* it easier to read/write from/to disk.
*/
_RuneRange __runetype_ext;
_RuneRange __maplower_ext;
_RuneRange __mapupper_ext;
void *__variable; /* Data which depends on the encoding */
int __variable_len; /* how long that data is */
} _RuneLocale;
#define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */
__BEGIN_DECLS
extern const _RuneLocale _DefaultRuneLocale;
extern const _RuneLocale *_CurrentRuneLocale;
#ifdef __RUNETYPE_INTERNAL
extern const _RuneLocale *__getCurrentRuneLocale(void);
#else
# 93 "/usr/include/runetype.h" 3 4
extern _Thread_local const _RuneLocale *_ThreadRuneLocale;
static __inline const _RuneLocale *__getCurrentRuneLocale(void)
{
if (_ThreadRuneLocale)
return _ThreadRuneLocale;
return _CurrentRuneLocale;
}
#endif /*__RUNETYPE_INTERNAL */
# 102 "/usr/include/runetype.h" 3 4
#define _CurrentRuneLocale (__getCurrentRuneLocale())
__END_DECLS
#endif /* !_RUNETYPE_H_ */
# 106 "/usr/include/runetype.h" 3 4
# 97 "/usr/include/_ctype.h" 2 3 4
static __inline int
__maskrune(__ct_rune_t _c, unsigned long _f)
{
return ((_c < 0 || _c >= _CACHED_RUNES) ? ___runetype(_c) :
_CurrentRuneLocale->__runetype[_c]) & _f;
}
static __inline int
__sbmaskrune(__ct_rune_t _c, unsigned long _f)
{
return (_c < 0 || _c >= __mb_sb_limit) ? 0 :
_CurrentRuneLocale->__runetype[_c] & _f;
}
static __inline int
__istype(__ct_rune_t _c, unsigned long _f)
{
return (!!__maskrune(_c, _f));
}
static __inline int
__sbistype(__ct_rune_t _c, unsigned long _f)
{
return (!!__sbmaskrune(_c, _f));
}
static __inline int
__isctype(__ct_rune_t _c, unsigned long _f)
{
return (_c < 0 || _c >= 128) ? 0 :
!!(_DefaultRuneLocale.__runetype[_c] & _f);
}
static __inline __ct_rune_t
__toupper(__ct_rune_t _c)
{
return (_c < 0 || _c >= _CACHED_RUNES) ? ___toupper(_c) :
_CurrentRuneLocale->__mapupper[_c];
}
static __inline __ct_rune_t
__sbtoupper(__ct_rune_t _c)
{
return (_c < 0 || _c >= __mb_sb_limit) ? _c :
_CurrentRuneLocale->__mapupper[_c];
}
static __inline __ct_rune_t
__tolower(__ct_rune_t _c)
{
return (_c < 0 || _c >= _CACHED_RUNES) ? ___tolower(_c) :
_CurrentRuneLocale->__maplower[_c];
}
static __inline __ct_rune_t
__sbtolower(__ct_rune_t _c)
{
return (_c < 0 || _c >= __mb_sb_limit) ? _c :
_CurrentRuneLocale->__maplower[_c];
}
static __inline int
__wcwidth(__ct_rune_t _c)
{
unsigned int _x;
if (_c == 0)
return (0);
_x = (unsigned int)__maskrune(_c, _CTYPE_SWM|_CTYPE_R);
if ((_x & _CTYPE_SWM) != 0)
return ((_x & _CTYPE_SWM) >> _CTYPE_SWS);
return ((_x & _CTYPE_R) != 0 ? 1 : -1);
}
#else /* not using inlines */
# 173 "/usr/include/_ctype.h" 3 4
__BEGIN_DECLS
int __maskrune(__ct_rune_t, unsigned long);
int __sbmaskrune(__ct_rune_t, unsigned long);
int __istype(__ct_rune_t, unsigned long);
int __sbistype(__ct_rune_t, unsigned long);
int __isctype(__ct_rune_t, unsigned long);
__ct_rune_t __toupper(__ct_rune_t);
__ct_rune_t __sbtoupper(__ct_rune_t);
__ct_rune_t __tolower(__ct_rune_t);
__ct_rune_t __sbtolower(__ct_rune_t);
int __wcwidth(__ct_rune_t);
__END_DECLS
#endif /* using inlines */
# 187 "/usr/include/_ctype.h" 3 4
#endif /* !__CTYPE_H_ */
# 189 "/usr/include/_ctype.h" 3 4
# 68 "/usr/include/wchar.h" 2 3 4
#ifndef _MBSTATE_T_DECLARED
typedef __mbstate_t mbstate_t;
#define _MBSTATE_T_DECLARED
#endif
# 73 "/usr/include/wchar.h" 3 4
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 78 "/usr/include/wchar.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809 || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 80 "/usr/include/wchar.h" 3 4
#ifndef _VA_LIST_DECLARED
typedef __va_list va_list;
#define _VA_LIST_DECLARED
#endif
# 84 "/usr/include/wchar.h" 3 4
#endif
# 85 "/usr/include/wchar.h" 3 4
#ifndef __cplusplus
#ifndef _WCHAR_T_DECLARED
typedef ___wchar_t wchar_t;
#define _WCHAR_T_DECLARED
#endif
# 91 "/usr/include/wchar.h" 3 4
#endif
# 92 "/usr/include/wchar.h" 3 4
#ifndef _WINT_T_DECLARED
typedef __wint_t wint_t;
#define _WINT_T_DECLARED
#endif
# 97 "/usr/include/wchar.h" 3 4
#define WCHAR_MIN __WCHAR_MIN
#define WCHAR_MAX __WCHAR_MAX
#ifndef WEOF
#define WEOF ((wint_t)-1)
#endif
# 104 "/usr/include/wchar.h" 3 4
#ifndef _STDFILE_DECLARED
#define _STDFILE_DECLARED
typedef struct __sFILE FILE;
#endif
# 109 "/usr/include/wchar.h" 3 4
struct tm;
__BEGIN_DECLS
wint_t btowc(int);
wint_t fgetwc(FILE *);
wchar_t *
fgetws(wchar_t * __restrict, int, FILE * __restrict);
wint_t fputwc(wchar_t, FILE *);
int fputws(const wchar_t * __restrict, FILE * __restrict);
int fwide(FILE *, int);
int fwprintf(FILE * __restrict, const wchar_t * __restrict, ...);
int fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
wint_t getwc(FILE *);
wint_t getwchar(void);
size_t mbrlen(const char * __restrict, size_t, mbstate_t * __restrict);
size_t mbrtowc(wchar_t * __restrict, const char * __restrict, size_t,
mbstate_t * __restrict);
int mbsinit(const mbstate_t *);
size_t mbsrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
mbstate_t * __restrict);
wint_t putwc(wchar_t, FILE *);
wint_t putwchar(wchar_t);
int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
...);
int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
wint_t ungetwc(wint_t, FILE *);
int vfwprintf(FILE * __restrict, const wchar_t * __restrict,
__va_list);
int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict,
__va_list);
int vwprintf(const wchar_t * __restrict, __va_list);
size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict);
wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict);
wchar_t *wcschr(const wchar_t *, wchar_t) __pure;
int wcscmp(const wchar_t *, const wchar_t *) __pure;
int wcscoll(const wchar_t *, const wchar_t *);
wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict);
size_t wcscspn(const wchar_t *, const wchar_t *) __pure;
size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict,
const struct tm * __restrict);
size_t wcslen(const wchar_t *) __pure;
wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict,
size_t);
int wcsncmp(const wchar_t *, const wchar_t *, size_t) __pure;
wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t);
wchar_t *wcspbrk(const wchar_t *, const wchar_t *) __pure;
wchar_t *wcsrchr(const wchar_t *, wchar_t) __pure;
size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
mbstate_t * __restrict);
size_t wcsspn(const wchar_t *, const wchar_t *) __pure;
wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict)
__pure;
size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t);
int wctob(wint_t);
double wcstod(const wchar_t * __restrict, wchar_t ** __restrict);
wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict,
wchar_t ** __restrict);
long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int);
unsigned long
wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
wchar_t *wmemchr(const wchar_t *, wchar_t, size_t) __pure;
int wmemcmp(const wchar_t *, const wchar_t *, size_t) __pure;
wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
wchar_t *wmemmove(wchar_t *, const wchar_t *, size_t);
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 174 "/usr/include/wchar.h" 3 4
wchar_t *wmempcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
#endif
# 176 "/usr/include/wchar.h" 3 4
wchar_t *wmemset(wchar_t *, wchar_t, size_t);
int wprintf(const wchar_t * __restrict, ...);
int wscanf(const wchar_t * __restrict, ...);
#ifndef _STDSTREAM_DECLARED
extern FILE *__stdinp;
extern FILE *__stdoutp;
extern FILE *__stderrp;
#define _STDSTREAM_DECLARED
#endif
# 186 "/usr/include/wchar.h" 3 4
#define getwc(fp) fgetwc(fp)
#define getwchar() fgetwc(__stdinp)
#define putwc(wc, fp) fputwc(wc, fp)
#define putwchar(wc) fputwc(wc, __stdoutp)
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 1999
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 193 "/usr/include/wchar.h" 3 4
int vfwscanf(FILE * __restrict, const wchar_t * __restrict,
__va_list);
int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict,
__va_list);
int vwscanf(const wchar_t * __restrict, __va_list);
float wcstof(const wchar_t * __restrict, wchar_t ** __restrict);
long double
wcstold(const wchar_t * __restrict, wchar_t ** __restrict);
#ifdef __LONG_LONG_SUPPORTED
/* LONGLONG */
long long
wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int);
/* LONGLONG */
unsigned long long
wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int);
#endif
# 209 "/usr/include/wchar.h" 3 4
#endif /* __ISO_C_VISIBLE >= 1999 */
# 210 "/usr/include/wchar.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 212 "/usr/include/wchar.h" 3 4
int wcswidth(const wchar_t *, size_t);
int wcwidth(wchar_t);
#define wcwidth(_c) __wcwidth(_c)
#endif
# 216 "/usr/include/wchar.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 218 "/usr/include/wchar.h" 3 4
size_t mbsnrtowcs(wchar_t * __restrict, const char ** __restrict, size_t,
size_t, mbstate_t * __restrict);
FILE *open_wmemstream(wchar_t **, size_t *);
wchar_t *wcpcpy(wchar_t * __restrict, const wchar_t * __restrict);
wchar_t *wcpncpy(wchar_t * __restrict, const wchar_t * __restrict, size_t);
wchar_t *wcsdup(const wchar_t *) __malloc_like;
int wcscasecmp(const wchar_t *, const wchar_t *);
int wcsncasecmp(const wchar_t *, const wchar_t *, size_t n);
size_t wcsnlen(const wchar_t *, size_t) __pure;
size_t wcsnrtombs(char * __restrict, const wchar_t ** __restrict, size_t,
size_t, mbstate_t * __restrict);
#endif
# 230 "/usr/include/wchar.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 232 "/usr/include/wchar.h" 3 4
wchar_t *fgetwln(FILE * __restrict, size_t * __restrict);
size_t wcslcat(wchar_t *, const wchar_t *, size_t);
size_t wcslcpy(wchar_t *, const wchar_t *, size_t);
#endif
# 236 "/usr/include/wchar.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 238 "/usr/include/wchar.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_wchar.h>
#endif /* expanded by -frewrite-includes */
# 238 "/usr/include/wchar.h" 3 4
# 1 "/usr/include/xlocale/_wchar.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011, 2012 The FreeBSD Foundation
*
* This software was developed by David Chisnall under sponsorship from
* the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 35 "/usr/include/xlocale/_wchar.h" 3 4
#ifndef _XLOCALE_WCHAR1_H
#define _XLOCALE_WCHAR1_H
int wcscasecmp_l(const wchar_t *, const wchar_t *,
locale_t);
int wcsncasecmp_l(const wchar_t *, const wchar_t *, size_t,
locale_t);
int wcscoll_l(const wchar_t *, const wchar_t *, locale_t);
size_t wcsxfrm_l(wchar_t * __restrict,
const wchar_t * __restrict, size_t, locale_t);
#endif /* _XLOCALE_WCHAR1_H */
# 47 "/usr/include/xlocale/_wchar.h" 3 4
/*
* Only declare the non-POSIX functions if we're included from xlocale.h.
*/
#ifdef _XLOCALE_H_
#ifndef _XLOCALE_WCHAR2_H
#define _XLOCALE_WCHAR2_H
wint_t btowc_l(int, locale_t);
wint_t fgetwc_l(FILE *, locale_t);
wchar_t *fgetws_l(wchar_t * __restrict, int, FILE * __restrict,
locale_t);
wint_t fputwc_l(wchar_t, FILE *, locale_t);
int fputws_l(const wchar_t * __restrict, FILE * __restrict,
locale_t);
int fwprintf_l(FILE * __restrict, locale_t,
const wchar_t * __restrict, ...);
int fwscanf_l(FILE * __restrict, locale_t,
const wchar_t * __restrict, ...);
wint_t getwc_l(FILE *, locale_t);
wint_t getwchar_l(locale_t);
size_t mbrlen_l(const char * __restrict, size_t,
mbstate_t * __restrict, locale_t);
size_t mbrtowc_l(wchar_t * __restrict,
const char * __restrict, size_t,
mbstate_t * __restrict, locale_t);
int mbsinit_l(const mbstate_t *, locale_t);
size_t mbsrtowcs_l(wchar_t * __restrict,
const char ** __restrict, size_t,
mbstate_t * __restrict, locale_t);
wint_t putwc_l(wchar_t, FILE *, locale_t);
wint_t putwchar_l(wchar_t, locale_t);
int swprintf_l(wchar_t * __restrict, size_t n, locale_t,
const wchar_t * __restrict, ...);
int swscanf_l(const wchar_t * __restrict, locale_t,
const wchar_t * __restrict, ...);
wint_t ungetwc_l(wint_t, FILE *, locale_t);
int vfwprintf_l(FILE * __restrict, locale_t,
const wchar_t * __restrict, __va_list);
int vswprintf_l(wchar_t * __restrict, size_t n, locale_t,
const wchar_t * __restrict, __va_list);
int vwprintf_l(locale_t, const wchar_t * __restrict,
__va_list);
size_t wcrtomb_l(char * __restrict, wchar_t,
mbstate_t * __restrict, locale_t);
size_t wcsftime_l(wchar_t * __restrict, size_t,
const wchar_t * __restrict,
const struct tm * __restrict, locale_t);
size_t wcsrtombs_l(char * __restrict,
const wchar_t ** __restrict, size_t,
mbstate_t * __restrict, locale_t);
double wcstod_l(const wchar_t * __restrict,
wchar_t ** __restrict, locale_t);
long wcstol_l(const wchar_t * __restrict,
wchar_t ** __restrict, int, locale_t);
unsigned long wcstoul_l(const wchar_t * __restrict,
wchar_t ** __restrict, int, locale_t);
int wcswidth_l(const wchar_t *, size_t, locale_t);
int wctob_l(wint_t, locale_t);
int wcwidth_l(wchar_t, locale_t);
int wprintf_l(locale_t, const wchar_t * __restrict, ...);
int wscanf_l(locale_t, const wchar_t * __restrict, ...);
int vfwscanf_l(FILE * __restrict, locale_t,
const wchar_t * __restrict, __va_list);
int vswscanf_l(const wchar_t * __restrict, locale_t,
const wchar_t *__restrict, __va_list);
int vwscanf_l(locale_t, const wchar_t * __restrict,
__va_list);
float wcstof_l(const wchar_t * __restrict,
wchar_t ** __restrict, locale_t);
long double wcstold_l(const wchar_t * __restrict,
wchar_t ** __restrict, locale_t);
long long wcstoll_l(const wchar_t * __restrict,
wchar_t ** __restrict, int, locale_t);
unsigned long long wcstoull_l(const wchar_t * __restrict,
wchar_t ** __restrict, int, locale_t);
size_t mbsnrtowcs_l(wchar_t * __restrict,
const char ** __restrict, size_t, size_t,
mbstate_t * __restrict, locale_t);
size_t wcsnrtombs_l(char * __restrict,
const wchar_t ** __restrict, size_t, size_t,
mbstate_t * __restrict, locale_t);
#endif /* _XLOCALE_WCHAR_H */
# 132 "/usr/include/xlocale/_wchar.h" 3 4
#endif /* _XLOCALE_H_ */
# 133 "/usr/include/xlocale/_wchar.h" 3 4
# 239 "/usr/include/wchar.h" 2 3 4
#endif
# 240 "/usr/include/wchar.h" 3 4
__END_DECLS
#endif /* !_WCHAR_H_ */
# 243 "/usr/include/wchar.h" 3 4
# 37 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pyport.h"
#endif /* expanded by -frewrite-includes */
# 38 "./Include/Python.h"
# 1 "./Include/pyport.h" 1
#ifndef Py_PYPORT_H
#define Py_PYPORT_H
#if 0 /* expanded by -frewrite-includes */
#include "pyconfig.h" /* include for defines */
#endif /* expanded by -frewrite-includes */
# 4 "./Include/pyport.h"
# 1 "./pyconfig.h" 1
/* pyconfig.h. Generated from pyconfig.h.in by configure. */
/* pyconfig.h.in. Generated from configure.ac by autoheader. */
#ifndef Py_PYCONFIG_H
#define Py_PYCONFIG_H
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* BUILD_GNU_TYPE + AIX_BUILDDATE are used to construct the PEP425 tag of the
build system. */
/* #undef AIX_BUILDDATE */
/* Define for AIX if your compiler is a genuine IBM xlC/xlC_r and you want
support for AIX C++ shared extension modules. */
/* #undef AIX_GENUINE_CPLUSPLUS */
/* The normal alignment of `long', in bytes. */
#define ALIGNOF_LONG 8
/* The normal alignment of `max_align_t', in bytes. */
#define ALIGNOF_MAX_ALIGN_T 16
/* The normal alignment of `size_t', in bytes. */
#define ALIGNOF_SIZE_T 8
/* Alternative SOABI used in debug build to load C extensions built in release
mode */
/* #undef ALT_SOABI */
/* The Android API level. */
/* #undef ANDROID_API_LEVEL */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored in ARM
mixed-endian order (byte order 45670123) */
/* #undef DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the most
significant byte first */
/* #undef DOUBLE_IS_BIG_ENDIAN_IEEE754 */
/* Define if C doubles are 64-bit IEEE 754 binary format, stored with the
least significant byte first */
#define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 1
/* Define if --enable-ipv6 is specified */
#define ENABLE_IPV6 1
/* Define to 1 if your system stores words within floats with the most
significant word first */
/* #undef FLOAT_WORDS_BIGENDIAN */
/* Define if getpgrp() must be called as getpgrp(0). */
/* #undef GETPGRP_HAVE_ARG */
/* Define if you have the 'accept' function. */
#define HAVE_ACCEPT 1
/* Define to 1 if you have the `accept4' function. */
#define HAVE_ACCEPT4 1
/* Define to 1 if you have the `acosh' function. */
#define HAVE_ACOSH 1
/* struct addrinfo (netdb.h) */
#define HAVE_ADDRINFO 1
/* Define to 1 if you have the `alarm' function. */
#define HAVE_ALARM 1
/* Define if aligned memory access is required */
/* #undef HAVE_ALIGNED_REQUIRED */
/* Define to 1 if you have the <alloca.h> header file. */
/* #undef HAVE_ALLOCA_H */
/* Define this if your time.h defines altzone. */
/* #undef HAVE_ALTZONE */
/* Define to 1 if you have the `asinh' function. */
#define HAVE_ASINH 1
/* Define to 1 if you have the <asm/types.h> header file. */
/* #undef HAVE_ASM_TYPES_H */
/* Define to 1 if you have the `atanh' function. */
#define HAVE_ATANH 1
/* Define if you have the 'bind' function. */
#define HAVE_BIND 1
/* Define to 1 if you have the `bind_textdomain_codeset' function. */
#define HAVE_BIND_TEXTDOMAIN_CODESET 1
/* Define to 1 if you have the <bluetooth/bluetooth.h> header file. */
/* #undef HAVE_BLUETOOTH_BLUETOOTH_H */
/* Define to 1 if you have the <bluetooth.h> header file. */
#define HAVE_BLUETOOTH_H 1
/* Define if mbstowcs(NULL, "text", 0) does not return the number of wide
chars that would be converted. */
/* #undef HAVE_BROKEN_MBSTOWCS */
/* Define if nice() returns success/failure instead of the new priority. */
#define HAVE_BROKEN_NICE 1
/* Define if the system reports an invalid PIPE_BUF value. */
/* #undef HAVE_BROKEN_PIPE_BUF */
/* Define if poll() sets errno on invalid file descriptors. */
/* #undef HAVE_BROKEN_POLL */
/* Define if the Posix semaphores do not work on your system */
/* #undef HAVE_BROKEN_POSIX_SEMAPHORES */
/* Define if pthread_sigmask() does not work on your system. */
/* #undef HAVE_BROKEN_PTHREAD_SIGMASK */
/* define to 1 if your sem_getvalue is broken. */
/* #undef HAVE_BROKEN_SEM_GETVALUE */
/* Define if 'unsetenv' does not return an int. */
/* #undef HAVE_BROKEN_UNSETENV */
/* Has builtin __atomic_load_n() and __atomic_store_n() functions */
#define HAVE_BUILTIN_ATOMIC 1
/* Define to 1 if you have the <bzlib.h> header file. */
#define HAVE_BZLIB_H 1
/* Define to 1 if you have the 'chflags' function. */
#define HAVE_CHFLAGS 1
/* Define to 1 if you have the `chmod' function. */
#define HAVE_CHMOD 1
/* Define to 1 if you have the `chown' function. */
#define HAVE_CHOWN 1
/* Define if you have the 'chroot' function. */
#define HAVE_CHROOT 1
/* Define to 1 if you have the `clock' function. */
#define HAVE_CLOCK 1
/* Define to 1 if you have the `clock_getres' function. */
#define HAVE_CLOCK_GETRES 1
/* Define to 1 if you have the `clock_gettime' function. */
#define HAVE_CLOCK_GETTIME 1
/* Define to 1 if you have the `clock_nanosleep' function. */
#define HAVE_CLOCK_NANOSLEEP 1
/* Define to 1 if you have the `clock_settime' function. */
#define HAVE_CLOCK_SETTIME 1
/* Define to 1 if you have the `close_range' function. */
#define HAVE_CLOSE_RANGE 1
/* Define if the C compiler supports computed gotos. */
#define HAVE_COMPUTED_GOTOS 1
/* Define to 1 if you have the `confstr' function. */
#define HAVE_CONFSTR 1
/* Define to 1 if you have the <conio.h> header file. */
/* #undef HAVE_CONIO_H */
/* Define if you have the 'connect' function. */
#define HAVE_CONNECT 1
/* Define to 1 if you have the `copy_file_range' function. */
#define HAVE_COPY_FILE_RANGE 1
/* Define to 1 if you have the <crypt.h> header file. */
/* #undef HAVE_CRYPT_H */
/* Define if you have the crypt_r() function. */
#define HAVE_CRYPT_R 1
/* Define to 1 if you have the `ctermid' function. */
#define HAVE_CTERMID 1
/* Define if you have the 'ctermid_r' function. */
#define HAVE_CTERMID_R 1
/* Define if you have the 'filter' function. */
#define HAVE_CURSES_FILTER 1
/* Define to 1 if you have the <curses.h> header file. */
#define HAVE_CURSES_H 1
/* Define if you have the 'has_key' function. */
#define HAVE_CURSES_HAS_KEY 1
/* Define if you have the 'immedok' function. */
#define HAVE_CURSES_IMMEDOK 1
/* Define if you have the 'is_pad' function. */
#define HAVE_CURSES_IS_PAD 1
/* Define if you have the 'is_term_resized' function. */
#define HAVE_CURSES_IS_TERM_RESIZED 1
/* Define if you have the 'resizeterm' function. */
#define HAVE_CURSES_RESIZETERM 1
/* Define if you have the 'resize_term' function. */
#define HAVE_CURSES_RESIZE_TERM 1
/* Define if you have the 'syncok' function. */
#define HAVE_CURSES_SYNCOK 1
/* Define if you have the 'typeahead' function. */
#define HAVE_CURSES_TYPEAHEAD 1
/* Define if you have the 'use_env' function. */
#define HAVE_CURSES_USE_ENV 1
/* Define if you have the 'wchgat' function. */
#define HAVE_CURSES_WCHGAT 1
/* Define to 1 if you have the <db.h> header file. */
#define HAVE_DB_H 1
/* Define to 1 if you have the declaration of `RTLD_DEEPBIND', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_DEEPBIND 1
/* Define to 1 if you have the declaration of `RTLD_GLOBAL', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_GLOBAL 1
/* Define to 1 if you have the declaration of `RTLD_LAZY', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_LAZY 1
/* Define to 1 if you have the declaration of `RTLD_LOCAL', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_LOCAL 1
/* Define to 1 if you have the declaration of `RTLD_MEMBER', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_MEMBER 0
/* Define to 1 if you have the declaration of `RTLD_NODELETE', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_NODELETE 1
/* Define to 1 if you have the declaration of `RTLD_NOLOAD', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_NOLOAD 1
/* Define to 1 if you have the declaration of `RTLD_NOW', and to 0 if you
don't. */
#define HAVE_DECL_RTLD_NOW 1
/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
*/
/* #undef HAVE_DECL_TZNAME */
/* Define to 1 if you have the device macros. */
#define HAVE_DEVICE_MACROS 1
/* Define to 1 if you have the /dev/ptc device file. */
/* #undef HAVE_DEV_PTC */
/* Define to 1 if you have the /dev/ptmx device file. */
/* #undef HAVE_DEV_PTMX */
/* Define to 1 if you have the <direct.h> header file. */
/* #undef HAVE_DIRECT_H */
/* Define to 1 if the dirent structure has a d_type field */
#define HAVE_DIRENT_D_TYPE 1
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#define HAVE_DIRENT_H 1
/* Define if you have the 'dirfd' function or macro. */
#define HAVE_DIRFD 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the `dlopen' function. */
#define HAVE_DLOPEN 1
/* Define to 1 if you have the `dup' function. */
#define HAVE_DUP 1
/* Define to 1 if you have the `dup2' function. */
#define HAVE_DUP2 1
/* Define to 1 if you have the `dup3' function. */
#define HAVE_DUP3 1
/* Define if you have the '_dyld_shared_cache_contains_path' function. */
/* #undef HAVE_DYLD_SHARED_CACHE_CONTAINS_PATH */
/* Defined when any dynamic module loading is enabled. */
#define HAVE_DYNAMIC_LOADING 1
/* Define to 1 if you have the <editline/readline.h> header file. */
/* #undef HAVE_EDITLINE_READLINE_H */
/* Define to 1 if you have the <endian.h> header file. */
#define HAVE_ENDIAN_H 1
/* Define if you have the 'epoll_create' function. */
/* #undef HAVE_EPOLL */
/* Define if you have the 'epoll_create1' function. */
/* #undef HAVE_EPOLL_CREATE1 */
/* Define to 1 if you have the `erf' function. */
#define HAVE_ERF 1
/* Define to 1 if you have the `erfc' function. */
#define HAVE_ERFC 1
/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
/* Define if you have the 'eventfd' function. */
#define HAVE_EVENTFD 1
/* Define to 1 if you have the `execv' function. */
#define HAVE_EXECV 1
/* Define to 1 if you have the `explicit_bzero' function. */
#define HAVE_EXPLICIT_BZERO 1
/* Define to 1 if you have the `explicit_memset' function. */
/* #undef HAVE_EXPLICIT_MEMSET */
/* Define to 1 if you have the `expm1' function. */
#define HAVE_EXPM1 1
/* Define to 1 if you have the `faccessat' function. */
#define HAVE_FACCESSAT 1
/* Define if you have the 'fchdir' function. */
#define HAVE_FCHDIR 1
/* Define to 1 if you have the `fchmod' function. */
#define HAVE_FCHMOD 1
/* Define to 1 if you have the `fchmodat' function. */
#define HAVE_FCHMODAT 1
/* Define to 1 if you have the `fchown' function. */
#define HAVE_FCHOWN 1
/* Define to 1 if you have the `fchownat' function. */
#define HAVE_FCHOWNAT 1
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define if you have the 'fdatasync' function. */
#define HAVE_FDATASYNC 1
/* Define to 1 if you have the `fdopendir' function. */
#define HAVE_FDOPENDIR 1
/* Define to 1 if you have the `fdwalk' function. */
/* #undef HAVE_FDWALK */
/* Define to 1 if you have the `fexecve' function. */
#define HAVE_FEXECVE 1
/* Define if you have the 'ffi_closure_alloc' function. */
#define HAVE_FFI_CLOSURE_ALLOC 1
/* Define if you have the 'ffi_prep_cif_var' function. */
#define HAVE_FFI_PREP_CIF_VAR 1
/* Define if you have the 'ffi_prep_closure_loc' function. */
#define HAVE_FFI_PREP_CLOSURE_LOC 1
/* Define to 1 if you have the `flock' function. */
#define HAVE_FLOCK 1
/* Define to 1 if you have the `fork' function. */
#define HAVE_FORK 1
/* Define to 1 if you have the `fork1' function. */
/* #undef HAVE_FORK1 */
/* Define to 1 if you have the `forkpty' function. */
#define HAVE_FORKPTY 1
/* Define to 1 if you have the `fpathconf' function. */
#define HAVE_FPATHCONF 1
/* Define to 1 if you have the `fseek64' function. */
/* #undef HAVE_FSEEK64 */
/* Define to 1 if you have the `fseeko' function. */
#define HAVE_FSEEKO 1
/* Define to 1 if you have the `fstatat' function. */
#define HAVE_FSTATAT 1
/* Define to 1 if you have the `fstatvfs' function. */
#define HAVE_FSTATVFS 1
/* Define if you have the 'fsync' function. */
#define HAVE_FSYNC 1
/* Define to 1 if you have the `ftell64' function. */
/* #undef HAVE_FTELL64 */
/* Define to 1 if you have the `ftello' function. */
#define HAVE_FTELLO 1
/* Define to 1 if you have the `ftime' function. */
/* #undef HAVE_FTIME */
/* Define to 1 if you have the `ftruncate' function. */
#define HAVE_FTRUNCATE 1
/* Define to 1 if you have the `futimens' function. */
#define HAVE_FUTIMENS 1
/* Define to 1 if you have the `futimes' function. */
#define HAVE_FUTIMES 1
/* Define to 1 if you have the `futimesat' function. */
#define HAVE_FUTIMESAT 1
/* Define to 1 if you have the `gai_strerror' function. */
#define HAVE_GAI_STRERROR 1
/* Define if we can use gcc inline assembler to get and set mc68881 fpcr */
/* #undef HAVE_GCC_ASM_FOR_MC68881 */
/* Define if we can use x64 gcc inline assembler */
/* #undef HAVE_GCC_ASM_FOR_X64 */
/* Define if we can use gcc inline assembler to get and set x87 control word
*/
/* #undef HAVE_GCC_ASM_FOR_X87 */
/* Define if your compiler provides __uint128_t */
#define HAVE_GCC_UINT128_T 1
/* Define to 1 if you have the <gdbm-ndbm.h> header file. */
/* #undef HAVE_GDBM_DASH_NDBM_H */
/* Define to 1 if you have the <gdbm.h> header file. */
/* #undef HAVE_GDBM_H */
/* Define to 1 if you have the <gdbm/ndbm.h> header file. */
/* #undef HAVE_GDBM_NDBM_H */
/* Define if you have the getaddrinfo function. */
#define HAVE_GETADDRINFO 1
/* Define this if you have flockfile(), getc_unlocked(), and funlockfile() */
#define HAVE_GETC_UNLOCKED 1
/* Define to 1 if you have the `getegid' function. */
#define HAVE_GETEGID 1
/* Define to 1 if you have the `getentropy' function. */
#define HAVE_GETENTROPY 1
/* Define to 1 if you have the `geteuid' function. */
#define HAVE_GETEUID 1
/* Define to 1 if you have the `getgid' function. */
#define HAVE_GETGID 1
/* Define to 1 if you have the `getgrgid' function. */
#define HAVE_GETGRGID 1
/* Define to 1 if you have the `getgrgid_r' function. */
#define HAVE_GETGRGID_R 1
/* Define to 1 if you have the `getgrnam_r' function. */
#define HAVE_GETGRNAM_R 1
/* Define to 1 if you have the `getgrouplist' function. */
#define HAVE_GETGROUPLIST 1
/* Define to 1 if you have the `getgroups' function. */
#define HAVE_GETGROUPS 1
/* Define if you have the 'gethostbyaddr' function. */
#define HAVE_GETHOSTBYADDR 1
/* Define to 1 if you have the `gethostbyname' function. */
#define HAVE_GETHOSTBYNAME 1
/* Define this if you have some version of gethostbyname_r() */
#define HAVE_GETHOSTBYNAME_R 1
/* Define this if you have the 3-arg version of gethostbyname_r(). */
/* #undef HAVE_GETHOSTBYNAME_R_3_ARG */
/* Define this if you have the 5-arg version of gethostbyname_r(). */
/* #undef HAVE_GETHOSTBYNAME_R_5_ARG */
/* Define this if you have the 6-arg version of gethostbyname_r(). */
#define HAVE_GETHOSTBYNAME_R_6_ARG 1
/* Define to 1 if you have the `gethostname' function. */
#define HAVE_GETHOSTNAME 1
/* Define to 1 if you have the `getitimer' function. */
#define HAVE_GETITIMER 1
/* Define to 1 if you have the `getloadavg' function. */
#define HAVE_GETLOADAVG 1
/* Define to 1 if you have the `getlogin' function. */
#define HAVE_GETLOGIN 1
/* Define to 1 if you have the `getnameinfo' function. */
#define HAVE_GETNAMEINFO 1
/* Define if you have the 'getpagesize' function. */
#define HAVE_GETPAGESIZE 1
/* Define if you have the 'getpeername' function. */
#define HAVE_GETPEERNAME 1
/* Define to 1 if you have the `getpgid' function. */
#define HAVE_GETPGID 1
/* Define to 1 if you have the `getpgrp' function. */
#define HAVE_GETPGRP 1
/* Define to 1 if you have the `getpid' function. */
#define HAVE_GETPID 1
/* Define to 1 if you have the `getppid' function. */
#define HAVE_GETPPID 1
/* Define to 1 if you have the `getpriority' function. */
#define HAVE_GETPRIORITY 1
/* Define if you have the 'getprotobyname' function. */
#define HAVE_GETPROTOBYNAME 1
/* Define to 1 if you have the `getpwent' function. */
#define HAVE_GETPWENT 1
/* Define to 1 if you have the `getpwnam_r' function. */
#define HAVE_GETPWNAM_R 1
/* Define to 1 if you have the `getpwuid' function. */
#define HAVE_GETPWUID 1
/* Define to 1 if you have the `getpwuid_r' function. */
#define HAVE_GETPWUID_R 1
/* Define to 1 if the getrandom() function is available */
#define HAVE_GETRANDOM 1
/* Define to 1 if the Linux getrandom() syscall is available */
/* #undef HAVE_GETRANDOM_SYSCALL */
/* Define to 1 if you have the `getresgid' function. */
#define HAVE_GETRESGID 1
/* Define to 1 if you have the `getresuid' function. */
#define HAVE_GETRESUID 1
/* Define to 1 if you have the `getrusage' function. */
#define HAVE_GETRUSAGE 1
/* Define if you have the 'getservbyname' function. */
#define HAVE_GETSERVBYNAME 1
/* Define if you have the 'getservbyport' function. */
#define HAVE_GETSERVBYPORT 1
/* Define to 1 if you have the `getsid' function. */
#define HAVE_GETSID 1
/* Define if you have the 'getsockname' function. */
#define HAVE_GETSOCKNAME 1
/* Define to 1 if you have the `getspent' function. */
/* #undef HAVE_GETSPENT */
/* Define to 1 if you have the `getspnam' function. */
/* #undef HAVE_GETSPNAM */
/* Define to 1 if you have the `getuid' function. */
#define HAVE_GETUID 1
/* Define to 1 if you have the `getwd' function. */
#define HAVE_GETWD 1
/* Define if glibc has incorrect _FORTIFY_SOURCE wrappers for memmove and
bcopy. */
/* #undef HAVE_GLIBC_MEMMOVE_BUG */
/* Define to 1 if you have the <grp.h> header file. */
#define HAVE_GRP_H 1
/* Define if you have the 'hstrerror' function. */
#define HAVE_HSTRERROR 1
/* Define this if you have le64toh() */
/* #undef HAVE_HTOLE64 */
/* Define to 1 if you have the <ieeefp.h> header file. */
#define HAVE_IEEEFP_H 1
/* Define to 1 if you have the `if_nameindex' function. */
#define HAVE_IF_NAMEINDEX 1
/* Define if you have the 'inet_aton' function. */
#define HAVE_INET_ATON 1
/* Define if you have the 'inet_ntoa' function. */
#define HAVE_INET_NTOA 1
/* Define if you have the 'inet_pton' function. */
#define HAVE_INET_PTON 1
/* Define to 1 if you have the `initgroups' function. */
#define HAVE_INITGROUPS 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <io.h> header file. */
/* #undef HAVE_IO_H */
/* Define if gcc has the ipa-pure-const bug. */
/* #undef HAVE_IPA_PURE_CONST_BUG */
/* Define to 1 if you have the `kill' function. */
#define HAVE_KILL 1
/* Define to 1 if you have the `killpg' function. */
#define HAVE_KILLPG 1
/* Define if you have the 'kqueue' function. */
#define HAVE_KQUEUE 1
/* Define to 1 if you have the <langinfo.h> header file. */
#define HAVE_LANGINFO_H 1
/* Defined to enable large file support when an off_t is bigger than a long
and long long is at least as big as an off_t. You may need to add some
flags for configuration and compilation to enable this mode. (For Solaris
and Linux, the necessary defines are already defined.) */
/* #undef HAVE_LARGEFILE_SUPPORT */
/* Define to 1 if you have the 'lchflags' function. */
#define HAVE_LCHFLAGS 1
/* Define to 1 if you have the `lchmod' function. */
#define HAVE_LCHMOD 1
/* Define to 1 if you have the `lchown' function. */
#define HAVE_LCHOWN 1
/* Define to 1 if you want to build _blake2 module with libb2 */
/* #undef HAVE_LIBB2 */
/* Define to 1 if you have the `db' library (-ldb). */
/* #undef HAVE_LIBDB */
/* Define to 1 if you have the `dl' library (-ldl). */
#define HAVE_LIBDL 1
/* Define to 1 if you have the `dld' library (-ldld). */
/* #undef HAVE_LIBDLD */
/* Define to 1 if you have the `ieee' library (-lieee). */
/* #undef HAVE_LIBIEEE */
/* Define to 1 if you have the <libintl.h> header file. */
#define HAVE_LIBINTL_H 1
/* Define to 1 if you have the `resolv' library (-lresolv). */
/* #undef HAVE_LIBRESOLV */
/* Define to 1 if you have the `sendfile' library (-lsendfile). */
/* #undef HAVE_LIBSENDFILE */
/* Define to 1 if you have the `sqlite3' library (-lsqlite3). */
#define HAVE_LIBSQLITE3 1
/* Define to 1 if you have the <libutil.h> header file. */
#define HAVE_LIBUTIL_H 1
/* Define if you have the 'link' function. */
#define HAVE_LINK 1
/* Define to 1 if you have the `linkat' function. */
#define HAVE_LINKAT 1
/* Define to 1 if you have the <linux/auxvec.h> header file. */
/* #undef HAVE_LINUX_AUXVEC_H */
/* Define to 1 if you have the <linux/can/bcm.h> header file. */
/* #undef HAVE_LINUX_CAN_BCM_H */
/* Define to 1 if you have the <linux/can.h> header file. */
/* #undef HAVE_LINUX_CAN_H */
/* Define to 1 if you have the <linux/can/j1939.h> header file. */
/* #undef HAVE_LINUX_CAN_J1939_H */
/* Define if compiling using Linux 3.6 or later. */
/* #undef HAVE_LINUX_CAN_RAW_FD_FRAMES */
/* Define to 1 if you have the <linux/can/raw.h> header file. */
/* #undef HAVE_LINUX_CAN_RAW_H */
/* Define if compiling using Linux 4.1 or later. */
/* #undef HAVE_LINUX_CAN_RAW_JOIN_FILTERS */
/* Define to 1 if you have the <linux/fs.h> header file. */
/* #undef HAVE_LINUX_FS_H */
/* Define to 1 if you have the <linux/limits.h> header file. */
/* #undef HAVE_LINUX_LIMITS_H */
/* Define to 1 if you have the <linux/memfd.h> header file. */
/* #undef HAVE_LINUX_MEMFD_H */
/* Define to 1 if you have the <linux/netlink.h> header file. */
/* #undef HAVE_LINUX_NETLINK_H */
/* Define to 1 if you have the <linux/qrtr.h> header file. */
/* #undef HAVE_LINUX_QRTR_H */
/* Define to 1 if you have the <linux/random.h> header file. */
/* #undef HAVE_LINUX_RANDOM_H */
/* Define to 1 if you have the <linux/soundcard.h> header file. */
/* #undef HAVE_LINUX_SOUNDCARD_H */
/* Define to 1 if you have the <linux/tipc.h> header file. */
/* #undef HAVE_LINUX_TIPC_H */
/* Define to 1 if you have the <linux/vm_sockets.h> header file. */
/* #undef HAVE_LINUX_VM_SOCKETS_H */
/* Define to 1 if you have the <linux/wait.h> header file. */
/* #undef HAVE_LINUX_WAIT_H */
/* Define if you have the 'listen' function. */
#define HAVE_LISTEN 1
/* Define to 1 if you have the `lockf' function. */
#define HAVE_LOCKF 1
/* Define to 1 if you have the `log1p' function. */
#define HAVE_LOG1P 1
/* Define to 1 if you have the `log2' function. */
#define HAVE_LOG2 1
/* Define to 1 if you have the `login_tty' function. */
#define HAVE_LOGIN_TTY 1
/* Define to 1 if the system has the type `long double'. */
#define HAVE_LONG_DOUBLE 1
/* Define to 1 if you have the `lstat' function. */
#define HAVE_LSTAT 1
/* Define to 1 if you have the `lutimes' function. */
#define HAVE_LUTIMES 1
/* Define to 1 if you have the <lzma.h> header file. */
/* #undef HAVE_LZMA_H */
/* Define to 1 if you have the `madvise' function. */
#define HAVE_MADVISE 1
/* Define this if you have the makedev macro. */
#define HAVE_MAKEDEV 1
/* Define to 1 if you have the `mbrtowc' function. */
#define HAVE_MBRTOWC 1
/* Define if you have the 'memfd_create' function. */
#define HAVE_MEMFD_CREATE 1
/* Define to 1 if you have the `memrchr' function. */
#define HAVE_MEMRCHR 1
/* Define to 1 if you have the <minix/config.h> header file. */
/* #undef HAVE_MINIX_CONFIG_H */
/* Define to 1 if you have the `mkdirat' function. */
#define HAVE_MKDIRAT 1
/* Define to 1 if you have the `mkfifo' function. */
#define HAVE_MKFIFO 1
/* Define to 1 if you have the `mkfifoat' function. */
#define HAVE_MKFIFOAT 1
/* Define to 1 if you have the `mknod' function. */
#define HAVE_MKNOD 1
/* Define to 1 if you have the `mknodat' function. */
#define HAVE_MKNODAT 1
/* Define to 1 if you have the `mktime' function. */
#define HAVE_MKTIME 1
/* Define to 1 if you have the `mmap' function. */
#define HAVE_MMAP 1
/* Define to 1 if you have the `mremap' function. */
/* #undef HAVE_MREMAP */
/* Define to 1 if you have the `nanosleep' function. */
#define HAVE_NANOSLEEP 1
/* Define to 1 if you have the `ncursesw' library. */
#define HAVE_NCURSESW 1
/* Define to 1 if you have the <ncurses.h> header file. */
#define HAVE_NCURSES_H 1
/* Define to 1 if you have the <ndbm.h> header file. */
#define HAVE_NDBM_H 1
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
/* Define to 1 if you have the <netcan/can.h> header file. */
/* #undef HAVE_NETCAN_CAN_H */
/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* Define to 1 if you have the <netpacket/packet.h> header file. */
/* #undef HAVE_NETPACKET_PACKET_H */
/* Define to 1 if you have the <net/ethernet.h> header file. */
#define HAVE_NET_ETHERNET_H 1
/* Define to 1 if you have the <net/if.h> header file. */
#define HAVE_NET_IF_H 1
/* Define to 1 if you have the `nice' function. */
#define HAVE_NICE 1
/* Define if the internal form of wchar_t in non-Unicode locales is not
Unicode. */
/* #undef HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION */
/* Define to 1 if you have the `openat' function. */
#define HAVE_OPENAT 1
/* Define to 1 if you have the `opendir' function. */
#define HAVE_OPENDIR 1
/* Define to 1 if you have the `openpty' function. */
#define HAVE_OPENPTY 1
/* Define to 1 if you have the <panel.h> header file. */
#define HAVE_PANEL_H 1
/* Define to 1 if you have the `pathconf' function. */
#define HAVE_PATHCONF 1
/* Define to 1 if you have the `pause' function. */
#define HAVE_PAUSE 1
/* Define to 1 if you have the `pipe' function. */
#define HAVE_PIPE 1
/* Define to 1 if you have the `pipe2' function. */
#define HAVE_PIPE2 1
/* Define to 1 if you have the `plock' function. */
/* #undef HAVE_PLOCK */
/* Define to 1 if you have the `poll' function. */
#define HAVE_POLL 1
/* Define to 1 if you have the <poll.h> header file. */
#define HAVE_POLL_H 1
/* Define to 1 if you have the `posix_fadvise' function. */
#define HAVE_POSIX_FADVISE 1
/* Define to 1 if you have the `posix_fallocate' function. */
#define HAVE_POSIX_FALLOCATE 1
/* Define to 1 if you have the `posix_spawn' function. */
#define HAVE_POSIX_SPAWN 1
/* Define to 1 if you have the `posix_spawnp' function. */
#define HAVE_POSIX_SPAWNP 1
/* Define to 1 if you have the `pread' function. */
#define HAVE_PREAD 1
/* Define to 1 if you have the `preadv' function. */
#define HAVE_PREADV 1
/* Define to 1 if you have the `preadv2' function. */
/* #undef HAVE_PREADV2 */
/* Define if you have the 'prlimit' function. */
/* #undef HAVE_PRLIMIT */
/* Define to 1 if you have the <process.h> header file. */
/* #undef HAVE_PROCESS_H */
/* Define if your compiler supports function prototype */
#define HAVE_PROTOTYPES 1
/* Define to 1 if you have the `pthread_condattr_setclock' function. */
#define HAVE_PTHREAD_CONDATTR_SETCLOCK 1
/* Defined for Solaris 2.6 bug in pthread header. */
/* #undef HAVE_PTHREAD_DESTRUCTOR */
/* Define to 1 if you have the `pthread_getcpuclockid' function. */
#define HAVE_PTHREAD_GETCPUCLOCKID 1
/* Define to 1 if you have the <pthread.h> header file. */
#define HAVE_PTHREAD_H 1
/* Define to 1 if you have the `pthread_init' function. */
/* #undef HAVE_PTHREAD_INIT */
/* Define to 1 if you have the `pthread_kill' function. */
#define HAVE_PTHREAD_KILL 1
/* Define to 1 if you have the `pthread_sigmask' function. */
#define HAVE_PTHREAD_SIGMASK 1
/* Define if platform requires stubbed pthreads support */
/* #undef HAVE_PTHREAD_STUBS */
/* Define to 1 if you have the <pty.h> header file. */
/* #undef HAVE_PTY_H */
/* Define to 1 if you have the `pwrite' function. */
#define HAVE_PWRITE 1
/* Define to 1 if you have the `pwritev' function. */
#define HAVE_PWRITEV 1
/* Define to 1 if you have the `pwritev2' function. */
/* #undef HAVE_PWRITEV2 */
/* Define to 1 if you have the <readline/readline.h> header file. */
/* #undef HAVE_READLINE_READLINE_H */
/* Define to 1 if you have the `readlink' function. */
#define HAVE_READLINK 1
/* Define to 1 if you have the `readlinkat' function. */
#define HAVE_READLINKAT 1
/* Define to 1 if you have the `readv' function. */
#define HAVE_READV 1
/* Define to 1 if you have the `realpath' function. */
#define HAVE_REALPATH 1
/* Define if you have the 'recvfrom' function. */
#define HAVE_RECVFROM 1
/* Define to 1 if you have the `renameat' function. */
#define HAVE_RENAMEAT 1
/* Define if readline supports append_history */
#define HAVE_RL_APPEND_HISTORY 1
/* Define if you can turn off readline's signal handling. */
#define HAVE_RL_CATCH_SIGNAL 1
/* Define if readline supports rl_compdisp_func_t */
#define HAVE_RL_COMPDISP_FUNC_T 1
/* Define if you have readline 2.2 */
#define HAVE_RL_COMPLETION_APPEND_CHARACTER 1
/* Define if you have readline 4.0 */
#define HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK 1
/* Define if you have readline 4.2 */
#define HAVE_RL_COMPLETION_MATCHES 1
/* Define if you have rl_completion_suppress_append */
#define HAVE_RL_COMPLETION_SUPPRESS_APPEND 1
/* Define if you have readline 4.0 */
#define HAVE_RL_PRE_INPUT_HOOK 1
/* Define if you have readline 4.0 */
#define HAVE_RL_RESIZE_TERMINAL 1
/* Define to 1 if you have the <rpc/rpc.h> header file. */
#define HAVE_RPC_RPC_H 1
/* Define to 1 if you have the `rtpSpawn' function. */
/* #undef HAVE_RTPSPAWN */
/* Define to 1 if you have the `sched_get_priority_max' function. */
#define HAVE_SCHED_GET_PRIORITY_MAX 1
/* Define to 1 if you have the <sched.h> header file. */
#define HAVE_SCHED_H 1
/* Define to 1 if you have the `sched_rr_get_interval' function. */
#define HAVE_SCHED_RR_GET_INTERVAL 1
/* Define to 1 if you have the `sched_setaffinity' function. */
#define HAVE_SCHED_SETAFFINITY 1
/* Define to 1 if you have the `sched_setparam' function. */
#define HAVE_SCHED_SETPARAM 1
/* Define to 1 if you have the `sched_setscheduler' function. */
#define HAVE_SCHED_SETSCHEDULER 1
/* Define to 1 if you have the `sem_clockwait' function. */
/* #undef HAVE_SEM_CLOCKWAIT */
/* Define to 1 if you have the `sem_getvalue' function. */
#define HAVE_SEM_GETVALUE 1
/* Define to 1 if you have the `sem_open' function. */
#define HAVE_SEM_OPEN 1
/* Define to 1 if you have the `sem_timedwait' function. */
#define HAVE_SEM_TIMEDWAIT 1
/* Define to 1 if you have the `sem_unlink' function. */
#define HAVE_SEM_UNLINK 1
/* Define to 1 if you have the `sendfile' function. */
#define HAVE_SENDFILE 1
/* Define if you have the 'sendto' function. */
#define HAVE_SENDTO 1
/* Define to 1 if you have the `setegid' function. */
#define HAVE_SETEGID 1
/* Define to 1 if you have the `seteuid' function. */
#define HAVE_SETEUID 1
/* Define to 1 if you have the `setgid' function. */
#define HAVE_SETGID 1
/* Define if you have the 'setgroups' function. */
#define HAVE_SETGROUPS 1
/* Define to 1 if you have the `sethostname' function. */
#define HAVE_SETHOSTNAME 1
/* Define to 1 if you have the `setitimer' function. */
#define HAVE_SETITIMER 1
/* Define to 1 if you have the <setjmp.h> header file. */
#define HAVE_SETJMP_H 1
/* Define to 1 if you have the `setlocale' function. */
#define HAVE_SETLOCALE 1
/* Define to 1 if you have the `setns' function. */
/* #undef HAVE_SETNS */
/* Define to 1 if you have the `setpgid' function. */
#define HAVE_SETPGID 1
/* Define to 1 if you have the `setpgrp' function. */
#define HAVE_SETPGRP 1
/* Define to 1 if you have the `setpriority' function. */
#define HAVE_SETPRIORITY 1
/* Define to 1 if you have the `setregid' function. */
#define HAVE_SETREGID 1
/* Define to 1 if you have the `setresgid' function. */
#define HAVE_SETRESGID 1
/* Define to 1 if you have the `setresuid' function. */
#define HAVE_SETRESUID 1
/* Define to 1 if you have the `setreuid' function. */
#define HAVE_SETREUID 1
/* Define to 1 if you have the `setsid' function. */
#define HAVE_SETSID 1
/* Define if you have the 'setsockopt' function. */
#define HAVE_SETSOCKOPT 1
/* Define to 1 if you have the `setuid' function. */
#define HAVE_SETUID 1
/* Define to 1 if you have the `setvbuf' function. */
#define HAVE_SETVBUF 1
/* Define to 1 if you have the <shadow.h> header file. */
/* #undef HAVE_SHADOW_H */
/* Define to 1 if you have the `shm_open' function. */
#define HAVE_SHM_OPEN 1
/* Define to 1 if you have the `shm_unlink' function. */
#define HAVE_SHM_UNLINK 1
/* Define to 1 if you have the `shutdown' function. */
#define HAVE_SHUTDOWN 1
/* Define to 1 if you have the `sigaction' function. */
#define HAVE_SIGACTION 1
/* Define to 1 if you have the `sigaltstack' function. */
#define HAVE_SIGALTSTACK 1
/* Define to 1 if you have the `sigfillset' function. */
#define HAVE_SIGFILLSET 1
/* Define to 1 if `si_band' is a member of `siginfo_t'. */
#define HAVE_SIGINFO_T_SI_BAND 1
/* Define to 1 if you have the `siginterrupt' function. */
#define HAVE_SIGINTERRUPT 1
/* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1
/* Define to 1 if you have the `sigpending' function. */
#define HAVE_SIGPENDING 1
/* Define to 1 if you have the `sigrelse' function. */
#define HAVE_SIGRELSE 1
/* Define to 1 if you have the `sigtimedwait' function. */
#define HAVE_SIGTIMEDWAIT 1
/* Define to 1 if you have the `sigwait' function. */
#define HAVE_SIGWAIT 1
/* Define to 1 if you have the `sigwaitinfo' function. */
#define HAVE_SIGWAITINFO 1
/* Define to 1 if you have the `snprintf' function. */
#define HAVE_SNPRINTF 1
/* struct sockaddr_alg (linux/if_alg.h) */
/* #undef HAVE_SOCKADDR_ALG */
/* Define if sockaddr has sa_len member */
#define HAVE_SOCKADDR_SA_LEN 1
/* struct sockaddr_storage (sys/socket.h) */
#define HAVE_SOCKADDR_STORAGE 1
/* Define if you have the 'socket' function. */
#define HAVE_SOCKET 1
/* Define if you have the 'socketpair' function. */
#define HAVE_SOCKETPAIR 1
/* Define to 1 if you have the <spawn.h> header file. */
#define HAVE_SPAWN_H 1
/* Define to 1 if you have the `splice' function. */
/* #undef HAVE_SPLICE */
/* Define if your compiler provides ssize_t */
#define HAVE_SSIZE_T 1
/* Define to 1 if you have the `statvfs' function. */
#define HAVE_STATVFS 1
/* Define if you have struct stat.st_mtim.tv_nsec */
#define HAVE_STAT_TV_NSEC 1
/* Define if you have struct stat.st_mtimensec */
#define HAVE_STAT_TV_NSEC2 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Has stdatomic.h with atomic_int and atomic_uintptr_t */
#define HAVE_STD_ATOMIC 1
/* Define to 1 if you have the `strftime' function. */
#define HAVE_STRFTIME 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the `strlcpy' function. */
#define HAVE_STRLCPY 1
/* Define to 1 if you have the <stropts.h> header file. */
/* #undef HAVE_STROPTS_H */
/* Define to 1 if you have the `strsignal' function. */
#define HAVE_STRSIGNAL 1
/* Define to 1 if `pw_gecos' is a member of `struct passwd'. */
#define HAVE_STRUCT_PASSWD_PW_GECOS 1
/* Define to 1 if `pw_passwd' is a member of `struct passwd'. */
#define HAVE_STRUCT_PASSWD_PW_PASSWD 1
/* Define to 1 if `st_birthtime' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
/* Define to 1 if `st_blksize' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
/* Define to 1 if `st_blocks' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_BLOCKS 1
/* Define to 1 if `st_flags' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_FLAGS 1
/* Define to 1 if `st_gen' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_GEN 1
/* Define to 1 if `st_rdev' is a member of `struct stat'. */
#define HAVE_STRUCT_STAT_ST_RDEV 1
/* Define to 1 if `tm_zone' is a member of `struct tm'. */
#define HAVE_STRUCT_TM_TM_ZONE 1
/* Define if you have the 'symlink' function. */
#define HAVE_SYMLINK 1
/* Define to 1 if you have the `symlinkat' function. */
#define HAVE_SYMLINKAT 1
/* Define to 1 if you have the `sync' function. */
#define HAVE_SYNC 1
/* Define to 1 if you have the `sysconf' function. */
#define HAVE_SYSCONF 1
/* Define to 1 if you have the <sysexits.h> header file. */
#define HAVE_SYSEXITS_H 1
/* Define to 1 if you have the <syslog.h> header file. */
#define HAVE_SYSLOG_H 1
/* Define to 1 if you have the `system' function. */
#define HAVE_SYSTEM 1
/* Define to 1 if you have the <sys/audioio.h> header file. */
/* #undef HAVE_SYS_AUDIOIO_H */
/* Define to 1 if you have the <sys/auxv.h> header file. */
#define HAVE_SYS_AUXV_H 1
/* Define to 1 if you have the <sys/bsdtty.h> header file. */
/* #undef HAVE_SYS_BSDTTY_H */
/* Define to 1 if you have the <sys/devpoll.h> header file. */
/* #undef HAVE_SYS_DEVPOLL_H */
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_DIR_H */
/* Define to 1 if you have the <sys/endian.h> header file. */
#define HAVE_SYS_ENDIAN_H 1
/* Define to 1 if you have the <sys/epoll.h> header file. */
/* #undef HAVE_SYS_EPOLL_H */
/* Define to 1 if you have the <sys/eventfd.h> header file. */
#define HAVE_SYS_EVENTFD_H 1
/* Define to 1 if you have the <sys/event.h> header file. */
#define HAVE_SYS_EVENT_H 1
/* Define to 1 if you have the <sys/file.h> header file. */
#define HAVE_SYS_FILE_H 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/kern_control.h> header file. */
/* #undef HAVE_SYS_KERN_CONTROL_H */
/* Define to 1 if you have the <sys/loadavg.h> header file. */
/* #undef HAVE_SYS_LOADAVG_H */
/* Define to 1 if you have the <sys/lock.h> header file. */
#define HAVE_SYS_LOCK_H 1
/* Define to 1 if you have the <sys/memfd.h> header file. */
/* #undef HAVE_SYS_MEMFD_H */
/* Define to 1 if you have the <sys/mkdev.h> header file. */
/* #undef HAVE_SYS_MKDEV_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the <sys/modem.h> header file. */
/* #undef HAVE_SYS_MODEM_H */
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
*/
/* #undef HAVE_SYS_NDIR_H */
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/poll.h> header file. */
#define HAVE_SYS_POLL_H 1
/* Define to 1 if you have the <sys/random.h> header file. */
#define HAVE_SYS_RANDOM_H 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
#define HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/sendfile.h> header file. */
/* #undef HAVE_SYS_SENDFILE_H */
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/soundcard.h> header file. */
#define HAVE_SYS_SOUNDCARD_H 1
/* Define to 1 if you have the <sys/statvfs.h> header file. */
#define HAVE_SYS_STATVFS_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/syscall.h> header file. */
#define HAVE_SYS_SYSCALL_H 1
/* Define to 1 if you have the <sys/sysmacros.h> header file. */
/* #undef HAVE_SYS_SYSMACROS_H */
/* Define to 1 if you have the <sys/sys_domain.h> header file. */
/* #undef HAVE_SYS_SYS_DOMAIN_H */
/* Define to 1 if you have the <sys/termio.h> header file. */
/* #undef HAVE_SYS_TERMIO_H */
/* Define to 1 if you have the <sys/times.h> header file. */
#define HAVE_SYS_TIMES_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
#define HAVE_SYS_UIO_H 1
/* Define to 1 if you have the <sys/un.h> header file. */
#define HAVE_SYS_UN_H 1
/* Define to 1 if you have the <sys/utsname.h> header file. */
#define HAVE_SYS_UTSNAME_H 1
/* Define to 1 if you have the <sys/wait.h> header file. */
#define HAVE_SYS_WAIT_H 1
/* Define to 1 if you have the <sys/xattr.h> header file. */
/* #undef HAVE_SYS_XATTR_H */
/* Define to 1 if you have the `tcgetpgrp' function. */
#define HAVE_TCGETPGRP 1
/* Define to 1 if you have the `tcsetpgrp' function. */
#define HAVE_TCSETPGRP 1
/* Define to 1 if you have the `tempnam' function. */
#define HAVE_TEMPNAM 1
/* Define to 1 if you have the <termios.h> header file. */
#define HAVE_TERMIOS_H 1
/* Define to 1 if you have the <term.h> header file. */
#define HAVE_TERM_H 1
/* Define to 1 if you have the `timegm' function. */
#define HAVE_TIMEGM 1
/* Define to 1 if you have the `times' function. */
#define HAVE_TIMES 1
/* Define to 1 if you have the `tmpfile' function. */
#define HAVE_TMPFILE 1
/* Define to 1 if you have the `tmpnam' function. */
#define HAVE_TMPNAM 1
/* Define to 1 if you have the `tmpnam_r' function. */
/* #undef HAVE_TMPNAM_R */
/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
`HAVE_STRUCT_TM_TM_ZONE' instead. */
#define HAVE_TM_ZONE 1
/* Define to 1 if you have the `truncate' function. */
#define HAVE_TRUNCATE 1
/* Define to 1 if you have the `ttyname' function. */
#define HAVE_TTYNAME 1
/* Define to 1 if you don't have `tm_zone' but do have the external array
`tzname'. */
/* #undef HAVE_TZNAME */
/* Define to 1 if you have the `umask' function. */
#define HAVE_UMASK 1
/* Define to 1 if you have the `uname' function. */
#define HAVE_UNAME 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the `unlinkat' function. */
#define HAVE_UNLINKAT 1
/* Define to 1 if you have the `unshare' function. */
/* #undef HAVE_UNSHARE */
/* Define if you have a useable wchar_t type defined in wchar.h; useable means
wchar_t must be an unsigned type with at least 16 bits. (see
Include/unicodeobject.h). */
#define HAVE_USABLE_WCHAR_T 1
/* Define to 1 if you have the <util.h> header file. */
/* #undef HAVE_UTIL_H */
/* Define to 1 if you have the `utimensat' function. */
#define HAVE_UTIMENSAT 1
/* Define to 1 if you have the `utimes' function. */
#define HAVE_UTIMES 1
/* Define to 1 if you have the <utime.h> header file. */
#define HAVE_UTIME_H 1
/* Define to 1 if you have the <utmp.h> header file. */
/* #undef HAVE_UTMP_H */
/* Define to 1 if you have the `uuid_create' function. */
#define HAVE_UUID_CREATE 1
/* Define to 1 if you have the `uuid_enc_be' function. */
#define HAVE_UUID_ENC_BE 1
/* Define if uuid_generate_time_safe() exists. */
/* #undef HAVE_UUID_GENERATE_TIME_SAFE */
/* Define to 1 if you have the <uuid.h> header file. */
#define HAVE_UUID_H 1
/* Define to 1 if you have the <uuid/uuid.h> header file. */
/* #undef HAVE_UUID_UUID_H */
/* Define to 1 if you have the `vfork' function. */
#define HAVE_VFORK 1
/* Define to 1 if you have the `wait' function. */
#define HAVE_WAIT 1
/* Define to 1 if you have the `wait3' function. */
#define HAVE_WAIT3 1
/* Define to 1 if you have the `wait4' function. */
#define HAVE_WAIT4 1
/* Define to 1 if you have the `waitid' function. */
#define HAVE_WAITID 1
/* Define to 1 if you have the `waitpid' function. */
#define HAVE_WAITPID 1
/* Define if the compiler provides a wchar.h header file. */
#define HAVE_WCHAR_H 1
/* Define to 1 if you have the `wcscoll' function. */
#define HAVE_WCSCOLL 1
/* Define to 1 if you have the `wcsftime' function. */
#define HAVE_WCSFTIME 1
/* Define to 1 if you have the `wcsxfrm' function. */
#define HAVE_WCSXFRM 1
/* Define to 1 if you have the `wmemcmp' function. */
#define HAVE_WMEMCMP 1
/* Define if tzset() actually switches the local timezone in a meaningful way.
*/
#define HAVE_WORKING_TZSET 1
/* Define to 1 if you have the `writev' function. */
#define HAVE_WRITEV 1
/* Define if the zlib library has inflateCopy */
#define HAVE_ZLIB_COPY 1
/* Define to 1 if you have the <zlib.h> header file. */
/* #undef HAVE_ZLIB_H */
/* Define to 1 if you have the `_getpty' function. */
/* #undef HAVE__GETPTY */
/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
*/
/* #undef MAJOR_IN_MKDEV */
/* Define to 1 if `major', `minor', and `makedev' are declared in
<sysmacros.h>. */
/* #undef MAJOR_IN_SYSMACROS */
/* Define if mvwdelch in curses.h is an expression. */
#define MVWDELCH_IS_EXPRESSION 1
/* Define to the address where bug reports for this package should be sent. */
/* #undef PACKAGE_BUGREPORT */
/* Define to the full name of this package. */
/* #undef PACKAGE_NAME */
/* Define to the full name and version of this package. */
/* #undef PACKAGE_STRING */
/* Define to the one symbol short name of this package. */
/* #undef PACKAGE_TARNAME */
/* Define to the home page for this package. */
/* #undef PACKAGE_URL */
/* Define to the version of this package. */
/* #undef PACKAGE_VERSION */
/* Define if POSIX semaphores aren't enabled on your system */
/* #undef POSIX_SEMAPHORES_NOT_ENABLED */
/* Define if pthread_key_t is compatible with int. */
#define PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT 1
/* Defined if PTHREAD_SCOPE_SYSTEM supported. */
#define PTHREAD_SYSTEM_SCHED_SUPPORTED 1
/* Define as the preferred size in bits of long digits */
/* #undef PYLONG_BITS_IN_DIGIT */
/* enabled builtin hash modules */
#define PY_BUILTIN_HASHLIB_HASHES "md5,sha1,sha2,sha3,blake2"
/* Define if you want to coerce the C locale to a UTF-8 based locale */
#define PY_COERCE_C_LOCALE 1
/* Define to 1 if you have the perf trampoline. */
/* #undef PY_HAVE_PERF_TRAMPOLINE */
/* Define to 1 to build the sqlite module with loadable extensions support. */
#define PY_SQLITE_ENABLE_LOAD_EXTENSION 1
/* Define if SQLite was compiled with the serialize API */
#define PY_SQLITE_HAVE_SERIALIZE 1
/* Default cipher suites list for ssl module. 1: Python's preferred selection,
2: leave OpenSSL defaults untouched, 0: custom string */
#define PY_SSL_DEFAULT_CIPHERS 1
/* Cipher suite string for PY_SSL_DEFAULT_CIPHERS=0 */
/* #undef PY_SSL_DEFAULT_CIPHER_STRING */
/* PEP 11 Support tier (1, 2, 3 or 0 for unsupported) */
#define PY_SUPPORT_TIER 0
/* Define if you want to build an interpreter with many run-time checks. */
/* #undef Py_DEBUG */
/* Defined if Python is built as a shared library. */
#define Py_ENABLE_SHARED 1
/* Define hash algorithm for str, bytes and memoryview. SipHash24: 1, FNV: 2,
SipHash13: 3, externally defined: 0 */
#define Py_HASH_ALGORITHM 2
/* Define if you want to enable internal statistics gathering. */
/* #undef Py_STATS */
/* The version of SunOS/Solaris as reported by `uname -r' without the dot. */
/* #undef Py_SUNOS_VERSION */
/* Define if you want to enable tracing references for debugging purpose */
/* #undef Py_TRACE_REFS */
/* assume C89 semantics that RETSIGTYPE is always void */
#define RETSIGTYPE void
/* Define if setpgrp() must be called as setpgrp(0, 0). */
#define SETPGRP_HAVE_ARG 1
/* Define if i>>j for signed int i does not extend the sign bit when i < 0 */
/* #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS */
/* The size of `double', as computed by sizeof. */
#define SIZEOF_DOUBLE 8
/* The size of `float', as computed by sizeof. */
#define SIZEOF_FLOAT 4
/* The size of `fpos_t', as computed by sizeof. */
#define SIZEOF_FPOS_T 8
/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 8
/* The size of `long double', as computed by sizeof. */
#define SIZEOF_LONG_DOUBLE 16
/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8
/* The size of `off_t', as computed by sizeof. */
#define SIZEOF_OFF_T 8
/* The size of `pid_t', as computed by sizeof. */
#define SIZEOF_PID_T 4
/* The size of `pthread_key_t', as computed by sizeof. */
#define SIZEOF_PTHREAD_KEY_T 4
/* The size of `pthread_t', as computed by sizeof. */
#define SIZEOF_PTHREAD_T 8
/* The size of `short', as computed by sizeof. */
#define SIZEOF_SHORT 2
/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 8
/* The size of `time_t', as computed by sizeof. */
#define SIZEOF_TIME_T 8
/* The size of `uintptr_t', as computed by sizeof. */
#define SIZEOF_UINTPTR_T 8
/* The size of `void *', as computed by sizeof. */
#define SIZEOF_VOID_P 8
/* The size of `wchar_t', as computed by sizeof. */
#define SIZEOF_WCHAR_T 4
/* The size of `_Bool', as computed by sizeof. */
#define SIZEOF__BOOL 1
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if you can safely include both <sys/select.h> and <sys/time.h>
(which you can't on SCO ODT 3.0). */
#define SYS_SELECT_WITH_SYS_TIME 1
/* Custom thread stack size depending on chosen sanitizer runtimes. */
/* #undef THREAD_STACK_SIZE */
/* Library needed by timemodule.c: librt may be needed for clock_gettime() */
/* #undef TIMEMODULE_LIB */
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
/* #undef TM_IN_SYS_TIME */
/* Define if you want to use computed gotos in ceval.c. */
/* #undef USE_COMPUTED_GOTOS */
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
# 1717 "./pyconfig.h"
/* Enable general extensions on macOS. */
#ifndef _DARWIN_C_SOURCE
# define _DARWIN_C_SOURCE 1
#endif
# 1721 "./pyconfig.h"
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
# 1725 "./pyconfig.h"
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
# 1729 "./pyconfig.h"
/* Enable X/Open compliant socket functions that do not require linking
with -lxnet on HP-UX 11.11. */
#ifndef _HPUX_ALT_XOPEN_SOCKET_API
# define _HPUX_ALT_XOPEN_SOCKET_API 1
#endif
# 1734 "./pyconfig.h"
/* Identify the host operating system as Minix.
This macro does not affect the system headers' behavior.
A future release of Autoconf may stop defining this macro. */
#ifndef _MINIX
/* # undef _MINIX */
#endif
# 1740 "./pyconfig.h"
/* Enable general extensions on NetBSD.
Enable NetBSD compatibility extensions on Minix. */
#ifndef _NETBSD_SOURCE
# define _NETBSD_SOURCE 1
#endif
# 1745 "./pyconfig.h"
/* Enable OpenBSD compatibility extensions on NetBSD.
Oddly enough, this does nothing on OpenBSD. */
#ifndef _OPENBSD_SOURCE
# define _OPENBSD_SOURCE 1
#endif
# 1750 "./pyconfig.h"
/* Define to 1 if needed for POSIX-compatible behavior. */
#ifndef _POSIX_SOURCE
/* # undef _POSIX_SOURCE */
#endif
# 1754 "./pyconfig.h"
/* Define to 2 if needed for POSIX-compatible behavior. */
#ifndef _POSIX_1_SOURCE
/* # undef _POSIX_1_SOURCE */
#endif
# 1758 "./pyconfig.h"
/* Enable POSIX-compatible threading on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
# 1762 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TS 18661-5:2014. */
#ifndef __STDC_WANT_IEC_60559_ATTRIBS_EXT__
# define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1
#endif
# 1766 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TS 18661-1:2014. */
#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
# define __STDC_WANT_IEC_60559_BFP_EXT__ 1
#endif
# 1770 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TS 18661-2:2015. */
#ifndef __STDC_WANT_IEC_60559_DFP_EXT__
# define __STDC_WANT_IEC_60559_DFP_EXT__ 1
#endif
# 1774 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TS 18661-4:2015. */
#ifndef __STDC_WANT_IEC_60559_FUNCS_EXT__
# define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1
#endif
# 1778 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TS 18661-3:2015. */
#ifndef __STDC_WANT_IEC_60559_TYPES_EXT__
# define __STDC_WANT_IEC_60559_TYPES_EXT__ 1
#endif
# 1782 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC TR 24731-2:2010. */
#ifndef __STDC_WANT_LIB_EXT2__
# define __STDC_WANT_LIB_EXT2__ 1
#endif
# 1786 "./pyconfig.h"
/* Enable extensions specified by ISO/IEC 24747:2009. */
#ifndef __STDC_WANT_MATH_SPEC_FUNCS__
# define __STDC_WANT_MATH_SPEC_FUNCS__ 1
#endif
# 1790 "./pyconfig.h"
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
# 1794 "./pyconfig.h"
/* Enable X/Open extensions. Define to 500 only if necessary
to make mbstate_t available. */
#ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 700
#endif
# 1799 "./pyconfig.h"
/* Define if WINDOW in curses.h offers a field _flags. */
#define WINDOW_HAS_FLAGS 1
/* Define if you want build the _decimal module using a coroutine-local rather
than a thread-local context */
#define WITH_DECIMAL_CONTEXTVAR 1
/* Define if you want documentation strings in extension modules */
#define WITH_DOC_STRINGS 1
/* Define if you want to compile in DTrace support */
/* #undef WITH_DTRACE */
/* Define if you want to use the new-style (Openstep, Rhapsody, MacOS) dynamic
linker (dyld) instead of the old-style (NextStep) dynamic linker (rld).
Dyld is necessary to support frameworks. */
/* #undef WITH_DYLD */
/* Define to build the readline module against libedit. */
/* #undef WITH_EDITLINE */
/* Define if you want to compile in object freelists optimization */
#define WITH_FREELISTS 1
/* Define to 1 if libintl is needed for locale functions. */
#define WITH_LIBINTL 1
/* Define if you want to produce an OpenStep/Rhapsody framework (shared
library plus accessory files). */
/* #undef WITH_NEXT_FRAMEWORK */
/* Define if you want to compile in Python-specific mallocs */
#define WITH_PYMALLOC 1
/* Define if you want pymalloc to be disabled when running under valgrind */
/* #undef WITH_VALGRIND */
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if 0 /* disabled by -frewrite-includes */
#if defined AC_APPLE_UNIVERSAL_BUILD
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 1841 "./pyconfig.h"
#if 0 /* disabled by -frewrite-includes */
# if defined __BIG_ENDIAN__
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 1842 "./pyconfig.h"
# define WORDS_BIGENDIAN 1
# endif
# 1844 "./pyconfig.h"
#else
# 1845 "./pyconfig.h"
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
# 1848 "./pyconfig.h"
#endif
# 1849 "./pyconfig.h"
/* Define if arithmetic is subject to x87-style double rounding issue */
/* #undef X87_DOUBLE_ROUNDING */
/* Define on OpenBSD to activate all library features */
/* #undef _BSD_SOURCE */
/* Define on Darwin to activate all library features */
#define _DARWIN_C_SOURCE 1
/* This must be set to 64 on some systems to enable large file support. */
#define _FILE_OFFSET_BITS 64
/* Define to include mbstate_t for mbrtowc */
/* #undef _INCLUDE__STDC_A1_SOURCE */
/* This must be defined on some systems to enable large file support. */
#define _LARGEFILE_SOURCE 1
/* This must be defined on AIX systems to enable large file support. */
/* #undef _LARGE_FILES */
/* Define on NetBSD to activate all library features */
#define _NETBSD_SOURCE 1
/* Define to activate features from IEEE Stds 1003.1-2008 */
#define _POSIX_C_SOURCE 200809L
/* Define if you have POSIX threads, and your system does not define that. */
/* #undef _POSIX_THREADS */
/* framework name */
#define _PYTHONFRAMEWORK ""
/* Define to force use of thread-safe errno, h_errno, and other functions */
/* #undef _REENTRANT */
/* Define to 1 if you want to emulate getpid() on WASI */
/* #undef _WASI_EMULATED_GETPID */
/* Define to 1 if you want to emulate process clocks on WASI */
/* #undef _WASI_EMULATED_PROCESS_CLOCKS */
/* Define to 1 if you want to emulate signals on WASI */
/* #undef _WASI_EMULATED_SIGNAL */
/* Define to the level of X/Open that your system supports */
#define _XOPEN_SOURCE 700
/* Define to activate Unix95-and-earlier features */
#define _XOPEN_SOURCE_EXTENDED 1
/* Define on FreeBSD to activate all library features */
#define __BSD_VISIBLE 1
/* Define to 'long' if <time.h> doesn't define. */
/* #undef clock_t */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef mode_t */
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define as a signed integer type capable of holding a process identifier. */
/* #undef pid_t */
/* Define to empty if the keyword does not work. */
/* #undef signed */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to `int' if <sys/socket.h> does not define. */
/* #undef socklen_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef uid_t */
/* Define the macros needed if on a UnixWare 7.x system. */
#if 0 /* disabled by -frewrite-includes */
#if defined(__USLC__) && defined(__SCO_VERSION__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 1937 "./pyconfig.h"
#define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
#endif
# 1939 "./pyconfig.h"
#endif /*Py_PYCONFIG_H*/
# 1941 "./pyconfig.h"
#define HAVE_TIMEGM 1
# 5 "./Include/pyport.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <inttypes.h>
#endif /* expanded by -frewrite-includes */
# 6 "./Include/pyport.h"
# 1 "/usr/include/inttypes.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _INTTYPES_H_
#define _INTTYPES_H_
#if 0 /* expanded by -frewrite-includes */
#include <machine/_inttypes.h>
#endif /* expanded by -frewrite-includes */
# 32 "/usr/include/inttypes.h" 3 4
# 1 "/usr/include/machine/_inttypes.h" 1 3 4
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* From: $NetBSD: int_fmtio.h,v 1.4 2008/04/28 20:23:36 martin Exp $
*/
#ifdef __arm__
#if 0 /* expanded by -frewrite-includes */
#include <arm/_inttypes.h>
#endif /* expanded by -frewrite-includes */
# 33 "/usr/include/machine/_inttypes.h" 3 4
# 34 "/usr/include/machine/_inttypes.h" 3 4
#else /* !__arm__ */
# 35 "/usr/include/machine/_inttypes.h" 3 4
#ifndef _MACHINE__INTTYPES_H_
#define _MACHINE__INTTYPES_H_
/*
* Macros for format specifiers.
*/
/* fprintf(3) macros for signed integers. */
#define PRId8 "d" /* int8_t */
#define PRId16 "d" /* int16_t */
#define PRId32 "d" /* int32_t */
#define PRId64 "ld" /* int64_t */
#define PRIdLEAST8 "d" /* int_least8_t */
#define PRIdLEAST16 "d" /* int_least16_t */
#define PRIdLEAST32 "d" /* int_least32_t */
#define PRIdLEAST64 "ld" /* int_least64_t */
#define PRIdFAST8 "d" /* int_fast8_t */
#define PRIdFAST16 "d" /* int_fast16_t */
#define PRIdFAST32 "d" /* int_fast32_t */
#define PRIdFAST64 "ld" /* int_fast64_t */
#define PRIdMAX "jd" /* intmax_t */
#define PRIdPTR "ld" /* intptr_t */
#define PRIi8 "i" /* int8_t */
#define PRIi16 "i" /* int16_t */
#define PRIi32 "i" /* int32_t */
#define PRIi64 "li" /* int64_t */
#define PRIiLEAST8 "i" /* int_least8_t */
#define PRIiLEAST16 "i" /* int_least16_t */
#define PRIiLEAST32 "i" /* int_least32_t */
#define PRIiLEAST64 "li" /* int_least64_t */
#define PRIiFAST8 "i" /* int_fast8_t */
#define PRIiFAST16 "i" /* int_fast16_t */
#define PRIiFAST32 "i" /* int_fast32_t */
#define PRIiFAST64 "li" /* int_fast64_t */
#define PRIiMAX "ji" /* intmax_t */
#define PRIiPTR "li" /* intptr_t */
/* fprintf(3) macros for unsigned integers. */
#define PRIo8 "o" /* uint8_t */
#define PRIo16 "o" /* uint16_t */
#define PRIo32 "o" /* uint32_t */
#define PRIo64 "lo" /* uint64_t */
#define PRIoLEAST8 "o" /* uint_least8_t */
#define PRIoLEAST16 "o" /* uint_least16_t */
#define PRIoLEAST32 "o" /* uint_least32_t */
#define PRIoLEAST64 "lo" /* uint_least64_t */
#define PRIoFAST8 "o" /* uint_fast8_t */
#define PRIoFAST16 "o" /* uint_fast16_t */
#define PRIoFAST32 "o" /* uint_fast32_t */
#define PRIoFAST64 "lo" /* uint_fast64_t */
#define PRIoMAX "jo" /* uintmax_t */
#define PRIoPTR "lo" /* uintptr_t */
#define PRIu8 "u" /* uint8_t */
#define PRIu16 "u" /* uint16_t */
#define PRIu32 "u" /* uint32_t */
#define PRIu64 "lu" /* uint64_t */
#define PRIuLEAST8 "u" /* uint_least8_t */
#define PRIuLEAST16 "u" /* uint_least16_t */
#define PRIuLEAST32 "u" /* uint_least32_t */
#define PRIuLEAST64 "lu" /* uint_least64_t */
#define PRIuFAST8 "u" /* uint_fast8_t */
#define PRIuFAST16 "u" /* uint_fast16_t */
#define PRIuFAST32 "u" /* uint_fast32_t */
#define PRIuFAST64 "lu" /* uint_fast64_t */
#define PRIuMAX "ju" /* uintmax_t */
#define PRIuPTR "lu" /* uintptr_t */
#define PRIx8 "x" /* uint8_t */
#define PRIx16 "x" /* uint16_t */
#define PRIx32 "x" /* uint32_t */
#define PRIx64 "lx" /* uint64_t */
#define PRIxLEAST8 "x" /* uint_least8_t */
#define PRIxLEAST16 "x" /* uint_least16_t */
#define PRIxLEAST32 "x" /* uint_least32_t */
#define PRIxLEAST64 "lx" /* uint_least64_t */
#define PRIxFAST8 "x" /* uint_fast8_t */
#define PRIxFAST16 "x" /* uint_fast16_t */
#define PRIxFAST32 "x" /* uint_fast32_t */
#define PRIxFAST64 "lx" /* uint_fast64_t */
#define PRIxMAX "jx" /* uintmax_t */
#define PRIxPTR "lx" /* uintptr_t */
#define PRIX8 "X" /* uint8_t */
#define PRIX16 "X" /* uint16_t */
#define PRIX32 "X" /* uint32_t */
#define PRIX64 "lX" /* uint64_t */
#define PRIXLEAST8 "X" /* uint_least8_t */
#define PRIXLEAST16 "X" /* uint_least16_t */
#define PRIXLEAST32 "X" /* uint_least32_t */
#define PRIXLEAST64 "lX" /* uint_least64_t */
#define PRIXFAST8 "X" /* uint_fast8_t */
#define PRIXFAST16 "X" /* uint_fast16_t */
#define PRIXFAST32 "X" /* uint_fast32_t */
#define PRIXFAST64 "lX" /* uint_fast64_t */
#define PRIXMAX "jX" /* uintmax_t */
#define PRIXPTR "lX" /* uintptr_t */
/* fscanf(3) macros for signed integers. */
#define SCNd8 "hhd" /* int8_t */
#define SCNd16 "hd" /* int16_t */
#define SCNd32 "d" /* int32_t */
#define SCNd64 "ld" /* int64_t */
#define SCNdLEAST8 "hhd" /* int_least8_t */
#define SCNdLEAST16 "hd" /* int_least16_t */
#define SCNdLEAST32 "d" /* int_least32_t */
#define SCNdLEAST64 "ld" /* int_least64_t */
#define SCNdFAST8 "d" /* int_fast8_t */
#define SCNdFAST16 "d" /* int_fast16_t */
#define SCNdFAST32 "d" /* int_fast32_t */
#define SCNdFAST64 "ld" /* int_fast64_t */
#define SCNdMAX "jd" /* intmax_t */
#define SCNdPTR "ld" /* intptr_t */
#define SCNi8 "hhi" /* int8_t */
#define SCNi16 "hi" /* int16_t */
#define SCNi32 "i" /* int32_t */
#define SCNi64 "li" /* int64_t */
#define SCNiLEAST8 "hhi" /* int_least8_t */
#define SCNiLEAST16 "hi" /* int_least16_t */
#define SCNiLEAST32 "i" /* int_least32_t */
#define SCNiLEAST64 "li" /* int_least64_t */
#define SCNiFAST8 "i" /* int_fast8_t */
#define SCNiFAST16 "i" /* int_fast16_t */
#define SCNiFAST32 "i" /* int_fast32_t */
#define SCNiFAST64 "li" /* int_fast64_t */
#define SCNiMAX "ji" /* intmax_t */
#define SCNiPTR "li" /* intptr_t */
/* fscanf(3) macros for unsigned integers. */
#define SCNo8 "hho" /* uint8_t */
#define SCNo16 "ho" /* uint16_t */
#define SCNo32 "o" /* uint32_t */
#define SCNo64 "lo" /* uint64_t */
#define SCNoLEAST8 "hho" /* uint_least8_t */
#define SCNoLEAST16 "ho" /* uint_least16_t */
#define SCNoLEAST32 "o" /* uint_least32_t */
#define SCNoLEAST64 "lo" /* uint_least64_t */
#define SCNoFAST8 "o" /* uint_fast8_t */
#define SCNoFAST16 "o" /* uint_fast16_t */
#define SCNoFAST32 "o" /* uint_fast32_t */
#define SCNoFAST64 "lo" /* uint_fast64_t */
#define SCNoMAX "jo" /* uintmax_t */
#define SCNoPTR "lo" /* uintptr_t */
#define SCNu8 "hhu" /* uint8_t */
#define SCNu16 "hu" /* uint16_t */
#define SCNu32 "u" /* uint32_t */
#define SCNu64 "lu" /* uint64_t */
#define SCNuLEAST8 "hhu" /* uint_least8_t */
#define SCNuLEAST16 "hu" /* uint_least16_t */
#define SCNuLEAST32 "u" /* uint_least32_t */
#define SCNuLEAST64 "lu" /* uint_least64_t */
#define SCNuFAST8 "u" /* uint_fast8_t */
#define SCNuFAST16 "u" /* uint_fast16_t */
#define SCNuFAST32 "u" /* uint_fast32_t */
#define SCNuFAST64 "lu" /* uint_fast64_t */
#define SCNuMAX "ju" /* uintmax_t */
#define SCNuPTR "lu" /* uintptr_t */
#define SCNx8 "hhx" /* uint8_t */
#define SCNx16 "hx" /* uint16_t */
#define SCNx32 "x" /* uint32_t */
#define SCNx64 "lx" /* uint64_t */
#define SCNxLEAST8 "hhx" /* uint_least8_t */
#define SCNxLEAST16 "hx" /* uint_least16_t */
#define SCNxLEAST32 "x" /* uint_least32_t */
#define SCNxLEAST64 "lx" /* uint_least64_t */
#define SCNxFAST8 "x" /* uint_fast8_t */
#define SCNxFAST16 "x" /* uint_fast16_t */
#define SCNxFAST32 "x" /* uint_fast32_t */
#define SCNxFAST64 "lx" /* uint_fast64_t */
#define SCNxMAX "jx" /* uintmax_t */
#define SCNxPTR "lx" /* uintptr_t */
#endif /* !_MACHINE__INTTYPES_H_ */
# 217 "/usr/include/machine/_inttypes.h" 3 4
#endif /* !__arm__ */
# 219 "/usr/include/machine/_inttypes.h" 3 4
# 33 "/usr/include/inttypes.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/stdint.h>
#endif /* expanded by -frewrite-includes */
# 33 "/usr/include/inttypes.h" 3 4
# 1 "/usr/include/sys/stdint.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2001 Mike Barcroft <mike@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS_STDINT_H_
#define _SYS_STDINT_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 32 "/usr/include/sys/stdint.h" 3 4
# 33 "/usr/include/sys/stdint.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 33 "/usr/include/sys/stdint.h" 3 4
# 34 "/usr/include/sys/stdint.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/_stdint.h>
#endif /* expanded by -frewrite-includes */
# 35 "/usr/include/sys/stdint.h" 3 4
# 1 "/usr/include/machine/_stdint.h" 1 3 4
/*-
* Copyright (c) 2001, 2002 Mike Barcroft <mike@FreeBSD.org>
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef __arm__
#if 0 /* expanded by -frewrite-includes */
#include <arm/_stdint.h>
#endif /* expanded by -frewrite-includes */
# 32 "/usr/include/machine/_stdint.h" 3 4
# 33 "/usr/include/machine/_stdint.h" 3 4
#else /* !__arm__ */
# 34 "/usr/include/machine/_stdint.h" 3 4
#ifndef _MACHINE__STDINT_H_
#define _MACHINE__STDINT_H_
#if 0 /* disabled by -frewrite-includes */
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 39 "/usr/include/machine/_stdint.h" 3 4
#define INT8_C(c) (c)
#define INT16_C(c) (c)
#define INT32_C(c) (c)
#define INT64_C(c) (c ## L)
#define UINT8_C(c) (c)
#define UINT16_C(c) (c)
#define UINT32_C(c) (c ## U)
#define UINT64_C(c) (c ## UL)
#define INTMAX_C(c) INT64_C(c)
#define UINTMAX_C(c) UINT64_C(c)
#endif /* !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) */
# 54 "/usr/include/machine/_stdint.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 56 "/usr/include/machine/_stdint.h" 3 4
/*
* ISO/IEC 9899:1999
* 7.18.2.1 Limits of exact-width integer types
*/
/* Minimum values of exact-width signed integer types. */
#define INT8_MIN (-0x7f-1)
#define INT16_MIN (-0x7fff-1)
#define INT32_MIN (-0x7fffffff-1)
#define INT64_MIN (-0x7fffffffffffffffL-1)
/* Maximum values of exact-width signed integer types. */
#define INT8_MAX 0x7f
#define INT16_MAX 0x7fff
#define INT32_MAX 0x7fffffff
#define INT64_MAX 0x7fffffffffffffffL
/* Maximum values of exact-width unsigned integer types. */
#define UINT8_MAX 0xff
#define UINT16_MAX 0xffff
#define UINT32_MAX 0xffffffffU
#define UINT64_MAX 0xffffffffffffffffUL
/*
* ISO/IEC 9899:1999
* 7.18.2.2 Limits of minimum-width integer types
*/
/* Minimum values of minimum-width signed integer types. */
#define INT_LEAST8_MIN INT8_MIN
#define INT_LEAST16_MIN INT16_MIN
#define INT_LEAST32_MIN INT32_MIN
#define INT_LEAST64_MIN INT64_MIN
/* Maximum values of minimum-width signed integer types. */
#define INT_LEAST8_MAX INT8_MAX
#define INT_LEAST16_MAX INT16_MAX
#define INT_LEAST32_MAX INT32_MAX
#define INT_LEAST64_MAX INT64_MAX
/* Maximum values of minimum-width unsigned integer types. */
#define UINT_LEAST8_MAX UINT8_MAX
#define UINT_LEAST16_MAX UINT16_MAX
#define UINT_LEAST32_MAX UINT32_MAX
#define UINT_LEAST64_MAX UINT64_MAX
/*
* ISO/IEC 9899:1999
* 7.18.2.3 Limits of fastest minimum-width integer types
*/
/* Minimum values of fastest minimum-width signed integer types. */
#define INT_FAST8_MIN INT32_MIN
#define INT_FAST16_MIN INT32_MIN
#define INT_FAST32_MIN INT32_MIN
#define INT_FAST64_MIN INT64_MIN
/* Maximum values of fastest minimum-width signed integer types. */
#define INT_FAST8_MAX INT32_MAX
#define INT_FAST16_MAX INT32_MAX
#define INT_FAST32_MAX INT32_MAX
#define INT_FAST64_MAX INT64_MAX
/* Maximum values of fastest minimum-width unsigned integer types. */
#define UINT_FAST8_MAX UINT32_MAX
#define UINT_FAST16_MAX UINT32_MAX
#define UINT_FAST32_MAX UINT32_MAX
#define UINT_FAST64_MAX UINT64_MAX
/*
* ISO/IEC 9899:1999
* 7.18.2.4 Limits of integer types capable of holding object pointers
*/
#define INTPTR_MIN INT64_MIN
#define INTPTR_MAX INT64_MAX
#define UINTPTR_MAX UINT64_MAX
/*
* ISO/IEC 9899:1999
* 7.18.2.5 Limits of greatest-width integer types
*/
#define INTMAX_MIN INT64_MIN
#define INTMAX_MAX INT64_MAX
#define UINTMAX_MAX UINT64_MAX
/*
* ISO/IEC 9899:1999
* 7.18.3 Limits of other integer types
*/
/* Limits of ptrdiff_t. */
#define PTRDIFF_MIN INT64_MIN
#define PTRDIFF_MAX INT64_MAX
/* Limits of sig_atomic_t. */
#define SIG_ATOMIC_MIN INT64_MIN
#define SIG_ATOMIC_MAX INT64_MAX
/* Limit of size_t. */
#define SIZE_MAX UINT64_MAX
/* Limits of wint_t. */
#define WINT_MIN INT32_MIN
#define WINT_MAX INT32_MAX
#endif /* !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) */
# 159 "/usr/include/machine/_stdint.h" 3 4
#endif /* !_MACHINE__STDINT_H_ */
# 161 "/usr/include/machine/_stdint.h" 3 4
#endif /* !__arm__ */
# 163 "/usr/include/machine/_stdint.h" 3 4
# 36 "/usr/include/sys/stdint.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_stdint.h>
#endif /* expanded by -frewrite-includes */
# 36 "/usr/include/sys/stdint.h" 3 4
# 37 "/usr/include/sys/stdint.h" 3 4
typedef __int_least8_t int_least8_t;
typedef __int_least16_t int_least16_t;
typedef __int_least32_t int_least32_t;
typedef __int_least64_t int_least64_t;
typedef __uint_least8_t uint_least8_t;
typedef __uint_least16_t uint_least16_t;
typedef __uint_least32_t uint_least32_t;
typedef __uint_least64_t uint_least64_t;
typedef __int_fast8_t int_fast8_t;
typedef __int_fast16_t int_fast16_t;
typedef __int_fast32_t int_fast32_t;
typedef __int_fast64_t int_fast64_t;
typedef __uint_fast8_t uint_fast8_t;
typedef __uint_fast16_t uint_fast16_t;
typedef __uint_fast32_t uint_fast32_t;
typedef __uint_fast64_t uint_fast64_t;
/* GNU and Darwin define this and people seem to think it's portable */
#if 0 /* disabled by -frewrite-includes */
#if defined(UINTPTR_MAX) && defined(UINT64_MAX) && (UINTPTR_MAX == UINT64_MAX)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 60 "/usr/include/sys/stdint.h" 3 4
#define __WORDSIZE 64
#else
# 62 "/usr/include/sys/stdint.h" 3 4
#define __WORDSIZE 32
#endif
# 64 "/usr/include/sys/stdint.h" 3 4
/* Limits of wchar_t. */
#define WCHAR_MIN __WCHAR_MIN
#define WCHAR_MAX __WCHAR_MAX
#if 0 /* disabled by -frewrite-includes */
#if __EXT1_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 70 "/usr/include/sys/stdint.h" 3 4
/* ISO/IEC 9899:2011 K.3.4.4 */
#ifndef RSIZE_MAX
#define RSIZE_MAX (SIZE_MAX >> 1)
#endif
# 74 "/usr/include/sys/stdint.h" 3 4
#endif /* __EXT1_VISIBLE */
# 75 "/usr/include/sys/stdint.h" 3 4
#endif /* !_SYS_STDINT_H_ */
# 77 "/usr/include/sys/stdint.h" 3 4
# 34 "/usr/include/inttypes.h" 2 3 4
#ifndef __cplusplus
#ifndef _WCHAR_T_DECLARED
typedef ___wchar_t wchar_t;
#define _WCHAR_T_DECLARED
#endif
# 40 "/usr/include/inttypes.h" 3 4
#endif
# 41 "/usr/include/inttypes.h" 3 4
typedef struct {
intmax_t quot; /* Quotient. */
intmax_t rem; /* Remainder. */
} imaxdiv_t;
__BEGIN_DECLS
#ifdef _XLOCALE_H_
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_inttypes.h>
#endif /* expanded by -frewrite-includes */
# 49 "/usr/include/inttypes.h" 3 4
# 50 "/usr/include/inttypes.h" 3 4
#endif
# 51 "/usr/include/inttypes.h" 3 4
intmax_t imaxabs(intmax_t) __pure2;
imaxdiv_t imaxdiv(intmax_t, intmax_t) __pure2;
intmax_t strtoimax(const char * __restrict, char ** __restrict, int);
uintmax_t strtoumax(const char * __restrict, char ** __restrict, int);
intmax_t wcstoimax(const wchar_t * __restrict,
wchar_t ** __restrict, int);
uintmax_t wcstoumax(const wchar_t * __restrict,
wchar_t ** __restrict, int);
__END_DECLS
#endif /* !_INTTYPES_H_ */
# 63 "/usr/include/inttypes.h" 3 4
# 7 "./Include/pyport.h" 2
#if 0 /* expanded by -frewrite-includes */
#include <limits.h>
#endif /* expanded by -frewrite-includes */
# 8 "./Include/pyport.h"
# 1 "/usr/include/limits.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)limits.h 8.2 (Berkeley) 1/4/94
*/
#ifndef _LIMITS_H_
#define _LIMITS_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 37 "/usr/include/limits.h" 3 4
# 38 "/usr/include/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 40 "/usr/include/limits.h" 3 4
#define _POSIX_ARG_MAX 4096
#define _POSIX_LINK_MAX 8
#define _POSIX_MAX_CANON 255
#define _POSIX_MAX_INPUT 255
#define _POSIX_NAME_MAX 14
#define _POSIX_PIPE_BUF 512
#define _POSIX_SSIZE_MAX 32767
#define _POSIX_STREAM_MAX 8
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 50 "/usr/include/limits.h" 3 4
#define _POSIX_CHILD_MAX 25
#define _POSIX_NGROUPS_MAX 8
#define _POSIX_OPEN_MAX 20
#define _POSIX_PATH_MAX 256
#define _POSIX_TZNAME_MAX 6
#else
# 56 "/usr/include/limits.h" 3 4
#define _POSIX_CHILD_MAX 6
#define _POSIX_NGROUPS_MAX 0
#define _POSIX_OPEN_MAX 16
#define _POSIX_PATH_MAX 255
#define _POSIX_TZNAME_MAX 3
#endif
# 62 "/usr/include/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 64 "/usr/include/limits.h" 3 4
#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */
#define BC_DIM_MAX 2048 /* max array elements in bc(1) */
#define BC_SCALE_MAX 99 /* max scale value in bc(1) */
#define BC_STRING_MAX 1000 /* max const string length in bc(1) */
#define CHARCLASS_NAME_MAX 14 /* max character class name size */
#define COLL_WEIGHTS_MAX 10 /* max weights for order keyword */
#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */
#define LINE_MAX 2048 /* max bytes in an input line */
#define RE_DUP_MAX 255 /* max RE's in interval notation */
#define _POSIX2_BC_BASE_MAX 99
#define _POSIX2_BC_DIM_MAX 2048
#define _POSIX2_BC_SCALE_MAX 99
#define _POSIX2_BC_STRING_MAX 1000
#define _POSIX2_CHARCLASS_NAME_MAX 14
#define _POSIX2_COLL_WEIGHTS_MAX 2
#define _POSIX2_EQUIV_CLASS_MAX 2
#define _POSIX2_EXPR_NEST_MAX 32
#define _POSIX2_LINE_MAX 2048
#define _POSIX2_RE_DUP_MAX 255
#endif
# 85 "/usr/include/limits.h" 3 4
#endif
# 86 "/usr/include/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199309
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 88 "/usr/include/limits.h" 3 4
#define _POSIX_AIO_LISTIO_MAX 2
#define _POSIX_AIO_MAX 1
#define _POSIX_DELAYTIMER_MAX 32
#define _POSIX_MQ_OPEN_MAX 8
#define _POSIX_MQ_PRIO_MAX 32
#define _POSIX_RTSIG_MAX 8
#define _POSIX_SEM_NSEMS_MAX 256
#define _POSIX_SEM_VALUE_MAX 32767
#define _POSIX_SIGQUEUE_MAX 32
#define _POSIX_TIMER_MAX 32
#define _POSIX_CLOCKRES_MIN 20000000
#endif
# 101 "/usr/include/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199506
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 103 "/usr/include/limits.h" 3 4
#define _POSIX_THREAD_DESTRUCTOR_ITERATIONS 4
#define _POSIX_THREAD_KEYS_MAX 128
#define _POSIX_THREAD_THREADS_MAX 64
#endif
# 107 "/usr/include/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 109 "/usr/include/limits.h" 3 4
#define _POSIX_HOST_NAME_MAX 255
#define _POSIX_LOGIN_NAME_MAX 9
#define _POSIX_SS_REPL_MAX 4
#define _POSIX_SYMLINK_MAX 255
#define _POSIX_SYMLOOP_MAX 8
#define _POSIX_TRACE_EVENT_NAME_MAX 30
#define _POSIX_TRACE_NAME_MAX 8
#define _POSIX_TRACE_SYS_MAX 8
#define _POSIX_TRACE_USER_EVENT_MAX 32
#define _POSIX_TTY_NAME_MAX 9
#define _POSIX_RE_DUP_MAX _POSIX2_RE_DUP_MAX
#endif
# 122 "/usr/include/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 124 "/usr/include/limits.h" 3 4
#define NL_ARGMAX 4096 /* max # of position args for printf */
#define NL_MSGMAX 32767
#define NL_SETMAX 255
#define NL_TEXTMAX 2048
#endif
# 129 "/usr/include/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 131 "/usr/include/limits.h" 3 4
#define _XOPEN_IOV_MAX 16
#define _XOPEN_NAME_MAX 255
#define _XOPEN_PATH_MAX 1024
#define PASS_MAX 128 /* _PASSWORD_LEN from <pwd.h> */
#define NL_LANGMAX 31 /* max LANG name length */
#define NL_NMAX 1
#endif
# 139 "/usr/include/limits.h" 3 4
#define MB_LEN_MAX 6 /* 31-bit UTF-8 */
#if 0 /* expanded by -frewrite-includes */
#include <sys/limits.h>
#endif /* expanded by -frewrite-includes */
# 142 "/usr/include/limits.h" 3 4
# 1 "/usr/include/sys/limits.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS_LIMITS_H_
#define _SYS_LIMITS_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 35 "/usr/include/sys/limits.h" 3 4
# 36 "/usr/include/sys/limits.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/_limits.h>
#endif /* expanded by -frewrite-includes */
# 36 "/usr/include/sys/limits.h" 3 4
# 1 "/usr/include/machine/_limits.h" 1 3 4
/*-
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)limits.h 8.3 (Berkeley) 1/4/94
*/
#ifdef __arm__
#if 0 /* expanded by -frewrite-includes */
#include <arm/_limits.h>
#endif /* expanded by -frewrite-includes */
# 30 "/usr/include/machine/_limits.h" 3 4
# 31 "/usr/include/machine/_limits.h" 3 4
#else /* !__arm__ */
# 32 "/usr/include/machine/_limits.h" 3 4
#ifndef _MACHINE__LIMITS_H_
#define _MACHINE__LIMITS_H_
/*
* According to ANSI (section 2.2.4.2), the values below must be usable by
* #if preprocessing directives. Additionally, the expression must have the
* same type as would an expression that is an object of the corresponding
* type converted according to the integral promotions. The subtraction for
* INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
* unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
*/
#define __CHAR_BIT 8 /* number of bits in a char */
#define __SCHAR_MAX 0x7f /* max value for a signed char */
#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */
#define __UCHAR_MAX 0xff /* max value for an unsigned char */
#define __USHRT_MAX 0xffff /* max value for an unsigned short */
#define __SHRT_MAX 0x7fff /* max value for a short */
#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */
#define __UINT_MAX 0xffffffff /* max value for an unsigned int */
#define __INT_MAX 0x7fffffff /* max value for an int */
#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */
#define __ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */
#define __LONG_MAX 0x7fffffffffffffffL /* max for a long */
#define __LONG_MIN (-0x7fffffffffffffffL - 1) /* min for a long */
/* Long longs have the same size but not the same type as longs. */
/* max for an unsigned long long */
#define __ULLONG_MAX 0xffffffffffffffffULL
#define __LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */
#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */
#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */
#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */
#define __OFF_MAX __LONG_MAX /* max value for an off_t */
#define __OFF_MIN __LONG_MIN /* min value for an off_t */
/* Quads and longs are the same size. Ensure they stay in sync. */
#define __UQUAD_MAX (__ULONG_MAX) /* max value for a uquad_t */
#define __QUAD_MAX (__LONG_MAX) /* max value for a quad_t */
#define __QUAD_MIN (__LONG_MIN) /* min value for a quad_t */
#define __LONG_BIT 64
#define __WORD_BIT 32
/* Minimum signal stack size. */
#define __MINSIGSTKSZ (1024 * 4)
#endif /* !_MACHINE__LIMITS_H_ */
# 89 "/usr/include/machine/_limits.h" 3 4
#endif /* !__arm__ */
# 91 "/usr/include/machine/_limits.h" 3 4
# 37 "/usr/include/sys/limits.h" 2 3 4
#define CHAR_BIT __CHAR_BIT /* number of bits in a char */
#define SCHAR_MAX __SCHAR_MAX /* max value for a signed char */
#define SCHAR_MIN __SCHAR_MIN /* min value for a signed char */
#define UCHAR_MAX __UCHAR_MAX /* max value for an unsigned char */
#ifdef __CHAR_UNSIGNED__
#define CHAR_MAX UCHAR_MAX /* max value for a char */
#define CHAR_MIN 0 /* min value for a char */
#else
# 49 "/usr/include/sys/limits.h" 3 4
#define CHAR_MAX SCHAR_MAX
#define CHAR_MIN SCHAR_MIN
#endif
# 52 "/usr/include/sys/limits.h" 3 4
#define USHRT_MAX __USHRT_MAX /* max value for an unsigned short */
#define SHRT_MAX __SHRT_MAX /* max value for a short */
#define SHRT_MIN __SHRT_MIN /* min value for a short */
#define UINT_MAX __UINT_MAX /* max value for an unsigned int */
#define INT_MAX __INT_MAX /* max value for an int */
#define INT_MIN __INT_MIN /* min value for an int */
#define ULONG_MAX __ULONG_MAX /* max for an unsigned long */
#define LONG_MAX __LONG_MAX /* max for a long */
#define LONG_MIN __LONG_MIN /* min for a long */
#ifdef __LONG_LONG_SUPPORTED
#define ULLONG_MAX __ULLONG_MAX /* max for an unsigned long long */
#define LLONG_MAX __LLONG_MAX /* max for a long long */
#define LLONG_MIN __LLONG_MIN /* min for a long long */
#endif
# 70 "/usr/include/sys/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 72 "/usr/include/sys/limits.h" 3 4
#define SSIZE_MAX __SSIZE_MAX /* max value for an ssize_t */
#endif
# 74 "/usr/include/sys/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 76 "/usr/include/sys/limits.h" 3 4
#define SIZE_T_MAX __SIZE_T_MAX /* max value for a size_t */
#define OFF_MAX __OFF_MAX /* max value for an off_t */
#define OFF_MIN __OFF_MIN /* min value for an off_t */
#endif
# 81 "/usr/include/sys/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 83 "/usr/include/sys/limits.h" 3 4
#define GID_MAX UINT_MAX /* max value for a gid_t */
#define UID_MAX UINT_MAX /* max value for a uid_t */
#define UQUAD_MAX (__UQUAD_MAX) /* max value for a uquad_t */
#define QUAD_MAX (__QUAD_MAX) /* max value for a quad_t */
#define QUAD_MIN (__QUAD_MIN) /* min value for a quad_t */
#endif
# 90 "/usr/include/sys/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE || __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 92 "/usr/include/sys/limits.h" 3 4
#define LONG_BIT __LONG_BIT
#define WORD_BIT __WORD_BIT
#endif
# 95 "/usr/include/sys/limits.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 97 "/usr/include/sys/limits.h" 3 4
#define MQ_PRIO_MAX 64
#endif
# 99 "/usr/include/sys/limits.h" 3 4
#endif /* !_SYS_LIMITS_H_ */
# 101 "/usr/include/sys/limits.h" 3 4
# 143 "/usr/include/limits.h" 2 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 145 "/usr/include/limits.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/syslimits.h>
#endif /* expanded by -frewrite-includes */
# 145 "/usr/include/limits.h" 3 4
# 1 "/usr/include/sys/syslimits.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)syslimits.h 8.1 (Berkeley) 6/2/93
*/
#ifndef _SYS_SYSLIMITS_H_
#define _SYS_SYSLIMITS_H_
#if 0 /* disabled by -frewrite-includes */
#if !defined(_STANDALONE) && !defined(_KERNEL) && !defined(_LIMITS_H_) && !defined(_SYS_PARAM_H_)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 38 "/usr/include/sys/syslimits.h" 3 4
#warning "No user-serviceable parts inside."
#endif
# 40 "/usr/include/sys/syslimits.h" 3 4
/*
* Do not add any new variables here. (See the comment at the end of
* the file for why.)
*/
#ifndef __ILP32__
#define ARG_MAX (2 * 256 * 1024) /* max bytes for an exec function */
#else
# 48 "/usr/include/sys/syslimits.h" 3 4
#define ARG_MAX (256 * 1024) /* max bytes for KVA-starved archs */
#endif
# 50 "/usr/include/sys/syslimits.h" 3 4
#ifndef CHILD_MAX
#define CHILD_MAX 40 /* max simultaneous processes */
#endif
# 53 "/usr/include/sys/syslimits.h" 3 4
#define MAX_CANON 255 /* max bytes in term canon input line */
#define MAX_INPUT 255 /* max bytes in terminal input */
#define NAME_MAX 255 /* max bytes in a file name */
#ifndef NGROUPS_MAX
#define NGROUPS_MAX 1023 /* max supplemental group id's */
#endif
# 59 "/usr/include/sys/syslimits.h" 3 4
#ifndef OPEN_MAX
#define OPEN_MAX 64 /* max open files per process */
#endif
# 62 "/usr/include/sys/syslimits.h" 3 4
#define PATH_MAX 1024 /* max bytes in pathname */
#define PIPE_BUF 512 /* max bytes for atomic pipe writes */
#define IOV_MAX 1024 /* max elements in i/o vector */
/*
* We leave the following values undefined to force applications to either
* assume conservative values or call sysconf() to get the current value.
*
* HOST_NAME_MAX
*
* (We should do this for most of the values currently defined here,
* but many programs are not prepared to deal with this yet.)
*/
#endif
# 76 "/usr/include/sys/syslimits.h" 3 4
# 146 "/usr/include/limits.h" 2 3 4
#endif
# 147 "/usr/include/limits.h" 3 4
#endif /* !_LIMITS_H_ */
# 149 "/usr/include/limits.h" 3 4
# 9 "./Include/pyport.h" 2
#ifndef UCHAR_MAX
# error "limits.h must define UCHAR_MAX"
#endif
# 12 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
#if UCHAR_MAX != 255
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 13 "./Include/pyport.h"
# error "Python's source code assumes C's unsigned char is an 8-bit type"
#endif
# 15 "./Include/pyport.h"
// Macro to use C++ static_cast<> in the Python C API.
#ifdef __cplusplus
# define _Py_STATIC_CAST(type, expr) static_cast<type>(expr)
#else
# 21 "./Include/pyport.h"
# define _Py_STATIC_CAST(type, expr) ((type)(expr))
#endif
# 23 "./Include/pyport.h"
// Macro to use the more powerful/dangerous C-style cast even in C++.
#define _Py_CAST(type, expr) ((type)(expr))
// Static inline functions should use _Py_NULL rather than using directly NULL
// to prevent C++ compiler warnings. On C++11 and newer, _Py_NULL is defined as
// nullptr.
#if 0 /* disabled by -frewrite-includes */
#if defined(__cplusplus) && __cplusplus >= 201103
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 30 "./Include/pyport.h"
# define _Py_NULL nullptr
#else
# 32 "./Include/pyport.h"
# define _Py_NULL NULL
#endif
# 34 "./Include/pyport.h"
/* Defines to build Python and its standard library:
*
* - Py_BUILD_CORE: Build Python core. Give access to Python internals, but
* should not be used by third-party modules.
* - Py_BUILD_CORE_BUILTIN: Build a Python stdlib module as a built-in module.
* - Py_BUILD_CORE_MODULE: Build a Python stdlib module as a dynamic library.
*
* Py_BUILD_CORE_BUILTIN and Py_BUILD_CORE_MODULE imply Py_BUILD_CORE.
*
* On Windows, Py_BUILD_CORE_MODULE exports "PyInit_xxx" symbol, whereas
* Py_BUILD_CORE_BUILTIN does not.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(Py_BUILD_CORE_BUILTIN) && !defined(Py_BUILD_CORE)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 49 "./Include/pyport.h"
# define Py_BUILD_CORE
#endif
# 51 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
#if defined(Py_BUILD_CORE_MODULE) && !defined(Py_BUILD_CORE)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 52 "./Include/pyport.h"
# define Py_BUILD_CORE
#endif
# 54 "./Include/pyport.h"
/**************************************************************************
Symbols and macros to supply platform-independent interfaces to basic
C language & library operations whose spellings vary across platforms.
Please try to make documentation here as clear as possible: by definition,
the stuff here is trying to illuminate C's darkest corners.
Config #defines referenced here:
SIGNED_RIGHT_SHIFT_ZERO_FILLS
Meaning: To be defined iff i>>j does not extend the sign bit when i is a
signed integral type and i < 0.
Used in: Py_ARITHMETIC_RIGHT_SHIFT
Py_DEBUG
Meaning: Extra checks compiled in for debug mode.
Used in: Py_SAFE_DOWNCAST
**************************************************************************/
/* typedefs for some C9X-defined synonyms for integral types.
*
* The names in Python are exactly the same as the C9X names, except with a
* Py_ prefix. Until C9X is universally implemented, this is the only way
* to ensure that Python gets reliable names that don't conflict with names
* in non-Python code that are playing their own tricks to define the C9X
* names.
*
* NOTE: don't go nuts here! Python has no use for *most* of the C9X
* integral synonyms. Only define the ones we actually need.
*/
/* long long is required. Ensure HAVE_LONG_LONG is defined for compatibility. */
#ifndef HAVE_LONG_LONG
#define HAVE_LONG_LONG 1
#endif
# 92 "./Include/pyport.h"
#ifndef PY_LONG_LONG
#define PY_LONG_LONG long long
/* If LLONG_MAX is defined in limits.h, use that. */
#define PY_LLONG_MIN LLONG_MIN
#define PY_LLONG_MAX LLONG_MAX
#define PY_ULLONG_MAX ULLONG_MAX
#endif
# 99 "./Include/pyport.h"
#define PY_UINT32_T uint32_t
#define PY_UINT64_T uint64_t
/* Signed variants of the above */
#define PY_INT32_T int32_t
#define PY_INT64_T int64_t
/* PYLONG_BITS_IN_DIGIT describes the number of bits per "digit" (limb) in the
* PyLongObject implementation (longintrepr.h). It's currently either 30 or 15,
* defaulting to 30. The 15-bit digit option may be removed in the future.
*/
#ifndef PYLONG_BITS_IN_DIGIT
#define PYLONG_BITS_IN_DIGIT 30
#endif
# 114 "./Include/pyport.h"
/* uintptr_t is the C9X name for an unsigned integral type such that a
* legitimate void* can be cast to uintptr_t and then back to void* again
* without loss of information. Similarly for intptr_t, wrt a signed
* integral type.
*/
typedef uintptr_t Py_uintptr_t;
typedef intptr_t Py_intptr_t;
/* Py_ssize_t is a signed integral type such that sizeof(Py_ssize_t) ==
* sizeof(size_t). C99 doesn't define such a thing directly (size_t is an
* unsigned integral type). See PEP 353 for details.
* PY_SSIZE_T_MAX is the largest positive value of type Py_ssize_t.
*/
#ifdef HAVE_PY_SSIZE_T
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif HAVE_SSIZE_T
#endif
#endif /* disabled by -frewrite-includes */
#elif 1 /* evaluated by -frewrite-includes */
# 131 "./Include/pyport.h"
typedef ssize_t Py_ssize_t;
# define PY_SSIZE_T_MAX SSIZE_MAX
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif SIZEOF_VOID_P == SIZEOF_SIZE_T
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 134 "./Include/pyport.h"
typedef Py_intptr_t Py_ssize_t;
# define PY_SSIZE_T_MAX INTPTR_MAX
#else
# 137 "./Include/pyport.h"
# error "Python needs a typedef for Py_ssize_t in pyport.h."
#endif
# 139 "./Include/pyport.h"
/* Smallest negative value of type Py_ssize_t. */
#define PY_SSIZE_T_MIN (-PY_SSIZE_T_MAX-1)
/* Py_hash_t is the same size as a pointer. */
#define SIZEOF_PY_HASH_T SIZEOF_SIZE_T
typedef Py_ssize_t Py_hash_t;
/* Py_uhash_t is the unsigned equivalent needed to calculate numeric hash. */
#define SIZEOF_PY_UHASH_T SIZEOF_SIZE_T
typedef size_t Py_uhash_t;
/* Now PY_SSIZE_T_CLEAN is mandatory. This is just for backward compatibility. */
typedef Py_ssize_t Py_ssize_clean_t;
/* Largest possible value of size_t. */
#define PY_SIZE_MAX SIZE_MAX
/* Macro kept for backward compatibility: use directly "z" in new code.
*
* PY_FORMAT_SIZE_T is a modifier for use in a printf format to convert an
* argument with the width of a size_t or Py_ssize_t: "z" (C99).
*/
#ifndef PY_FORMAT_SIZE_T
# define PY_FORMAT_SIZE_T "z"
#endif
# 164 "./Include/pyport.h"
/* Py_LOCAL can be used instead of static to get the fastest possible calling
* convention for functions that are local to a given module.
*
* Py_LOCAL_INLINE does the same thing, and also explicitly requests inlining,
* for platforms that support that.
*
* NOTE: You can only use this for functions that are entirely local to a
* module; functions that are exported via method tables, callbacks, etc,
* should keep using static.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(_MSC_VER)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 177 "./Include/pyport.h"
/* ignore warnings if the compiler decides not to inline a function */
# pragma warning(disable: 4710)
/* fastest possible local call under MSVC */
# define Py_LOCAL(type) static type __fastcall
# define Py_LOCAL_INLINE(type) static __inline type __fastcall
#else
# 183 "./Include/pyport.h"
# define Py_LOCAL(type) static type
# define Py_LOCAL_INLINE(type) static inline type
#endif
# 186 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 188 "./Include/pyport.h"
# define Py_MEMCPY memcpy
#endif
# 190 "./Include/pyport.h"
#ifdef HAVE_IEEEFP_H
#if 0 /* expanded by -frewrite-includes */
#include <ieeefp.h> /* needed for 'finite' declaration on some platforms */
#endif /* expanded by -frewrite-includes */
# 192 "./Include/pyport.h"
# 1 "/usr/include/ieeefp.h" 1 3 4
/* $NetBSD: ieeefp.h,v 1.4 1998/01/09 08:03:43 perry Exp $ */
/*
* Written by J.T. Conklin, Apr 6, 1995
* Public domain.
*/
#ifndef _IEEEFP_H_
#define _IEEEFP_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 11 "/usr/include/ieeefp.h" 3 4
# 12 "/usr/include/ieeefp.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/ieeefp.h>
#endif /* expanded by -frewrite-includes */
# 12 "/usr/include/ieeefp.h" 3 4
# 1 "/usr/include/machine/ieeefp.h" 1 3 4
/*-
* Based on sys/sparc64/include/ieeefp.h
* Public domain.
*/
#ifdef __arm__
#if 0 /* expanded by -frewrite-includes */
#include <arm/ieeefp.h>
#endif /* expanded by -frewrite-includes */
# 7 "/usr/include/machine/ieeefp.h" 3 4
# 8 "/usr/include/machine/ieeefp.h" 3 4
#else /* !__arm__ */
# 9 "/usr/include/machine/ieeefp.h" 3 4
#ifndef _MACHINE_IEEEFP_H_
#define _MACHINE_IEEEFP_H_
/* Deprecated FPU control interface */
/* FP exception codes */
#define FP_EXCEPT_INV 8
#define FP_EXCEPT_DZ 9
#define FP_EXCEPT_OFL 10
#define FP_EXCEPT_UFL 11
#define FP_EXCEPT_IMP 12
#define FP_EXCEPT_DNML 15
typedef int fp_except_t;
#define FP_X_INV (1 << FP_EXCEPT_INV) /* invalid operation exception */
#define FP_X_DZ (1 << FP_EXCEPT_DZ) /* divide-by-zero exception */
#define FP_X_OFL (1 << FP_EXCEPT_OFL) /* overflow exception */
#define FP_X_UFL (1 << FP_EXCEPT_UFL) /* underflow exception */
#define FP_X_IMP (1 << FP_EXCEPT_IMP) /* imprecise (loss of precision) */
#define FP_X_DNML (1 << FP_EXCEPT_DNML) /* denormal exception */
typedef enum {
FP_RN = (0 << 22), /* round to nearest representable number */
FP_RP = (1 << 22), /* round toward positive infinity */
FP_RM = (2 << 22), /* round toward negative infinity */
FP_RZ = (3 << 22) /* round to zero (truncate) */
} fp_rnd_t;
__BEGIN_DECLS
extern fp_rnd_t fpgetround(void);
extern fp_rnd_t fpsetround(fp_rnd_t);
extern fp_except_t fpgetmask(void);
extern fp_except_t fpsetmask(fp_except_t);
__END_DECLS
#endif /* _MACHINE_IEEEFP_H_ */
# 47 "/usr/include/machine/ieeefp.h" 3 4
#endif /* !__arm__ */
# 49 "/usr/include/machine/ieeefp.h" 3 4
# 13 "/usr/include/ieeefp.h" 2 3 4
#endif /* _IEEEFP_H_ */
# 15 "/usr/include/ieeefp.h" 3 4
# 193 "./Include/pyport.h" 2
#endif
# 194 "./Include/pyport.h"
#if 0 /* expanded by -frewrite-includes */
#include <math.h> /* Moved here from the math section, before extern "C" */
#endif /* expanded by -frewrite-includes */
# 195 "./Include/pyport.h"
# 1 "/usr/include/math.h" 1 3 4
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permission to use, copy, modify, and distribute this
* software is freely granted, provided that this notice
* is preserved.
* ====================================================
*/
/*
* from: @(#)fdlibm.h 5.1 93/09/24
*/
#ifndef _MATH_H_
#define _MATH_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 19 "/usr/include/math.h" 3 4
# 20 "/usr/include/math.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 20 "/usr/include/math.h" 3 4
# 21 "/usr/include/math.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <machine/_limits.h>
#endif /* expanded by -frewrite-includes */
# 21 "/usr/include/math.h" 3 4
# 1 "/usr/include/machine/_limits.h" 1 3 4
/*-
* Copyright (c) 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)limits.h 8.3 (Berkeley) 1/4/94
*/
#ifdef __arm__
#if 0 /* expanded by -frewrite-includes */
#include <arm/_limits.h>
#endif /* expanded by -frewrite-includes */
# 30 "/usr/include/machine/_limits.h" 3 4
# 31 "/usr/include/machine/_limits.h" 3 4
#else /* !__arm__ */
# 32 "/usr/include/machine/_limits.h" 3 4
#ifndef _MACHINE__LIMITS_H_
#define _MACHINE__LIMITS_H_
/*
* According to ANSI (section 2.2.4.2), the values below must be usable by
* #if preprocessing directives. Additionally, the expression must have the
* same type as would an expression that is an object of the corresponding
* type converted according to the integral promotions. The subtraction for
* INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
* unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
*/
#define __CHAR_BIT 8 /* number of bits in a char */
#define __SCHAR_MAX 0x7f /* max value for a signed char */
#define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */
#define __UCHAR_MAX 0xff /* max value for an unsigned char */
#define __USHRT_MAX 0xffff /* max value for an unsigned short */
#define __SHRT_MAX 0x7fff /* max value for a short */
#define __SHRT_MIN (-0x7fff - 1) /* min value for a short */
#define __UINT_MAX 0xffffffff /* max value for an unsigned int */
#define __INT_MAX 0x7fffffff /* max value for an int */
#define __INT_MIN (-0x7fffffff - 1) /* min value for an int */
#define __ULONG_MAX 0xffffffffffffffffUL /* max for an unsigned long */
#define __LONG_MAX 0x7fffffffffffffffL /* max for a long */
#define __LONG_MIN (-0x7fffffffffffffffL - 1) /* min for a long */
/* Long longs have the same size but not the same type as longs. */
/* max for an unsigned long long */
#define __ULLONG_MAX 0xffffffffffffffffULL
#define __LLONG_MAX 0x7fffffffffffffffLL /* max for a long long */
#define __LLONG_MIN (-0x7fffffffffffffffLL - 1) /* min for a long long */
#define __SSIZE_MAX __LONG_MAX /* max value for a ssize_t */
#define __SIZE_T_MAX __ULONG_MAX /* max value for a size_t */
#define __OFF_MAX __LONG_MAX /* max value for an off_t */
#define __OFF_MIN __LONG_MIN /* min value for an off_t */
/* Quads and longs are the same size. Ensure they stay in sync. */
#define __UQUAD_MAX (__ULONG_MAX) /* max value for a uquad_t */
#define __QUAD_MAX (__LONG_MAX) /* max value for a quad_t */
#define __QUAD_MIN (__LONG_MIN) /* min value for a quad_t */
#define __LONG_BIT 64
#define __WORD_BIT 32
/* Minimum signal stack size. */
#define __MINSIGSTKSZ (1024 * 4)
#endif /* !_MACHINE__LIMITS_H_ */
# 89 "/usr/include/machine/_limits.h" 3 4
#endif /* !__arm__ */
# 91 "/usr/include/machine/_limits.h" 3 4
# 22 "/usr/include/math.h" 2 3 4
/*
* ANSI/POSIX
*/
extern const union __infinity_un {
unsigned char __uc[8];
double __ud;
} __infinity;
extern const union __nan_un {
unsigned char __uc[sizeof(float)];
float __uf;
} __nan;
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(3, 3)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 37 "/usr/include/math.h" 3 4
#define __MATH_BUILTIN_CONSTANTS
#endif
# 39 "/usr/include/math.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __GNUC_PREREQ__(3, 0)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 41 "/usr/include/math.h" 3 4
#define __MATH_BUILTIN_RELOPS
#endif
# 43 "/usr/include/math.h" 3 4
#ifdef __MATH_BUILTIN_CONSTANTS
#define HUGE_VAL __builtin_huge_val()
#else
# 47 "/usr/include/math.h" 3 4
#define HUGE_VAL (__infinity.__ud)
#endif
# 49 "/usr/include/math.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 1999
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 51 "/usr/include/math.h" 3 4
#define FP_ILOGB0 (-__INT_MAX)
#define FP_ILOGBNAN __INT_MAX
#ifdef __MATH_BUILTIN_CONSTANTS
#define HUGE_VALF __builtin_huge_valf()
#define HUGE_VALL __builtin_huge_vall()
#define INFINITY __builtin_inff()
#define NAN __builtin_nanf("")
#else
# 60 "/usr/include/math.h" 3 4
#define HUGE_VALF (float)HUGE_VAL
#define HUGE_VALL (long double)HUGE_VAL
#define INFINITY HUGE_VALF
#define NAN (__nan.__uf)
#endif /* __MATH_BUILTIN_CONSTANTS */
# 65 "/usr/include/math.h" 3 4
#define MATH_ERRNO 1
#define MATH_ERREXCEPT 2
#define math_errhandling MATH_ERREXCEPT
#define FP_FAST_FMAF 1
/* Symbolic constants to classify floating point numbers. */
#define FP_INFINITE 0x01
#define FP_NAN 0x02
#define FP_NORMAL 0x04
#define FP_SUBNORMAL 0x08
#define FP_ZERO 0x10
#if 0 /* disabled by -frewrite-includes */
#if __STDC_VERSION__ >= 201112L || __has_extension(c_generic_selections)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 80 "/usr/include/math.h" 3 4
#define __fp_type_select(x, f, d, ld) __extension__ _Generic((x), \
float: f(x), \
double: d(x), \
long double: ld(x))
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 85 "/usr/include/math.h" 3 4
#define __fp_type_select(x, f, d, ld) __builtin_choose_expr( \
__builtin_types_compatible_p(__typeof(x), long double), ld(x), \
__builtin_choose_expr( \
__builtin_types_compatible_p(__typeof(x), double), d(x), \
__builtin_choose_expr( \
__builtin_types_compatible_p(__typeof(x), float), f(x), (void)0)))
#else
# 92 "/usr/include/math.h" 3 4
#define __fp_type_select(x, f, d, ld) \
((sizeof(x) == sizeof(float)) ? f(x) \
: (sizeof(x) == sizeof(double)) ? d(x) \
: ld(x))
#endif
# 97 "/usr/include/math.h" 3 4
#define fpclassify(x) \
__fp_type_select(x, __fpclassifyf, __fpclassifyd, __fpclassifyl)
#define isfinite(x) __fp_type_select(x, __isfinitef, __isfinite, __isfinitel)
#define isinf(x) __fp_type_select(x, __isinff, __isinf, __isinfl)
#define isnan(x) \
__fp_type_select(x, __inline_isnanf, __inline_isnan, __inline_isnanl)
#define isnormal(x) __fp_type_select(x, __isnormalf, __isnormal, __isnormall)
#ifdef __MATH_BUILTIN_RELOPS
#define isgreater(x, y) __builtin_isgreater((x), (y))
#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y))
#define isless(x, y) __builtin_isless((x), (y))
#define islessequal(x, y) __builtin_islessequal((x), (y))
#define islessgreater(x, y) __builtin_islessgreater((x), (y))
#define isunordered(x, y) __builtin_isunordered((x), (y))
#else
# 114 "/usr/include/math.h" 3 4
#define isgreater(x, y) (!isunordered((x), (y)) && (x) > (y))
#define isgreaterequal(x, y) (!isunordered((x), (y)) && (x) >= (y))
#define isless(x, y) (!isunordered((x), (y)) && (x) < (y))
#define islessequal(x, y) (!isunordered((x), (y)) && (x) <= (y))
#define islessgreater(x, y) (!isunordered((x), (y)) && \
((x) > (y) || (y) > (x)))
#define isunordered(x, y) (isnan(x) || isnan(y))
#endif /* __MATH_BUILTIN_RELOPS */
# 122 "/usr/include/math.h" 3 4
#define signbit(x) __fp_type_select(x, __signbitf, __signbit, __signbitl)
typedef __double_t double_t;
typedef __float_t float_t;
#endif /* __ISO_C_VISIBLE >= 1999 */
# 128 "/usr/include/math.h" 3 4
/*
* XOPEN/SVID
*/
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 133 "/usr/include/math.h" 3 4
#define M_E 2.7182818284590452354 /* e */
#define M_LOG2E 1.4426950408889634074 /* log 2e */
#define M_LOG10E 0.43429448190325182765 /* log 10e */
#define M_LN2 0.69314718055994530942 /* log e2 */
#define M_LN10 2.30258509299404568402 /* log e10 */
#define M_PI 3.14159265358979323846 /* pi */
#define M_PI_2 1.57079632679489661923 /* pi/2 */
#define M_PI_4 0.78539816339744830962 /* pi/4 */
#define M_1_PI 0.31830988618379067154 /* 1/pi */
#define M_2_PI 0.63661977236758134308 /* 2/pi */
#define M_2_SQRTPI 1.12837916709551257390 /* 2/sqrt(pi) */
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */
#define MAXFLOAT ((float)3.40282346638528860e+38)
extern int signgam;
#endif /* __BSD_VISIBLE || __XSI_VISIBLE */
# 150 "/usr/include/math.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 152 "/usr/include/math.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if 0
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 153 "/usr/include/math.h" 3 4
/* Old value from 4.4BSD-Lite math.h; this is probably better. */
#define HUGE HUGE_VAL
#else
# 156 "/usr/include/math.h" 3 4
#define HUGE MAXFLOAT
#endif
# 158 "/usr/include/math.h" 3 4
#endif /* __BSD_VISIBLE */
# 159 "/usr/include/math.h" 3 4
/*
* Most of these functions depend on the rounding mode and have the side
* effect of raising floating-point exceptions, so they are not declared
* as __pure2. In C99, FENV_ACCESS affects the purity of these functions.
*/
__BEGIN_DECLS
/*
* ANSI/POSIX
*/
int __fpclassifyd(double) __pure2;
int __fpclassifyf(float) __pure2;
int __fpclassifyl(long double) __pure2;
int __isfinitef(float) __pure2;
int __isfinite(double) __pure2;
int __isfinitel(long double) __pure2;
int __isinff(float) __pure2;
int __isinf(double) __pure2;
int __isinfl(long double) __pure2;
int __isnormalf(float) __pure2;
int __isnormal(double) __pure2;
int __isnormall(long double) __pure2;
int __signbit(double) __pure2;
int __signbitf(float) __pure2;
int __signbitl(long double) __pure2;
static __inline int
__inline_isnan(__const double __x)
{
return (__x != __x);
}
static __inline int
__inline_isnanf(__const float __x)
{
return (__x != __x);
}
static __inline int
__inline_isnanl(__const long double __x)
{
return (__x != __x);
}
/*
* Define the following aliases, for compatibility with glibc and CUDA.
*/
#define __isnan __inline_isnan
#define __isnanf __inline_isnanf
/*
* Version 2 of the Single UNIX Specification (UNIX98) defined isnan() and
* isinf() as functions taking double. C99, and the subsequent POSIX revisions
* (SUSv3, POSIX.1-2001, define it as a macro that accepts any real floating
* point type. If we are targeting SUSv2 and C99 or C11 (or C++11) then we
* expose the newer definition, assuming that the language spec takes
* precedence over the operating system interface spec.
*/
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE > 0 && __XSI_VISIBLE < 600 && __ISO_C_VISIBLE < 1999
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 221 "/usr/include/math.h" 3 4
#undef isinf
#undef isnan
int isinf(double);
int isnan(double);
#endif
# 226 "/usr/include/math.h" 3 4
double acos(double);
double asin(double);
double atan(double);
double atan2(double, double);
double cos(double);
double sin(double);
double tan(double);
double cosh(double);
double sinh(double);
double tanh(double);
double exp(double);
double frexp(double, int *); /* fundamentally !__pure2 */
double ldexp(double, int);
double log(double);
double log10(double);
double modf(double, double *); /* fundamentally !__pure2 */
double pow(double, double);
double sqrt(double);
double ceil(double);
double fabs(double) __pure2;
double floor(double);
double fmod(double, double);
/*
* These functions are not in C90.
*/
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 258 "/usr/include/math.h" 3 4
double acosh(double);
double asinh(double);
double atanh(double);
double cbrt(double);
double erf(double);
double erfc(double);
double exp2(double);
double expm1(double);
double fma(double, double, double);
double hypot(double, double);
int ilogb(double) __pure2;
double lgamma(double);
long long llrint(double);
long long llround(double);
double log1p(double);
double log2(double);
double logb(double);
long lrint(double);
long lround(double);
double nan(const char *) __pure2;
double nextafter(double, double);
double remainder(double, double);
double remquo(double, double, int *);
double rint(double);
#endif /* __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999 || __XSI_VISIBLE */
# 283 "/usr/include/math.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE || __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 285 "/usr/include/math.h" 3 4
double j0(double);
double j1(double);
double jn(int, double);
double y0(double);
double y1(double);
double yn(int, double);
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE <= 500 || __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 293 "/usr/include/math.h" 3 4
double gamma(double);
#endif
# 295 "/usr/include/math.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE <= 600 || __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 297 "/usr/include/math.h" 3 4
double scalb(double, double);
#endif
# 299 "/usr/include/math.h" 3 4
#endif /* __BSD_VISIBLE || __XSI_VISIBLE */
# 300 "/usr/include/math.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 1999
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 302 "/usr/include/math.h" 3 4
double copysign(double, double) __pure2;
double fdim(double, double);
double fmax(double, double) __pure2;
double fmin(double, double) __pure2;
double nearbyint(double);
double round(double);
double scalbln(double, long);
double scalbn(double, int);
double tgamma(double);
double trunc(double);
#endif
# 313 "/usr/include/math.h" 3 4
/*
* BSD math library entry points
*/
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 318 "/usr/include/math.h" 3 4
double drem(double, double);
int finite(double) __pure2;
int isnanf(float) __pure2;
/*
* Reentrant version of gamma & lgamma; passes signgam back by reference
* as the second argument; user must allocate space for signgam.
*/
double gamma_r(double, int *);
double lgamma_r(double, int *);
/*
* IEEE Test Vector
*/
double significand(double);
#endif /* __BSD_VISIBLE */
# 334 "/usr/include/math.h" 3 4
/* float versions of ANSI/POSIX functions */
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 1999
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 337 "/usr/include/math.h" 3 4
float acosf(float);
float asinf(float);
float atanf(float);
float atan2f(float, float);
float cosf(float);
float sinf(float);
float tanf(float);
float coshf(float);
float sinhf(float);
float tanhf(float);
float exp2f(float);
float expf(float);
float expm1f(float);
float frexpf(float, int *); /* fundamentally !__pure2 */
int ilogbf(float) __pure2;
float ldexpf(float, int);
float log10f(float);
float log1pf(float);
float log2f(float);
float logf(float);
float modff(float, float *); /* fundamentally !__pure2 */
float powf(float, float);
float sqrtf(float);
float ceilf(float);
float fabsf(float) __pure2;
float floorf(float);
float fmodf(float, float);
float roundf(float);
float erff(float);
float erfcf(float);
float hypotf(float, float);
float lgammaf(float);
float tgammaf(float);
float acoshf(float);
float asinhf(float);
float atanhf(float);
float cbrtf(float);
float logbf(float);
float copysignf(float, float) __pure2;
long long llrintf(float);
long long llroundf(float);
long lrintf(float);
long lroundf(float);
float nanf(const char *) __pure2;
float nearbyintf(float);
float nextafterf(float, float);
float remainderf(float, float);
float remquof(float, float, int *);
float rintf(float);
float scalblnf(float, long);
float scalbnf(float, int);
float truncf(float);
float fdimf(float, float);
float fmaf(float, float, float);
float fmaxf(float, float) __pure2;
float fminf(float, float) __pure2;
#endif
# 401 "/usr/include/math.h" 3 4
/*
* float versions of BSD math library entry points
*/
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 406 "/usr/include/math.h" 3 4
float dremf(float, float);
int finitef(float) __pure2;
float gammaf(float);
float j0f(float);
float j1f(float);
float jnf(int, float);
float scalbf(float, float);
float y0f(float);
float y1f(float);
float ynf(int, float);
/*
* Float versions of reentrant version of gamma & lgamma; passes
* signgam back by reference as the second argument; user must
* allocate space for signgam.
*/
float gammaf_r(float, int *);
float lgammaf_r(float, int *);
/*
* float version of IEEE Test Vector
*/
float significandf(float);
#endif /* __BSD_VISIBLE */
# 430 "/usr/include/math.h" 3 4
/*
* long double versions of ISO/POSIX math functions
*/
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 1999
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 435 "/usr/include/math.h" 3 4
long double acoshl(long double);
long double acosl(long double);
long double asinhl(long double);
long double asinl(long double);
long double atan2l(long double, long double);
long double atanhl(long double);
long double atanl(long double);
long double cbrtl(long double);
long double ceill(long double);
long double copysignl(long double, long double) __pure2;
long double coshl(long double);
long double cosl(long double);
long double erfcl(long double);
long double erfl(long double);
long double exp2l(long double);
long double expl(long double);
long double expm1l(long double);
long double fabsl(long double) __pure2;
long double fdiml(long double, long double);
long double floorl(long double);
long double fmal(long double, long double, long double);
long double fmaxl(long double, long double) __pure2;
long double fminl(long double, long double) __pure2;
long double fmodl(long double, long double);
long double frexpl(long double, int *); /* fundamentally !__pure2 */
long double hypotl(long double, long double);
int ilogbl(long double) __pure2;
long double ldexpl(long double, int);
long double lgammal(long double);
long long llrintl(long double);
long long llroundl(long double);
long double log10l(long double);
long double log1pl(long double);
long double log2l(long double);
long double logbl(long double);
long double logl(long double);
long lrintl(long double);
long lroundl(long double);
long double modfl(long double, long double *); /* fundamentally !__pure2 */
long double nanl(const char *) __pure2;
long double nearbyintl(long double);
long double nextafterl(long double, long double);
double nexttoward(double, long double);
float nexttowardf(float, long double);
long double nexttowardl(long double, long double);
long double powl(long double, long double);
long double remainderl(long double, long double);
long double remquol(long double, long double, int *);
long double rintl(long double);
long double roundl(long double);
long double scalblnl(long double, long);
long double scalbnl(long double, int);
long double sinhl(long double);
long double sinl(long double);
long double sqrtl(long double);
long double tanhl(long double);
long double tanl(long double);
long double tgammal(long double);
long double truncl(long double);
#endif /* __ISO_C_VISIBLE >= 1999 */
# 495 "/usr/include/math.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 497 "/usr/include/math.h" 3 4
long double lgammal_r(long double, int *);
void sincos(double, double *, double *);
void sincosf(float, float *, float *);
void sincosl(long double, long double *, long double *);
double cospi(double);
float cospif(float);
long double cospil(long double);
double sinpi(double);
float sinpif(float);
long double sinpil(long double);
double tanpi(double);
float tanpif(float);
long double tanpil(long double);
#endif
# 511 "/usr/include/math.h" 3 4
__END_DECLS
#endif /* !_MATH_H_ */
# 515 "/usr/include/math.h" 3 4
# 196 "./Include/pyport.h" 2
/********************************************
* WRAPPER FOR <time.h> and/or <sys/time.h> *
********************************************/
#ifdef HAVE_SYS_TIME_H
#if 0 /* expanded by -frewrite-includes */
#include <sys/time.h>
#endif /* expanded by -frewrite-includes */
# 202 "./Include/pyport.h"
# 1 "/usr/include/sys/time.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)time.h 8.5 (Berkeley) 5/4/95
*/
#ifndef _SYS_TIME_H_
#define _SYS_TIME_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_timeval.h>
#endif /* expanded by -frewrite-includes */
# 37 "/usr/include/sys/time.h" 3 4
# 38 "/usr/include/sys/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h>
#endif /* expanded by -frewrite-includes */
# 38 "/usr/include/sys/time.h" 3 4
# 39 "/usr/include/sys/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/timespec.h>
#endif /* expanded by -frewrite-includes */
# 39 "/usr/include/sys/time.h" 3 4
# 40 "/usr/include/sys/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_clock_id.h>
#endif /* expanded by -frewrite-includes */
# 40 "/usr/include/sys/time.h" 3 4
# 1 "/usr/include/sys/_clock_id.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2021 Netflix, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS_SYS__CLOCK_ID_H
#define _SYS_SYS__CLOCK_ID_H
/*
* These macros are shared between time.h and sys/time.h.
*/
/*
* Note: The values shown below as a comment for the __POSIX_VISIBLE values are
* the ones FreeBSD traditionally used based on our reading of the POSIX
* standards. However, glibc uses 199309 for all of them, even those many were
* not defined there. To remain bug compatible with glibc means more software
* that relied on the glibc behavior will compile easily on FreeBSD.
*
* Also, CLOCK_UPTIME_FAST is improperly visible temporarily for the lang/pocl
* port until it can be updated properly. It incorrectly assumes that this was a
* standard value. It will be moved back to the __BSD_VISIBLE section once the
* issue is corrected.
*/
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199309 /* 199506 */
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 49 "/usr/include/sys/_clock_id.h" 3 4
#define CLOCK_REALTIME 0
#endif /* __POSIX_VISIBLE >= 199309 */
# 51 "/usr/include/sys/_clock_id.h" 3 4
#ifdef __BSD_VISIBLE
#define CLOCK_VIRTUAL 1
#define CLOCK_PROF 2
#endif /* __BSD_VISIBLE */
# 55 "/usr/include/sys/_clock_id.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199309 /* 200112 */
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 56 "/usr/include/sys/_clock_id.h" 3 4
#define CLOCK_MONOTONIC 4
#define CLOCK_UPTIME_FAST 8
#endif /* __POSIX_VISIBLE >= 199309 */
# 59 "/usr/include/sys/_clock_id.h" 3 4
#ifdef __BSD_VISIBLE
/*
* FreeBSD-specific clocks.
*/
#define CLOCK_UPTIME 5
#define CLOCK_UPTIME_PRECISE 7
#define CLOCK_REALTIME_PRECISE 9
#define CLOCK_REALTIME_FAST 10
#define CLOCK_MONOTONIC_PRECISE 11
#define CLOCK_MONOTONIC_FAST 12
#define CLOCK_SECOND 13
#endif /* __BSD_VISIBLE */
# 71 "/usr/include/sys/_clock_id.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199309 /* 200112 */
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 73 "/usr/include/sys/_clock_id.h" 3 4
#define CLOCK_THREAD_CPUTIME_ID 14
#define CLOCK_PROCESS_CPUTIME_ID 15
#endif /* __POSIX_VISIBLE >= 199309 */
# 76 "/usr/include/sys/_clock_id.h" 3 4
/*
* Linux compatible names.
*/
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 81 "/usr/include/sys/_clock_id.h" 3 4
#define CLOCK_BOOTTIME CLOCK_UPTIME
#define CLOCK_REALTIME_COARSE CLOCK_REALTIME_FAST
#define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC_FAST
#endif
# 85 "/usr/include/sys/_clock_id.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 87 "/usr/include/sys/_clock_id.h" 3 4
#define TIMER_RELTIME 0x0 /* relative timer */
#endif
# 89 "/usr/include/sys/_clock_id.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199309
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 90 "/usr/include/sys/_clock_id.h" 3 4
#define TIMER_ABSTIME 0x1 /* absolute timer */
#endif /* __POSIX_VISIBLE >= 199309 */
# 92 "/usr/include/sys/_clock_id.h" 3 4
#endif /* _SYS_SYS__CLOCK_ID_H */
# 94 "/usr/include/sys/_clock_id.h" 3 4
# 41 "/usr/include/sys/time.h" 2 3 4
struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of dst correction */
};
#define DST_NONE 0 /* not on dst */
#define DST_USA 1 /* USA style dst */
#define DST_AUST 2 /* Australian style dst */
#define DST_WET 3 /* Western European dst */
#define DST_MET 4 /* Middle European dst */
#define DST_EET 5 /* Eastern European dst */
#define DST_CAN 6 /* Canada */
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 55 "/usr/include/sys/time.h" 3 4
struct bintime {
time_t sec;
uint64_t frac;
};
static __inline void
bintime_addx(struct bintime *_bt, uint64_t _x)
{
uint64_t _u;
_u = _bt->frac;
_bt->frac += _x;
if (_u > _bt->frac)
_bt->sec++;
}
static __inline void
bintime_add(struct bintime *_bt, const struct bintime *_bt2)
{
uint64_t _u;
_u = _bt->frac;
_bt->frac += _bt2->frac;
if (_u > _bt->frac)
_bt->sec++;
_bt->sec += _bt2->sec;
}
static __inline void
bintime_sub(struct bintime *_bt, const struct bintime *_bt2)
{
uint64_t _u;
_u = _bt->frac;
_bt->frac -= _bt2->frac;
if (_u < _bt->frac)
_bt->sec--;
_bt->sec -= _bt2->sec;
}
static __inline void
bintime_mul(struct bintime *_bt, u_int _x)
{
uint64_t _p1, _p2;
_p1 = (_bt->frac & 0xffffffffull) * _x;
_p2 = (_bt->frac >> 32) * _x + (_p1 >> 32);
_bt->sec *= _x;
_bt->sec += (_p2 >> 32);
_bt->frac = (_p2 << 32) | (_p1 & 0xffffffffull);
}
static __inline void
bintime_shift(struct bintime *_bt, int _exp)
{
if (_exp > 0) {
_bt->sec <<= _exp;
_bt->sec |= _bt->frac >> (64 - _exp);
_bt->frac <<= _exp;
} else if (_exp < 0) {
_bt->frac >>= -_exp;
_bt->frac |= (uint64_t)_bt->sec << (64 + _exp);
_bt->sec >>= -_exp;
}
}
#define bintime_clear(a) ((a)->sec = (a)->frac = 0)
#define bintime_isset(a) ((a)->sec || (a)->frac)
#define bintime_cmp(a, b, cmp) \
(((a)->sec == (b)->sec) ? \
((a)->frac cmp (b)->frac) : \
((a)->sec cmp (b)->sec))
#define SBT_1S ((sbintime_t)1 << 32)
#define SBT_1M (SBT_1S * 60)
#define SBT_1MS (SBT_1S / 1000)
#define SBT_1US (SBT_1S / 1000000)
#define SBT_1NS (SBT_1S / 1000000000) /* beware rounding, see nstosbt() */
#define SBT_MAX 0x7fffffffffffffffLL
static __inline int
sbintime_getsec(sbintime_t _sbt)
{
return (_sbt >> 32);
}
static __inline sbintime_t
bttosbt(const struct bintime _bt)
{
return (((sbintime_t)_bt.sec << 32) + (_bt.frac >> 32));
}
static __inline struct bintime
sbttobt(sbintime_t _sbt)
{
struct bintime _bt;
_bt.sec = _sbt >> 32;
_bt.frac = _sbt << 32;
return (_bt);
}
/*
* Scaling functions for signed and unsigned 64-bit time using any
* 32-bit fraction:
*/
static __inline int64_t
__stime64_scale32_ceil(int64_t x, int32_t factor, int32_t divisor)
{
const int64_t rem = x % divisor;
return (x / divisor * factor + (rem * factor + divisor - 1) / divisor);
}
static __inline int64_t
__stime64_scale32_floor(int64_t x, int32_t factor, int32_t divisor)
{
const int64_t rem = x % divisor;
return (x / divisor * factor + (rem * factor) / divisor);
}
static __inline uint64_t
__utime64_scale32_ceil(uint64_t x, uint32_t factor, uint32_t divisor)
{
const uint64_t rem = x % divisor;
return (x / divisor * factor + (rem * factor + divisor - 1) / divisor);
}
static __inline uint64_t
__utime64_scale32_floor(uint64_t x, uint32_t factor, uint32_t divisor)
{
const uint64_t rem = x % divisor;
return (x / divisor * factor + (rem * factor) / divisor);
}
/*
* This function finds the common divisor between the two arguments,
* in powers of two. Use a macro, so the compiler will output a
* warning if the value overflows!
*
* Detailed description:
*
* Create a variable with 1's at the positions of the leading 0's
* starting at the least significant bit, producing 0 if none (e.g.,
* 01011000 -> 0000 0111). Then these two variables are bitwise AND'ed
* together, to produce the greatest common power of two minus one. In
* the end add one to flip the value to the actual power of two (e.g.,
* 0000 0111 + 1 -> 0000 1000).
*/
#define __common_powers_of_two(a, b) \
((~(a) & ((a) - 1) & ~(b) & ((b) - 1)) + 1)
/*
* Scaling functions for signed and unsigned 64-bit time assuming
* reducable 64-bit fractions to 32-bit fractions:
*/
static __inline int64_t
__stime64_scale64_ceil(int64_t x, int64_t factor, int64_t divisor)
{
const int64_t gcd = __common_powers_of_two(factor, divisor);
return (__stime64_scale32_ceil(x, factor / gcd, divisor / gcd));
}
static __inline int64_t
__stime64_scale64_floor(int64_t x, int64_t factor, int64_t divisor)
{
const int64_t gcd = __common_powers_of_two(factor, divisor);
return (__stime64_scale32_floor(x, factor / gcd, divisor / gcd));
}
static __inline uint64_t
__utime64_scale64_ceil(uint64_t x, uint64_t factor, uint64_t divisor)
{
const uint64_t gcd = __common_powers_of_two(factor, divisor);
return (__utime64_scale32_ceil(x, factor / gcd, divisor / gcd));
}
static __inline uint64_t
__utime64_scale64_floor(uint64_t x, uint64_t factor, uint64_t divisor)
{
const uint64_t gcd = __common_powers_of_two(factor, divisor);
return (__utime64_scale32_floor(x, factor / gcd, divisor / gcd));
}
/*
* Decimal<->sbt conversions. Multiplying or dividing by SBT_1NS
* results in large roundoff errors which sbttons() and nstosbt()
* avoid. Millisecond and microsecond functions are also provided for
* completeness.
*
* When converting from sbt to another unit, the result is always
* rounded down. When converting back to sbt the result is always
* rounded up. This gives the property that sbttoX(Xtosbt(y)) == y .
*
* The conversion functions can also handle negative values.
*/
#define SBT_DECLARE_CONVERSION_PAIR(name, units_per_second) \
static __inline int64_t \
sbtto##name(sbintime_t sbt) \
{ \
return (__stime64_scale64_floor(sbt, units_per_second, SBT_1S)); \
} \
static __inline sbintime_t \
name##tosbt(int64_t name) \
{ \
return (__stime64_scale64_ceil(name, SBT_1S, units_per_second)); \
}
SBT_DECLARE_CONVERSION_PAIR(ns, 1000000000)
SBT_DECLARE_CONVERSION_PAIR(us, 1000000)
SBT_DECLARE_CONVERSION_PAIR(ms, 1000)
/*-
* Background information:
*
* When converting between timestamps on parallel timescales of differing
* resolutions it is historical and scientific practice to round down rather
* than doing 4/5 rounding.
*
* The date changes at midnight, not at noon.
*
* Even at 15:59:59.999999999 it's not four'o'clock.
*
* time_second ticks after N.999999999 not after N.4999999999
*/
static __inline void
bintime2timespec(const struct bintime *_bt, struct timespec *_ts)
{
_ts->tv_sec = _bt->sec;
_ts->tv_nsec = __utime64_scale64_floor(
_bt->frac, 1000000000, 1ULL << 32) >> 32;
}
static __inline uint64_t
bintime2ns(const struct bintime *_bt)
{
uint64_t ret;
ret = (uint64_t)(_bt->sec) * (uint64_t)1000000000;
ret += __utime64_scale64_floor(
_bt->frac, 1000000000, 1ULL << 32) >> 32;
return (ret);
}
static __inline void
timespec2bintime(const struct timespec *_ts, struct bintime *_bt)
{
_bt->sec = _ts->tv_sec;
_bt->frac = __utime64_scale64_floor(
(uint64_t)_ts->tv_nsec << 32, 1ULL << 32, 1000000000);
}
static __inline void
bintime2timeval(const struct bintime *_bt, struct timeval *_tv)
{
_tv->tv_sec = _bt->sec;
_tv->tv_usec = __utime64_scale64_floor(
_bt->frac, 1000000, 1ULL << 32) >> 32;
}
static __inline void
timeval2bintime(const struct timeval *_tv, struct bintime *_bt)
{
_bt->sec = _tv->tv_sec;
_bt->frac = __utime64_scale64_floor(
(uint64_t)_tv->tv_usec << 32, 1ULL << 32, 1000000);
}
static __inline struct timespec
sbttots(sbintime_t _sbt)
{
struct timespec _ts;
_ts.tv_sec = _sbt >> 32;
_ts.tv_nsec = sbttons((uint32_t)_sbt);
return (_ts);
}
static __inline sbintime_t
tstosbt(struct timespec _ts)
{
return (((sbintime_t)_ts.tv_sec << 32) + nstosbt(_ts.tv_nsec));
}
static __inline struct timeval
sbttotv(sbintime_t _sbt)
{
struct timeval _tv;
_tv.tv_sec = _sbt >> 32;
_tv.tv_usec = sbttous((uint32_t)_sbt);
return (_tv);
}
static __inline sbintime_t
tvtosbt(struct timeval _tv)
{
return (((sbintime_t)_tv.tv_sec << 32) + ustosbt(_tv.tv_usec));
}
#endif /* __BSD_VISIBLE */
# 374 "/usr/include/sys/time.h" 3 4
#ifdef _KERNEL
/*
* Simple macros to convert ticks to milliseconds
* or microseconds and vice-versa. The answer
* will always be at least 1. Note the return
* value is a uint32_t however we step up the
* operations to 64 bit to avoid any overflow/underflow
* problems.
*/
#define TICKS_2_MSEC(t) max(1, (uint32_t)(hz == 1000) ? \
(t) : (((uint64_t)(t) * (uint64_t)1000)/(uint64_t)hz))
#define TICKS_2_USEC(t) max(1, (uint32_t)(hz == 1000) ? \
((t) * 1000) : (((uint64_t)(t) * (uint64_t)1000000)/(uint64_t)hz))
#define MSEC_2_TICKS(m) max(1, (uint32_t)((hz == 1000) ? \
(m) : ((uint64_t)(m) * (uint64_t)hz)/(uint64_t)1000))
#define USEC_2_TICKS(u) max(1, (uint32_t)((hz == 1000) ? \
((u) / 1000) : ((uint64_t)(u) * (uint64_t)hz)/(uint64_t)1000000))
#endif
# 394 "/usr/include/sys/time.h" 3 4
/* Operations on timespecs */
#define timespecclear(tvp) ((tvp)->tv_sec = (tvp)->tv_nsec = 0)
#define timespecisset(tvp) ((tvp)->tv_sec || (tvp)->tv_nsec)
#define timespeccmp(tvp, uvp, cmp) \
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))
#define timespecadd(tsp, usp, vsp) \
do { \
(vsp)->tv_sec = (tsp)->tv_sec + (usp)->tv_sec; \
(vsp)->tv_nsec = (tsp)->tv_nsec + (usp)->tv_nsec; \
if ((vsp)->tv_nsec >= 1000000000L) { \
(vsp)->tv_sec++; \
(vsp)->tv_nsec -= 1000000000L; \
} \
} while (0)
#define timespecsub(tsp, usp, vsp) \
do { \
(vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \
(vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \
if ((vsp)->tv_nsec < 0) { \
(vsp)->tv_sec--; \
(vsp)->tv_nsec += 1000000000L; \
} \
} while (0)
#define timespecvalid_interval(tsp) ((tsp)->tv_sec >= 0 && \
(tsp)->tv_nsec >= 0 && (tsp)->tv_nsec < 1000000000L)
#ifdef _KERNEL
/* Operations on timevals. */
#define timevalclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
#define timevalisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#define timevalcmp(tvp, uvp, cmp) \
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_usec cmp (uvp)->tv_usec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))
/* timevaladd and timevalsub are not inlined */
#endif /* _KERNEL */
# 437 "/usr/include/sys/time.h" 3 4
#ifndef _KERNEL /* NetBSD/OpenBSD compatible interfaces */
#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0)
#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
#define timercmp(tvp, uvp, cmp) \
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_usec cmp (uvp)->tv_usec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))
#define timeradd(tvp, uvp, vvp) \
do { \
(vvp)->tv_sec = (tvp)->tv_sec + (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec + (uvp)->tv_usec; \
if ((vvp)->tv_usec >= 1000000) { \
(vvp)->tv_sec++; \
(vvp)->tv_usec -= 1000000; \
} \
} while (0)
#define timersub(tvp, uvp, vvp) \
do { \
(vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \
(vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \
if ((vvp)->tv_usec < 0) { \
(vvp)->tv_sec--; \
(vvp)->tv_usec += 1000000; \
} \
} while (0)
#endif
# 465 "/usr/include/sys/time.h" 3 4
/*
* Names of the interval timers, and structure
* defining a timer setting.
*/
#define ITIMER_REAL 0
#define ITIMER_VIRTUAL 1
#define ITIMER_PROF 2
struct itimerval {
struct timeval it_interval; /* timer interval */
struct timeval it_value; /* current value */
};
/*
* Getkerninfo clock information structure
*/
struct clockinfo {
int hz; /* clock frequency */
int tick; /* micro-seconds per hz tick */
int spare;
int stathz; /* statistics clock frequency */
int profhz; /* profiling clock frequency */
};
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 491 "/usr/include/sys/time.h" 3 4
#define CPUCLOCK_WHICH_PID 0
#define CPUCLOCK_WHICH_TID 1
#endif
# 494 "/usr/include/sys/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if defined(_KERNEL) || defined(_STANDALONE)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 496 "/usr/include/sys/time.h" 3 4
/*
* Kernel to clock driver interface.
*/
void inittodr(time_t base);
void resettodr(void);
extern volatile time_t time_second;
extern volatile time_t time_uptime;
extern struct bintime tc_tick_bt;
extern sbintime_t tc_tick_sbt;
extern time_t tick_seconds_max;
extern struct bintime tick_bt;
extern sbintime_t tick_sbt;
extern int tc_precexp;
extern int tc_timepercentage;
extern struct bintime bt_timethreshold;
extern struct bintime bt_tickthreshold;
extern sbintime_t sbt_timethreshold;
extern sbintime_t sbt_tickthreshold;
extern volatile int rtc_generation;
/*
* Functions for looking at our clock: [get]{bin,nano,micro}[up]time()
*
* Functions without the "get" prefix returns the best timestamp
* we can produce in the given format.
*
* "bin" == struct bintime == seconds + 64 bit fraction of seconds.
* "nano" == struct timespec == seconds + nanoseconds.
* "micro" == struct timeval == seconds + microseconds.
*
* Functions containing "up" returns time relative to boot and
* should be used for calculating time intervals.
*
* Functions without "up" returns UTC time.
*
* Functions with the "get" prefix returns a less precise result
* much faster than the functions without "get" prefix and should
* be used where a precision of 1/hz seconds is acceptable or where
* performance is priority. (NB: "precision", _not_ "resolution" !)
*/
void binuptime(struct bintime *bt);
void nanouptime(struct timespec *tsp);
void microuptime(struct timeval *tvp);
static __inline sbintime_t
sbinuptime(void)
{
struct bintime _bt;
binuptime(&_bt);
return (bttosbt(_bt));
}
void bintime(struct bintime *bt);
void nanotime(struct timespec *tsp);
void microtime(struct timeval *tvp);
void getbinuptime(struct bintime *bt);
void getnanouptime(struct timespec *tsp);
void getmicrouptime(struct timeval *tvp);
static __inline sbintime_t
getsbinuptime(void)
{
struct bintime _bt;
getbinuptime(&_bt);
return (bttosbt(_bt));
}
void getbintime(struct bintime *bt);
void getnanotime(struct timespec *tsp);
void getmicrotime(struct timeval *tvp);
void getboottime(struct timeval *boottime);
void getboottimebin(struct bintime *boottimebin);
/* Other functions */
int itimerdecr(struct itimerval *itp, int usec);
int itimerfix(struct timeval *tv);
int eventratecheck(struct timeval *, int *, int);
#define ppsratecheck(t, c, m) eventratecheck(t, c, m)
int ratecheck(struct timeval *, const struct timeval *);
void timevaladd(struct timeval *t1, const struct timeval *t2);
void timevalsub(struct timeval *t1, const struct timeval *t2);
int tvtohz(struct timeval *tv);
/*
* The following HZ limits allow the tvtohz() function
* to only use integer computations.
*/
#define HZ_MAXIMUM (INT_MAX / (1000000 >> 6)) /* 137kHz */
#define HZ_MINIMUM 8 /* hz */
#define TC_DEFAULTPERC 5
#define BT2FREQ(bt) \
(((uint64_t)0x8000000000000000 + ((bt)->frac >> 2)) / \
((bt)->frac >> 1))
#define SBT2FREQ(sbt) ((SBT_1S + ((sbt) >> 1)) / (sbt))
#define FREQ2BT(freq, bt) \
{ \
(bt)->sec = 0; \
(bt)->frac = ((uint64_t)0x8000000000000000 / (freq)) << 1; \
}
#define TIMESEL(sbt, sbt2) \
(((sbt2) >= sbt_timethreshold) ? \
((*(sbt) = getsbinuptime()), 1) : ((*(sbt) = sbinuptime()), 0))
#else /* !_KERNEL && !_STANDALONE */
# 613 "/usr/include/sys/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <time.h>
#endif /* expanded by -frewrite-includes */
# 613 "/usr/include/sys/time.h" 3 4
# 1 "/usr/include/time.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)time.h 8.3 (Berkeley) 1/21/94
*/
/*
*/
#ifndef _TIME_H_
#define _TIME_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 45 "/usr/include/time.h" 3 4
# 46 "/usr/include/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_null.h>
#endif /* expanded by -frewrite-includes */
# 46 "/usr/include/time.h" 3 4
# 47 "/usr/include/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 47 "/usr/include/time.h" 3 4
# 48 "/usr/include/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_clock_id.h>
#endif /* expanded by -frewrite-includes */
# 48 "/usr/include/time.h" 3 4
# 49 "/usr/include/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE > 0 && __POSIX_VISIBLE < 200112 || __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 51 "/usr/include/time.h" 3 4
/*
* Frequency of the clock ticks reported by times(). Deprecated - use
* sysconf(_SC_CLK_TCK) instead. (Removed in 1003.1-2001.)
*/
#define CLK_TCK 128
#endif
# 57 "/usr/include/time.h" 3 4
/* Frequency of the clock ticks reported by clock(). */
#define CLOCKS_PER_SEC 128
#ifndef _CLOCK_T_DECLARED
typedef __clock_t clock_t;
#define _CLOCK_T_DECLARED
#endif
# 65 "/usr/include/time.h" 3 4
#ifndef _TIME_T_DECLARED
typedef __time_t time_t;
#define _TIME_T_DECLARED
#endif
# 70 "/usr/include/time.h" 3 4
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
#define _SIZE_T_DECLARED
#endif
# 75 "/usr/include/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199309
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 77 "/usr/include/time.h" 3 4
/*
* New in POSIX 1003.1b-1993.
*/
#ifndef _CLOCKID_T_DECLARED
typedef __clockid_t clockid_t;
#define _CLOCKID_T_DECLARED
#endif
# 84 "/usr/include/time.h" 3 4
#ifndef _TIMER_T_DECLARED
typedef __timer_t timer_t;
#define _TIMER_T_DECLARED
#endif
# 89 "/usr/include/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/timespec.h>
#endif /* expanded by -frewrite-includes */
# 90 "/usr/include/time.h" 3 4
# 91 "/usr/include/time.h" 3 4
#endif /* __POSIX_VISIBLE >= 199309 */
# 92 "/usr/include/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 94 "/usr/include/time.h" 3 4
#ifndef _PID_T_DECLARED
typedef __pid_t pid_t;
#define _PID_T_DECLARED
#endif
# 98 "/usr/include/time.h" 3 4
#endif
# 99 "/usr/include/time.h" 3 4
struct tm {
int tm_sec; /* seconds after the minute [0-60] */
int tm_min; /* minutes after the hour [0-59] */
int tm_hour; /* hours since midnight [0-23] */
int tm_mday; /* day of the month [1-31] */
int tm_mon; /* months since January [0-11] */
int tm_year; /* years since 1900 */
int tm_wday; /* days since Sunday [0-6] */
int tm_yday; /* days since January 1 [0-365] */
int tm_isdst; /* Daylight Savings Time flag */
long tm_gmtoff; /* offset from UTC in seconds */
char *tm_zone; /* timezone abbreviation */
};
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 115 "/usr/include/time.h" 3 4
extern char *tzname[];
#endif
# 117 "/usr/include/time.h" 3 4
__BEGIN_DECLS
char *asctime(const struct tm *);
clock_t clock(void);
char *ctime(const time_t *);
#ifndef _STANDALONE
double difftime(time_t, time_t);
#endif
# 125 "/usr/include/time.h" 3 4
/* XXX missing: getdate() */
struct tm *gmtime(const time_t *);
struct tm *localtime(const time_t *);
time_t mktime(struct tm *);
size_t strftime(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict);
time_t time(time_t *);
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 133 "/usr/include/time.h" 3 4
struct sigevent;
int timer_create(clockid_t, struct sigevent *__restrict, timer_t *__restrict);
int timer_delete(timer_t);
int timer_gettime(timer_t, struct itimerspec *);
int timer_getoverrun(timer_t);
int timer_settime(timer_t, int, const struct itimerspec *__restrict,
struct itimerspec *__restrict);
#endif
# 141 "/usr/include/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 142 "/usr/include/time.h" 3 4
void tzset(void);
#endif
# 144 "/usr/include/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199309
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 146 "/usr/include/time.h" 3 4
int clock_getres(clockid_t, struct timespec *);
int clock_gettime(clockid_t, struct timespec *);
int clock_settime(clockid_t, const struct timespec *);
int nanosleep(const struct timespec *, struct timespec *);
#endif /* __POSIX_VISIBLE >= 199309 */
# 151 "/usr/include/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 153 "/usr/include/time.h" 3 4
int clock_getcpuclockid(pid_t, clockid_t *);
int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *);
#endif
# 156 "/usr/include/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 199506
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 158 "/usr/include/time.h" 3 4
char *asctime_r(const struct tm *, char *);
char *ctime_r(const time_t *, char *);
struct tm *gmtime_r(const time_t *, struct tm *);
struct tm *localtime_r(const time_t *, struct tm *);
#endif
# 163 "/usr/include/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 165 "/usr/include/time.h" 3 4
char *strptime(const char * __restrict, const char * __restrict,
struct tm * __restrict);
#endif
# 168 "/usr/include/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 170 "/usr/include/time.h" 3 4
char *timezone(int, int); /* XXX XSI conflict */
time_t timelocal(struct tm * const);
time_t timegm(struct tm * const);
int timer_oshandle_np(timer_t timerid);
time_t time2posix(time_t t);
time_t posix2time(time_t t);
#endif /* __BSD_VISIBLE */
# 177 "/usr/include/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 179 "/usr/include/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_time.h>
#endif /* expanded by -frewrite-includes */
# 179 "/usr/include/time.h" 3 4
# 1 "/usr/include/xlocale/_time.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011, 2012 The FreeBSD Foundation
*
* This software was developed by David Chisnall under sponsorship from
* the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 35 "/usr/include/xlocale/_time.h" 3 4
/*
* This file is included from both locale.h and xlocale.h. We need to expose
* the declarations unconditionally if we are included from xlocale.h, but only
* if we are in POSIX2008 mode if included from locale.h.
*/
#ifndef _XLOCALE_LOCALE1_H
#define _XLOCALE_LOCALE1_H
size_t strftime_l(char * __restrict, size_t, const char * __restrict,
const struct tm * __restrict, locale_t) __strftimelike(3, 0);
#endif /* _XLOCALE_LOCALE1_H */
# 48 "/usr/include/xlocale/_time.h" 3 4
#ifdef _XLOCALE_H_
#ifndef _XLOCALE_LOCALE2_H
#define _XLOCALE_LOCALE2_H
char *strptime_l(const char * __restrict, const char * __restrict,
struct tm * __restrict, locale_t);
#endif /* _XLOCALE_LOCALE2_H */
# 57 "/usr/include/xlocale/_time.h" 3 4
#endif /* _XLOCALE_H_ */
# 58 "/usr/include/xlocale/_time.h" 3 4
# 180 "/usr/include/time.h" 2 3 4
#endif
# 181 "/usr/include/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2011 || \
(defined(__cplusplus) && __cplusplus >= 201703)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 184 "/usr/include/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_timespec.h>
#endif /* expanded by -frewrite-includes */
# 184 "/usr/include/time.h" 3 4
# 185 "/usr/include/time.h" 3 4
/* ISO/IEC 9899:2011 7.27.2.5 The timespec_get function */
#define TIME_UTC 1 /* time elapsed since epoch */
int timespec_get(struct timespec *ts, int base);
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE || __ISO_C_VISIBLE >= 2023
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 189 "/usr/include/time.h" 3 4
/* ISO/IEC 9899:2024 7.29.1 Components of time */
#define TIME_MONOTONIC 2 /* monotonic time */
/* ISO/IEC 9899:2024 7.29.2.7 The timespec_getres function */
int timespec_getres(struct timespec *, int);
#endif
# 194 "/usr/include/time.h" 3 4
#endif
# 195 "/usr/include/time.h" 3 4
__END_DECLS
#endif /* !_TIME_H_ */
# 199 "/usr/include/time.h" 3 4
# 614 "/usr/include/sys/time.h" 2 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 615 "/usr/include/sys/time.h" 3 4
# 616 "/usr/include/sys/time.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/select.h>
#endif /* expanded by -frewrite-includes */
# 616 "/usr/include/sys/time.h" 3 4
# 617 "/usr/include/sys/time.h" 3 4
__BEGIN_DECLS
int setitimer(int, const struct itimerval *, struct itimerval *);
int utimes(const char *, const struct timeval *);
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 623 "/usr/include/sys/time.h" 3 4
int adjtime(const struct timeval *, struct timeval *);
int clock_getcpuclockid2(id_t, int, clockid_t *);
int futimes(int, const struct timeval *);
int futimesat(int, const char *, const struct timeval [2]);
int lutimes(const char *, const struct timeval *);
int settimeofday(const struct timeval *, const struct timezone *);
#endif
# 630 "/usr/include/sys/time.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 632 "/usr/include/sys/time.h" 3 4
int getitimer(int, struct itimerval *);
int gettimeofday(struct timeval *, struct timezone *);
#endif
# 635 "/usr/include/sys/time.h" 3 4
__END_DECLS
#endif /* !_KERNEL */
# 639 "/usr/include/sys/time.h" 3 4
#endif /* !_SYS_TIME_H_ */
# 641 "/usr/include/sys/time.h" 3 4
# 203 "./Include/pyport.h" 2
#endif
# 204 "./Include/pyport.h"
#if 0 /* expanded by -frewrite-includes */
#include <time.h>
#endif /* expanded by -frewrite-includes */
# 204 "./Include/pyport.h"
# 205 "./Include/pyport.h"
/******************************
* WRAPPER FOR <sys/select.h> *
******************************/
/* NB caller must include <sys/types.h> */
#ifdef HAVE_SYS_SELECT_H
#if 0 /* expanded by -frewrite-includes */
#include <sys/select.h>
#endif /* expanded by -frewrite-includes */
# 213 "./Include/pyport.h"
# 214 "./Include/pyport.h"
#endif /* !HAVE_SYS_SELECT_H */
# 215 "./Include/pyport.h"
/*******************************
* stat() and fstat() fiddling *
*******************************/
#ifdef HAVE_SYS_STAT_H
#if 0 /* expanded by -frewrite-includes */
#include <sys/stat.h>
#endif /* expanded by -frewrite-includes */
# 221 "./Include/pyport.h"
# 1 "/usr/include/sys/stat.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1982, 1986, 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)stat.h 8.12 (Berkeley) 6/16/95
*/
#ifndef _SYS_STAT_H_
#define _SYS_STAT_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 42 "/usr/include/sys/stat.h" 3 4
# 43 "/usr/include/sys/stat.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_timespec.h>
#endif /* expanded by -frewrite-includes */
# 43 "/usr/include/sys/stat.h" 3 4
# 44 "/usr/include/sys/stat.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 44 "/usr/include/sys/stat.h" 3 4
# 45 "/usr/include/sys/stat.h" 3 4
#ifndef _BLKSIZE_T_DECLARED
typedef __blksize_t blksize_t;
#define _BLKSIZE_T_DECLARED
#endif
# 50 "/usr/include/sys/stat.h" 3 4
#ifndef _BLKCNT_T_DECLARED
typedef __blkcnt_t blkcnt_t;
#define _BLKCNT_T_DECLARED
#endif
# 55 "/usr/include/sys/stat.h" 3 4
#ifndef _DEV_T_DECLARED
typedef __dev_t dev_t;
#define _DEV_T_DECLARED
#endif
# 60 "/usr/include/sys/stat.h" 3 4
#ifndef _FFLAGS_T_DECLARED
typedef __fflags_t fflags_t;
#define _FFLAGS_T_DECLARED
#endif
# 65 "/usr/include/sys/stat.h" 3 4
#ifndef _GID_T_DECLARED
typedef __gid_t gid_t;
#define _GID_T_DECLARED
#endif
# 70 "/usr/include/sys/stat.h" 3 4
#ifndef _INO_T_DECLARED
typedef __ino_t ino_t;
#define _INO_T_DECLARED
#endif
# 75 "/usr/include/sys/stat.h" 3 4
#ifndef _MODE_T_DECLARED
typedef __mode_t mode_t;
#define _MODE_T_DECLARED
#endif
# 80 "/usr/include/sys/stat.h" 3 4
#ifndef _NLINK_T_DECLARED
typedef __nlink_t nlink_t;
#define _NLINK_T_DECLARED
#endif
# 85 "/usr/include/sys/stat.h" 3 4
#ifndef _OFF_T_DECLARED
typedef __off_t off_t;
#define _OFF_T_DECLARED
#endif
# 90 "/usr/include/sys/stat.h" 3 4
#ifndef _UID_T_DECLARED
typedef __uid_t uid_t;
#define _UID_T_DECLARED
#endif
# 95 "/usr/include/sys/stat.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if !defined(_KERNEL) && __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 97 "/usr/include/sys/stat.h" 3 4
/*
* XXX We get miscellaneous namespace pollution with this.
*/
#if 0 /* expanded by -frewrite-includes */
#include <sys/time.h>
#endif /* expanded by -frewrite-includes */
# 100 "/usr/include/sys/stat.h" 3 4
# 101 "/usr/include/sys/stat.h" 3 4
#endif
# 102 "/usr/include/sys/stat.h" 3 4
#ifdef _KERNEL
struct ostat {
__uint16_t st_dev; /* inode's device */
__uint32_t st_ino; /* inode's number */
mode_t st_mode; /* inode protection mode */
__uint16_t st_nlink; /* number of hard links */
__uint16_t st_uid; /* user ID of the file's owner */
__uint16_t st_gid; /* group ID of the file's group */
__uint16_t st_rdev; /* device type */
__int32_t st_size; /* file size, in bytes */
struct timespec st_atim; /* time of last access */
struct timespec st_mtim; /* time of last data modification */
struct timespec st_ctim; /* time of last file status change */
__int32_t st_blksize; /* optimal blocksize for I/O */
__int32_t st_blocks; /* blocks allocated for file */
fflags_t st_flags; /* user defined flags for file */
__uint32_t st_gen; /* file generation number */
};
#endif
# 122 "/usr/include/sys/stat.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if defined(_WANT_FREEBSD11_STAT) || defined(_KERNEL)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 124 "/usr/include/sys/stat.h" 3 4
struct freebsd11_stat {
__uint32_t st_dev; /* inode's device */
__uint32_t st_ino; /* inode's number */
mode_t st_mode; /* inode protection mode */
__uint16_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of the file's owner */
gid_t st_gid; /* group ID of the file's group */
__uint32_t st_rdev; /* device type */
struct timespec st_atim; /* time of last access */
struct timespec st_mtim; /* time of last data modification */
struct timespec st_ctim; /* time of last file status change */
off_t st_size; /* file size, in bytes */
blkcnt_t st_blocks; /* blocks allocated for file */
blksize_t st_blksize; /* optimal blocksize for I/O */
fflags_t st_flags; /* user defined flags for file */
__uint32_t st_gen; /* file generation number */
__int32_t st_lspare;
struct timespec st_birthtim; /* time of file creation */
/*
* Explicitly pad st_birthtim to 16 bytes so that the size of
* struct stat is backwards compatible. We use bitfields instead
* of an array of chars so that this doesn't require a C99 compiler
* to compile if the size of the padding is 0. We use 2 bitfields
* to cover up to 64 bits on 32-bit machines. We assume that
* CHAR_BIT is 8...
*/
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));
};
#endif /* _WANT_FREEBSD11_STAT || _KERNEL */
# 154 "/usr/include/sys/stat.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if defined(__i386__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 156 "/usr/include/sys/stat.h" 3 4
#define __STAT_TIME_T_EXT 1
#endif
# 158 "/usr/include/sys/stat.h" 3 4
struct stat {
dev_t st_dev; /* inode's device */
ino_t st_ino; /* inode's number */
nlink_t st_nlink; /* number of hard links */
mode_t st_mode; /* inode protection mode */
__int16_t st_padding0;
uid_t st_uid; /* user ID of the file's owner */
gid_t st_gid; /* group ID of the file's group */
__int32_t st_padding1;
dev_t st_rdev; /* device type */
#ifdef __STAT_TIME_T_EXT
__int32_t st_atim_ext;
#endif
# 172 "/usr/include/sys/stat.h" 3 4
struct timespec st_atim; /* time of last access */
#ifdef __STAT_TIME_T_EXT
__int32_t st_mtim_ext;
#endif
# 176 "/usr/include/sys/stat.h" 3 4
struct timespec st_mtim; /* time of last data modification */
#ifdef __STAT_TIME_T_EXT
__int32_t st_ctim_ext;
#endif
# 180 "/usr/include/sys/stat.h" 3 4
struct timespec st_ctim; /* time of last file status change */
#ifdef __STAT_TIME_T_EXT
__int32_t st_btim_ext;
#endif
# 184 "/usr/include/sys/stat.h" 3 4
struct timespec st_birthtim; /* time of file creation */
off_t st_size; /* file size, in bytes */
blkcnt_t st_blocks; /* blocks allocated for file */
blksize_t st_blksize; /* optimal blocksize for I/O */
fflags_t st_flags; /* user defined flags for file */
__uint64_t st_gen; /* file generation number */
__uint64_t st_spare[10];
};
#ifdef _KERNEL
struct nstat {
__uint32_t st_dev; /* inode's device */
__uint32_t st_ino; /* inode's number */
__uint32_t st_mode; /* inode protection mode */
__uint32_t st_nlink; /* number of hard links */
uid_t st_uid; /* user ID of the file's owner */
gid_t st_gid; /* group ID of the file's group */
__uint32_t st_rdev; /* device type */
struct timespec st_atim; /* time of last access */
struct timespec st_mtim; /* time of last data modification */
struct timespec st_ctim; /* time of last file status change */
off_t st_size; /* file size, in bytes */
blkcnt_t st_blocks; /* blocks allocated for file */
blksize_t st_blksize; /* optimal blocksize for I/O */
fflags_t st_flags; /* user defined flags for file */
__uint32_t st_gen; /* file generation number */
struct timespec st_birthtim; /* time of file creation */
/*
* See comment in the definition of struct freebsd11_stat
* above about the following padding.
*/
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));
unsigned int :(8 / 2) * (16 - (int)sizeof(struct timespec));
};
#endif
# 219 "/usr/include/sys/stat.h" 3 4
#ifndef _KERNEL
#define st_atime st_atim.tv_sec
#define st_mtime st_mtim.tv_sec
#define st_ctime st_ctim.tv_sec
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 225 "/usr/include/sys/stat.h" 3 4
#define st_birthtime st_birthtim.tv_sec
#define st_atimensec st_atim.tv_nsec
#define st_mtimensec st_mtim.tv_nsec
#define st_ctimensec st_ctim.tv_nsec
#define st_birthtimensec st_birthtim.tv_nsec
#endif
# 231 "/usr/include/sys/stat.h" 3 4
/* For compatibility. */
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 234 "/usr/include/sys/stat.h" 3 4
#define st_atimespec st_atim
#define st_mtimespec st_mtim
#define st_ctimespec st_ctim
#define st_birthtimespec st_birthtim
#endif
# 239 "/usr/include/sys/stat.h" 3 4
#endif /* !_KERNEL */
# 240 "/usr/include/sys/stat.h" 3 4
#define S_ISUID 0004000 /* set user id on execution */
#define S_ISGID 0002000 /* set group id on execution */
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 244 "/usr/include/sys/stat.h" 3 4
#define S_ISTXT 0001000 /* sticky bit */
#endif
# 246 "/usr/include/sys/stat.h" 3 4
#define S_IRWXU 0000700 /* RWX mask for owner */
#define S_IRUSR 0000400 /* R for owner */
#define S_IWUSR 0000200 /* W for owner */
#define S_IXUSR 0000100 /* X for owner */
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 253 "/usr/include/sys/stat.h" 3 4
#define S_IREAD S_IRUSR
#define S_IWRITE S_IWUSR
#define S_IEXEC S_IXUSR
#endif
# 257 "/usr/include/sys/stat.h" 3 4
#define S_IRWXG 0000070 /* RWX mask for group */
#define S_IRGRP 0000040 /* R for group */
#define S_IWGRP 0000020 /* W for group */
#define S_IXGRP 0000010 /* X for group */
#define S_IRWXO 0000007 /* RWX mask for other */
#define S_IROTH 0000004 /* R for other */
#define S_IWOTH 0000002 /* W for other */
#define S_IXOTH 0000001 /* X for other */
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 269 "/usr/include/sys/stat.h" 3 4
#define S_IFMT 0170000 /* type of file mask */
#define S_IFIFO 0010000 /* named pipe (fifo) */
#define S_IFCHR 0020000 /* character special */
#define S_IFDIR 0040000 /* directory */
#define S_IFBLK 0060000 /* block special */
#define S_IFREG 0100000 /* regular */
#define S_IFLNK 0120000 /* symbolic link */
#define S_IFSOCK 0140000 /* socket */
#define S_ISVTX 0001000 /* save swapped text even after use */
#endif
# 279 "/usr/include/sys/stat.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 280 "/usr/include/sys/stat.h" 3 4
#define S_IFWHT 0160000 /* whiteout */
#endif
# 282 "/usr/include/sys/stat.h" 3 4
#define S_ISDIR(m) (((m) & 0170000) == 0040000) /* directory */
#define S_ISCHR(m) (((m) & 0170000) == 0020000) /* char special */
#define S_ISBLK(m) (((m) & 0170000) == 0060000) /* block special */
#define S_ISREG(m) (((m) & 0170000) == 0100000) /* regular file */
#define S_ISFIFO(m) (((m) & 0170000) == 0010000) /* fifo or socket */
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 289 "/usr/include/sys/stat.h" 3 4
#define S_ISLNK(m) (((m) & 0170000) == 0120000) /* symbolic link */
#define S_ISSOCK(m) (((m) & 0170000) == 0140000) /* socket */
#endif
# 292 "/usr/include/sys/stat.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 293 "/usr/include/sys/stat.h" 3 4
#define S_ISWHT(m) (((m) & 0170000) == 0160000) /* whiteout */
#endif
# 295 "/usr/include/sys/stat.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 297 "/usr/include/sys/stat.h" 3 4
#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
/* 7777 */
#define ALLPERMS (S_ISUID|S_ISGID|S_ISTXT|S_IRWXU|S_IRWXG|S_IRWXO)
/* 0666 */
#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
#define S_BLKSIZE 512 /* block size used in the stat struct */
/*
* Definitions of flags stored in file flags word.
*
* Super-user and owner changeable flags.
*/
#define UF_SETTABLE 0x0000ffff /* mask of owner changeable flags */
#define UF_NODUMP 0x00000001 /* do not dump file */
#define UF_IMMUTABLE 0x00000002 /* file may not be changed */
#define UF_APPEND 0x00000004 /* writes to file may only append */
#define UF_OPAQUE 0x00000008 /* directory is opaque wrt. union */
#define UF_NOUNLINK 0x00000010 /* file may not be removed or renamed */
/*
* These two bits are defined in MacOS X. They are not currently used in
* FreeBSD.
*/
#if 0 /* disabled by -frewrite-includes */
#if 0
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 321 "/usr/include/sys/stat.h" 3 4
#define UF_COMPRESSED 0x00000020 /* file is compressed */
#define UF_TRACKED 0x00000040 /* renames and deletes are tracked */
#endif
# 324 "/usr/include/sys/stat.h" 3 4
#define UF_SYSTEM 0x00000080 /* Windows system file bit */
#define UF_SPARSE 0x00000100 /* sparse file */
#define UF_OFFLINE 0x00000200 /* file is offline */
#define UF_REPARSE 0x00000400 /* Windows reparse point file bit */
#define UF_ARCHIVE 0x00000800 /* file needs to be archived */
#define UF_READONLY 0x00001000 /* Windows readonly file bit */
/* This is the same as the MacOS X definition of UF_HIDDEN. */
#define UF_HIDDEN 0x00008000 /* file is hidden */
/*
* Super-user changeable flags.
*/
#define SF_SETTABLE 0xffff0000 /* mask of superuser changeable flags */
#define SF_ARCHIVED 0x00010000 /* file is archived */
#define SF_IMMUTABLE 0x00020000 /* file may not be changed */
#define SF_APPEND 0x00040000 /* writes to file may only append */
#define SF_NOUNLINK 0x00100000 /* file may not be removed or renamed */
#define SF_SNAPSHOT 0x00200000 /* snapshot inode */
#ifdef _KERNEL
/*
* Shorthand abbreviations of above.
*/
#define OPAQUE (UF_OPAQUE)
#define APPEND (UF_APPEND | SF_APPEND)
#define IMMUTABLE (UF_IMMUTABLE | SF_IMMUTABLE)
#define NOUNLINK (UF_NOUNLINK | SF_NOUNLINK)
#endif
# 353 "/usr/include/sys/stat.h" 3 4
#endif /* __BSD_VISIBLE */
# 355 "/usr/include/sys/stat.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 357 "/usr/include/sys/stat.h" 3 4
#define UTIME_NOW -1
#define UTIME_OMIT -2
#endif
# 360 "/usr/include/sys/stat.h" 3 4
#ifndef _KERNEL
__BEGIN_DECLS
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 364 "/usr/include/sys/stat.h" 3 4
int chflags(const char *, unsigned long);
int chflagsat(int, const char *, unsigned long, int);
#endif
# 367 "/usr/include/sys/stat.h" 3 4
int chmod(const char *, mode_t);
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 369 "/usr/include/sys/stat.h" 3 4
int fchflags(int, unsigned long);
#endif
# 371 "/usr/include/sys/stat.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 372 "/usr/include/sys/stat.h" 3 4
int fchmod(int, mode_t);
#endif
# 374 "/usr/include/sys/stat.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 375 "/usr/include/sys/stat.h" 3 4
int fchmodat(int, const char *, mode_t, int);
int futimens(int fd, const struct timespec times[2]);
int utimensat(int fd, const char *path, const struct timespec times[2],
int flag);
#endif
# 380 "/usr/include/sys/stat.h" 3 4
int fstat(int, struct stat *);
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 382 "/usr/include/sys/stat.h" 3 4
int lchflags(const char *, unsigned long);
int lchmod(const char *, mode_t);
#endif
# 385 "/usr/include/sys/stat.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200112
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 386 "/usr/include/sys/stat.h" 3 4
int lstat(const char * __restrict, struct stat * __restrict);
#endif
# 388 "/usr/include/sys/stat.h" 3 4
int mkdir(const char *, mode_t);
int mkfifo(const char *, mode_t);
#if 0 /* disabled by -frewrite-includes */
#if !defined(_MKNOD_DECLARED) && __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 391 "/usr/include/sys/stat.h" 3 4
int mknod(const char *, mode_t, dev_t);
#define _MKNOD_DECLARED
#endif
# 394 "/usr/include/sys/stat.h" 3 4
int stat(const char * __restrict, struct stat * __restrict);
mode_t umask(mode_t);
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 397 "/usr/include/sys/stat.h" 3 4
int fstatat(int, const char *, struct stat *, int);
int mkdirat(int, const char *, mode_t);
int mkfifoat(int, const char *, mode_t);
#endif
# 401 "/usr/include/sys/stat.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE >= 700
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 402 "/usr/include/sys/stat.h" 3 4
int mknodat(int, const char *, mode_t, dev_t);
#endif
# 404 "/usr/include/sys/stat.h" 3 4
__END_DECLS
#endif /* !_KERNEL */
# 406 "/usr/include/sys/stat.h" 3 4
#endif /* !_SYS_STAT_H_ */
# 408 "/usr/include/sys/stat.h" 3 4
# 222 "./Include/pyport.h" 2
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(HAVE_STAT_H)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 223 "./Include/pyport.h"
#if 0 /* expanded by -frewrite-includes */
#include <stat.h>
#endif /* expanded by -frewrite-includes */
# 223 "./Include/pyport.h"
# 224 "./Include/pyport.h"
#endif
# 225 "./Include/pyport.h"
#ifndef S_IFMT
/* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */
#define S_IFMT 0170000
#endif
# 230 "./Include/pyport.h"
#ifndef S_IFLNK
/* Windows doesn't define S_IFLNK but posixmodule.c maps
* IO_REPARSE_TAG_SYMLINK to S_IFLNK */
# define S_IFLNK 0120000
#endif
# 236 "./Include/pyport.h"
#ifndef S_ISREG
#define S_ISREG(x) (((x) & S_IFMT) == S_IFREG)
#endif
# 240 "./Include/pyport.h"
#ifndef S_ISDIR
#define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
#endif
# 244 "./Include/pyport.h"
#ifndef S_ISCHR
#define S_ISCHR(x) (((x) & S_IFMT) == S_IFCHR)
#endif
# 248 "./Include/pyport.h"
#ifndef S_ISLNK
#define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK)
#endif
# 252 "./Include/pyport.h"
#ifdef __cplusplus
/* Move this down here since some C++ #include's don't like to be included
inside an extern "C" */
extern "C" {
#endif
# 258 "./Include/pyport.h"
/* Py_ARITHMETIC_RIGHT_SHIFT
* C doesn't define whether a right-shift of a signed integer sign-extends
* or zero-fills. Here a macro to force sign extension:
* Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J)
* Return I >> J, forcing sign extension. Arithmetically, return the
* floor of I/2**J.
* Requirements:
* I should have signed integer type. In the terminology of C99, this can
* be either one of the five standard signed integer types (signed char,
* short, int, long, long long) or an extended signed integer type.
* J is an integer >= 0 and strictly less than the number of bits in the
* type of I (because C doesn't define what happens for J outside that
* range either).
* TYPE used to specify the type of I, but is now ignored. It's been left
* in for backwards compatibility with versions <= 2.6 or 3.0.
* Caution:
* I may be evaluated more than once.
*/
#ifdef SIGNED_RIGHT_SHIFT_ZERO_FILLS
#define Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) \
((I) < 0 ? -1-((-1-(I)) >> (J)) : (I) >> (J))
#else
# 282 "./Include/pyport.h"
#define Py_ARITHMETIC_RIGHT_SHIFT(TYPE, I, J) ((I) >> (J))
#endif
# 284 "./Include/pyport.h"
/* Py_FORCE_EXPANSION(X)
* "Simply" returns its argument. However, macro expansions within the
* argument are evaluated. This unfortunate trickery is needed to get
* token-pasting to work as desired in some cases.
*/
#define Py_FORCE_EXPANSION(X) X
/* Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW)
* Cast VALUE to type NARROW from type WIDE. In Py_DEBUG mode, this
* assert-fails if any information is lost.
* Caution:
* VALUE may be evaluated more than once.
*/
#ifdef Py_DEBUG
# define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) \
(assert(_Py_STATIC_CAST(WIDE, _Py_STATIC_CAST(NARROW, (VALUE))) == (VALUE)), \
_Py_STATIC_CAST(NARROW, (VALUE)))
#else
# 303 "./Include/pyport.h"
# define Py_SAFE_DOWNCAST(VALUE, WIDE, NARROW) _Py_STATIC_CAST(NARROW, (VALUE))
#endif
# 305 "./Include/pyport.h"
/* Py_DEPRECATED(version)
* Declare a variable, type, or function deprecated.
* The macro must be placed before the declaration.
* Usage:
* Py_DEPRECATED(3.3) extern int old_var;
* Py_DEPRECATED(3.4) typedef int T1;
* Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__) \
&& ((__GNUC__ >= 4) || (__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 317 "./Include/pyport.h"
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(_MSC_VER)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 319 "./Include/pyport.h"
#define Py_DEPRECATED(VERSION) __declspec(deprecated( \
"deprecated in " #VERSION))
#else
# 322 "./Include/pyport.h"
#define Py_DEPRECATED(VERSION_UNUSED)
#endif
# 324 "./Include/pyport.h"
// _Py_DEPRECATED_EXTERNALLY(version)
// Deprecated outside CPython core.
#ifdef Py_BUILD_CORE
#define _Py_DEPRECATED_EXTERNALLY(VERSION_UNUSED)
#else
# 330 "./Include/pyport.h"
#define _Py_DEPRECATED_EXTERNALLY(version) Py_DEPRECATED(version)
#endif
# 332 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
#if defined(__clang__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 335 "./Include/pyport.h"
#define _Py_COMP_DIAG_PUSH _Pragma("clang diagnostic push")
#define _Py_COMP_DIAG_IGNORE_DEPR_DECLS \
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"")
#define _Py_COMP_DIAG_POP _Pragma("clang diagnostic pop")
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(__GNUC__) \
&& ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 341 "./Include/pyport.h"
#define _Py_COMP_DIAG_PUSH _Pragma("GCC diagnostic push")
#define _Py_COMP_DIAG_IGNORE_DEPR_DECLS \
_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")
#define _Py_COMP_DIAG_POP _Pragma("GCC diagnostic pop")
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(_MSC_VER)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 346 "./Include/pyport.h"
#define _Py_COMP_DIAG_PUSH __pragma(warning(push))
#define _Py_COMP_DIAG_IGNORE_DEPR_DECLS __pragma(warning(disable: 4996))
#define _Py_COMP_DIAG_POP __pragma(warning(pop))
#else
# 350 "./Include/pyport.h"
#define _Py_COMP_DIAG_PUSH
#define _Py_COMP_DIAG_IGNORE_DEPR_DECLS
#define _Py_COMP_DIAG_POP
#endif
# 354 "./Include/pyport.h"
/* _Py_HOT_FUNCTION
* The hot attribute on a function is used to inform the compiler that the
* function is a hot spot of the compiled program. The function is optimized
* more aggressively and on many target it is placed into special subsection of
* the text section so all hot functions appears close together improving
* locality.
*
* Usage:
* int _Py_HOT_FUNCTION x(void) { return 3; }
*
* Issue #28618: This attribute must not be abused, otherwise it can have a
* negative effect on performance. Only the functions were Python spend most of
* its time must use it. Use a profiler when running performance benchmark
* suite to find these functions.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__) \
&& ((__GNUC__ >= 5) || (__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 372 "./Include/pyport.h"
#define _Py_HOT_FUNCTION __attribute__((hot))
#else
# 374 "./Include/pyport.h"
#define _Py_HOT_FUNCTION
#endif
# 376 "./Include/pyport.h"
// Ask the compiler to always inline a static inline function. The compiler can
// ignore it and decides to not inline the function.
//
// It can be used to inline performance critical static inline functions when
// building Python in debug mode with function inlining disabled. For example,
// MSC disables function inlining when building in debug mode.
//
// Marking blindly a static inline function with Py_ALWAYS_INLINE can result in
// worse performances (due to increased code size for example). The compiler is
// usually smarter than the developer for the cost/benefit analysis.
//
// If Python is built in debug mode (if the Py_DEBUG macro is defined), the
// Py_ALWAYS_INLINE macro does nothing.
//
// It must be specified before the function return type. Usage:
//
// static inline Py_ALWAYS_INLINE int random(void) { return 4; }
#if 0 /* disabled by -frewrite-includes */
#if defined(Py_DEBUG)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 395 "./Include/pyport.h"
// If Python is built in debug mode, usually compiler optimizations are
// disabled. In this case, Py_ALWAYS_INLINE can increase a lot the stack
// memory usage. For example, forcing inlining using gcc -O0 increases the
// stack usage from 6 KB to 15 KB per Python function call.
# define Py_ALWAYS_INLINE
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
#endif
#endif /* disabled by -frewrite-includes */
#elif 1 /* evaluated by -frewrite-includes */
# 401 "./Include/pyport.h"
# define Py_ALWAYS_INLINE __attribute__((always_inline))
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(_MSC_VER)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 403 "./Include/pyport.h"
# define Py_ALWAYS_INLINE __forceinline
#else
# 405 "./Include/pyport.h"
# define Py_ALWAYS_INLINE
#endif
# 407 "./Include/pyport.h"
// Py_NO_INLINE
// Disable inlining on a function. For example, it reduces the C stack
// consumption: useful on LTO+PGO builds which heavily inline code (see
// bpo-33720).
//
// Usage:
//
// Py_NO_INLINE static int random(void) { return 4; }
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 417 "./Include/pyport.h"
# define Py_NO_INLINE __attribute__ ((noinline))
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(_MSC_VER)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 419 "./Include/pyport.h"
# define Py_NO_INLINE __declspec(noinline)
#else
# 421 "./Include/pyport.h"
# define Py_NO_INLINE
#endif
# 423 "./Include/pyport.h"
/**************************************************************************
Prototypes that are missing from the standard include files on some systems
(and possibly only some versions of such systems.)
Please be conservative with adding new ones, document them and enclose them
in platform-specific #ifdefs.
**************************************************************************/
#ifdef HAVE__GETPTY
#if 0 /* expanded by -frewrite-includes */
#include <sys/types.h> /* we need to import mode_t */
#endif /* expanded by -frewrite-includes */
# 433 "./Include/pyport.h"
# 434 "./Include/pyport.h"
extern char * _getpty(int *, int, mode_t, int);
#endif
# 436 "./Include/pyport.h"
/* On QNX 6, struct termio must be declared by including sys/termio.h
if TCGETA, TCSETA, TCSETAW, or TCSETAF are used. sys/termio.h must
be included before termios.h or it will generate an error. */
#if 0 /* disabled by -frewrite-includes */
#if defined(HAVE_SYS_TERMIO_H) && !defined(__hpux)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 441 "./Include/pyport.h"
#if 0 /* expanded by -frewrite-includes */
#include <sys/termio.h>
#endif /* expanded by -frewrite-includes */
# 441 "./Include/pyport.h"
# 442 "./Include/pyport.h"
#endif
# 443 "./Include/pyport.h"
/* On 4.4BSD-descendants, ctype functions serves the whole range of
* wchar_t character set rather than single byte code points only.
* This characteristic can break some operations of string object
* including str.upper() and str.split() on UTF-8 locales. This
* workaround was provided by Tim Robbins of FreeBSD project.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__APPLE__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 453 "./Include/pyport.h"
# define _PY_PORT_CTYPE_UTF8_ISSUE
#endif
# 455 "./Include/pyport.h"
#ifdef _PY_PORT_CTYPE_UTF8_ISSUE
#ifndef __cplusplus
/* The workaround below is unsafe in C++ because
* the <locale> defines these symbols as real functions,
* with a slightly different signature.
* See issue #10910
*/
#if 0 /* expanded by -frewrite-includes */
#include <ctype.h>
#endif /* expanded by -frewrite-includes */
# 463 "./Include/pyport.h"
# 464 "./Include/pyport.h"
#if 0 /* expanded by -frewrite-includes */
#include <wctype.h>
#endif /* expanded by -frewrite-includes */
# 464 "./Include/pyport.h"
# 465 "./Include/pyport.h"
#undef isalnum
#define isalnum(c) iswalnum(btowc(c))
#undef isalpha
#define isalpha(c) iswalpha(btowc(c))
#undef islower
#define islower(c) iswlower(btowc(c))
#undef isspace
#define isspace(c) iswspace(btowc(c))
#undef isupper
#define isupper(c) iswupper(btowc(c))
#undef tolower
#define tolower(c) towlower(btowc(c))
#undef toupper
#define toupper(c) towupper(btowc(c))
#endif
# 480 "./Include/pyport.h"
#endif
# 481 "./Include/pyport.h"
/* Declarations for symbol visibility.
PyAPI_FUNC(type): Declares a public Python API function and return type
PyAPI_DATA(type): Declares public Python data and its type
PyMODINIT_FUNC: A Python module init function. If these functions are
inside the Python core, they are private to the core.
If in an extension module, it may be declared with
external linkage depending on the platform.
As a number of platforms support/require "__declspec(dllimport/dllexport)",
we support a HAVE_DECLSPEC_DLL macro to save duplication.
*/
/*
All windows ports, except cygwin, are handled in PC/pyconfig.h.
Cygwin is the only other autoconf platform requiring special
linkage handling and it uses __declspec().
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__CYGWIN__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 503 "./Include/pyport.h"
# define HAVE_DECLSPEC_DLL
#endif
# 505 "./Include/pyport.h"
#if 0 /* expanded by -frewrite-includes */
#include "exports.h"
#endif /* expanded by -frewrite-includes */
# 506 "./Include/pyport.h"
# 1 "./Include/exports.h" 1
#ifndef Py_EXPORTS_H
#define Py_EXPORTS_H
#if 0 /* disabled by -frewrite-includes */
#if defined(_WIN32) || defined(__CYGWIN__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 5 "./Include/exports.h"
#if 0 /* disabled by -frewrite-includes */
#if defined(Py_ENABLE_SHARED)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 6 "./Include/exports.h"
#define Py_IMPORTED_SYMBOL __declspec(dllimport)
#define Py_EXPORTED_SYMBOL __declspec(dllexport)
#define Py_LOCAL_SYMBOL
#else
# 10 "./Include/exports.h"
#define Py_IMPORTED_SYMBOL
#define Py_EXPORTED_SYMBOL
#define Py_LOCAL_SYMBOL
#endif
# 14 "./Include/exports.h"
#else
# 15 "./Include/exports.h"
/*
* If we only ever used gcc >= 5, we could use __has_attribute(visibility)
* as a cross-platform way to determine if visibility is supported. However,
* we may still need to support gcc >= 4, as some Ubuntu LTS and Centos versions
* have 4 < gcc < 5.
*/
#ifndef __has_attribute
#define __has_attribute(x) 0 // Compatibility with non-clang compilers.
#endif
# 24 "./Include/exports.h"
#if 0 /* disabled by -frewrite-includes */
#if (defined(__GNUC__) && (__GNUC__ >= 4)) ||\
(defined(__clang__) && __has_attribute(visibility))
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 26 "./Include/exports.h"
#define Py_IMPORTED_SYMBOL __attribute__ ((visibility ("default")))
#define Py_EXPORTED_SYMBOL __attribute__ ((visibility ("default")))
#define Py_LOCAL_SYMBOL __attribute__ ((visibility ("hidden")))
#else
# 30 "./Include/exports.h"
#define Py_IMPORTED_SYMBOL
#define Py_EXPORTED_SYMBOL
#define Py_LOCAL_SYMBOL
#endif
# 34 "./Include/exports.h"
#endif
# 35 "./Include/exports.h"
#endif /* Py_EXPORTS_H */
# 37 "./Include/exports.h"
# 507 "./Include/pyport.h" 2
/* only get special linkage if built as shared or platform is Cygwin */
#if 0 /* disabled by -frewrite-includes */
#if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 510 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
# if defined(HAVE_DECLSPEC_DLL)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 511 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
# if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 512 "./Include/pyport.h"
# define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE
# define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE
/* module init functions inside the core need no external linkage */
/* except for Cygwin to handle embedding */
#if 0 /* disabled by -frewrite-includes */
# if defined(__CYGWIN__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 517 "./Include/pyport.h"
# define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
# else /* __CYGWIN__ */
# 519 "./Include/pyport.h"
# define PyMODINIT_FUNC PyObject*
# endif /* __CYGWIN__ */
# 521 "./Include/pyport.h"
# else /* Py_BUILD_CORE */
# 522 "./Include/pyport.h"
/* Building an extension module, or an embedded situation */
/* public Python functions and data are imported */
/* Under Cygwin, auto-import functions to prevent compilation */
/* failures similar to those described at the bottom of 4.1: */
/* http://docs.python.org/extending/windows.html#a-cookbook-approach */
#if 0 /* disabled by -frewrite-includes */
# if !defined(__CYGWIN__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 528 "./Include/pyport.h"
# define PyAPI_FUNC(RTYPE) Py_IMPORTED_SYMBOL RTYPE
# endif /* !__CYGWIN__ */
# 530 "./Include/pyport.h"
# define PyAPI_DATA(RTYPE) extern Py_IMPORTED_SYMBOL RTYPE
/* module init functions outside the core must be exported */
#if 0 /* disabled by -frewrite-includes */
# if defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 533 "./Include/pyport.h"
# define PyMODINIT_FUNC extern "C" Py_EXPORTED_SYMBOL PyObject*
# else /* __cplusplus */
# 535 "./Include/pyport.h"
# define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
# endif /* __cplusplus */
# 537 "./Include/pyport.h"
# endif /* Py_BUILD_CORE */
# 538 "./Include/pyport.h"
# endif /* HAVE_DECLSPEC_DLL */
# 539 "./Include/pyport.h"
#endif /* Py_ENABLE_SHARED */
# 540 "./Include/pyport.h"
/* If no external linkage macros defined by now, create defaults */
#ifndef PyAPI_FUNC
# define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE
#endif
# 545 "./Include/pyport.h"
#ifndef PyAPI_DATA
# define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE
#endif
# 548 "./Include/pyport.h"
#ifndef PyMODINIT_FUNC
#if 0 /* disabled by -frewrite-includes */
# if defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 550 "./Include/pyport.h"
# define PyMODINIT_FUNC extern "C" Py_EXPORTED_SYMBOL PyObject*
# else /* __cplusplus */
# 552 "./Include/pyport.h"
# define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject*
# endif /* __cplusplus */
# 554 "./Include/pyport.h"
#endif
# 555 "./Include/pyport.h"
/* limits.h constants that may be missing */
#ifndef INT_MAX
#define INT_MAX 2147483647
#endif
# 561 "./Include/pyport.h"
#ifndef LONG_MAX
#if 0 /* disabled by -frewrite-includes */
#if SIZEOF_LONG == 4
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 564 "./Include/pyport.h"
#define LONG_MAX 0X7FFFFFFFL
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif SIZEOF_LONG == 8
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 566 "./Include/pyport.h"
#define LONG_MAX 0X7FFFFFFFFFFFFFFFL
#else
# 568 "./Include/pyport.h"
#error "could not set LONG_MAX in pyport.h"
#endif
# 570 "./Include/pyport.h"
#endif
# 571 "./Include/pyport.h"
#ifndef LONG_MIN
#define LONG_MIN (-LONG_MAX-1)
#endif
# 575 "./Include/pyport.h"
#ifndef LONG_BIT
#define LONG_BIT (8 * SIZEOF_LONG)
#endif
# 579 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
#if LONG_BIT != 8 * SIZEOF_LONG
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 581 "./Include/pyport.h"
/* 04-Oct-2000 LONG_BIT is apparently (mis)defined as 64 on some recent
* 32-bit platforms using gcc. We try to catch that here at compile-time
* rather than waiting for integer multiplication to trigger bogus
* overflows.
*/
#error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)."
#endif
# 588 "./Include/pyport.h"
#ifdef __cplusplus
}
#endif
# 592 "./Include/pyport.h"
/*
* Hide GCC attributes from compilers that don't support them.
*/
#if 0 /* disabled by -frewrite-includes */
#if (!defined(__GNUC__) || __GNUC__ < 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ < 7) )
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 598 "./Include/pyport.h"
#define Py_GCC_ATTRIBUTE(x)
#else
# 600 "./Include/pyport.h"
#define Py_GCC_ATTRIBUTE(x) __attribute__(x)
#endif
# 602 "./Include/pyport.h"
/*
* Specify alignment on compilers that support it.
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__) && __GNUC__ >= 3
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 607 "./Include/pyport.h"
#define Py_ALIGNED(x) __attribute__((aligned(x)))
#else
# 609 "./Include/pyport.h"
#define Py_ALIGNED(x)
#endif
# 611 "./Include/pyport.h"
/* Eliminate end-of-loop code not reached warnings from SunPro C
* when using do{...}while(0) macros
*/
#ifdef __SUNPRO_C
#pragma error_messages (off,E_END_OF_LOOP_CODE_NOT_REACHED)
#endif
# 618 "./Include/pyport.h"
#ifndef Py_LL
#define Py_LL(x) x##LL
#endif
# 622 "./Include/pyport.h"
#ifndef Py_ULL
#define Py_ULL(x) Py_LL(x##U)
#endif
# 626 "./Include/pyport.h"
#define Py_VA_COPY va_copy
/*
* Convenient macros to deal with endianness of the platform. WORDS_BIGENDIAN is
* detected by configure and defined in pyconfig.h. The code in pyconfig.h
* also takes care of Apple's universal builds.
*/
#ifdef WORDS_BIGENDIAN
# define PY_BIG_ENDIAN 1
# define PY_LITTLE_ENDIAN 0
#else
# 639 "./Include/pyport.h"
# define PY_BIG_ENDIAN 0
# define PY_LITTLE_ENDIAN 1
#endif
# 642 "./Include/pyport.h"
#ifdef __ANDROID__
/* The Android langinfo.h header is not used. */
# undef HAVE_LANGINFO_H
# undef CODESET
#endif
# 648 "./Include/pyport.h"
/* Maximum value of the Windows DWORD type */
#define PY_DWORD_MAX 4294967295U
/* This macro used to tell whether Python was built with multithreading
* enabled. Now multithreading is always enabled, but keep the macro
* for compatibility.
*/
#ifndef WITH_THREAD
# define WITH_THREAD
#endif
# 659 "./Include/pyport.h"
#ifdef WITH_THREAD
# ifdef Py_BUILD_CORE
# ifdef HAVE_THREAD_LOCAL
# error "HAVE_THREAD_LOCAL is already defined"
# endif
# 665 "./Include/pyport.h"
# define HAVE_THREAD_LOCAL 1
# ifdef thread_local
# define _Py_thread_local thread_local
#if 0 /* disabled by -frewrite-includes */
#if 0
# elif __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_THREADS__)
#endif
#endif /* disabled by -frewrite-includes */
#elif 1 /* evaluated by -frewrite-includes */
# 669 "./Include/pyport.h"
# define _Py_thread_local _Thread_local
#if 0 /* disabled by -frewrite-includes */
#if 0
# elif defined(_MSC_VER) /* AKA NT_THREADS */
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 671 "./Include/pyport.h"
# define _Py_thread_local __declspec(thread)
#if 0 /* disabled by -frewrite-includes */
#if 0
# elif defined(__GNUC__) /* includes clang */
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 673 "./Include/pyport.h"
# define _Py_thread_local __thread
# else
# 675 "./Include/pyport.h"
// fall back to the PyThread_tss_*() API, or ignore.
# undef HAVE_THREAD_LOCAL
# endif
# 678 "./Include/pyport.h"
# endif
# 679 "./Include/pyport.h"
#endif
# 680 "./Include/pyport.h"
/* Check that ALT_SOABI is consistent with Py_TRACE_REFS:
./configure --with-trace-refs should must be used to define Py_TRACE_REFS */
#if 0 /* disabled by -frewrite-includes */
#if defined(ALT_SOABI) && defined(Py_TRACE_REFS)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 684 "./Include/pyport.h"
# error "Py_TRACE_REFS ABI is not compatible with release and debug ABI"
#endif
# 686 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
#if defined(__ANDROID__) || defined(__VXWORKS__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 688 "./Include/pyport.h"
// Use UTF-8 as the locale encoding, ignore the LC_CTYPE locale.
// See _Py_GetLocaleEncoding(), PyUnicode_DecodeLocale()
// and PyUnicode_EncodeLocale().
# define _Py_FORCE_UTF8_LOCALE
#endif
# 693 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
#if defined(_Py_FORCE_UTF8_LOCALE) || defined(__APPLE__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 695 "./Include/pyport.h"
// Use UTF-8 as the filesystem encoding.
// See PyUnicode_DecodeFSDefaultAndSize(), PyUnicode_EncodeFSDefault(),
// Py_DecodeLocale() and Py_EncodeLocale().
# define _Py_FORCE_UTF8_FS_ENCODING
#endif
# 700 "./Include/pyport.h"
/* Mark a function which cannot return. Example:
PyAPI_FUNC(void) _Py_NO_RETURN PyThread_exit_thread(void);
XLC support is intentionally omitted due to bpo-40244 */
#ifndef _Py_NO_RETURN
#if 0 /* disabled by -frewrite-includes */
#if defined(__clang__) || \
(defined(__GNUC__) && \
((__GNUC__ >= 3) || \
(__GNUC__ == 2) && (__GNUC_MINOR__ >= 5)))
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 710 "./Include/pyport.h"
# define _Py_NO_RETURN __attribute__((__noreturn__))
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(_MSC_VER)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 712 "./Include/pyport.h"
# define _Py_NO_RETURN __declspec(noreturn)
#else
# 714 "./Include/pyport.h"
# define _Py_NO_RETURN
#endif
# 716 "./Include/pyport.h"
#endif
# 717 "./Include/pyport.h"
// Preprocessor check for a builtin preprocessor function. Always return 0
// if __has_builtin() macro is not defined.
//
// __has_builtin() is available on clang and GCC 10.
#ifdef __has_builtin
# define _Py__has_builtin(x) __has_builtin(x)
#else
# 726 "./Include/pyport.h"
# define _Py__has_builtin(x) 0
#endif
# 728 "./Include/pyport.h"
// _Py_TYPEOF(expr) gets the type of an expression.
//
// Example: _Py_TYPEOF(x) x_copy = (x);
//
// The macro is only defined if GCC or clang compiler is used.
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__) || defined(__clang__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 735 "./Include/pyport.h"
# define _Py_TYPEOF(expr) __typeof__(expr)
#endif
# 737 "./Include/pyport.h"
/* A convenient way for code to know if sanitizers are enabled. */
#if 0 /* disabled by -frewrite-includes */
#if defined(__has_feature)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 741 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
# if __has_feature(memory_sanitizer)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 742 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
# if !defined(_Py_MEMORY_SANITIZER)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 743 "./Include/pyport.h"
# define _Py_MEMORY_SANITIZER
# endif
# 745 "./Include/pyport.h"
# endif
# 746 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
# if __has_feature(address_sanitizer)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 747 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
# if !defined(_Py_ADDRESS_SANITIZER)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 748 "./Include/pyport.h"
# define _Py_ADDRESS_SANITIZER
# endif
# 750 "./Include/pyport.h"
# endif
# 751 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(__GNUC__)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 752 "./Include/pyport.h"
#if 0 /* disabled by -frewrite-includes */
# if defined(__SANITIZE_ADDRESS__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 753 "./Include/pyport.h"
# define _Py_ADDRESS_SANITIZER
# endif
# 755 "./Include/pyport.h"
#endif
# 756 "./Include/pyport.h"
/* AIX has __bool__ redefined in it's system header file. */
#if 0 /* disabled by -frewrite-includes */
#if defined(_AIX) && defined(__bool__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 760 "./Include/pyport.h"
#undef __bool__
#endif
# 762 "./Include/pyport.h"
// Make sure we have maximum alignment, even if the current compiler
// does not support max_align_t. Note that:
// - Autoconf reports alignment of unknown types to 0.
// - 'long double' has maximum alignment on *most* platforms,
// looks like the best we can do for pre-C11 compilers.
// - The value is tested, see test_alignof_max_align_t
#if 0 /* disabled by -frewrite-includes */
#if !defined(ALIGNOF_MAX_ALIGN_T) || ALIGNOF_MAX_ALIGN_T == 0
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 770 "./Include/pyport.h"
# undef ALIGNOF_MAX_ALIGN_T
# define ALIGNOF_MAX_ALIGN_T _Alignof(long double)
#endif
# 773 "./Include/pyport.h"
#endif /* Py_PYPORT_H */
# 775 "./Include/pyport.h"
# 39 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pymacro.h"
#endif /* expanded by -frewrite-includes */
# 39 "./Include/Python.h"
# 1 "./Include/pymacro.h" 1
#ifndef Py_PYMACRO_H
#define Py_PYMACRO_H
// gh-91782: On FreeBSD 12, if the _POSIX_C_SOURCE and _XOPEN_SOURCE macros are
// defined, <sys/cdefs.h> disables C11 support and <assert.h> does not define
// the static_assert() macro.
// https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=255290
//
// macOS <= 10.10 doesn't define static_assert in assert.h at all despite
// having C11 compiler support.
//
// static_assert is defined in glibc from version 2.16. Compiler support for
// the C11 _Static_assert keyword is in gcc >= 4.6.
//
// MSVC makes static_assert a keyword in C11-17, contrary to the standards.
//
// In C++11 and C2x, static_assert is a keyword, redefining is undefined
// behaviour. So only define if building as C (if __STDC_VERSION__ is defined),
// not C++, and only for C11-17.
#if 0 /* disabled by -frewrite-includes */
#if !defined(static_assert) && (defined(__GNUC__) || defined(__clang__)) \
&& defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L \
&& __STDC_VERSION__ <= 201710L
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 23 "./Include/pymacro.h"
# define static_assert _Static_assert
#endif
# 25 "./Include/pymacro.h"
/* Minimum value between x and y */
#define Py_MIN(x, y) (((x) > (y)) ? (y) : (x))
/* Maximum value between x and y */
#define Py_MAX(x, y) (((x) > (y)) ? (x) : (y))
/* Absolute value of the number x */
#define Py_ABS(x) ((x) < 0 ? -(x) : (x))
#define _Py_XSTRINGIFY(x) #x
/* Convert the argument to a string. For example, Py_STRINGIFY(123) is replaced
with "123" by the preprocessor. Defines are also replaced by their value.
For example Py_STRINGIFY(__LINE__) is replaced by the line number, not
by "__LINE__". */
#define Py_STRINGIFY(x) _Py_XSTRINGIFY(x)
/* Get the size of a structure member in bytes */
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
/* Argument must be a char or an int in [-128, 127] or [0, 255]. */
#define Py_CHARMASK(c) ((unsigned char)((c) & 0xff))
/* Assert a build-time dependency, as an expression.
Your compile will fail if the condition isn't true, or can't be evaluated
by the compiler. This can be used in an expression: its value is 0.
Example:
#define foo_to_char(foo) \
((char *)(foo) \
+ Py_BUILD_ASSERT_EXPR(offsetof(struct foo, string) == 0))
Written by Rusty Russell, public domain, http://ccodearchive.net/ */
#define Py_BUILD_ASSERT_EXPR(cond) \
(sizeof(char [1 - 2*!(cond)]) - 1)
#define Py_BUILD_ASSERT(cond) do { \
(void)Py_BUILD_ASSERT_EXPR(cond); \
} while(0)
/* Get the number of elements in a visible array
This does not work on pointers, or arrays declared as [], or function
parameters. With correct compiler support, such usage will cause a build
error (see Py_BUILD_ASSERT_EXPR).
Written by Rusty Russell, public domain, http://ccodearchive.net/
Requires at GCC 3.1+ */
#if 0 /* disabled by -frewrite-includes */
#if (defined(__GNUC__) && !defined(__STRICT_ANSI__) && \
(((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ >= 4)))
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 79 "./Include/pymacro.h"
/* Two gcc extensions.
&a[0] degrades to a pointer: a different type from an array */
#define Py_ARRAY_LENGTH(array) \
(sizeof(array) / sizeof((array)[0]) \
+ Py_BUILD_ASSERT_EXPR(!__builtin_types_compatible_p(typeof(array), \
typeof(&(array)[0]))))
#else
# 86 "./Include/pymacro.h"
#define Py_ARRAY_LENGTH(array) \
(sizeof(array) / sizeof((array)[0]))
#endif
# 89 "./Include/pymacro.h"
/* Define macros for inline documentation. */
#define PyDoc_VAR(name) static const char name[]
#define PyDoc_STRVAR(name,str) PyDoc_VAR(name) = PyDoc_STR(str)
#ifdef WITH_DOC_STRINGS
#define PyDoc_STR(str) str
#else
# 97 "./Include/pymacro.h"
#define PyDoc_STR(str) ""
#endif
# 99 "./Include/pymacro.h"
/* Below "a" is a power of 2. */
/* Round down size "n" to be a multiple of "a". */
#define _Py_SIZE_ROUND_DOWN(n, a) ((size_t)(n) & ~(size_t)((a) - 1))
/* Round up size "n" to be a multiple of "a". */
#define _Py_SIZE_ROUND_UP(n, a) (((size_t)(n) + \
(size_t)((a) - 1)) & ~(size_t)((a) - 1))
/* Round pointer "p" down to the closest "a"-aligned address <= "p". */
#define _Py_ALIGN_DOWN(p, a) ((void *)((uintptr_t)(p) & ~(uintptr_t)((a) - 1)))
/* Round pointer "p" up to the closest "a"-aligned address >= "p". */
#define _Py_ALIGN_UP(p, a) ((void *)(((uintptr_t)(p) + \
(uintptr_t)((a) - 1)) & ~(uintptr_t)((a) - 1)))
/* Check if pointer "p" is aligned to "a"-bytes boundary. */
#define _Py_IS_ALIGNED(p, a) (!((uintptr_t)(p) & (uintptr_t)((a) - 1)))
/* Use this for unused arguments in a function definition to silence compiler
* warnings. Example:
*
* int func(int a, int Py_UNUSED(b)) { return a; }
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__) || defined(__clang__)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 120 "./Include/pymacro.h"
# define Py_UNUSED(name) _unused_ ## name __attribute__((unused))
#else
# 122 "./Include/pymacro.h"
# define Py_UNUSED(name) _unused_ ## name
#endif
# 124 "./Include/pymacro.h"
#if 0 /* disabled by -frewrite-includes */
#if defined(RANDALL_WAS_HERE)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 126 "./Include/pymacro.h"
# define Py_UNREACHABLE() \
Py_FatalError( \
"If you're seeing this, the code is in what I thought was\n" \
"an unreachable state.\n\n" \
"I could give you advice for what to do, but honestly, why\n" \
"should you trust me? I clearly screwed this up. I'm writing\n" \
"a message that should never appear, yet I know it will\n" \
"probably appear someday.\n\n" \
"On a deep level, I know I'm not up to this task.\n" \
"I'm so sorry.\n" \
"https://xkcd.com/2200")
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(Py_DEBUG)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 138 "./Include/pymacro.h"
# define Py_UNREACHABLE() \
Py_FatalError( \
"We've reached an unreachable state. Anything is possible.\n" \
"The limits were in our heads all along. Follow your dreams.\n" \
"https://xkcd.com/2200")
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5))
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 144 "./Include/pymacro.h"
# define Py_UNREACHABLE() __builtin_unreachable()
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(__clang__) || defined(__INTEL_COMPILER)
#endif
#endif /* disabled by -frewrite-includes */
#elif 1 /* evaluated by -frewrite-includes */
# 146 "./Include/pymacro.h"
# define Py_UNREACHABLE() __builtin_unreachable()
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(_MSC_VER)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 148 "./Include/pymacro.h"
# define Py_UNREACHABLE() __assume(0)
#else
# 150 "./Include/pymacro.h"
# define Py_UNREACHABLE() \
Py_FatalError("Unreachable C code path reached")
#endif
# 153 "./Include/pymacro.h"
// Prevent using an expression as a l-value.
// For example, "int x; _Py_RVALUE(x) = 1;" fails with a compiler error.
#define _Py_RVALUE(EXPR) ((void)0, (EXPR))
// Return non-zero if the type is signed, return zero if it's unsigned.
// Use "<= 0" rather than "< 0" to prevent the compiler warning:
// "comparison of unsigned expression in '< 0' is always false".
#define _Py_IS_TYPE_SIGNED(type) ((type)(-1) <= 0)
#endif /* Py_PYMACRO_H */
# 164 "./Include/pymacro.h"
# 40 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pymath.h"
#endif /* expanded by -frewrite-includes */
# 40 "./Include/Python.h"
# 1 "./Include/pymath.h" 1
// Symbols and macros to supply platform-independent interfaces to mathematical
// functions and constants.
#ifndef Py_PYMATH_H
#define Py_PYMATH_H
/* High precision definition of pi and e (Euler)
* The values are taken from libc6's math.h.
*/
#ifndef Py_MATH_PIl
#define Py_MATH_PIl 3.1415926535897932384626433832795029L
#endif
# 13 "./Include/pymath.h"
#ifndef Py_MATH_PI
#define Py_MATH_PI 3.14159265358979323846
#endif
# 16 "./Include/pymath.h"
#ifndef Py_MATH_El
#define Py_MATH_El 2.7182818284590452353602874713526625L
#endif
# 20 "./Include/pymath.h"
#ifndef Py_MATH_E
#define Py_MATH_E 2.7182818284590452354
#endif
# 24 "./Include/pymath.h"
/* Tau (2pi) to 40 digits, taken from tauday.com/tau-digits. */
#ifndef Py_MATH_TAU
#define Py_MATH_TAU 6.2831853071795864769252867665590057683943L
#endif
# 29 "./Include/pymath.h"
// Py_IS_NAN(X)
// Return 1 if float or double arg is a NaN, else 0.
#define Py_IS_NAN(X) isnan(X)
// Py_IS_INFINITY(X)
// Return 1 if float or double arg is an infinity, else 0.
#define Py_IS_INFINITY(X) isinf(X)
// Py_IS_FINITE(X)
// Return 1 if float or double arg is neither infinite nor NAN, else 0.
#define Py_IS_FINITE(X) isfinite(X)
// Py_INFINITY: Value that evaluates to a positive double infinity.
#ifndef Py_INFINITY
# define Py_INFINITY ((double)INFINITY)
#endif
# 46 "./Include/pymath.h"
/* Py_HUGE_VAL should always be the same as Py_INFINITY. But historically
* this was not reliable and Python did not require IEEE floats and C99
* conformity. Prefer Py_INFINITY for new code.
*/
#ifndef Py_HUGE_VAL
# define Py_HUGE_VAL HUGE_VAL
#endif
# 54 "./Include/pymath.h"
/* Py_NAN: Value that evaluates to a quiet Not-a-Number (NaN). The sign is
* undefined and normally not relevant, but e.g. fixed for float("nan").
*/
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_NAN)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 59 "./Include/pymath.h"
# define Py_NAN ((double)NAN)
#endif
# 61 "./Include/pymath.h"
#endif /* Py_PYMATH_H */
# 63 "./Include/pymath.h"
# 41 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pymem.h"
#endif /* expanded by -frewrite-includes */
# 41 "./Include/Python.h"
# 1 "./Include/pymem.h" 1
/* The PyMem_ family: low-level memory allocation interfaces.
See objimpl.h for the PyObject_ memory family.
*/
#ifndef Py_PYMEM_H
#define Py_PYMEM_H
#if 0 /* expanded by -frewrite-includes */
#include "pyport.h"
#endif /* expanded by -frewrite-includes */
# 8 "./Include/pymem.h"
# 9 "./Include/pymem.h"
#ifdef __cplusplus
extern "C" {
#endif
# 13 "./Include/pymem.h"
/* BEWARE:
Each interface exports both functions and macros. Extension modules should
use the functions, to ensure binary compatibility across Python versions.
Because the Python implementation is free to change internal details, and
the macros may (or may not) expose details for speed, if you do use the
macros you must recompile your extensions with each Python release.
Never mix calls to PyMem_ with calls to the platform malloc/realloc/
calloc/free. For example, on Windows different DLLs may end up using
different heaps, and if you use PyMem_Malloc you'll get the memory from the
heap used by the Python DLL; it could be a disaster if you free()'ed that
directly in your own extension. Using PyMem_Free instead ensures Python
can return the memory to the proper heap. As another example, in
a debug build (Py_DEBUG macro), Python wraps all calls to all PyMem_ and
PyObject_ memory functions in special debugging wrappers that add additional
debugging info to dynamic memory blocks. The system routines have no idea
what to do with that stuff, and the Python wrappers have no idea what to do
with raw blocks obtained directly by the system routines then.
The GIL must be held when using these APIs.
*/
/*
* Raw memory interface
* ====================
*/
/* Functions
Functions supplying platform-independent semantics for malloc/realloc/
free. These functions make sure that allocating 0 bytes returns a distinct
non-NULL pointer (whenever possible -- if we're flat out of memory, NULL
may be returned), even if the platform malloc and realloc don't.
Returned pointers must be checked for NULL explicitly. No action is
performed on failure (no exception is set, no warning is printed, etc).
*/
PyAPI_FUNC(void *) PyMem_Malloc(size_t size);
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
PyAPI_FUNC(void *) PyMem_Realloc(void *ptr, size_t new_size);
PyAPI_FUNC(void) PyMem_Free(void *ptr);
/*
* Type-oriented memory interface
* ==============================
*
* Allocate memory for n objects of the given type. Returns a new pointer
* or NULL if the request was too large or memory allocation failed. Use
* these macros rather than doing the multiplication yourself so that proper
* overflow checking is always done.
*/
#define PyMem_New(type, n) \
( ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
( (type *) PyMem_Malloc((n) * sizeof(type)) ) )
/*
* The value of (p) is always clobbered by this macro regardless of success.
* The caller MUST check if (p) is NULL afterwards and deal with the memory
* error if so. This means the original value of (p) MUST be saved for the
* caller's memory error handler to not lose track of it.
*/
#define PyMem_Resize(p, type, n) \
( (p) = ((size_t)(n) > PY_SSIZE_T_MAX / sizeof(type)) ? NULL : \
(type *) PyMem_Realloc((p), (n) * sizeof(type)) )
// Deprecated aliases only kept for backward compatibility.
// PyMem_Del and PyMem_DEL are defined with no parameter to be able to use
// them as function pointers (ex: dealloc = PyMem_Del).
#define PyMem_MALLOC(n) PyMem_Malloc((n))
#define PyMem_NEW(type, n) PyMem_New(type, (n))
#define PyMem_REALLOC(p, n) PyMem_Realloc((p), (n))
#define PyMem_RESIZE(p, type, n) PyMem_Resize((p), type, (n))
#define PyMem_FREE(p) PyMem_Free((p))
#define PyMem_Del(p) PyMem_Free((p))
#define PyMem_DEL(p) PyMem_Free((p))
#ifndef Py_LIMITED_API
# define Py_CPYTHON_PYMEM_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/pymem.h"
#endif /* expanded by -frewrite-includes */
# 96 "./Include/pymem.h"
# 1 "./Include/cpython/pymem.h" 1
#ifndef Py_CPYTHON_PYMEM_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/pymem.h"
PyAPI_FUNC(void *) PyMem_RawMalloc(size_t size);
PyAPI_FUNC(void *) PyMem_RawCalloc(size_t nelem, size_t elsize);
PyAPI_FUNC(void *) PyMem_RawRealloc(void *ptr, size_t new_size);
PyAPI_FUNC(void) PyMem_RawFree(void *ptr);
/* Try to get the allocators name set by _PyMem_SetupAllocators(). */
PyAPI_FUNC(const char*) _PyMem_GetCurrentAllocatorName(void);
/* strdup() using PyMem_RawMalloc() */
PyAPI_FUNC(char *) _PyMem_RawStrdup(const char *str);
/* strdup() using PyMem_Malloc() */
PyAPI_FUNC(char *) _PyMem_Strdup(const char *str);
/* wcsdup() using PyMem_RawMalloc() */
PyAPI_FUNC(wchar_t*) _PyMem_RawWcsdup(const wchar_t *str);
typedef enum {
/* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */
PYMEM_DOMAIN_RAW,
/* PyMem_Malloc(), PyMem_Realloc() and PyMem_Free() */
PYMEM_DOMAIN_MEM,
/* PyObject_Malloc(), PyObject_Realloc() and PyObject_Free() */
PYMEM_DOMAIN_OBJ
} PyMemAllocatorDomain;
typedef enum {
PYMEM_ALLOCATOR_NOT_SET = 0,
PYMEM_ALLOCATOR_DEFAULT = 1,
PYMEM_ALLOCATOR_DEBUG = 2,
PYMEM_ALLOCATOR_MALLOC = 3,
PYMEM_ALLOCATOR_MALLOC_DEBUG = 4,
#ifdef WITH_PYMALLOC
PYMEM_ALLOCATOR_PYMALLOC = 5,
PYMEM_ALLOCATOR_PYMALLOC_DEBUG = 6,
#endif
# 44 "./Include/cpython/pymem.h"
} PyMemAllocatorName;
typedef struct {
/* user context passed as the first argument to the 4 functions */
void *ctx;
/* allocate a memory block */
void* (*malloc) (void *ctx, size_t size);
/* allocate a memory block initialized by zeros */
void* (*calloc) (void *ctx, size_t nelem, size_t elsize);
/* allocate or resize a memory block */
void* (*realloc) (void *ctx, void *ptr, size_t new_size);
/* release a memory block */
void (*free) (void *ctx, void *ptr);
} PyMemAllocatorEx;
/* Get the memory block allocator of the specified domain. */
PyAPI_FUNC(void) PyMem_GetAllocator(PyMemAllocatorDomain domain,
PyMemAllocatorEx *allocator);
/* Set the memory block allocator of the specified domain.
The new allocator must return a distinct non-NULL pointer when requesting
zero bytes.
For the PYMEM_DOMAIN_RAW domain, the allocator must be thread-safe: the GIL
is not held when the allocator is called.
If the new allocator is not a hook (don't call the previous allocator), the
PyMem_SetupDebugHooks() function must be called to reinstall the debug hooks
on top on the new allocator. */
PyAPI_FUNC(void) PyMem_SetAllocator(PyMemAllocatorDomain domain,
PyMemAllocatorEx *allocator);
/* Setup hooks to detect bugs in the following Python memory allocator
functions:
- PyMem_RawMalloc(), PyMem_RawRealloc(), PyMem_RawFree()
- PyMem_Malloc(), PyMem_Realloc(), PyMem_Free()
- PyObject_Malloc(), PyObject_Realloc() and PyObject_Free()
Newly allocated memory is filled with the byte 0xCB, freed memory is filled
with the byte 0xDB. Additional checks:
- detect API violations, ex: PyObject_Free() called on a buffer allocated
by PyMem_Malloc()
- detect write before the start of the buffer (buffer underflow)
- detect write after the end of the buffer (buffer overflow)
The function does nothing if Python is not compiled is debug mode. */
PyAPI_FUNC(void) PyMem_SetupDebugHooks(void);
# 97 "./Include/pymem.h" 2
# undef Py_CPYTHON_PYMEM_H
#endif
# 99 "./Include/pymem.h"
#ifdef __cplusplus
}
#endif
# 103 "./Include/pymem.h"
#endif /* !Py_PYMEM_H */
# 105 "./Include/pymem.h"
# 42 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pytypedefs.h"
#endif /* expanded by -frewrite-includes */
# 42 "./Include/Python.h"
# 1 "./Include/pytypedefs.h" 1
// Forward declarations of types of the Python C API.
// Declare them at the same place since redefining typedef is a C11 feature.
// Only use a forward declaration if there is an interdependency between two
// header files.
#ifndef Py_PYTYPEDEFS_H
#define Py_PYTYPEDEFS_H
#ifdef __cplusplus
extern "C" {
#endif
# 11 "./Include/pytypedefs.h"
typedef struct PyModuleDef PyModuleDef;
typedef struct PyModuleDef_Slot PyModuleDef_Slot;
typedef struct PyMethodDef PyMethodDef;
typedef struct PyGetSetDef PyGetSetDef;
typedef struct PyMemberDef PyMemberDef;
typedef struct _object PyObject;
typedef struct _longobject PyLongObject;
typedef struct _typeobject PyTypeObject;
typedef struct PyCodeObject PyCodeObject;
typedef struct _frame PyFrameObject;
typedef struct _ts PyThreadState;
typedef struct _is PyInterpreterState;
#ifdef __cplusplus
}
#endif
# 30 "./Include/pytypedefs.h"
#endif // !Py_PYTYPEDEFS_H
# 31 "./Include/pytypedefs.h"
# 43 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pybuffer.h"
#endif /* expanded by -frewrite-includes */
# 43 "./Include/Python.h"
# 1 "./Include/pybuffer.h" 1
/* Public Py_buffer API */
#ifndef Py_BUFFER_H
#define Py_BUFFER_H
#ifdef __cplusplus
extern "C" {
#endif
# 8 "./Include/pybuffer.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 10 "./Include/pybuffer.h"
/* === New Buffer API ============================================
* Limited API and stable ABI since Python 3.11
*
* Py_buffer struct layout and size is now part of the stable abi3. The
* struct layout and size must not be changed in any way, as it would
* break the ABI.
*
*/
typedef struct {
void *buf;
PyObject *obj; /* owned reference */
Py_ssize_t len;
Py_ssize_t itemsize; /* This is Py_ssize_t so it can be
pointed to by strides in simple case.*/
int readonly;
int ndim;
char *format;
Py_ssize_t *shape;
Py_ssize_t *strides;
Py_ssize_t *suboffsets;
void *internal;
} Py_buffer;
typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
/* Return 1 if the getbuffer function is available, otherwise return 0. */
PyAPI_FUNC(int) PyObject_CheckBuffer(PyObject *obj);
/* This is a C-API version of the getbuffer function call. It checks
to make sure object has the required function pointer and issues the
call.
Returns -1 and raises an error on failure and returns 0 on success. */
PyAPI_FUNC(int) PyObject_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
/* Get the memory area pointed to by the indices for the buffer given.
Note that view->ndim is the assumed size of indices. */
PyAPI_FUNC(void *) PyBuffer_GetPointer(const Py_buffer *view, const Py_ssize_t *indices);
/* Return the implied itemsize of the data-format area from a
struct-style description. */
PyAPI_FUNC(Py_ssize_t) PyBuffer_SizeFromFormat(const char *format);
/* Implementation in memoryobject.c */
PyAPI_FUNC(int) PyBuffer_ToContiguous(void *buf, const Py_buffer *view,
Py_ssize_t len, char order);
PyAPI_FUNC(int) PyBuffer_FromContiguous(const Py_buffer *view, const void *buf,
Py_ssize_t len, char order);
/* Copy len bytes of data from the contiguous chunk of memory
pointed to by buf into the buffer exported by obj. Return
0 on success and return -1 and raise a PyBuffer_Error on
error (i.e. the object does not have a buffer interface or
it is not working).
If fort is 'F', then if the object is multi-dimensional,
then the data will be copied into the array in
Fortran-style (first dimension varies the fastest). If
fort is 'C', then the data will be copied into the array
in C-style (last dimension varies the fastest). If fort
is 'A', then it does not matter and the copy will be made
in whatever way is more efficient. */
PyAPI_FUNC(int) PyObject_CopyData(PyObject *dest, PyObject *src);
/* Copy the data from the src buffer to the buffer of destination. */
PyAPI_FUNC(int) PyBuffer_IsContiguous(const Py_buffer *view, char fort);
/*Fill the strides array with byte-strides of a contiguous
(Fortran-style if fort is 'F' or C-style otherwise)
array of the given shape with the given number of bytes
per element. */
PyAPI_FUNC(void) PyBuffer_FillContiguousStrides(int ndims,
Py_ssize_t *shape,
Py_ssize_t *strides,
int itemsize,
char fort);
/* Fills in a buffer-info structure correctly for an exporter
that can only share a contiguous chunk of memory of
"unsigned bytes" of the given length.
Returns 0 on success and -1 (with raising an error) on error. */
PyAPI_FUNC(int) PyBuffer_FillInfo(Py_buffer *view, PyObject *o, void *buf,
Py_ssize_t len, int readonly,
int flags);
/* Releases a Py_buffer obtained from getbuffer ParseTuple's "s*". */
PyAPI_FUNC(void) PyBuffer_Release(Py_buffer *view);
/* Maximum number of dimensions */
#define PyBUF_MAX_NDIM 64
/* Flags for getting buffers. Keep these in sync with inspect.BufferFlags. */
#define PyBUF_SIMPLE 0
#define PyBUF_WRITABLE 0x0001
#ifndef Py_LIMITED_API
/* we used to include an E, backwards compatible alias */
#define PyBUF_WRITEABLE PyBUF_WRITABLE
#endif
# 115 "./Include/pybuffer.h"
#define PyBUF_FORMAT 0x0004
#define PyBUF_ND 0x0008
#define PyBUF_STRIDES (0x0010 | PyBUF_ND)
#define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
#define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
#define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
#define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
#define PyBUF_CONTIG (PyBUF_ND | PyBUF_WRITABLE)
#define PyBUF_CONTIG_RO (PyBUF_ND)
#define PyBUF_STRIDED (PyBUF_STRIDES | PyBUF_WRITABLE)
#define PyBUF_STRIDED_RO (PyBUF_STRIDES)
#define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_WRITABLE | PyBUF_FORMAT)
#define PyBUF_RECORDS_RO (PyBUF_STRIDES | PyBUF_FORMAT)
#define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_WRITABLE | PyBUF_FORMAT)
#define PyBUF_FULL_RO (PyBUF_INDIRECT | PyBUF_FORMAT)
#define PyBUF_READ 0x100
#define PyBUF_WRITE 0x200
#endif /* !Py_LIMITED_API || Py_LIMITED_API >= 3.11 */
# 141 "./Include/pybuffer.h"
#ifdef __cplusplus
}
#endif
# 145 "./Include/pybuffer.h"
#endif /* Py_BUFFER_H */
# 146 "./Include/pybuffer.h"
# 44 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "object.h"
#endif /* expanded by -frewrite-includes */
# 44 "./Include/Python.h"
# 1 "./Include/object.h" 1
#ifndef Py_OBJECT_H
#define Py_OBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 6 "./Include/object.h"
/* Object and type object interface */
/*
Objects are structures allocated on the heap. Special rules apply to
the use of objects to ensure they are properly garbage-collected.
Objects are never allocated statically or on the stack; they must be
accessed through special macros and functions only. (Type objects are
exceptions to the first rule; the standard types are represented by
statically initialized type objects, although work on type/class unification
for Python 2.2 made it possible to have heap-allocated type objects too).
An object has a 'reference count' that is increased or decreased when a
pointer to the object is copied or deleted; when the reference count
reaches zero there are no references to the object left and it can be
removed from the heap.
An object has a 'type' that determines what it represents and what kind
of data it contains. An object's type is fixed when it is created.
Types themselves are represented as objects; an object contains a
pointer to the corresponding type object. The type itself has a type
pointer pointing to the object representing the type 'type', which
contains a pointer to itself!.
Objects do not float around in memory; once allocated an object keeps
the same size and address. Objects that must hold variable-size data
can contain pointers to variable-size parts of the object. Not all
objects of the same type have the same size; but the size cannot change
after allocation. (These restrictions are made so a reference to an
object can be simply a pointer -- moving an object would require
updating all the pointers, and changing an object's size would require
moving it if there was another object right next to it.)
Objects are always accessed through pointers of the type 'PyObject *'.
The type 'PyObject' is a structure that only contains the reference count
and the type pointer. The actual memory allocated for an object
contains other data that can only be accessed after casting the pointer
to a pointer to a longer structure type. This longer type must start
with the reference count and type fields; the macro PyObject_HEAD should be
used for this (to accommodate for future changes). The implementation
of a particular object type can cast the object pointer to the proper
type and back.
A standard interface exists for objects that contain an array of items
whose size is determined when the object is allocated.
*/
#if 0 /* expanded by -frewrite-includes */
#include "pystats.h"
#endif /* expanded by -frewrite-includes */
# 54 "./Include/object.h"
# 1 "./Include/pystats.h" 1
#ifndef Py_PYSTATS_H
#define Py_PYSTATS_H
#ifdef __cplusplus
extern "C" {
#endif
# 8 "./Include/pystats.h"
#ifdef Py_STATS
#define SPECIALIZATION_FAILURE_KINDS 36
/* Stats for determining who is calling PyEval_EvalFrame */
#define EVAL_CALL_TOTAL 0
#define EVAL_CALL_VECTOR 1
#define EVAL_CALL_GENERATOR 2
#define EVAL_CALL_LEGACY 3
#define EVAL_CALL_FUNCTION_VECTORCALL 4
#define EVAL_CALL_BUILD_CLASS 5
#define EVAL_CALL_SLOT 6
#define EVAL_CALL_FUNCTION_EX 7
#define EVAL_CALL_API 8
#define EVAL_CALL_METHOD 9
#define EVAL_CALL_KINDS 10
typedef struct _specialization_stats {
uint64_t success;
uint64_t failure;
uint64_t hit;
uint64_t deferred;
uint64_t miss;
uint64_t deopt;
uint64_t failure_kinds[SPECIALIZATION_FAILURE_KINDS];
} SpecializationStats;
typedef struct _opcode_stats {
SpecializationStats specialization;
uint64_t execution_count;
uint64_t pair_count[256];
} OpcodeStats;
typedef struct _call_stats {
uint64_t inlined_py_calls;
uint64_t pyeval_calls;
uint64_t frames_pushed;
uint64_t frame_objects_created;
uint64_t eval_calls[EVAL_CALL_KINDS];
} CallStats;
typedef struct _object_stats {
uint64_t increfs;
uint64_t decrefs;
uint64_t interpreter_increfs;
uint64_t interpreter_decrefs;
uint64_t allocations;
uint64_t allocations512;
uint64_t allocations4k;
uint64_t allocations_big;
uint64_t frees;
uint64_t to_freelist;
uint64_t from_freelist;
uint64_t new_values;
uint64_t dict_materialized_on_request;
uint64_t dict_materialized_new_key;
uint64_t dict_materialized_too_big;
uint64_t dict_materialized_str_subclass;
uint64_t type_cache_hits;
uint64_t type_cache_misses;
uint64_t type_cache_dunder_hits;
uint64_t type_cache_dunder_misses;
uint64_t type_cache_collisions;
} ObjectStats;
typedef struct _stats {
OpcodeStats opcode_stats[256];
CallStats call_stats;
ObjectStats object_stats;
} PyStats;
PyAPI_DATA(PyStats) _py_stats_struct;
PyAPI_DATA(PyStats *) _py_stats;
extern void _Py_StatsClear(void);
extern void _Py_PrintSpecializationStats(int to_file);
#ifdef _PY_INTERPRETER
#define _Py_INCREF_STAT_INC() do { if (_py_stats) _py_stats->object_stats.interpreter_increfs++; } while (0)
#define _Py_DECREF_STAT_INC() do { if (_py_stats) _py_stats->object_stats.interpreter_decrefs++; } while (0)
#else
# 94 "./Include/pystats.h"
#define _Py_INCREF_STAT_INC() do { if (_py_stats) _py_stats->object_stats.increfs++; } while (0)
#define _Py_DECREF_STAT_INC() do { if (_py_stats) _py_stats->object_stats.decrefs++; } while (0)
#endif
# 99 "./Include/pystats.h"
#else
# 101 "./Include/pystats.h"
#define _Py_INCREF_STAT_INC() ((void)0)
#define _Py_DECREF_STAT_INC() ((void)0)
#endif // !Py_STATS
# 106 "./Include/pystats.h"
#ifdef __cplusplus
}
#endif
# 110 "./Include/pystats.h"
#endif /* !Py_PYSTATs_H */
# 111 "./Include/pystats.h"
# 55 "./Include/object.h" 2
/* Py_DEBUG implies Py_REF_DEBUG. */
#if 0 /* disabled by -frewrite-includes */
#if defined(Py_DEBUG) && !defined(Py_REF_DEBUG)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 58 "./Include/object.h"
# define Py_REF_DEBUG
#endif
# 60 "./Include/object.h"
#if 0 /* disabled by -frewrite-includes */
#if defined(Py_LIMITED_API) && defined(Py_TRACE_REFS)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 62 "./Include/object.h"
# error Py_LIMITED_API is incompatible with Py_TRACE_REFS
#endif
# 64 "./Include/object.h"
#ifdef Py_TRACE_REFS
/* Define pointers to support a doubly-linked list of all live heap objects. */
#define _PyObject_HEAD_EXTRA \
PyObject *_ob_next; \
PyObject *_ob_prev;
#define _PyObject_EXTRA_INIT _Py_NULL, _Py_NULL,
#else
# 74 "./Include/object.h"
# define _PyObject_HEAD_EXTRA
# define _PyObject_EXTRA_INIT
#endif
# 77 "./Include/object.h"
/* PyObject_HEAD defines the initial segment of every PyObject. */
#define PyObject_HEAD PyObject ob_base;
/*
Immortalization:
The following indicates the immortalization strategy depending on the amount
of available bits in the reference count field. All strategies are backwards
compatible but the specific reference count value or immortalization check
might change depending on the specializations for the underlying system.
Proper deallocation of immortal instances requires distinguishing between
statically allocated immortal instances vs those promoted by the runtime to be
immortal. The latter should be the only instances that require
cleanup during runtime finalization.
*/
#if 0 /* disabled by -frewrite-includes */
#if SIZEOF_VOID_P > 4
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 96 "./Include/object.h"
/*
In 64+ bit systems, an object will be marked as immortal by setting all of the
lower 32 bits of the reference count field, which is equal to: 0xFFFFFFFF
Using the lower 32 bits makes the value backwards compatible by allowing
C-Extensions without the updated checks in Py_INCREF and Py_DECREF to safely
increase and decrease the objects reference count. The object would lose its
immortality, but the execution would still be correct.
Reference count increases will use saturated arithmetic, taking advantage of
having all the lower 32 bits set, which will avoid the reference count to go
beyond the refcount limit. Immortality checks for reference count decreases will
be done by checking the bit sign flag in the lower 32 bits.
*/
#define _Py_IMMORTAL_REFCNT UINT_MAX
#else
# 113 "./Include/object.h"
/*
In 32 bit systems, an object will be marked as immortal by setting all of the
lower 30 bits of the reference count field, which is equal to: 0x3FFFFFFF
Using the lower 30 bits makes the value backwards compatible by allowing
C-Extensions without the updated checks in Py_INCREF and Py_DECREF to safely
increase and decrease the objects reference count. The object would lose its
immortality, but the execution would still be correct.
Reference count increases and decreases will first go through an immortality
check by comparing the reference count field to the immortality reference count.
*/
#define _Py_IMMORTAL_REFCNT (UINT_MAX >> 2)
#endif
# 127 "./Include/object.h"
// Make all internal uses of PyObject_HEAD_INIT immortal while preserving the
// C-API expectation that the refcnt will be set to 1.
#ifdef Py_BUILD_CORE
#define PyObject_HEAD_INIT(type) \
{ \
_PyObject_EXTRA_INIT \
{ _Py_IMMORTAL_REFCNT }, \
(type) \
},
#else
# 138 "./Include/object.h"
#define PyObject_HEAD_INIT(type) \
{ \
_PyObject_EXTRA_INIT \
{ 1 }, \
(type) \
},
#endif /* Py_BUILD_CORE */
# 145 "./Include/object.h"
#define PyVarObject_HEAD_INIT(type, size) \
{ \
PyObject_HEAD_INIT(type) \
(size) \
},
/* PyObject_VAR_HEAD defines the initial segment of all variable-size
* container objects. These end with a declaration of an array with 1
* element, but enough space is malloc'ed so that the array actually
* has room for ob_size elements. Note that ob_size is an element count,
* not necessarily a byte count.
*/
#define PyObject_VAR_HEAD PyVarObject ob_base;
#define Py_INVALID_SIZE (Py_ssize_t)-1
/* Nothing is actually declared to be a PyObject, but every pointer to
* a Python object can be cast to a PyObject*. This is inheritance built
* by hand. Similarly every pointer to a variable-size Python object can,
* in addition, be cast to PyVarObject*.
*/
struct _object {
_PyObject_HEAD_EXTRA
#if 0 /* disabled by -frewrite-includes */
#if (defined(__GNUC__) || defined(__clang__)) \
&& !(defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 171 "./Include/object.h"
// On C99 and older, anonymous union is a GCC and clang extension
__extension__
#endif
# 174 "./Include/object.h"
#ifdef _MSC_VER
// Ignore MSC warning C4201: "nonstandard extension used:
// nameless struct/union"
__pragma(warning(push))
__pragma(warning(disable: 4201))
#endif
# 180 "./Include/object.h"
union {
Py_ssize_t ob_refcnt;
#if 0 /* disabled by -frewrite-includes */
#if SIZEOF_VOID_P > 4
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 183 "./Include/object.h"
PY_UINT32_T ob_refcnt_split[2];
#endif
# 185 "./Include/object.h"
};
#ifdef _MSC_VER
__pragma(warning(pop))
#endif
# 189 "./Include/object.h"
PyTypeObject *ob_type;
};
/* Cast argument to PyObject* type. */
#define _PyObject_CAST(op) _Py_CAST(PyObject*, (op))
typedef struct {
PyObject ob_base;
Py_ssize_t ob_size; /* Number of items in variable part */
} PyVarObject;
/* Cast argument to PyVarObject* type. */
#define _PyVarObject_CAST(op) _Py_CAST(PyVarObject*, (op))
// Test if the 'x' object is the 'y' object, the same as "x is y" in Python.
PyAPI_FUNC(int) Py_Is(PyObject *x, PyObject *y);
#define Py_Is(x, y) ((x) == (y))
static inline Py_ssize_t Py_REFCNT(PyObject *ob) {
return ob->ob_refcnt;
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 214 "./Include/object.h"
# define Py_REFCNT(ob) Py_REFCNT(_PyObject_CAST(ob))
#endif
# 216 "./Include/object.h"
// bpo-39573: The Py_SET_TYPE() function must be used to set an object type.
static inline PyTypeObject* Py_TYPE(PyObject *ob) {
return ob->ob_type;
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 223 "./Include/object.h"
# define Py_TYPE(ob) Py_TYPE(_PyObject_CAST(ob))
#endif
# 225 "./Include/object.h"
PyAPI_DATA(PyTypeObject) PyLong_Type;
PyAPI_DATA(PyTypeObject) PyBool_Type;
// bpo-39573: The Py_SET_SIZE() function must be used to set an object size.
static inline Py_ssize_t Py_SIZE(PyObject *ob) {
assert(ob->ob_type != &PyLong_Type);
assert(ob->ob_type != &PyBool_Type);
PyVarObject *var_ob = _PyVarObject_CAST(ob);
return var_ob->ob_size;
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 237 "./Include/object.h"
# define Py_SIZE(ob) Py_SIZE(_PyObject_CAST(ob))
#endif
# 239 "./Include/object.h"
static inline Py_ALWAYS_INLINE int _Py_IsImmortal(PyObject *op)
{
#if 0 /* disabled by -frewrite-includes */
#if SIZEOF_VOID_P > 4
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 243 "./Include/object.h"
return _Py_CAST(PY_INT32_T, op->ob_refcnt) < 0;
#else
# 245 "./Include/object.h"
return op->ob_refcnt == _Py_IMMORTAL_REFCNT;
#endif
# 247 "./Include/object.h"
}
#define _Py_IsImmortal(op) _Py_IsImmortal(_PyObject_CAST(op))
static inline int Py_IS_TYPE(PyObject *ob, PyTypeObject *type) {
return Py_TYPE(ob) == type;
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 254 "./Include/object.h"
# define Py_IS_TYPE(ob, type) Py_IS_TYPE(_PyObject_CAST(ob), (type))
#endif
# 256 "./Include/object.h"
static inline void Py_SET_REFCNT(PyObject *ob, Py_ssize_t refcnt) {
// This immortal check is for code that is unaware of immortal objects.
// The runtime tracks these objects and we should avoid as much
// as possible having extensions inadvertently change the refcnt
// of an immortalized object.
if (_Py_IsImmortal(ob)) {
return;
}
ob->ob_refcnt = refcnt;
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 269 "./Include/object.h"
# define Py_SET_REFCNT(ob, refcnt) Py_SET_REFCNT(_PyObject_CAST(ob), (refcnt))
#endif
# 271 "./Include/object.h"
static inline void Py_SET_TYPE(PyObject *ob, PyTypeObject *type) {
ob->ob_type = type;
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 277 "./Include/object.h"
# define Py_SET_TYPE(ob, type) Py_SET_TYPE(_PyObject_CAST(ob), type)
#endif
# 279 "./Include/object.h"
static inline void Py_SET_SIZE(PyVarObject *ob, Py_ssize_t size) {
assert(ob->ob_base.ob_type != &PyLong_Type);
assert(ob->ob_base.ob_type != &PyBool_Type);
ob->ob_size = size;
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 286 "./Include/object.h"
# define Py_SET_SIZE(ob, size) Py_SET_SIZE(_PyVarObject_CAST(ob), (size))
#endif
# 288 "./Include/object.h"
/*
Type objects contain a string containing the type name (to help somewhat
in debugging), the allocation parameters (see PyObject_New() and
PyObject_NewVar()),
and methods for accessing objects of the type. Methods are optional, a
nil pointer meaning that particular kind of access is not available for
this type. The Py_DECREF() macro uses the tp_dealloc method without
checking for a nil pointer; it should always be implemented except if
the implementation can guarantee that the reference count will never
reach zero (e.g., for statically allocated type objects).
NB: the methods for certain type groups are now contained in separate
method blocks.
*/
typedef PyObject * (*unaryfunc)(PyObject *);
typedef PyObject * (*binaryfunc)(PyObject *, PyObject *);
typedef PyObject * (*ternaryfunc)(PyObject *, PyObject *, PyObject *);
typedef int (*inquiry)(PyObject *);
typedef Py_ssize_t (*lenfunc)(PyObject *);
typedef PyObject *(*ssizeargfunc)(PyObject *, Py_ssize_t);
typedef PyObject *(*ssizessizeargfunc)(PyObject *, Py_ssize_t, Py_ssize_t);
typedef int(*ssizeobjargproc)(PyObject *, Py_ssize_t, PyObject *);
typedef int(*ssizessizeobjargproc)(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
typedef int(*objobjargproc)(PyObject *, PyObject *, PyObject *);
typedef int (*objobjproc)(PyObject *, PyObject *);
typedef int (*visitproc)(PyObject *, void *);
typedef int (*traverseproc)(PyObject *, visitproc, void *);
typedef void (*freefunc)(void *);
typedef void (*destructor)(PyObject *);
typedef PyObject *(*getattrfunc)(PyObject *, char *);
typedef PyObject *(*getattrofunc)(PyObject *, PyObject *);
typedef int (*setattrfunc)(PyObject *, char *, PyObject *);
typedef int (*setattrofunc)(PyObject *, PyObject *, PyObject *);
typedef PyObject *(*reprfunc)(PyObject *);
typedef Py_hash_t (*hashfunc)(PyObject *);
typedef PyObject *(*richcmpfunc) (PyObject *, PyObject *, int);
typedef PyObject *(*getiterfunc) (PyObject *);
typedef PyObject *(*iternextfunc) (PyObject *);
typedef PyObject *(*descrgetfunc) (PyObject *, PyObject *, PyObject *);
typedef int (*descrsetfunc) (PyObject *, PyObject *, PyObject *);
typedef int (*initproc)(PyObject *, PyObject *, PyObject *);
typedef PyObject *(*newfunc)(PyTypeObject *, PyObject *, PyObject *);
typedef PyObject *(*allocfunc)(PyTypeObject *, Py_ssize_t);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c0000 // 3.12
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 339 "./Include/object.h"
typedef PyObject *(*vectorcallfunc)(PyObject *callable, PyObject *const *args,
size_t nargsf, PyObject *kwnames);
#endif
# 342 "./Include/object.h"
typedef struct{
int slot; /* slot id, see below */
void *pfunc; /* function pointer */
} PyType_Slot;
typedef struct{
const char* name;
int basicsize;
int itemsize;
unsigned int flags;
PyType_Slot *slots; /* terminated by slot==0. */
} PyType_Spec;
PyAPI_FUNC(PyObject*) PyType_FromSpec(PyType_Spec*);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 358 "./Include/object.h"
PyAPI_FUNC(PyObject*) PyType_FromSpecWithBases(PyType_Spec*, PyObject*);
#endif
# 360 "./Include/object.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03040000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 361 "./Include/object.h"
PyAPI_FUNC(void*) PyType_GetSlot(PyTypeObject*, int);
#endif
# 363 "./Include/object.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 364 "./Include/object.h"
PyAPI_FUNC(PyObject*) PyType_FromModuleAndSpec(PyObject *, PyType_Spec *, PyObject *);
PyAPI_FUNC(PyObject *) PyType_GetModule(PyTypeObject *);
PyAPI_FUNC(void *) PyType_GetModuleState(PyTypeObject *);
#endif
# 368 "./Include/object.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030B0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 369 "./Include/object.h"
PyAPI_FUNC(PyObject *) PyType_GetName(PyTypeObject *);
PyAPI_FUNC(PyObject *) PyType_GetQualName(PyTypeObject *);
#endif
# 372 "./Include/object.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 373 "./Include/object.h"
PyAPI_FUNC(PyObject *) PyType_FromMetaclass(PyTypeObject*, PyObject*, PyType_Spec*, PyObject*);
PyAPI_FUNC(void *) PyObject_GetTypeData(PyObject *obj, PyTypeObject *cls);
PyAPI_FUNC(Py_ssize_t) PyType_GetTypeDataSize(PyTypeObject *cls);
#endif
# 377 "./Include/object.h"
/* Generic type check */
PyAPI_FUNC(int) PyType_IsSubtype(PyTypeObject *, PyTypeObject *);
static inline int PyObject_TypeCheck(PyObject *ob, PyTypeObject *type) {
return Py_IS_TYPE(ob, type) || PyType_IsSubtype(Py_TYPE(ob), type);
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 385 "./Include/object.h"
# define PyObject_TypeCheck(ob, type) PyObject_TypeCheck(_PyObject_CAST(ob), (type))
#endif
# 387 "./Include/object.h"
PyAPI_DATA(PyTypeObject) PyType_Type; /* built-in 'type' */
PyAPI_DATA(PyTypeObject) PyBaseObject_Type; /* built-in 'object' */
PyAPI_DATA(PyTypeObject) PySuper_Type; /* built-in 'super' */
PyAPI_FUNC(unsigned long) PyType_GetFlags(PyTypeObject*);
PyAPI_FUNC(int) PyType_Ready(PyTypeObject *);
PyAPI_FUNC(PyObject *) PyType_GenericAlloc(PyTypeObject *, Py_ssize_t);
PyAPI_FUNC(PyObject *) PyType_GenericNew(PyTypeObject *,
PyObject *, PyObject *);
PyAPI_FUNC(unsigned int) PyType_ClearCache(void);
PyAPI_FUNC(void) PyType_Modified(PyTypeObject *);
/* Generic operations on objects */
PyAPI_FUNC(PyObject *) PyObject_Repr(PyObject *);
PyAPI_FUNC(PyObject *) PyObject_Str(PyObject *);
PyAPI_FUNC(PyObject *) PyObject_ASCII(PyObject *);
PyAPI_FUNC(PyObject *) PyObject_Bytes(PyObject *);
PyAPI_FUNC(PyObject *) PyObject_RichCompare(PyObject *, PyObject *, int);
PyAPI_FUNC(int) PyObject_RichCompareBool(PyObject *, PyObject *, int);
PyAPI_FUNC(PyObject *) PyObject_GetAttrString(PyObject *, const char *);
PyAPI_FUNC(int) PyObject_SetAttrString(PyObject *, const char *, PyObject *);
PyAPI_FUNC(int) PyObject_HasAttrString(PyObject *, const char *);
PyAPI_FUNC(PyObject *) PyObject_GetAttr(PyObject *, PyObject *);
PyAPI_FUNC(int) PyObject_SetAttr(PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(int) PyObject_HasAttr(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyObject_SelfIter(PyObject *);
PyAPI_FUNC(PyObject *) PyObject_GenericGetAttr(PyObject *, PyObject *);
PyAPI_FUNC(int) PyObject_GenericSetAttr(PyObject *, PyObject *, PyObject *);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 418 "./Include/object.h"
PyAPI_FUNC(int) PyObject_GenericSetDict(PyObject *, PyObject *, void *);
#endif
# 420 "./Include/object.h"
PyAPI_FUNC(Py_hash_t) PyObject_Hash(PyObject *);
PyAPI_FUNC(Py_hash_t) PyObject_HashNotImplemented(PyObject *);
PyAPI_FUNC(int) PyObject_IsTrue(PyObject *);
PyAPI_FUNC(int) PyObject_Not(PyObject *);
PyAPI_FUNC(int) PyCallable_Check(PyObject *);
PyAPI_FUNC(void) PyObject_ClearWeakRefs(PyObject *);
/* PyObject_Dir(obj) acts like Python builtins.dir(obj), returning a
list of strings. PyObject_Dir(NULL) is like builtins.dir(),
returning the names of the current locals. In this case, if there are
no current locals, NULL is returned, and PyErr_Occurred() is false.
*/
PyAPI_FUNC(PyObject *) PyObject_Dir(PyObject *);
/* Pickle support. */
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PyObject_GetState(PyObject *);
#endif
# 438 "./Include/object.h"
/* Helpers for printing recursive container types */
PyAPI_FUNC(int) Py_ReprEnter(PyObject *);
PyAPI_FUNC(void) Py_ReprLeave(PyObject *);
/* Flag bits for printing: */
#define Py_PRINT_RAW 1 /* No string quotes etc. */
/*
Type flags (tp_flags)
These flags are used to change expected features and behavior for a
particular type.
Arbitration of the flag bit positions will need to be coordinated among
all extension writers who publicly release their extensions (this will
be fewer than you might expect!).
Most flags were removed as of Python 3.0 to make room for new flags. (Some
flags are not for backwards compatibility but to indicate the presence of an
optional feature; these flags remain of course.)
Type definitions should use Py_TPFLAGS_DEFAULT for their tp_flags value.
Code can use PyType_HasFeature(type_ob, flag_value) to test whether the
given type object has a specified feature.
*/
#ifndef Py_LIMITED_API
/* Track types initialized using _PyStaticType_InitBuiltin(). */
#define _Py_TPFLAGS_STATIC_BUILTIN (1 << 1)
/* Placement of weakref pointers are managed by the VM, not by the type.
* The VM will automatically set tp_weaklistoffset.
*/
#define Py_TPFLAGS_MANAGED_WEAKREF (1 << 3)
/* Placement of dict (and values) pointers are managed by the VM, not by the type.
* The VM will automatically set tp_dictoffset.
*/
#define Py_TPFLAGS_MANAGED_DICT (1 << 4)
#define Py_TPFLAGS_PREHEADER (Py_TPFLAGS_MANAGED_WEAKREF | Py_TPFLAGS_MANAGED_DICT)
/* Set if instances of the type object are treated as sequences for pattern matching */
#define Py_TPFLAGS_SEQUENCE (1 << 5)
/* Set if instances of the type object are treated as mappings for pattern matching */
#define Py_TPFLAGS_MAPPING (1 << 6)
#endif
# 489 "./Include/object.h"
/* Disallow creating instances of the type: set tp_new to NULL and don't create
* the "__new__" key in the type dictionary. */
#define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
/* Set if the type object is immutable: type attributes cannot be set nor deleted */
#define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
/* Set if the type object is dynamically allocated */
#define Py_TPFLAGS_HEAPTYPE (1UL << 9)
/* Set if the type allows subclassing */
#define Py_TPFLAGS_BASETYPE (1UL << 10)
/* Set if the type implements the vectorcall protocol (PEP 590) */
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 505 "./Include/object.h"
#define Py_TPFLAGS_HAVE_VECTORCALL (1UL << 11)
#ifndef Py_LIMITED_API
// Backwards compatibility alias for API that was provisional in Python 3.8
#define _Py_TPFLAGS_HAVE_VECTORCALL Py_TPFLAGS_HAVE_VECTORCALL
#endif
# 510 "./Include/object.h"
#endif
# 511 "./Include/object.h"
/* Set if the type is 'ready' -- fully initialized */
#define Py_TPFLAGS_READY (1UL << 12)
/* Set while the type is being 'readied', to prevent recursive ready calls */
#define Py_TPFLAGS_READYING (1UL << 13)
/* Objects support garbage collection (see objimpl.h) */
#define Py_TPFLAGS_HAVE_GC (1UL << 14)
/* These two bits are preserved for Stackless Python, next after this is 17 */
#ifdef STACKLESS
#define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION (3UL << 15)
#else
# 525 "./Include/object.h"
#define Py_TPFLAGS_HAVE_STACKLESS_EXTENSION 0
#endif
# 527 "./Include/object.h"
/* Objects behave like an unbound method */
#define Py_TPFLAGS_METHOD_DESCRIPTOR (1UL << 17)
/* Object has up-to-date type attribute cache */
#define Py_TPFLAGS_VALID_VERSION_TAG (1UL << 19)
/* Type is abstract and cannot be instantiated */
#define Py_TPFLAGS_IS_ABSTRACT (1UL << 20)
// This undocumented flag gives certain built-ins their unique pattern-matching
// behavior, which allows a single positional subpattern to match against the
// subject itself (rather than a mapped attribute on it):
#define _Py_TPFLAGS_MATCH_SELF (1UL << 22)
/* Items (ob_size*tp_itemsize) are found at the end of an instance's memory */
#define Py_TPFLAGS_ITEMS_AT_END (1UL << 23)
/* These flags are used to determine if a type is a subclass. */
#define Py_TPFLAGS_LONG_SUBCLASS (1UL << 24)
#define Py_TPFLAGS_LIST_SUBCLASS (1UL << 25)
#define Py_TPFLAGS_TUPLE_SUBCLASS (1UL << 26)
#define Py_TPFLAGS_BYTES_SUBCLASS (1UL << 27)
#define Py_TPFLAGS_UNICODE_SUBCLASS (1UL << 28)
#define Py_TPFLAGS_DICT_SUBCLASS (1UL << 29)
#define Py_TPFLAGS_BASE_EXC_SUBCLASS (1UL << 30)
#define Py_TPFLAGS_TYPE_SUBCLASS (1UL << 31)
#define Py_TPFLAGS_DEFAULT ( \
Py_TPFLAGS_HAVE_STACKLESS_EXTENSION | \
0)
/* NOTE: Some of the following flags reuse lower bits (removed as part of the
* Python 3.0 transition). */
/* The following flags are kept for compatibility; in previous
* versions they indicated presence of newer tp_* fields on the
* type struct.
* Starting with 3.8, binary compatibility of C extensions across
* feature releases of Python is not supported anymore (except when
* using the stable ABI, in which all classes are created dynamically,
* using the interpreter's memory layout.)
* Note that older extensions using the stable ABI set these flags,
* so the bits must not be repurposed.
*/
#define Py_TPFLAGS_HAVE_FINALIZE (1UL << 0)
#define Py_TPFLAGS_HAVE_VERSION_TAG (1UL << 18)
/*
The macros Py_INCREF(op) and Py_DECREF(op) are used to increment or decrement
reference counts. Py_DECREF calls the object's deallocator function when
the refcount falls to 0; for
objects that don't contain references to other objects or heap memory
this can be the standard function free(). Both macros can be used
wherever a void expression is allowed. The argument must not be a
NULL pointer. If it may be NULL, use Py_XINCREF/Py_XDECREF instead.
The macro _Py_NewReference(op) initialize reference counts to 1, and
in special builds (Py_REF_DEBUG, Py_TRACE_REFS) performs additional
bookkeeping appropriate to the special build.
We assume that the reference count field can never overflow; this can
be proven when the size of the field is the same as the pointer size, so
we ignore the possibility. Provided a C int is at least 32 bits (which
is implicitly assumed in many parts of this code), that's enough for
about 2**31 references to an object.
XXX The following became out of date in Python 2.2, but I'm not sure
XXX what the full truth is now. Certainly, heap-allocated type objects
XXX can and should be deallocated.
Type objects should never be deallocated; the type pointer in an object
is not considered to be a reference to the type object, to save
complications in the deallocation function. (This is actually a
decision that's up to the implementer of each new type so if you want,
you can count such references to the type object.)
*/
#if 0 /* disabled by -frewrite-includes */
#if defined(Py_REF_DEBUG) && !defined(Py_LIMITED_API)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 605 "./Include/object.h"
PyAPI_FUNC(void) _Py_NegativeRefcount(const char *filename, int lineno,
PyObject *op);
PyAPI_FUNC(void) _Py_INCREF_IncRefTotal(void);
PyAPI_FUNC(void) _Py_DECREF_DecRefTotal(void);
#endif // Py_REF_DEBUG && !Py_LIMITED_API
# 610 "./Include/object.h"
PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
/*
These are provided as conveniences to Python runtime embedders, so that
they can have object code that is not dependent on Python compilation flags.
*/
PyAPI_FUNC(void) Py_IncRef(PyObject *);
PyAPI_FUNC(void) Py_DecRef(PyObject *);
// Similar to Py_IncRef() and Py_DecRef() but the argument must be non-NULL.
// Private functions used by Py_INCREF() and Py_DECREF().
PyAPI_FUNC(void) _Py_IncRef(PyObject *);
PyAPI_FUNC(void) _Py_DecRef(PyObject *);
static inline Py_ALWAYS_INLINE void Py_INCREF(PyObject *op)
{
#if 0 /* disabled by -frewrite-includes */
#if defined(Py_LIMITED_API) && (Py_LIMITED_API+0 >= 0x030c0000 || defined(Py_REF_DEBUG))
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 628 "./Include/object.h"
// Stable ABI implements Py_INCREF() as a function call on limited C API
// version 3.12 and newer, and on Python built in debug mode. _Py_IncRef()
// was added to Python 3.10.0a7, use Py_IncRef() on older Python versions.
// Py_IncRef() accepts NULL whereas _Py_IncRef() doesn't.
#if 0 /* disabled by -frewrite-includes */
# if Py_LIMITED_API+0 >= 0x030a00A7
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 633 "./Include/object.h"
_Py_IncRef(op);
# else
# 635 "./Include/object.h"
Py_IncRef(op);
# endif
# 637 "./Include/object.h"
#else
# 638 "./Include/object.h"
// Non-limited C API and limited C API for Python 3.9 and older access
// directly PyObject.ob_refcnt.
#if 0 /* disabled by -frewrite-includes */
#if SIZEOF_VOID_P > 4
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 641 "./Include/object.h"
// Portable saturated add, branching on the carry flag and set low bits
PY_UINT32_T cur_refcnt = op->ob_refcnt_split[PY_BIG_ENDIAN];
PY_UINT32_T new_refcnt = cur_refcnt + 1;
if (new_refcnt == 0) {
return;
}
op->ob_refcnt_split[PY_BIG_ENDIAN] = new_refcnt;
#else
# 649 "./Include/object.h"
// Explicitly check immortality against the immortal value
if (_Py_IsImmortal(op)) {
return;
}
op->ob_refcnt++;
#endif
# 655 "./Include/object.h"
_Py_INCREF_STAT_INC();
#ifdef Py_REF_DEBUG
_Py_INCREF_IncRefTotal();
#endif
# 659 "./Include/object.h"
#endif
# 660 "./Include/object.h"
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 662 "./Include/object.h"
# define Py_INCREF(op) Py_INCREF(_PyObject_CAST(op))
#endif
# 664 "./Include/object.h"
#if 0 /* disabled by -frewrite-includes */
#if defined(Py_LIMITED_API) && (Py_LIMITED_API+0 >= 0x030c0000 || defined(Py_REF_DEBUG))
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 666 "./Include/object.h"
// Stable ABI implements Py_DECREF() as a function call on limited C API
// version 3.12 and newer, and on Python built in debug mode. _Py_DecRef() was
// added to Python 3.10.0a7, use Py_DecRef() on older Python versions.
// Py_DecRef() accepts NULL whereas _Py_IncRef() doesn't.
static inline void Py_DECREF(PyObject *op) {
#if 0 /* disabled by -frewrite-includes */
# if Py_LIMITED_API+0 >= 0x030a00A7
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 672 "./Include/object.h"
_Py_DecRef(op);
# else
# 674 "./Include/object.h"
Py_DecRef(op);
# endif
# 676 "./Include/object.h"
}
#define Py_DECREF(op) Py_DECREF(_PyObject_CAST(op))
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(Py_REF_DEBUG)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 680 "./Include/object.h"
static inline void Py_DECREF(const char *filename, int lineno, PyObject *op)
{
if (op->ob_refcnt <= 0) {
_Py_NegativeRefcount(filename, lineno, op);
}
if (_Py_IsImmortal(op)) {
return;
}
_Py_DECREF_STAT_INC();
_Py_DECREF_DecRefTotal();
if (--op->ob_refcnt == 0) {
_Py_Dealloc(op);
}
}
#define Py_DECREF(op) Py_DECREF(__FILE__, __LINE__, _PyObject_CAST(op))
#else
# 697 "./Include/object.h"
static inline Py_ALWAYS_INLINE void Py_DECREF(PyObject *op)
{
// Non-limited C API and limited C API for Python 3.9 and older access
// directly PyObject.ob_refcnt.
if (_Py_IsImmortal(op)) {
return;
}
_Py_DECREF_STAT_INC();
if (--op->ob_refcnt == 0) {
_Py_Dealloc(op);
}
}
#define Py_DECREF(op) Py_DECREF(_PyObject_CAST(op))
#endif
# 711 "./Include/object.h"
/* Safely decref `op` and set `op` to NULL, especially useful in tp_clear
* and tp_dealloc implementations.
*
* Note that "the obvious" code can be deadly:
*
* Py_XDECREF(op);
* op = NULL;
*
* Typically, `op` is something like self->containee, and `self` is done
* using its `containee` member. In the code sequence above, suppose
* `containee` is non-NULL with a refcount of 1. Its refcount falls to
* 0 on the first line, which can trigger an arbitrary amount of code,
* possibly including finalizers (like __del__ methods or weakref callbacks)
* coded in Python, which in turn can release the GIL and allow other threads
* to run, etc. Such code may even invoke methods of `self` again, or cause
* cyclic gc to trigger, but-- oops! --self->containee still points to the
* object being torn down, and it may be in an insane state while being torn
* down. This has in fact been a rich historic source of miserable (rare &
* hard-to-diagnose) segfaulting (and other) bugs.
*
* The safe way is:
*
* Py_CLEAR(op);
*
* That arranges to set `op` to NULL _before_ decref'ing, so that any code
* triggered as a side-effect of `op` getting torn down no longer believes
* `op` points to a valid object.
*
* There are cases where it's safe to use the naive code, but they're brittle.
* For example, if `op` points to a Python integer, you know that destroying
* one of those can't cause problems -- but in part that relies on that
* Python integers aren't currently weakly referencable. Best practice is
* to use Py_CLEAR() even if you can't think of a reason for why you need to.
*
* gh-98724: Use a temporary variable to only evaluate the macro argument once,
* to avoid the duplication of side effects if the argument has side effects.
*
* gh-99701: If the PyObject* type is used with casting arguments to PyObject*,
* the code can be miscompiled with strict aliasing because of type punning.
* With strict aliasing, a compiler considers that two pointers of different
* types cannot read or write the same memory which enables optimization
* opportunities.
*
* If available, use _Py_TYPEOF() to use the 'op' type for temporary variables,
* and so avoid type punning. Otherwise, use memcpy() which causes type erasure
* and so prevents the compiler to reuse an old cached 'op' value after
* Py_CLEAR().
*/
#ifdef _Py_TYPEOF
#define Py_CLEAR(op) \
do { \
_Py_TYPEOF(op)* _tmp_op_ptr = &(op); \
_Py_TYPEOF(op) _tmp_old_op = (*_tmp_op_ptr); \
if (_tmp_old_op != NULL) { \
*_tmp_op_ptr = _Py_NULL; \
Py_DECREF(_tmp_old_op); \
} \
} while (0)
#else
# 772 "./Include/object.h"
#define Py_CLEAR(op) \
do { \
PyObject **_tmp_op_ptr = _Py_CAST(PyObject**, &(op)); \
PyObject *_tmp_old_op = (*_tmp_op_ptr); \
if (_tmp_old_op != NULL) { \
PyObject *_null_ptr = _Py_NULL; \
memcpy(_tmp_op_ptr, &_null_ptr, sizeof(PyObject*)); \
Py_DECREF(_tmp_old_op); \
} \
} while (0)
#endif
# 783 "./Include/object.h"
/* Function to use in case the object pointer can be NULL: */
static inline void Py_XINCREF(PyObject *op)
{
if (op != _Py_NULL) {
Py_INCREF(op);
}
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 793 "./Include/object.h"
# define Py_XINCREF(op) Py_XINCREF(_PyObject_CAST(op))
#endif
# 795 "./Include/object.h"
static inline void Py_XDECREF(PyObject *op)
{
if (op != _Py_NULL) {
Py_DECREF(op);
}
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 803 "./Include/object.h"
# define Py_XDECREF(op) Py_XDECREF(_PyObject_CAST(op))
#endif
# 805 "./Include/object.h"
// Create a new strong reference to an object:
// increment the reference count of the object and return the object.
PyAPI_FUNC(PyObject*) Py_NewRef(PyObject *obj);
// Similar to Py_NewRef(), but the object can be NULL.
PyAPI_FUNC(PyObject*) Py_XNewRef(PyObject *obj);
static inline PyObject* _Py_NewRef(PyObject *obj)
{
Py_INCREF(obj);
return obj;
}
static inline PyObject* _Py_XNewRef(PyObject *obj)
{
Py_XINCREF(obj);
return obj;
}
// Py_NewRef() and Py_XNewRef() are exported as functions for the stable ABI.
// Names overridden with macros by static inline functions for best
// performances.
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 829 "./Include/object.h"
# define Py_NewRef(obj) _Py_NewRef(_PyObject_CAST(obj))
# define Py_XNewRef(obj) _Py_XNewRef(_PyObject_CAST(obj))
#else
# 832 "./Include/object.h"
# define Py_NewRef(obj) _Py_NewRef(obj)
# define Py_XNewRef(obj) _Py_XNewRef(obj)
#endif
# 835 "./Include/object.h"
/*
_Py_NoneStruct is an object of undefined type which can be used in contexts
where NULL (nil) is not suitable (since NULL often means 'error').
Don't forget to apply Py_INCREF() when returning this value!!!
*/
PyAPI_DATA(PyObject) _Py_NoneStruct; /* Don't use this directly */
#define Py_None (&_Py_NoneStruct)
// Test if an object is the None singleton, the same as "x is None" in Python.
PyAPI_FUNC(int) Py_IsNone(PyObject *x);
#define Py_IsNone(x) Py_Is((x), Py_None)
/* Macro for returning Py_None from a function */
#define Py_RETURN_NONE return Py_None
/*
Py_NotImplemented is a singleton used to signal that an operation is
not implemented for a given type combination.
*/
PyAPI_DATA(PyObject) _Py_NotImplementedStruct; /* Don't use this directly */
#define Py_NotImplemented (&_Py_NotImplementedStruct)
/* Macro for returning Py_NotImplemented from a function */
#define Py_RETURN_NOTIMPLEMENTED return Py_NotImplemented
/* Rich comparison opcodes */
#define Py_LT 0
#define Py_LE 1
#define Py_EQ 2
#define Py_NE 3
#define Py_GT 4
#define Py_GE 5
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 872 "./Include/object.h"
/* Result of calling PyIter_Send */
typedef enum {
PYGEN_RETURN = 0,
PYGEN_ERROR = -1,
PYGEN_NEXT = 1,
} PySendResult;
#endif
# 879 "./Include/object.h"
/*
* Macro for implementing rich comparisons
*
* Needs to be a macro because any C-comparable type can be used.
*/
#define Py_RETURN_RICHCOMPARE(val1, val2, op) \
do { \
switch (op) { \
case Py_EQ: if ((val1) == (val2)) Py_RETURN_TRUE; Py_RETURN_FALSE; \
case Py_NE: if ((val1) != (val2)) Py_RETURN_TRUE; Py_RETURN_FALSE; \
case Py_LT: if ((val1) < (val2)) Py_RETURN_TRUE; Py_RETURN_FALSE; \
case Py_GT: if ((val1) > (val2)) Py_RETURN_TRUE; Py_RETURN_FALSE; \
case Py_LE: if ((val1) <= (val2)) Py_RETURN_TRUE; Py_RETURN_FALSE; \
case Py_GE: if ((val1) >= (val2)) Py_RETURN_TRUE; Py_RETURN_FALSE; \
default: \
Py_UNREACHABLE(); \
} \
} while (0)
/*
More conventions
================
Argument Checking
-----------------
Functions that take objects as arguments normally don't check for nil
arguments, but they do check the type of the argument, and return an
error if the function doesn't apply to the type.
Failure Modes
-------------
Functions may fail for a variety of reasons, including running out of
memory. This is communicated to the caller in two ways: an error string
is set (see errors.h), and the function result differs: functions that
normally return a pointer return NULL for failure, functions returning
an integer return -1 (which could be a legal return value too!), and
other functions return 0 for success and -1 for failure.
Callers should always check for errors before using the result. If
an error was set, the caller must either explicitly clear it, or pass
the error on to its caller.
Reference Counts
----------------
It takes a while to get used to the proper usage of reference counts.
Functions that create an object set the reference count to 1; such new
objects must be stored somewhere or destroyed again with Py_DECREF().
Some functions that 'store' objects, such as PyTuple_SetItem() and
PyList_SetItem(),
don't increment the reference count of the object, since the most
frequent use is to store a fresh object. Functions that 'retrieve'
objects, such as PyTuple_GetItem() and PyDict_GetItemString(), also
don't increment
the reference count, since most frequently the object is only looked at
quickly. Thus, to retrieve an object and store it again, the caller
must call Py_INCREF() explicitly.
NOTE: functions that 'consume' a reference count, like
PyList_SetItem(), consume the reference even if the object wasn't
successfully stored, to simplify error handling.
It seems attractive to make other functions that take an object as
argument consume a reference count; however, this may quickly get
confusing (even the current practice is already confusing). Consider
it carefully, it may save lots of calls to Py_INCREF() and Py_DECREF() at
times.
*/
#ifndef Py_LIMITED_API
# define Py_CPYTHON_OBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/object.h"
#endif /* expanded by -frewrite-includes */
# 954 "./Include/object.h"
# 1 "./Include/cpython/object.h" 1
#ifndef Py_CPYTHON_OBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/object.h"
PyAPI_FUNC(void) _Py_NewReference(PyObject *op);
PyAPI_FUNC(void) _Py_NewReferenceNoTotal(PyObject *op);
#ifdef Py_TRACE_REFS
/* Py_TRACE_REFS is such major surgery that we call external routines. */
PyAPI_FUNC(void) _Py_ForgetReference(PyObject *);
#endif
# 12 "./Include/cpython/object.h"
#ifdef Py_REF_DEBUG
/* These are useful as debugging aids when chasing down refleaks. */
PyAPI_FUNC(Py_ssize_t) _Py_GetGlobalRefTotal(void);
# define _Py_GetRefTotal() _Py_GetGlobalRefTotal()
PyAPI_FUNC(Py_ssize_t) _Py_GetLegacyRefTotal(void);
PyAPI_FUNC(Py_ssize_t) _PyInterpreterState_GetRefTotal(PyInterpreterState *);
#endif
# 20 "./Include/cpython/object.h"
/********************* String Literals ****************************************/
/* This structure helps managing static strings. The basic usage goes like this:
Instead of doing
r = PyObject_CallMethod(o, "foo", "args", ...);
do
_Py_IDENTIFIER(foo);
...
r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...);
PyId_foo is a static variable, either on block level or file level. On first
usage, the string "foo" is interned, and the structures are linked. On interpreter
shutdown, all strings are released.
Alternatively, _Py_static_string allows choosing the variable name.
_PyUnicode_FromId returns a borrowed reference to the interned string.
_PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*.
*/
typedef struct _Py_Identifier {
const char* string;
// Index in PyInterpreterState.unicode.ids.array. It is process-wide
// unique and must be initialized to -1.
Py_ssize_t index;
} _Py_Identifier;
#ifndef Py_BUILD_CORE
// For now we are keeping _Py_IDENTIFIER for continued use
// in non-builtin extensions (and naughty PyPI modules).
#define _Py_static_string_init(value) { .string = (value), .index = -1 }
#define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value)
#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname)
#endif /* !Py_BUILD_CORE */
# 58 "./Include/cpython/object.h"
typedef struct {
/* Number implementations must check *both*
arguments for proper type and implement the necessary conversions
in the slot functions themselves. */
binaryfunc nb_add;
binaryfunc nb_subtract;
binaryfunc nb_multiply;
binaryfunc nb_remainder;
binaryfunc nb_divmod;
ternaryfunc nb_power;
unaryfunc nb_negative;
unaryfunc nb_positive;
unaryfunc nb_absolute;
inquiry nb_bool;
unaryfunc nb_invert;
binaryfunc nb_lshift;
binaryfunc nb_rshift;
binaryfunc nb_and;
binaryfunc nb_xor;
binaryfunc nb_or;
unaryfunc nb_int;
void *nb_reserved; /* the slot formerly known as nb_long */
unaryfunc nb_float;
binaryfunc nb_inplace_add;
binaryfunc nb_inplace_subtract;
binaryfunc nb_inplace_multiply;
binaryfunc nb_inplace_remainder;
ternaryfunc nb_inplace_power;
binaryfunc nb_inplace_lshift;
binaryfunc nb_inplace_rshift;
binaryfunc nb_inplace_and;
binaryfunc nb_inplace_xor;
binaryfunc nb_inplace_or;
binaryfunc nb_floor_divide;
binaryfunc nb_true_divide;
binaryfunc nb_inplace_floor_divide;
binaryfunc nb_inplace_true_divide;
unaryfunc nb_index;
binaryfunc nb_matrix_multiply;
binaryfunc nb_inplace_matrix_multiply;
} PyNumberMethods;
typedef struct {
lenfunc sq_length;
binaryfunc sq_concat;
ssizeargfunc sq_repeat;
ssizeargfunc sq_item;
void *was_sq_slice;
ssizeobjargproc sq_ass_item;
void *was_sq_ass_slice;
objobjproc sq_contains;
binaryfunc sq_inplace_concat;
ssizeargfunc sq_inplace_repeat;
} PySequenceMethods;
typedef struct {
lenfunc mp_length;
binaryfunc mp_subscript;
objobjargproc mp_ass_subscript;
} PyMappingMethods;
typedef PySendResult (*sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
typedef struct {
unaryfunc am_await;
unaryfunc am_aiter;
unaryfunc am_anext;
sendfunc am_send;
} PyAsyncMethods;
typedef struct {
getbufferproc bf_getbuffer;
releasebufferproc bf_releasebuffer;
} PyBufferProcs;
/* Allow printfunc in the tp_vectorcall_offset slot for
* backwards-compatibility */
typedef Py_ssize_t printfunc;
// If this structure is modified, Doc/includes/typestruct.h should be updated
// as well.
struct _typeobject {
PyObject_VAR_HEAD
const char *tp_name; /* For printing, in format "<module>.<name>" */
Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */
/* Methods to implement standard operations */
destructor tp_dealloc;
Py_ssize_t tp_vectorcall_offset;
getattrfunc tp_getattr;
setattrfunc tp_setattr;
PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)
or tp_reserved (Python 3) */
reprfunc tp_repr;
/* Method suites for standard classes */
PyNumberMethods *tp_as_number;
PySequenceMethods *tp_as_sequence;
PyMappingMethods *tp_as_mapping;
/* More standard operations (here for binary compatibility) */
hashfunc tp_hash;
ternaryfunc tp_call;
reprfunc tp_str;
getattrofunc tp_getattro;
setattrofunc tp_setattro;
/* Functions to access object as input/output buffer */
PyBufferProcs *tp_as_buffer;
/* Flags to define presence of optional/expanded features */
unsigned long tp_flags;
const char *tp_doc; /* Documentation string */
/* Assigned meaning in release 2.0 */
/* call function for all accessible objects */
traverseproc tp_traverse;
/* delete references to contained objects */
inquiry tp_clear;
/* Assigned meaning in release 2.1 */
/* rich comparisons */
richcmpfunc tp_richcompare;
/* weak reference enabler */
Py_ssize_t tp_weaklistoffset;
/* Iterators */
getiterfunc tp_iter;
iternextfunc tp_iternext;
/* Attribute descriptor and subclassing stuff */
PyMethodDef *tp_methods;
PyMemberDef *tp_members;
PyGetSetDef *tp_getset;
// Strong reference on a heap type, borrowed reference on a static type
PyTypeObject *tp_base;
PyObject *tp_dict;
descrgetfunc tp_descr_get;
descrsetfunc tp_descr_set;
Py_ssize_t tp_dictoffset;
initproc tp_init;
allocfunc tp_alloc;
newfunc tp_new;
freefunc tp_free; /* Low-level free-memory routine */
inquiry tp_is_gc; /* For PyObject_IS_GC */
PyObject *tp_bases;
PyObject *tp_mro; /* method resolution order */
PyObject *tp_cache; /* no longer used */
void *tp_subclasses; /* for static builtin types this is an index */
PyObject *tp_weaklist; /* not used for static builtin types */
destructor tp_del;
/* Type attribute cache version tag. Added in version 2.6 */
unsigned int tp_version_tag;
destructor tp_finalize;
vectorcallfunc tp_vectorcall;
/* bitset of which type-watchers care about this type */
unsigned char tp_watched;
};
/* This struct is used by the specializer
* It should should be treated as an opaque blob
* by code other than the specializer and interpreter. */
struct _specialization_cache {
// In order to avoid bloating the bytecode with lots of inline caches, the
// members of this structure have a somewhat unique contract. They are set
// by the specialization machinery, and are invalidated by PyType_Modified.
// The rules for using them are as follows:
// - If getitem is non-NULL, then it is the same Python function that
// PyType_Lookup(cls, "__getitem__") would return.
// - If getitem is NULL, then getitem_version is meaningless.
// - If getitem->func_version == getitem_version, then getitem can be called
// with two positional arguments and no keyword arguments, and has neither
// *args nor **kwargs (as required by BINARY_SUBSCR_GETITEM):
PyObject *getitem;
uint32_t getitem_version;
};
/* The *real* layout of a type object when allocated on the heap */
typedef struct _heaptypeobject {
/* Note: there's a dependency on the order of these members
in slotptr() in typeobject.c . */
PyTypeObject ht_type;
PyAsyncMethods as_async;
PyNumberMethods as_number;
PyMappingMethods as_mapping;
PySequenceMethods as_sequence; /* as_sequence comes after as_mapping,
so that the mapping wins when both
the mapping and the sequence define
a given operator (e.g. __getitem__).
see add_operators() in typeobject.c . */
PyBufferProcs as_buffer;
PyObject *ht_name, *ht_slots, *ht_qualname;
struct _dictkeysobject *ht_cached_keys;
PyObject *ht_module;
char *_ht_tpname; // Storage for "tp_name"; see PyType_FromModuleAndSpec
struct _specialization_cache _spec_cache; // For use by the specializer.
/* here are optional user slots, followed by the members. */
} PyHeapTypeObject;
PyAPI_FUNC(const char *) _PyType_Name(PyTypeObject *);
PyAPI_FUNC(PyObject *) _PyType_Lookup(PyTypeObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyType_LookupId(PyTypeObject *, _Py_Identifier *);
PyAPI_FUNC(PyObject *) _PyObject_LookupSpecialId(PyObject *, _Py_Identifier *);
#ifndef Py_BUILD_CORE
// Backward compatibility for 3rd-party extensions
// that may be using the old name.
#define _PyObject_LookupSpecial _PyObject_LookupSpecialId
#endif
# 282 "./Include/cpython/object.h"
PyAPI_FUNC(PyTypeObject *) _PyType_CalculateMetaclass(PyTypeObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyType_GetDocFromInternalDoc(const char *, const char *);
PyAPI_FUNC(PyObject *) _PyType_GetTextSignatureFromInternalDoc(const char *, const char *);
PyAPI_FUNC(PyObject *) PyType_GetModuleByDef(PyTypeObject *, PyModuleDef *);
PyAPI_FUNC(PyObject *) PyType_GetDict(PyTypeObject *);
PyAPI_FUNC(int) PyObject_Print(PyObject *, FILE *, int);
PyAPI_FUNC(void) _Py_BreakPoint(void);
PyAPI_FUNC(void) _PyObject_Dump(PyObject *);
PyAPI_FUNC(int) _PyObject_IsFreed(PyObject *);
PyAPI_FUNC(int) _PyObject_IsAbstract(PyObject *);
PyAPI_FUNC(PyObject *) _PyObject_GetAttrId(PyObject *, _Py_Identifier *);
PyAPI_FUNC(int) _PyObject_SetAttrId(PyObject *, _Py_Identifier *, PyObject *);
/* Replacements of PyObject_GetAttr() and _PyObject_GetAttrId() which
don't raise AttributeError.
Return 1 and set *result != NULL if an attribute is found.
Return 0 and set *result == NULL if an attribute is not found;
an AttributeError is silenced.
Return -1 and set *result == NULL if an error other than AttributeError
is raised.
*/
PyAPI_FUNC(int) _PyObject_LookupAttr(PyObject *, PyObject *, PyObject **);
PyAPI_FUNC(int) _PyObject_LookupAttrId(PyObject *, _Py_Identifier *, PyObject **);
PyAPI_FUNC(int) _PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
PyAPI_FUNC(PyObject **) _PyObject_GetDictPtr(PyObject *);
PyAPI_FUNC(PyObject *) _PyObject_NextNotImplemented(PyObject *);
PyAPI_FUNC(void) PyObject_CallFinalizer(PyObject *);
PyAPI_FUNC(int) PyObject_CallFinalizerFromDealloc(PyObject *);
/* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes
dict as the last parameter. */
PyAPI_FUNC(PyObject *)
_PyObject_GenericGetAttrWithDict(PyObject *, PyObject *, PyObject *, int);
PyAPI_FUNC(int)
_PyObject_GenericSetAttrWithDict(PyObject *, PyObject *,
PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyObject_FunctionStr(PyObject *);
/* Safely decref `dst` and set `dst` to `src`.
*
* As in case of Py_CLEAR "the obvious" code can be deadly:
*
* Py_DECREF(dst);
* dst = src;
*
* The safe way is:
*
* Py_SETREF(dst, src);
*
* That arranges to set `dst` to `src` _before_ decref'ing, so that any code
* triggered as a side-effect of `dst` getting torn down no longer believes
* `dst` points to a valid object.
*
* Temporary variables are used to only evalutate macro arguments once and so
* avoid the duplication of side effects. _Py_TYPEOF() or memcpy() is used to
* avoid a miscompilation caused by type punning. See Py_CLEAR() comment for
* implementation details about type punning.
*
* The memcpy() implementation does not emit a compiler warning if 'src' has
* not the same type than 'src': any pointer type is accepted for 'src'.
*/
#ifdef _Py_TYPEOF
#define Py_SETREF(dst, src) \
do { \
_Py_TYPEOF(dst)* _tmp_dst_ptr = &(dst); \
_Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \
*_tmp_dst_ptr = (src); \
Py_DECREF(_tmp_old_dst); \
} while (0)
#else
# 357 "./Include/cpython/object.h"
#define Py_SETREF(dst, src) \
do { \
PyObject **_tmp_dst_ptr = _Py_CAST(PyObject**, &(dst)); \
PyObject *_tmp_old_dst = (*_tmp_dst_ptr); \
PyObject *_tmp_src = _PyObject_CAST(src); \
memcpy(_tmp_dst_ptr, &_tmp_src, sizeof(PyObject*)); \
Py_DECREF(_tmp_old_dst); \
} while (0)
#endif
# 366 "./Include/cpython/object.h"
/* Py_XSETREF() is a variant of Py_SETREF() that uses Py_XDECREF() instead of
* Py_DECREF().
*/
#ifdef _Py_TYPEOF
#define Py_XSETREF(dst, src) \
do { \
_Py_TYPEOF(dst)* _tmp_dst_ptr = &(dst); \
_Py_TYPEOF(dst) _tmp_old_dst = (*_tmp_dst_ptr); \
*_tmp_dst_ptr = (src); \
Py_XDECREF(_tmp_old_dst); \
} while (0)
#else
# 379 "./Include/cpython/object.h"
#define Py_XSETREF(dst, src) \
do { \
PyObject **_tmp_dst_ptr = _Py_CAST(PyObject**, &(dst)); \
PyObject *_tmp_old_dst = (*_tmp_dst_ptr); \
PyObject *_tmp_src = _PyObject_CAST(src); \
memcpy(_tmp_dst_ptr, &_tmp_src, sizeof(PyObject*)); \
Py_XDECREF(_tmp_old_dst); \
} while (0)
#endif
# 388 "./Include/cpython/object.h"
PyAPI_DATA(PyTypeObject) _PyNone_Type;
PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type;
/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE.
* Defined in object.c.
*/
PyAPI_DATA(int) _Py_SwappedOp[];
PyAPI_FUNC(void)
_PyDebugAllocatorStats(FILE *out, const char *block_name, int num_blocks,
size_t sizeof_block);
PyAPI_FUNC(void)
_PyObject_DebugTypeStats(FILE *out);
/* Define a pair of assertion macros:
_PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT().
These work like the regular C assert(), in that they will abort the
process with a message on stderr if the given condition fails to hold,
but compile away to nothing if NDEBUG is defined.
However, before aborting, Python will also try to call _PyObject_Dump() on
the given object. This may be of use when investigating bugs in which a
particular object is corrupt (e.g. buggy a tp_visit method in an extension
module breaking the garbage collector), to help locate the broken objects.
The WITH_MSG variant allows you to supply an additional message that Python
will attempt to print to stderr, after the object dump. */
#ifdef NDEBUG
/* No debugging: compile away the assertions: */
# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \
((void)0)
#else
# 423 "./Include/cpython/object.h"
/* With debugging: generate checks: */
# define _PyObject_ASSERT_FROM(obj, expr, msg, filename, lineno, func) \
((expr) \
? (void)(0) \
: _PyObject_AssertFailed((obj), Py_STRINGIFY(expr), \
(msg), (filename), (lineno), (func)))
#endif
# 430 "./Include/cpython/object.h"
#define _PyObject_ASSERT_WITH_MSG(obj, expr, msg) \
_PyObject_ASSERT_FROM((obj), expr, (msg), __FILE__, __LINE__, __func__)
#define _PyObject_ASSERT(obj, expr) \
_PyObject_ASSERT_WITH_MSG((obj), expr, NULL)
#define _PyObject_ASSERT_FAILED_MSG(obj, msg) \
_PyObject_AssertFailed((obj), NULL, (msg), __FILE__, __LINE__, __func__)
/* Declare and define _PyObject_AssertFailed() even when NDEBUG is defined,
to avoid causing compiler/linker errors when building extensions without
NDEBUG against a Python built with NDEBUG defined.
msg, expr and function can be NULL. */
PyAPI_FUNC(void) _Py_NO_RETURN _PyObject_AssertFailed(
PyObject *obj,
const char *expr,
const char *msg,
const char *file,
int line,
const char *function);
/* Check if an object is consistent. For example, ensure that the reference
counter is greater than or equal to 1, and ensure that ob_type is not NULL.
Call _PyObject_AssertFailed() if the object is inconsistent.
If check_content is zero, only check header fields: reduce the overhead.
The function always return 1. The return value is just here to be able to
write:
assert(_PyObject_CheckConsistency(obj, 1)); */
PyAPI_FUNC(int) _PyObject_CheckConsistency(
PyObject *op,
int check_content);
/* Trashcan mechanism, thanks to Christian Tismer.
When deallocating a container object, it's possible to trigger an unbounded
chain of deallocations, as each Py_DECREF in turn drops the refcount on "the
next" object in the chain to 0. This can easily lead to stack overflows,
especially in threads (which typically have less stack space to work with).
A container object can avoid this by bracketing the body of its tp_dealloc
function with a pair of macros:
static void
mytype_dealloc(mytype *p)
{
... declarations go here ...
PyObject_GC_UnTrack(p); // must untrack first
Py_TRASHCAN_BEGIN(p, mytype_dealloc)
... The body of the deallocator goes here, including all calls ...
... to Py_DECREF on contained objects. ...
Py_TRASHCAN_END // there should be no code after this
}
CAUTION: Never return from the middle of the body! If the body needs to
"get out early", put a label immediately before the Py_TRASHCAN_END
call, and goto it. Else the call-depth counter (see below) will stay
above 0 forever, and the trashcan will never get emptied.
How it works: The BEGIN macro increments a call-depth counter. So long
as this counter is small, the body of the deallocator is run directly without
further ado. But if the counter gets large, it instead adds p to a list of
objects to be deallocated later, skips the body of the deallocator, and
resumes execution after the END macro. The tp_dealloc routine then returns
without deallocating anything (and so unbounded call-stack depth is avoided).
When the call stack finishes unwinding again, code generated by the END macro
notices this, and calls another routine to deallocate all the objects that
may have been added to the list of deferred deallocations. In effect, a
chain of N deallocations is broken into (N-1)/(_PyTrash_UNWIND_LEVEL-1) pieces,
with the call stack never exceeding a depth of _PyTrash_UNWIND_LEVEL.
Since the tp_dealloc of a subclass typically calls the tp_dealloc of the base
class, we need to ensure that the trashcan is only triggered on the tp_dealloc
of the actual class being deallocated. Otherwise we might end up with a
partially-deallocated object. To check this, the tp_dealloc function must be
passed as second argument to Py_TRASHCAN_BEGIN().
*/
/* Python 3.9 private API, invoked by the macros below. */
PyAPI_FUNC(int) _PyTrash_begin(PyThreadState *tstate, PyObject *op);
PyAPI_FUNC(void) _PyTrash_end(PyThreadState *tstate);
/* Python 3.10 private API, invoked by the Py_TRASHCAN_BEGIN(). */
PyAPI_FUNC(int) _PyTrash_cond(PyObject *op, destructor dealloc);
#define Py_TRASHCAN_BEGIN_CONDITION(op, cond) \
do { \
PyThreadState *_tstate = NULL; \
/* If "cond" is false, then _tstate remains NULL and the deallocator \
* is run normally without involving the trashcan */ \
if (cond) { \
_tstate = _PyThreadState_UncheckedGet(); \
if (_PyTrash_begin(_tstate, _PyObject_CAST(op))) { \
break; \
} \
}
/* The body of the deallocator is here. */
#define Py_TRASHCAN_END \
if (_tstate) { \
_PyTrash_end(_tstate); \
} \
} while (0);
#define Py_TRASHCAN_BEGIN(op, dealloc) \
Py_TRASHCAN_BEGIN_CONDITION((op), \
_PyTrash_cond(_PyObject_CAST(op), (destructor)(dealloc)))
/* The following two macros, Py_TRASHCAN_SAFE_BEGIN and
* Py_TRASHCAN_SAFE_END, are deprecated since version 3.11 and
* will be removed in the future.
* Use Py_TRASHCAN_BEGIN and Py_TRASHCAN_END instead.
*/
Py_DEPRECATED(3.11) typedef int UsingDeprecatedTrashcanMacro;
#define Py_TRASHCAN_SAFE_BEGIN(op) \
do { \
UsingDeprecatedTrashcanMacro cond=1; \
Py_TRASHCAN_BEGIN_CONDITION((op), cond);
#define Py_TRASHCAN_SAFE_END(op) \
Py_TRASHCAN_END; \
} while(0);
PyAPI_FUNC(void *) PyObject_GetItemData(PyObject *obj);
PyAPI_FUNC(int) _PyObject_VisitManagedDict(PyObject *obj, visitproc visit, void *arg);
PyAPI_FUNC(void) _PyObject_ClearManagedDict(PyObject *obj);
#define TYPE_MAX_WATCHERS 8
typedef int(*PyType_WatchCallback)(PyTypeObject *);
PyAPI_FUNC(int) PyType_AddWatcher(PyType_WatchCallback callback);
PyAPI_FUNC(int) PyType_ClearWatcher(int watcher_id);
PyAPI_FUNC(int) PyType_Watch(int watcher_id, PyObject *type);
PyAPI_FUNC(int) PyType_Unwatch(int watcher_id, PyObject *type);
/* Attempt to assign a version tag to the given type.
*
* Returns 1 if the type already had a valid version tag or a new one was
* assigned, or 0 if a new tag could not be assigned.
*/
PyAPI_FUNC(int) PyUnstable_Type_AssignVersionTag(PyTypeObject *type);
# 955 "./Include/object.h" 2
# undef Py_CPYTHON_OBJECT_H
#endif
# 957 "./Include/object.h"
static inline int
PyType_HasFeature(PyTypeObject *type, unsigned long feature)
{
unsigned long flags;
#ifdef Py_LIMITED_API
// PyTypeObject is opaque in the limited C API
flags = PyType_GetFlags(type);
#else
# 967 "./Include/object.h"
flags = type->tp_flags;
#endif
# 969 "./Include/object.h"
return ((flags & feature) != 0);
}
#define PyType_FastSubclass(type, flag) PyType_HasFeature((type), (flag))
static inline int PyType_Check(PyObject *op) {
return PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TYPE_SUBCLASS);
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 978 "./Include/object.h"
# define PyType_Check(op) PyType_Check(_PyObject_CAST(op))
#endif
# 980 "./Include/object.h"
#define _PyType_CAST(op) \
(assert(PyType_Check(op)), _Py_CAST(PyTypeObject*, (op)))
static inline int PyType_CheckExact(PyObject *op) {
return Py_IS_TYPE(op, &PyType_Type);
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 988 "./Include/object.h"
# define PyType_CheckExact(op) PyType_CheckExact(_PyObject_CAST(op))
#endif
# 990 "./Include/object.h"
#ifdef __cplusplus
}
#endif
# 994 "./Include/object.h"
#endif // !Py_OBJECT_H
# 995 "./Include/object.h"
# 45 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "objimpl.h"
#endif /* expanded by -frewrite-includes */
# 45 "./Include/Python.h"
# 1 "./Include/objimpl.h" 1
/* The PyObject_ memory family: high-level object memory interfaces.
See pymem.h for the low-level PyMem_ family.
*/
#ifndef Py_OBJIMPL_H
#define Py_OBJIMPL_H
#if 0 /* expanded by -frewrite-includes */
#include "pymem.h"
#endif /* expanded by -frewrite-includes */
# 8 "./Include/objimpl.h"
# 9 "./Include/objimpl.h"
#ifdef __cplusplus
extern "C" {
#endif
# 13 "./Include/objimpl.h"
/* BEWARE:
Each interface exports both functions and macros. Extension modules should
use the functions, to ensure binary compatibility across Python versions.
Because the Python implementation is free to change internal details, and
the macros may (or may not) expose details for speed, if you do use the
macros you must recompile your extensions with each Python release.
Never mix calls to PyObject_ memory functions with calls to the platform
malloc/realloc/ calloc/free, or with calls to PyMem_.
*/
/*
Functions and macros for modules that implement new object types.
- PyObject_New(type, typeobj) allocates memory for a new object of the given
type, and initializes part of it. 'type' must be the C structure type used
to represent the object, and 'typeobj' the address of the corresponding
type object. Reference count and type pointer are filled in; the rest of
the bytes of the object are *undefined*! The resulting expression type is
'type *'. The size of the object is determined by the tp_basicsize field
of the type object.
- PyObject_NewVar(type, typeobj, n) is similar but allocates a variable-size
object with room for n items. In addition to the refcount and type pointer
fields, this also fills in the ob_size field.
- PyObject_Free(op) releases the memory allocated for an object. It does not
run a destructor -- it only frees the memory. PyObject_Free is identical.
- PyObject_Init(op, typeobj) and PyObject_InitVar(op, typeobj, n) don't
allocate memory. Instead of a 'type' parameter, they take a pointer to a
new object (allocated by an arbitrary allocator), and initialize its object
header fields.
Note that objects created with PyObject_{New, NewVar} are allocated using the
specialized Python allocator (implemented in obmalloc.c), if WITH_PYMALLOC is
enabled. In addition, a special debugging allocator is used if Py_DEBUG
macro is also defined.
In case a specific form of memory management is needed (for example, if you
must use the platform malloc heap(s), or shared memory, or C++ local storage or
operator new), you must first allocate the object with your custom allocator,
then pass its pointer to PyObject_{Init, InitVar} for filling in its Python-
specific fields: reference count, type pointer, possibly others. You should
be aware that Python has no control over these objects because they don't
cooperate with the Python memory manager. Such objects may not be eligible
for automatic garbage collection and you have to make sure that they are
released accordingly whenever their destructor gets called (cf. the specific
form of memory management you're using).
Unless you have specific memory management requirements, use
PyObject_{New, NewVar, Del}.
*/
/*
* Raw object memory interface
* ===========================
*/
/* Functions to call the same malloc/realloc/free as used by Python's
object allocator. If WITH_PYMALLOC is enabled, these may differ from
the platform malloc/realloc/free. The Python object allocator is
designed for fast, cache-conscious allocation of many "small" objects,
and with low hidden memory overhead.
PyObject_Malloc(0) returns a unique non-NULL pointer if possible.
PyObject_Realloc(NULL, n) acts like PyObject_Malloc(n).
PyObject_Realloc(p != NULL, 0) does not return NULL, or free the memory
at p.
Returned pointers must be checked for NULL explicitly; no action is
performed on failure other than to return NULL (no warning it printed, no
exception is set, etc).
For allocating objects, use PyObject_{New, NewVar} instead whenever
possible. The PyObject_{Malloc, Realloc, Free} family is exposed
so that you can exploit Python's small-block allocator for non-object
uses. If you must use these routines to allocate object memory, make sure
the object gets initialized via PyObject_{Init, InitVar} after obtaining
the raw memory.
*/
PyAPI_FUNC(void *) PyObject_Malloc(size_t size);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 99 "./Include/objimpl.h"
PyAPI_FUNC(void *) PyObject_Calloc(size_t nelem, size_t elsize);
#endif
# 101 "./Include/objimpl.h"
PyAPI_FUNC(void *) PyObject_Realloc(void *ptr, size_t new_size);
PyAPI_FUNC(void) PyObject_Free(void *ptr);
// Deprecated aliases only kept for backward compatibility.
// PyObject_Del and PyObject_DEL are defined with no parameter to be able to
// use them as function pointers (ex: tp_free = PyObject_Del).
#define PyObject_MALLOC PyObject_Malloc
#define PyObject_REALLOC PyObject_Realloc
#define PyObject_FREE PyObject_Free
#define PyObject_Del PyObject_Free
#define PyObject_DEL PyObject_Free
/*
* Generic object allocator interface
* ==================================
*/
/* Functions */
PyAPI_FUNC(PyObject *) PyObject_Init(PyObject *, PyTypeObject *);
PyAPI_FUNC(PyVarObject *) PyObject_InitVar(PyVarObject *,
PyTypeObject *, Py_ssize_t);
#define PyObject_INIT(op, typeobj) \
PyObject_Init(_PyObject_CAST(op), (typeobj))
#define PyObject_INIT_VAR(op, typeobj, size) \
PyObject_InitVar(_PyVarObject_CAST(op), (typeobj), (size))
PyAPI_FUNC(PyObject *) _PyObject_New(PyTypeObject *);
PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
#define PyObject_New(type, typeobj) ((type *)_PyObject_New(typeobj))
// Alias to PyObject_New(). In Python 3.8, PyObject_NEW() called directly
// PyObject_MALLOC() with _PyObject_SIZE().
#define PyObject_NEW(type, typeobj) PyObject_New(type, (typeobj))
#define PyObject_NewVar(type, typeobj, n) \
( (type *) _PyObject_NewVar((typeobj), (n)) )
// Alias to PyObject_NewVar(). In Python 3.8, PyObject_NEW_VAR() called
// directly PyObject_MALLOC() with _PyObject_VAR_SIZE().
#define PyObject_NEW_VAR(type, typeobj, n) PyObject_NewVar(type, (typeobj), (n))
/*
* Garbage Collection Support
* ==========================
*/
/* C equivalent of gc.collect(). */
PyAPI_FUNC(Py_ssize_t) PyGC_Collect(void);
/* C API for controlling the state of the garbage collector */
PyAPI_FUNC(int) PyGC_Enable(void);
PyAPI_FUNC(int) PyGC_Disable(void);
PyAPI_FUNC(int) PyGC_IsEnabled(void);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 162 "./Include/objimpl.h"
/* Visit all live GC-capable objects, similar to gc.get_objects(None). The
* supplied callback is called on every such object with the void* arg set
* to the supplied arg. Returning 0 from the callback ends iteration, returning
* 1 allows iteration to continue. Returning any other value may result in
* undefined behaviour.
*
* If new objects are (de)allocated by the callback it is undefined if they
* will be visited.
* Garbage collection is disabled during operation. Explicitly running a
* collection in the callback may lead to undefined behaviour e.g. visiting the
* same objects multiple times or not at all.
*/
typedef int (*gcvisitobjects_t)(PyObject*, void*);
PyAPI_FUNC(void) PyUnstable_GC_VisitObjects(gcvisitobjects_t callback, void* arg);
#endif
# 178 "./Include/objimpl.h"
/* Test if a type has a GC head */
#define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC)
PyAPI_FUNC(PyVarObject *) _PyObject_GC_Resize(PyVarObject *, Py_ssize_t);
#define PyObject_GC_Resize(type, op, n) \
( (type *) _PyObject_GC_Resize(_PyVarObject_CAST(op), (n)) )
PyAPI_FUNC(PyObject *) _PyObject_GC_New(PyTypeObject *);
PyAPI_FUNC(PyVarObject *) _PyObject_GC_NewVar(PyTypeObject *, Py_ssize_t);
/* Tell the GC to track this object.
*
* See also private _PyObject_GC_TRACK() macro. */
PyAPI_FUNC(void) PyObject_GC_Track(void *);
/* Tell the GC to stop tracking this object.
*
* See also private _PyObject_GC_UNTRACK() macro. */
PyAPI_FUNC(void) PyObject_GC_UnTrack(void *);
PyAPI_FUNC(void) PyObject_GC_Del(void *);
#define PyObject_GC_New(type, typeobj) \
_Py_CAST(type*, _PyObject_GC_New(typeobj))
#define PyObject_GC_NewVar(type, typeobj, n) \
_Py_CAST(type*, _PyObject_GC_NewVar((typeobj), (n)))
PyAPI_FUNC(int) PyObject_GC_IsTracked(PyObject *);
PyAPI_FUNC(int) PyObject_GC_IsFinalized(PyObject *);
/* Utility macro to help write tp_traverse functions.
* To use this macro, the tp_traverse function must name its arguments
* "visit" and "arg". This is intended to keep tp_traverse functions
* looking as much alike as possible.
*/
#define Py_VISIT(op) \
do { \
if (op) { \
int vret = visit(_PyObject_CAST(op), arg); \
if (vret) \
return vret; \
} \
} while (0)
#ifndef Py_LIMITED_API
# define Py_CPYTHON_OBJIMPL_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/objimpl.h"
#endif /* expanded by -frewrite-includes */
# 227 "./Include/objimpl.h"
# 1 "./Include/cpython/objimpl.h" 1
#ifndef Py_CPYTHON_OBJIMPL_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/objimpl.h"
static inline size_t _PyObject_SIZE(PyTypeObject *type) {
return _Py_STATIC_CAST(size_t, type->tp_basicsize);
}
/* _PyObject_VAR_SIZE returns the number of bytes (as size_t) allocated for a
vrbl-size object with nitems items, exclusive of gc overhead (if any). The
value is rounded up to the closest multiple of sizeof(void *), in order to
ensure that pointer fields at the end of the object are correctly aligned
for the platform (this is of special importance for subclasses of, e.g.,
str or int, so that pointers can be stored after the embedded data).
Note that there's no memory wastage in doing this, as malloc has to
return (at worst) pointer-aligned memory anyway.
*/
#if 0 /* disabled by -frewrite-includes */
#if ((SIZEOF_VOID_P - 1) & SIZEOF_VOID_P) != 0
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 20 "./Include/cpython/objimpl.h"
# error "_PyObject_VAR_SIZE requires SIZEOF_VOID_P be a power of 2"
#endif
# 22 "./Include/cpython/objimpl.h"
static inline size_t _PyObject_VAR_SIZE(PyTypeObject *type, Py_ssize_t nitems) {
size_t size = _Py_STATIC_CAST(size_t, type->tp_basicsize);
size += _Py_STATIC_CAST(size_t, nitems) * _Py_STATIC_CAST(size_t, type->tp_itemsize);
return _Py_SIZE_ROUND_UP(size, SIZEOF_VOID_P);
}
/* This example code implements an object constructor with a custom
allocator, where PyObject_New is inlined, and shows the important
distinction between two steps (at least):
1) the actual allocation of the object storage;
2) the initialization of the Python specific fields
in this storage with PyObject_{Init, InitVar}.
PyObject *
YourObject_New(...)
{
PyObject *op;
op = (PyObject *) Your_Allocator(_PyObject_SIZE(YourTypeStruct));
if (op == NULL) {
return PyErr_NoMemory();
}
PyObject_Init(op, &YourTypeStruct);
op->ob_field = value;
...
return op;
}
Note that in C++, the use of the new operator usually implies that
the 1st step is performed automatically for you, so in a C++ class
constructor you would start directly with PyObject_Init/InitVar. */
typedef struct {
/* user context passed as the first argument to the 2 functions */
void *ctx;
/* allocate an arena of size bytes */
void* (*alloc) (void *ctx, size_t size);
/* free an arena */
void (*free) (void *ctx, void *ptr, size_t size);
} PyObjectArenaAllocator;
/* Get the arena allocator. */
PyAPI_FUNC(void) PyObject_GetArenaAllocator(PyObjectArenaAllocator *allocator);
/* Set the arena allocator. */
PyAPI_FUNC(void) PyObject_SetArenaAllocator(PyObjectArenaAllocator *allocator);
/* Test if an object implements the garbage collector protocol */
PyAPI_FUNC(int) PyObject_IS_GC(PyObject *obj);
/* Code built with Py_BUILD_CORE must include pycore_gc.h instead which
defines a different _PyGC_FINALIZED() macro. */
#ifndef Py_BUILD_CORE
// Kept for backward compatibility with Python 3.8
# define _PyGC_FINALIZED(o) PyObject_GC_IsFinalized(o)
#endif
# 87 "./Include/cpython/objimpl.h"
// Test if a type supports weak references
PyAPI_FUNC(int) PyType_SUPPORTS_WEAKREFS(PyTypeObject *type);
PyAPI_FUNC(PyObject **) PyObject_GET_WEAKREFS_LISTPTR(PyObject *op);
PyAPI_FUNC(PyObject *) PyUnstable_Object_GC_NewWithExtraData(PyTypeObject *,
size_t);
# 228 "./Include/objimpl.h" 2
# undef Py_CPYTHON_OBJIMPL_H
#endif
# 230 "./Include/objimpl.h"
#ifdef __cplusplus
}
#endif
# 234 "./Include/objimpl.h"
#endif /* !Py_OBJIMPL_H */
# 235 "./Include/objimpl.h"
# 46 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "typeslots.h"
#endif /* expanded by -frewrite-includes */
# 46 "./Include/Python.h"
# 1 "./Include/typeslots.h" 1
/* Do not renumber the file; these numbers are part of the stable ABI. */
#define Py_bf_getbuffer 1
#define Py_bf_releasebuffer 2
#define Py_mp_ass_subscript 3
#define Py_mp_length 4
#define Py_mp_subscript 5
#define Py_nb_absolute 6
#define Py_nb_add 7
#define Py_nb_and 8
#define Py_nb_bool 9
#define Py_nb_divmod 10
#define Py_nb_float 11
#define Py_nb_floor_divide 12
#define Py_nb_index 13
#define Py_nb_inplace_add 14
#define Py_nb_inplace_and 15
#define Py_nb_inplace_floor_divide 16
#define Py_nb_inplace_lshift 17
#define Py_nb_inplace_multiply 18
#define Py_nb_inplace_or 19
#define Py_nb_inplace_power 20
#define Py_nb_inplace_remainder 21
#define Py_nb_inplace_rshift 22
#define Py_nb_inplace_subtract 23
#define Py_nb_inplace_true_divide 24
#define Py_nb_inplace_xor 25
#define Py_nb_int 26
#define Py_nb_invert 27
#define Py_nb_lshift 28
#define Py_nb_multiply 29
#define Py_nb_negative 30
#define Py_nb_or 31
#define Py_nb_positive 32
#define Py_nb_power 33
#define Py_nb_remainder 34
#define Py_nb_rshift 35
#define Py_nb_subtract 36
#define Py_nb_true_divide 37
#define Py_nb_xor 38
#define Py_sq_ass_item 39
#define Py_sq_concat 40
#define Py_sq_contains 41
#define Py_sq_inplace_concat 42
#define Py_sq_inplace_repeat 43
#define Py_sq_item 44
#define Py_sq_length 45
#define Py_sq_repeat 46
#define Py_tp_alloc 47
#define Py_tp_base 48
#define Py_tp_bases 49
#define Py_tp_call 50
#define Py_tp_clear 51
#define Py_tp_dealloc 52
#define Py_tp_del 53
#define Py_tp_descr_get 54
#define Py_tp_descr_set 55
#define Py_tp_doc 56
#define Py_tp_getattr 57
#define Py_tp_getattro 58
#define Py_tp_hash 59
#define Py_tp_init 60
#define Py_tp_is_gc 61
#define Py_tp_iter 62
#define Py_tp_iternext 63
#define Py_tp_methods 64
#define Py_tp_new 65
#define Py_tp_repr 66
#define Py_tp_richcompare 67
#define Py_tp_setattr 68
#define Py_tp_setattro 69
#define Py_tp_str 70
#define Py_tp_traverse 71
#define Py_tp_members 72
#define Py_tp_getset 73
#define Py_tp_free 74
#define Py_nb_matrix_multiply 75
#define Py_nb_inplace_matrix_multiply 76
#define Py_am_await 77
#define Py_am_aiter 78
#define Py_am_anext 79
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 82 "./Include/typeslots.h"
/* New in 3.5 */
#define Py_tp_finalize 80
#endif
# 85 "./Include/typeslots.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 86 "./Include/typeslots.h"
/* New in 3.10 */
#define Py_am_send 81
#endif
# 89 "./Include/typeslots.h"
# 47 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pyhash.h"
#endif /* expanded by -frewrite-includes */
# 47 "./Include/Python.h"
# 1 "./Include/pyhash.h" 1
#ifndef Py_HASH_H
#define Py_HASH_H
#ifdef __cplusplus
extern "C" {
#endif
# 7 "./Include/pyhash.h"
/* Helpers for hash functions */
#ifndef Py_LIMITED_API
PyAPI_FUNC(Py_hash_t) _Py_HashDouble(PyObject *, double);
PyAPI_FUNC(Py_hash_t) _Py_HashPointer(const void*);
// Similar to _Py_HashPointer(), but don't replace -1 with -2
PyAPI_FUNC(Py_hash_t) _Py_HashPointerRaw(const void*);
PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t);
#endif
# 16 "./Include/pyhash.h"
/* Prime multiplier used in string and various other hashes. */
#define _PyHASH_MULTIPLIER 1000003UL /* 0xf4243 */
/* Parameters used for the numeric hash implementation. See notes for
_Py_HashDouble in Python/pyhash.c. Numeric hashes are based on
reduction modulo the prime 2**_PyHASH_BITS - 1. */
#if 0 /* disabled by -frewrite-includes */
#if SIZEOF_VOID_P >= 8
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 25 "./Include/pyhash.h"
# define _PyHASH_BITS 61
#else
# 27 "./Include/pyhash.h"
# define _PyHASH_BITS 31
#endif
# 29 "./Include/pyhash.h"
#define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1)
#define _PyHASH_INF 314159
#define _PyHASH_IMAG _PyHASH_MULTIPLIER
/* hash secret
*
* memory layout on 64 bit systems
* cccccccc cccccccc cccccccc uc -- unsigned char[24]
* pppppppp ssssssss ........ fnv -- two Py_hash_t
* k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t
* ........ ........ ssssssss djbx33a -- 16 bytes padding + one Py_hash_t
* ........ ........ eeeeeeee pyexpat XML hash salt
*
* memory layout on 32 bit systems
* cccccccc cccccccc cccccccc uc
* ppppssss ........ ........ fnv -- two Py_hash_t
* k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t (*)
* ........ ........ ssss.... djbx33a -- 16 bytes padding + one Py_hash_t
* ........ ........ eeee.... pyexpat XML hash salt
*
* (*) The siphash member may not be available on 32 bit platforms without
* an unsigned int64 data type.
*/
#ifndef Py_LIMITED_API
typedef union {
/* ensure 24 bytes */
unsigned char uc[24];
/* two Py_hash_t for FNV */
struct {
Py_hash_t prefix;
Py_hash_t suffix;
} fnv;
/* two uint64 for SipHash24 */
struct {
uint64_t k0;
uint64_t k1;
} siphash;
/* a different (!) Py_hash_t for small string optimization */
struct {
unsigned char padding[16];
Py_hash_t suffix;
} djbx33a;
struct {
unsigned char padding[16];
Py_hash_t hashsalt;
} expat;
} _Py_HashSecret_t;
PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret;
#ifdef Py_DEBUG
PyAPI_DATA(int) _Py_HashSecret_Initialized;
#endif
# 83 "./Include/pyhash.h"
/* hash function definition */
typedef struct {
Py_hash_t (*const hash)(const void *, Py_ssize_t);
const char *name;
const int hash_bits;
const int seed_bits;
} PyHash_FuncDef;
PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
#endif
# 95 "./Include/pyhash.h"
/* cutoff for small string DJBX33A optimization in range [1, cutoff).
*
* About 50% of the strings in a typical Python application are smaller than
* 6 to 7 chars. However DJBX33A is vulnerable to hash collision attacks.
* NEVER use DJBX33A for long strings!
*
* A Py_HASH_CUTOFF of 0 disables small string optimization. 32 bit platforms
* should use a smaller cutoff because it is easier to create colliding
* strings. A cutoff of 7 on 64bit platforms and 5 on 32bit platforms should
* provide a decent safety margin.
*/
#ifndef Py_HASH_CUTOFF
# define Py_HASH_CUTOFF 0
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif (Py_HASH_CUTOFF > 7 || Py_HASH_CUTOFF < 0)
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 111 "./Include/pyhash.h"
# error Py_HASH_CUTOFF must in range 0...7.
#endif /* Py_HASH_CUTOFF */
# 113 "./Include/pyhash.h"
/* hash algorithm selection
*
* The values for Py_HASH_* are hard-coded in the
* configure script.
*
* - FNV and SIPHASH* are available on all platforms and architectures.
* - With EXTERNAL embedders can provide an alternative implementation with::
*
* PyHash_FuncDef PyHash_Func = {...};
*
* XXX: Figure out __declspec() for extern PyHash_FuncDef.
*/
#define Py_HASH_EXTERNAL 0
#define Py_HASH_SIPHASH24 1
#define Py_HASH_FNV 2
#define Py_HASH_SIPHASH13 3
#ifndef Py_HASH_ALGORITHM
# ifndef HAVE_ALIGNED_REQUIRED
# define Py_HASH_ALGORITHM Py_HASH_SIPHASH13
# else
# 136 "./Include/pyhash.h"
# define Py_HASH_ALGORITHM Py_HASH_FNV
# endif /* uint64_t && uint32_t && aligned */
# 138 "./Include/pyhash.h"
#endif /* Py_HASH_ALGORITHM */
# 139 "./Include/pyhash.h"
#ifdef __cplusplus
}
#endif
# 143 "./Include/pyhash.h"
#endif /* !Py_HASH_H */
# 145 "./Include/pyhash.h"
# 48 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "cpython/pydebug.h"
#endif /* expanded by -frewrite-includes */
# 48 "./Include/Python.h"
# 1 "./Include/cpython/pydebug.h" 1
#ifndef Py_LIMITED_API
#ifndef Py_PYDEBUG_H
#define Py_PYDEBUG_H
#ifdef __cplusplus
extern "C" {
#endif
# 7 "./Include/cpython/pydebug.h"
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_DebugFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_VerboseFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_QuietFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_InteractiveFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_InspectFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_OptimizeFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_NoSiteFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_BytesWarningFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_FrozenFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_IgnoreEnvironmentFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_DontWriteBytecodeFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_NoUserSiteDirectory;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_UnbufferedStdioFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_HashRandomizationFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_IsolatedFlag;
#ifdef MS_WINDOWS
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_LegacyWindowsFSEncodingFlag;
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_LegacyWindowsStdioFlag;
#endif
# 28 "./Include/cpython/pydebug.h"
/* this is a wrapper around getenv() that pays attention to
Py_IgnoreEnvironmentFlag. It should be used for getting variables like
PYTHONPATH and PYTHONHOME from the environment */
PyAPI_FUNC(char*) Py_GETENV(const char *name);
#ifdef __cplusplus
}
#endif
# 37 "./Include/cpython/pydebug.h"
#endif /* !Py_PYDEBUG_H */
# 38 "./Include/cpython/pydebug.h"
#endif /* Py_LIMITED_API */
# 39 "./Include/cpython/pydebug.h"
# 49 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "bytearrayobject.h"
#endif /* expanded by -frewrite-includes */
# 49 "./Include/Python.h"
# 1 "./Include/bytearrayobject.h" 1
/* ByteArray object interface */
#ifndef Py_BYTEARRAYOBJECT_H
#define Py_BYTEARRAYOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 8 "./Include/bytearrayobject.h"
/* Type PyByteArrayObject represents a mutable array of bytes.
* The Python API is that of a sequence;
* the bytes are mapped to ints in [0, 256).
* Bytes are not characters; they may be used to encode characters.
* The only way to go between bytes and str/unicode is via encoding
* and decoding.
* For the convenience of C programmers, the bytes type is considered
* to contain a char pointer, not an unsigned char pointer.
*/
/* Type object */
PyAPI_DATA(PyTypeObject) PyByteArray_Type;
PyAPI_DATA(PyTypeObject) PyByteArrayIter_Type;
/* Type check macros */
#define PyByteArray_Check(self) PyObject_TypeCheck((self), &PyByteArray_Type)
#define PyByteArray_CheckExact(self) Py_IS_TYPE((self), &PyByteArray_Type)
/* Direct API functions */
PyAPI_FUNC(PyObject *) PyByteArray_FromObject(PyObject *);
PyAPI_FUNC(PyObject *) PyByteArray_Concat(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyByteArray_FromStringAndSize(const char *, Py_ssize_t);
PyAPI_FUNC(Py_ssize_t) PyByteArray_Size(PyObject *);
PyAPI_FUNC(char *) PyByteArray_AsString(PyObject *);
PyAPI_FUNC(int) PyByteArray_Resize(PyObject *, Py_ssize_t);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_BYTEARRAYOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/bytearrayobject.h"
#endif /* expanded by -frewrite-includes */
# 37 "./Include/bytearrayobject.h"
# 1 "./Include/cpython/bytearrayobject.h" 1
#ifndef Py_CPYTHON_BYTEARRAYOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/bytearrayobject.h"
/* Object layout */
typedef struct {
PyObject_VAR_HEAD
Py_ssize_t ob_alloc; /* How many bytes allocated in ob_bytes */
char *ob_bytes; /* Physical backing buffer */
char *ob_start; /* Logical start inside ob_bytes */
Py_ssize_t ob_exports; /* How many buffer exports */
} PyByteArrayObject;
PyAPI_DATA(char) _PyByteArray_empty_string[];
/* Macros and static inline functions, trading safety for speed */
#define _PyByteArray_CAST(op) \
(assert(PyByteArray_Check(op)), _Py_CAST(PyByteArrayObject*, op))
static inline char* PyByteArray_AS_STRING(PyObject *op)
{
PyByteArrayObject *self = _PyByteArray_CAST(op);
if (Py_SIZE(self)) {
return self->ob_start;
}
return _PyByteArray_empty_string;
}
#define PyByteArray_AS_STRING(self) PyByteArray_AS_STRING(_PyObject_CAST(self))
static inline Py_ssize_t PyByteArray_GET_SIZE(PyObject *op) {
PyByteArrayObject *self = _PyByteArray_CAST(op);
return Py_SIZE(self);
}
#define PyByteArray_GET_SIZE(self) PyByteArray_GET_SIZE(_PyObject_CAST(self))
# 38 "./Include/bytearrayobject.h" 2
# undef Py_CPYTHON_BYTEARRAYOBJECT_H
#endif
# 40 "./Include/bytearrayobject.h"
#ifdef __cplusplus
}
#endif
# 44 "./Include/bytearrayobject.h"
#endif /* !Py_BYTEARRAYOBJECT_H */
# 45 "./Include/bytearrayobject.h"
# 50 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "bytesobject.h"
#endif /* expanded by -frewrite-includes */
# 50 "./Include/Python.h"
# 1 "./Include/bytesobject.h" 1
/* Bytes object interface */
#ifndef Py_BYTESOBJECT_H
#define Py_BYTESOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 9 "./Include/bytesobject.h"
#if 0 /* expanded by -frewrite-includes */
#include <stdarg.h> // va_list
#endif /* expanded by -frewrite-includes */
# 10 "./Include/bytesobject.h"
# 1 "/usr/include/stdarg.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2017 Poul-Henning Kamp. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _MACHINE_STDARG_H_
#define _MACHINE_STDARG_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/_stdarg.h>
#endif /* expanded by -frewrite-includes */
# 31 "/usr/include/stdarg.h" 3 4
# 1 "/usr/include/sys/_stdarg.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 2002 David E. O'Brien. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS__STDARG_H_
#define _SYS__STDARG_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 34 "/usr/include/sys/_stdarg.h" 3 4
# 35 "/usr/include/sys/_stdarg.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 35 "/usr/include/sys/_stdarg.h" 3 4
# 36 "/usr/include/sys/_stdarg.h" 3 4
#ifndef _VA_LIST_DECLARED
#define _VA_LIST_DECLARED
typedef __va_list va_list;
#endif
# 41 "/usr/include/sys/_stdarg.h" 3 4
#define va_start(ap, last) __builtin_va_start((ap), (last))
#define va_arg(ap, type) __builtin_va_arg((ap), type)
#define __va_copy(dest, src) __builtin_va_copy((dest), (src))
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 1999
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 46 "/usr/include/sys/_stdarg.h" 3 4
#define va_copy(dest, src) __va_copy(dest, src)
#endif
# 48 "/usr/include/sys/_stdarg.h" 3 4
#define va_end(ap) __builtin_va_end(ap)
#endif /* ! _SYS__STDARG_H_ */
# 51 "/usr/include/sys/_stdarg.h" 3 4
# 32 "/usr/include/stdarg.h" 2 3 4
#ifndef va_start
#error this file needs to be ported to your compiler
#endif
# 36 "/usr/include/stdarg.h" 3 4
#endif /* !_MACHINE_STDARG_H_ */
# 38 "/usr/include/stdarg.h" 3 4
# 11 "./Include/bytesobject.h" 2
/*
Type PyBytesObject represents a byte string. An extra zero byte is
reserved at the end to ensure it is zero-terminated, but a size is
present so strings with null bytes in them can be represented. This
is an immutable object type.
There are functions to create new bytes objects, to test
an object for bytes-ness, and to get the
byte string value. The latter function returns a null pointer
if the object is not of the proper type.
There is a variant that takes an explicit size as well as a
variant that assumes a zero-terminated string. Note that none of the
functions should be applied to NULL pointer.
*/
PyAPI_DATA(PyTypeObject) PyBytes_Type;
PyAPI_DATA(PyTypeObject) PyBytesIter_Type;
#define PyBytes_Check(op) \
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_BYTES_SUBCLASS)
#define PyBytes_CheckExact(op) Py_IS_TYPE((op), &PyBytes_Type)
PyAPI_FUNC(PyObject *) PyBytes_FromStringAndSize(const char *, Py_ssize_t);
PyAPI_FUNC(PyObject *) PyBytes_FromString(const char *);
PyAPI_FUNC(PyObject *) PyBytes_FromObject(PyObject *);
PyAPI_FUNC(PyObject *) PyBytes_FromFormatV(const char*, va_list)
Py_GCC_ATTRIBUTE((format(printf, 1, 0)));
PyAPI_FUNC(PyObject *) PyBytes_FromFormat(const char*, ...)
Py_GCC_ATTRIBUTE((format(printf, 1, 2)));
PyAPI_FUNC(Py_ssize_t) PyBytes_Size(PyObject *);
PyAPI_FUNC(char *) PyBytes_AsString(PyObject *);
PyAPI_FUNC(PyObject *) PyBytes_Repr(PyObject *, int);
PyAPI_FUNC(void) PyBytes_Concat(PyObject **, PyObject *);
PyAPI_FUNC(void) PyBytes_ConcatAndDel(PyObject **, PyObject *);
PyAPI_FUNC(PyObject *) PyBytes_DecodeEscape(const char *, Py_ssize_t,
const char *, Py_ssize_t,
const char *);
/* Provides access to the internal data buffer and size of a bytes object.
Passing NULL as len parameter will force the string buffer to be
0-terminated (passing a string with embedded NUL characters will
cause an exception). */
PyAPI_FUNC(int) PyBytes_AsStringAndSize(
PyObject *obj, /* bytes object */
char **s, /* pointer to buffer variable */
Py_ssize_t *len /* pointer to length variable or NULL */
);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_BYTESOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/bytesobject.h"
#endif /* expanded by -frewrite-includes */
# 62 "./Include/bytesobject.h"
# 1 "./Include/cpython/bytesobject.h" 1
#ifndef Py_CPYTHON_BYTESOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/bytesobject.h"
typedef struct {
PyObject_VAR_HEAD
Py_DEPRECATED(3.11) Py_hash_t ob_shash;
char ob_sval[1];
/* Invariants:
* ob_sval contains space for 'ob_size+1' elements.
* ob_sval[ob_size] == 0.
* ob_shash is the hash of the byte string or -1 if not computed yet.
*/
} PyBytesObject;
PyAPI_FUNC(int) _PyBytes_Resize(PyObject **, Py_ssize_t);
PyAPI_FUNC(PyObject*) _PyBytes_FormatEx(
const char *format,
Py_ssize_t format_len,
PyObject *args,
int use_bytearray);
PyAPI_FUNC(PyObject*) _PyBytes_FromHex(
PyObject *string,
int use_bytearray);
/* Helper for PyBytes_DecodeEscape that detects invalid escape chars. */
PyAPI_FUNC(PyObject *) _PyBytes_DecodeEscape(const char *, Py_ssize_t,
const char *, const char **);
/* Macros and static inline functions, trading safety for speed */
#define _PyBytes_CAST(op) \
(assert(PyBytes_Check(op)), _Py_CAST(PyBytesObject*, op))
static inline char* PyBytes_AS_STRING(PyObject *op)
{
return _PyBytes_CAST(op)->ob_sval;
}
#define PyBytes_AS_STRING(op) PyBytes_AS_STRING(_PyObject_CAST(op))
static inline Py_ssize_t PyBytes_GET_SIZE(PyObject *op) {
PyBytesObject *self = _PyBytes_CAST(op);
return Py_SIZE(self);
}
#define PyBytes_GET_SIZE(self) PyBytes_GET_SIZE(_PyObject_CAST(self))
/* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*,
x must be an iterable object. */
PyAPI_FUNC(PyObject *) _PyBytes_Join(PyObject *sep, PyObject *x);
/* The _PyBytesWriter structure is big: it contains an embedded "stack buffer".
A _PyBytesWriter variable must be declared at the end of variables in a
function to optimize the memory allocation on the stack. */
typedef struct {
/* bytes, bytearray or NULL (when the small buffer is used) */
PyObject *buffer;
/* Number of allocated size. */
Py_ssize_t allocated;
/* Minimum number of allocated bytes,
incremented by _PyBytesWriter_Prepare() */
Py_ssize_t min_size;
/* If non-zero, use a bytearray instead of a bytes object for buffer. */
int use_bytearray;
/* If non-zero, overallocate the buffer (default: 0).
This flag must be zero if use_bytearray is non-zero. */
int overallocate;
/* Stack buffer */
int use_small_buffer;
char small_buffer[512];
} _PyBytesWriter;
/* Initialize a bytes writer
By default, the overallocation is disabled. Set the overallocate attribute
to control the allocation of the buffer. */
PyAPI_FUNC(void) _PyBytesWriter_Init(_PyBytesWriter *writer);
/* Get the buffer content and reset the writer.
Return a bytes object, or a bytearray object if use_bytearray is non-zero.
Raise an exception and return NULL on error. */
PyAPI_FUNC(PyObject *) _PyBytesWriter_Finish(_PyBytesWriter *writer,
void *str);
/* Deallocate memory of a writer (clear its internal buffer). */
PyAPI_FUNC(void) _PyBytesWriter_Dealloc(_PyBytesWriter *writer);
/* Allocate the buffer to write size bytes.
Return the pointer to the beginning of buffer data.
Raise an exception and return NULL on error. */
PyAPI_FUNC(void*) _PyBytesWriter_Alloc(_PyBytesWriter *writer,
Py_ssize_t size);
/* Ensure that the buffer is large enough to write *size* bytes.
Add size to the writer minimum size (min_size attribute).
str is the current pointer inside the buffer.
Return the updated current pointer inside the buffer.
Raise an exception and return NULL on error. */
PyAPI_FUNC(void*) _PyBytesWriter_Prepare(_PyBytesWriter *writer,
void *str,
Py_ssize_t size);
/* Resize the buffer to make it larger.
The new buffer may be larger than size bytes because of overallocation.
Return the updated current pointer inside the buffer.
Raise an exception and return NULL on error.
Note: size must be greater than the number of allocated bytes in the writer.
This function doesn't use the writer minimum size (min_size attribute).
See also _PyBytesWriter_Prepare().
*/
PyAPI_FUNC(void*) _PyBytesWriter_Resize(_PyBytesWriter *writer,
void *str,
Py_ssize_t size);
/* Write bytes.
Raise an exception and return NULL on error. */
PyAPI_FUNC(void*) _PyBytesWriter_WriteBytes(_PyBytesWriter *writer,
void *str,
const void *bytes,
Py_ssize_t size);
# 63 "./Include/bytesobject.h" 2
# undef Py_CPYTHON_BYTESOBJECT_H
#endif
# 65 "./Include/bytesobject.h"
#ifdef __cplusplus
}
#endif
# 69 "./Include/bytesobject.h"
#endif /* !Py_BYTESOBJECT_H */
# 70 "./Include/bytesobject.h"
# 51 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "unicodeobject.h"
#endif /* expanded by -frewrite-includes */
# 51 "./Include/Python.h"
# 1 "./Include/unicodeobject.h" 1
#ifndef Py_UNICODEOBJECT_H
#define Py_UNICODEOBJECT_H
#if 0 /* expanded by -frewrite-includes */
#include <stdarg.h> // va_list
#endif /* expanded by -frewrite-includes */
# 4 "./Include/unicodeobject.h"
# 5 "./Include/unicodeobject.h"
/*
Unicode implementation based on original code by Fredrik Lundh,
modified by Marc-Andre Lemburg (mal@lemburg.com) according to the
Unicode Integration Proposal. (See
http://www.egenix.com/files/python/unicode-proposal.txt).
Copyright (c) Corporation for National Research Initiatives.
Original header:
--------------------------------------------------------------------
* Yet another Unicode string type for Python. This type supports the
* 16-bit Basic Multilingual Plane (BMP) only.
*
* Written by Fredrik Lundh, January 1999.
*
* Copyright (c) 1999 by Secret Labs AB.
* Copyright (c) 1999 by Fredrik Lundh.
*
* fredrik@pythonware.com
* http://www.pythonware.com
*
* --------------------------------------------------------------------
* This Unicode String Type is
*
* Copyright (c) 1999 by Secret Labs AB
* Copyright (c) 1999 by Fredrik Lundh
*
* By obtaining, using, and/or copying this software and/or its
* associated documentation, you agree that you have read, understood,
* and will comply with the following terms and conditions:
*
* Permission to use, copy, modify, and distribute this software and its
* associated documentation for any purpose and without fee is hereby
* granted, provided that the above copyright notice appears in all
* copies, and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of Secret Labs
* AB or the author not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior
* permission.
*
* SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO
* THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* -------------------------------------------------------------------- */
#if 0 /* expanded by -frewrite-includes */
#include <ctype.h>
#endif /* expanded by -frewrite-includes */
# 58 "./Include/unicodeobject.h"
# 1 "/usr/include/ctype.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-3-Clause
*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* This code is derived from software contributed to Berkeley by
* Paul Borman at Krystal Technologies.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)ctype.h 8.4 (Berkeley) 1/21/94
*/
#ifndef _CTYPE_H_
#define _CTYPE_H_
#if 0 /* expanded by -frewrite-includes */
#include <sys/cdefs.h>
#endif /* expanded by -frewrite-includes */
# 45 "/usr/include/ctype.h" 3 4
# 46 "/usr/include/ctype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <sys/_types.h>
#endif /* expanded by -frewrite-includes */
# 46 "/usr/include/ctype.h" 3 4
# 47 "/usr/include/ctype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <_ctype.h>
#endif /* expanded by -frewrite-includes */
# 47 "/usr/include/ctype.h" 3 4
# 48 "/usr/include/ctype.h" 3 4
__BEGIN_DECLS
int isalnum(int);
int isalpha(int);
int iscntrl(int);
int isdigit(int);
int isgraph(int);
int islower(int);
int isprint(int);
int ispunct(int);
int isspace(int);
int isupper(int);
int isxdigit(int);
int tolower(int);
int toupper(int);
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 65 "/usr/include/ctype.h" 3 4
int isascii(int);
int toascii(int);
#endif
# 68 "/usr/include/ctype.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 1999
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 70 "/usr/include/ctype.h" 3 4
int isblank(int);
#endif
# 72 "/usr/include/ctype.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 74 "/usr/include/ctype.h" 3 4
int digittoint(int);
int ishexnumber(int);
int isideogram(int);
int isnumber(int);
int isphonogram(int);
int isrune(int);
int isspecial(int);
#endif
# 82 "/usr/include/ctype.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 84 "/usr/include/ctype.h" 3 4
#if 0 /* expanded by -frewrite-includes */
#include <xlocale/_ctype.h>
#endif /* expanded by -frewrite-includes */
# 84 "/usr/include/ctype.h" 3 4
# 1 "/usr/include/xlocale/_ctype.h" 1 3 4
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2011 The FreeBSD Foundation
*
* This software was developed by David Chisnall under sponsorship from
* the FreeBSD Foundation.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if 0 /* disabled by -frewrite-includes */
#if (defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_WCTYPE_H)) || \
(!defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_CTYPE_H))
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 34 "/usr/include/xlocale/_ctype.h" 3 4
#ifdef _XLOCALE_WCTYPES
#define _XLOCALE_WCTYPE_H
#else
# 38 "/usr/include/xlocale/_ctype.h" 3 4
#define _XLOCALE_CTYPE_H
#endif
# 40 "/usr/include/xlocale/_ctype.h" 3 4
#ifndef _LOCALE_T_DEFINED
#define _LOCALE_T_DEFINED
typedef struct _xlocale *locale_t;
#endif
# 45 "/usr/include/xlocale/_ctype.h" 3 4
#ifndef _XLOCALE_RUN_FUNCTIONS_DEFINED
#define _XLOCALE_RUN_FUNCTIONS_DEFINED 1
unsigned long ___runetype_l(__ct_rune_t, locale_t) __pure;
__ct_rune_t ___tolower_l(__ct_rune_t, locale_t) __pure;
__ct_rune_t ___toupper_l(__ct_rune_t, locale_t) __pure;
_RuneLocale *__runes_for_locale(locale_t, int*);
#endif
# 53 "/usr/include/xlocale/_ctype.h" 3 4
#ifndef _XLOCALE_INLINE
#if 0 /* disabled by -frewrite-includes */
#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 56 "/usr/include/xlocale/_ctype.h" 3 4
/* GNU89 inline has nonstandard semantics. */
#define _XLOCALE_INLINE extern __inline
#else
# 59 "/usr/include/xlocale/_ctype.h" 3 4
/* Hack to work around people who define inline away */
#ifdef inline
#define _XLOCALE_INLINE static __inline
#else
# 63 "/usr/include/xlocale/_ctype.h" 3 4
/* Define with C++ / C99 compatible semantics */
#define _XLOCALE_INLINE inline
#endif
# 66 "/usr/include/xlocale/_ctype.h" 3 4
#endif
# 67 "/usr/include/xlocale/_ctype.h" 3 4
#endif /* _XLOCALE_INLINE */
# 68 "/usr/include/xlocale/_ctype.h" 3 4
#ifdef _XLOCALE_WCTYPES
_XLOCALE_INLINE int
__maskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc);
_XLOCALE_INLINE int
__istype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc);
_XLOCALE_INLINE int
__maskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
{
int __limit;
_RuneLocale *runes = __runes_for_locale(__loc, &__limit);
return ((__c < 0 || __c >= _CACHED_RUNES) ? ___runetype_l(__c, __loc) :
runes->__runetype[__c]) & __f;
}
_XLOCALE_INLINE int
__istype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
{
return (!!__maskrune_l(__c, __f, __loc));
}
#define XLOCALE_ISCTYPE(fname, cat) \
_XLOCALE_INLINE int isw##fname##_l(int, locale_t);\
_XLOCALE_INLINE int isw##fname##_l(int __c, locale_t __l)\
{ return __istype_l(__c, cat, __l); }
#else
# 95 "/usr/include/xlocale/_ctype.h" 3 4
_XLOCALE_INLINE int
__sbmaskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc);
_XLOCALE_INLINE int
__sbistype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc);
_XLOCALE_INLINE int
__sbmaskrune_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
{
int __limit;
_RuneLocale *runes = __runes_for_locale(__loc, &__limit);
return (__c < 0 || __c >= __limit) ? 0 :
runes->__runetype[__c] & __f;
}
_XLOCALE_INLINE int
__sbistype_l(__ct_rune_t __c, unsigned long __f, locale_t __loc)
{
return (!!__sbmaskrune_l(__c, __f, __loc));
}
#define XLOCALE_ISCTYPE(__fname, __cat) \
_XLOCALE_INLINE int is##__fname##_l(int, locale_t); \
_XLOCALE_INLINE int is##__fname##_l(int __c, locale_t __l)\
{ return __sbistype_l(__c, __cat, __l); }
#endif
# 120 "/usr/include/xlocale/_ctype.h" 3 4
XLOCALE_ISCTYPE(alnum, _CTYPE_A|_CTYPE_D|_CTYPE_N)
XLOCALE_ISCTYPE(alpha, _CTYPE_A)
XLOCALE_ISCTYPE(blank, _CTYPE_B)
XLOCALE_ISCTYPE(cntrl, _CTYPE_C)
XLOCALE_ISCTYPE(digit, _CTYPE_D)
XLOCALE_ISCTYPE(graph, _CTYPE_G)
XLOCALE_ISCTYPE(hexnumber, _CTYPE_X)
XLOCALE_ISCTYPE(ideogram, _CTYPE_I)
XLOCALE_ISCTYPE(lower, _CTYPE_L)
XLOCALE_ISCTYPE(number, _CTYPE_D|_CTYPE_N)
XLOCALE_ISCTYPE(phonogram, _CTYPE_Q)
XLOCALE_ISCTYPE(print, _CTYPE_R)
XLOCALE_ISCTYPE(punct, _CTYPE_P)
XLOCALE_ISCTYPE(rune, 0xFFFFFF00L)
XLOCALE_ISCTYPE(space, _CTYPE_S)
XLOCALE_ISCTYPE(special, _CTYPE_T)
XLOCALE_ISCTYPE(upper, _CTYPE_U)
XLOCALE_ISCTYPE(xdigit, _CTYPE_X)
#undef XLOCALE_ISCTYPE
#ifdef _XLOCALE_WCTYPES
_XLOCALE_INLINE int towlower_l(int, locale_t);
_XLOCALE_INLINE int __wcwidth_l(__ct_rune_t, locale_t);
_XLOCALE_INLINE int towupper_l(int, locale_t);
_XLOCALE_INLINE int towlower_l(int __c, locale_t __l)
{
int __limit;
_RuneLocale *__runes = __runes_for_locale(__l, &__limit);
return (__c < 0 || __c >= _CACHED_RUNES) ? ___tolower_l(__c, __l) :
__runes->__maplower[__c];
}
_XLOCALE_INLINE int towupper_l(int __c, locale_t __l)
{
int __limit;
_RuneLocale *__runes = __runes_for_locale(__l, &__limit);
return (__c < 0 || __c >= _CACHED_RUNES) ? ___toupper_l(__c, __l) :
__runes->__mapupper[__c];
}
_XLOCALE_INLINE int
__wcwidth_l(__ct_rune_t _c, locale_t __l)
{
unsigned int _x;
if (_c == 0)
return (0);
_x = (unsigned int)__maskrune_l(_c, _CTYPE_SWM|_CTYPE_R, __l);
if ((_x & _CTYPE_SWM) != 0)
return ((_x & _CTYPE_SWM) >> _CTYPE_SWS);
return ((_x & _CTYPE_R) != 0 ? 1 : -1);
}
int iswctype_l(wint_t __wc, wctype_t __charclass, locale_t __l);
wctype_t wctype_l(const char *property, locale_t __l);
wint_t towctrans_l(wint_t __wc, wctrans_t desc, locale_t __l);
wint_t nextwctype_l(wint_t __wc, wctype_t wct, locale_t __l);
wctrans_t wctrans_l(const char *__charclass, locale_t __l);
#undef _XLOCALE_WCTYPES
#else
# 179 "/usr/include/xlocale/_ctype.h" 3 4
_XLOCALE_INLINE int digittoint_l(int, locale_t);
_XLOCALE_INLINE int tolower_l(int, locale_t);
_XLOCALE_INLINE int toupper_l(int, locale_t);
_XLOCALE_INLINE int digittoint_l(int __c, locale_t __l)
{ return __sbmaskrune_l((__c), 0xFF, __l); }
_XLOCALE_INLINE int tolower_l(int __c, locale_t __l)
{
int __limit;
_RuneLocale *__runes = __runes_for_locale(__l, &__limit);
return (__c < 0 || __c >= __limit) ? __c :
__runes->__maplower[__c];
}
_XLOCALE_INLINE int toupper_l(int __c, locale_t __l)
{
int __limit;
_RuneLocale *__runes = __runes_for_locale(__l, &__limit);
return (__c < 0 || __c >= __limit) ? __c :
__runes->__mapupper[__c];
}
#endif
# 201 "/usr/include/xlocale/_ctype.h" 3 4
#endif /* (defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_WCTYPE_H)) || \
(!defined(_XLOCALE_WCTYPES) && !defined(_XLOCALE_CTYPE_H)) */
# 203 "/usr/include/xlocale/_ctype.h" 3 4
# 85 "/usr/include/ctype.h" 2 3 4
#endif
# 86 "/usr/include/ctype.h" 3 4
__END_DECLS
#ifndef __cplusplus
#define isalnum(c) __sbistype((c), _CTYPE_A|_CTYPE_D|_CTYPE_N)
#define isalpha(c) __sbistype((c), _CTYPE_A)
#define iscntrl(c) __sbistype((c), _CTYPE_C)
#define isdigit(c) __sbistype((c), _CTYPE_D)
#define isgraph(c) __sbistype((c), _CTYPE_G)
#define islower(c) __sbistype((c), _CTYPE_L)
#define isprint(c) __sbistype((c), _CTYPE_R)
#define ispunct(c) __sbistype((c), _CTYPE_P)
#define isspace(c) __sbistype((c), _CTYPE_S)
#define isupper(c) __sbistype((c), _CTYPE_U)
#define isxdigit(c) __sbistype((c), _CTYPE_X)
#define tolower(c) __sbtolower(c)
#define toupper(c) __sbtoupper(c)
#endif /* !__cplusplus */
# 103 "/usr/include/ctype.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __XSI_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 105 "/usr/include/ctype.h" 3 4
/*
* POSIX.1-2001 specifies _tolower() and _toupper() to be macros equivalent to
* tolower() and toupper() respectively, minus extra checking to ensure that
* the argument is a lower or uppercase letter respectively. We've chosen to
* implement these macros with the same error checking as tolower() and
* toupper() since this doesn't violate the specification itself, only its
* intent. We purposely leave _tolower() and _toupper() undocumented to
* discourage their use.
*
* XXX isascii() and toascii() should similarly be undocumented.
*/
#define _tolower(c) __sbtolower(c)
#define _toupper(c) __sbtoupper(c)
#define isascii(c) (((c) & ~0x7F) == 0)
#define toascii(c) ((c) & 0x7F)
#endif
# 121 "/usr/include/ctype.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __ISO_C_VISIBLE >= 1999 && !defined(__cplusplus)
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 123 "/usr/include/ctype.h" 3 4
#define isblank(c) __sbistype((c), _CTYPE_B)
#endif
# 125 "/usr/include/ctype.h" 3 4
#if 0 /* disabled by -frewrite-includes */
#if __BSD_VISIBLE
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 127 "/usr/include/ctype.h" 3 4
#define digittoint(c) __sbmaskrune((c), 0xFF)
#define ishexnumber(c) __sbistype((c), _CTYPE_X)
#define isideogram(c) __sbistype((c), _CTYPE_I)
#define isnumber(c) __sbistype((c), _CTYPE_D|_CTYPE_N)
#define isphonogram(c) __sbistype((c), _CTYPE_Q)
#define isrune(c) __sbistype((c), 0xFFFFFF00L)
#define isspecial(c) __sbistype((c), _CTYPE_T)
#endif
# 135 "/usr/include/ctype.h" 3 4
#endif /* !_CTYPE_H_ */
# 137 "/usr/include/ctype.h" 3 4
# 59 "./Include/unicodeobject.h" 2
/* === Internal API ======================================================= */
/* --- Internal Unicode Format -------------------------------------------- */
/* Python 3.x requires unicode */
#define Py_USING_UNICODE
#ifndef SIZEOF_WCHAR_T
#error Must define SIZEOF_WCHAR_T
#endif
# 70 "./Include/unicodeobject.h"
#define Py_UNICODE_SIZE SIZEOF_WCHAR_T
/* If wchar_t can be used for UCS-4 storage, set Py_UNICODE_WIDE.
Otherwise, Unicode strings are stored as UCS-2 (with limited support
for UTF-16) */
#if 0 /* disabled by -frewrite-includes */
#if Py_UNICODE_SIZE >= 4
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 78 "./Include/unicodeobject.h"
#define Py_UNICODE_WIDE
#endif
# 80 "./Include/unicodeobject.h"
/* Set these flags if the platform has "wchar.h" and the
wchar_t type is a 16-bit unsigned type */
/* #define HAVE_WCHAR_H */
/* #define HAVE_USABLE_WCHAR_T */
/* If the compiler provides a wchar_t type we try to support it
through the interface functions PyUnicode_FromWideChar(),
PyUnicode_AsWideChar() and PyUnicode_AsWideCharString(). */
#ifdef HAVE_USABLE_WCHAR_T
# ifndef HAVE_WCHAR_H
# define HAVE_WCHAR_H
# endif
# 94 "./Include/unicodeobject.h"
#endif
# 95 "./Include/unicodeobject.h"
#ifdef HAVE_WCHAR_H
#if 0 /* expanded by -frewrite-includes */
# include <wchar.h>
#endif /* expanded by -frewrite-includes */
# 97 "./Include/unicodeobject.h"
# 98 "./Include/unicodeobject.h"
#endif
# 99 "./Include/unicodeobject.h"
/* Py_UCS4 and Py_UCS2 are typedefs for the respective
unicode representations. */
typedef uint32_t Py_UCS4;
typedef uint16_t Py_UCS2;
typedef uint8_t Py_UCS1;
#ifdef __cplusplus
extern "C" {
#endif
# 109 "./Include/unicodeobject.h"
PyAPI_DATA(PyTypeObject) PyUnicode_Type;
PyAPI_DATA(PyTypeObject) PyUnicodeIter_Type;
#define PyUnicode_Check(op) \
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_UNICODE_SUBCLASS)
#define PyUnicode_CheckExact(op) Py_IS_TYPE((op), &PyUnicode_Type)
/* --- Constants ---------------------------------------------------------- */
/* This Unicode character will be used as replacement character during
decoding if the errors argument is set to "replace". Note: the
Unicode character U+FFFD is the official REPLACEMENT CHARACTER in
Unicode 3.0. */
#define Py_UNICODE_REPLACEMENT_CHARACTER ((Py_UCS4) 0xFFFD)
/* === Public API ========================================================= */
/* Similar to PyUnicode_FromUnicode(), but u points to UTF-8 encoded bytes */
PyAPI_FUNC(PyObject*) PyUnicode_FromStringAndSize(
const char *u, /* UTF-8 encoded string */
Py_ssize_t size /* size of buffer */
);
/* Similar to PyUnicode_FromUnicode(), but u points to null-terminated
UTF-8 encoded bytes. The size is determined with strlen(). */
PyAPI_FUNC(PyObject*) PyUnicode_FromString(
const char *u /* UTF-8 encoded string */
);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 142 "./Include/unicodeobject.h"
PyAPI_FUNC(PyObject*) PyUnicode_Substring(
PyObject *str,
Py_ssize_t start,
Py_ssize_t end);
#endif
# 147 "./Include/unicodeobject.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 149 "./Include/unicodeobject.h"
/* Copy the string into a UCS4 buffer including the null character if copy_null
is set. Return NULL and raise an exception on error. Raise a SystemError if
the buffer is smaller than the string. Return buffer on success.
buflen is the length of the buffer in (Py_UCS4) characters. */
PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4(
PyObject *unicode,
Py_UCS4* buffer,
Py_ssize_t buflen,
int copy_null);
/* Copy the string into a UCS4 buffer. A new buffer is allocated using
* PyMem_Malloc; if this fails, NULL is returned with a memory error
exception set. */
PyAPI_FUNC(Py_UCS4*) PyUnicode_AsUCS4Copy(PyObject *unicode);
#endif
# 165 "./Include/unicodeobject.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 167 "./Include/unicodeobject.h"
/* Get the length of the Unicode object. */
PyAPI_FUNC(Py_ssize_t) PyUnicode_GetLength(
PyObject *unicode
);
#endif
# 173 "./Include/unicodeobject.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 175 "./Include/unicodeobject.h"
/* Read a character from the string. */
PyAPI_FUNC(Py_UCS4) PyUnicode_ReadChar(
PyObject *unicode,
Py_ssize_t index
);
/* Write a character to the string. The string must have been created through
PyUnicode_New, must not be shared, and must not have been hashed yet.
Return 0 on success, -1 on error. */
PyAPI_FUNC(int) PyUnicode_WriteChar(
PyObject *unicode,
Py_ssize_t index,
Py_UCS4 character
);
#endif
# 193 "./Include/unicodeobject.h"
/* Resize a Unicode object. The length is the number of codepoints.
*unicode is modified to point to the new (resized) object and 0
returned on success.
Try to resize the string in place (which is usually faster than allocating
a new string and copy characters), or create a new string.
Error handling is implemented as follows: an exception is set, -1
is returned and *unicode left untouched.
WARNING: The function doesn't check string content, the result may not be a
string in canonical representation. */
PyAPI_FUNC(int) PyUnicode_Resize(
PyObject **unicode, /* Pointer to the Unicode object */
Py_ssize_t length /* New length */
);
/* Decode obj to a Unicode object.
bytes, bytearray and other bytes-like objects are decoded according to the
given encoding and error handler. The encoding and error handler can be
NULL to have the interface use UTF-8 and "strict".
All other objects (including Unicode objects) raise an exception.
The API returns NULL in case of an error. The caller is responsible
for decref'ing the returned objects.
*/
PyAPI_FUNC(PyObject*) PyUnicode_FromEncodedObject(
PyObject *obj, /* Object */
const char *encoding, /* encoding */
const char *errors /* error handling */
);
/* Copy an instance of a Unicode subtype to a new true Unicode object if
necessary. If obj is already a true Unicode object (not a subtype), return
the reference with *incremented* refcount.
The API returns NULL in case of an error. The caller is responsible
for decref'ing the returned objects.
*/
PyAPI_FUNC(PyObject*) PyUnicode_FromObject(
PyObject *obj /* Object */
);
PyAPI_FUNC(PyObject *) PyUnicode_FromFormatV(
const char *format, /* ASCII-encoded string */
va_list vargs
);
PyAPI_FUNC(PyObject *) PyUnicode_FromFormat(
const char *format, /* ASCII-encoded string */
...
);
PyAPI_FUNC(void) PyUnicode_InternInPlace(PyObject **);
PyAPI_FUNC(PyObject *) PyUnicode_InternFromString(
const char *u /* UTF-8 encoded string */
);
/* --- wchar_t support for platforms which support it --------------------- */
#ifdef HAVE_WCHAR_H
/* Create a Unicode Object from the wchar_t buffer w of the given
size.
The buffer is copied into the new object. */
PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar(
const wchar_t *w, /* wchar_t buffer */
Py_ssize_t size /* size of buffer */
);
/* Copies the Unicode Object contents into the wchar_t buffer w. At
most size wchar_t characters are copied.
Note that the resulting wchar_t string may or may not be
0-terminated. It is the responsibility of the caller to make sure
that the wchar_t string is 0-terminated in case this is required by
the application.
Returns the number of wchar_t characters copied (excluding a
possibly trailing 0-termination character) or -1 in case of an
error. */
PyAPI_FUNC(Py_ssize_t) PyUnicode_AsWideChar(
PyObject *unicode, /* Unicode object */
wchar_t *w, /* wchar_t buffer */
Py_ssize_t size /* size of buffer */
);
/* Convert the Unicode object to a wide character string. The output string
always ends with a nul character. If size is not NULL, write the number of
wide characters (excluding the null character) into *size.
Returns a buffer allocated by PyMem_Malloc() (use PyMem_Free() to free it)
on success. On error, returns NULL, *size is undefined and raises a
MemoryError. */
PyAPI_FUNC(wchar_t*) PyUnicode_AsWideCharString(
PyObject *unicode, /* Unicode object */
Py_ssize_t *size /* number of characters of the result */
);
#endif
# 305 "./Include/unicodeobject.h"
/* --- Unicode ordinals --------------------------------------------------- */
/* Create a Unicode Object from the given Unicode code point ordinal.
The ordinal must be in range(0x110000). A ValueError is
raised in case it is not.
*/
PyAPI_FUNC(PyObject*) PyUnicode_FromOrdinal(int ordinal);
/* === Builtin Codecs =====================================================
Many of these APIs take two arguments encoding and errors. These
parameters encoding and errors have the same semantics as the ones
of the builtin str() API.
Setting encoding to NULL causes the default encoding (UTF-8) to be used.
Error handling is set by errors which may also be set to NULL
meaning to use the default handling defined for the codec. Default
error handling for all builtin codecs is "strict" (ValueErrors are
raised).
The codecs all use a similar interface. Only deviation from the
generic ones are documented.
*/
/* --- Manage the default encoding ---------------------------------------- */
/* Returns "utf-8". */
PyAPI_FUNC(const char*) PyUnicode_GetDefaultEncoding(void);
/* --- Generic Codecs ----------------------------------------------------- */
/* Create a Unicode object by decoding the encoded string s of the
given size. */
PyAPI_FUNC(PyObject*) PyUnicode_Decode(
const char *s, /* encoded string */
Py_ssize_t size, /* size of buffer */
const char *encoding, /* encoding */
const char *errors /* error handling */
);
/* Decode a Unicode object unicode and return the result as Python
object.
This API is DEPRECATED. The only supported standard encoding is rot13.
Use PyCodec_Decode() to decode with rot13 and non-standard codecs
that decode from str. */
Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedObject(
PyObject *unicode, /* Unicode object */
const char *encoding, /* encoding */
const char *errors /* error handling */
);
/* Decode a Unicode object unicode and return the result as Unicode
object.
This API is DEPRECATED. The only supported standard encoding is rot13.
Use PyCodec_Decode() to decode with rot13 and non-standard codecs
that decode from str to str. */
Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsDecodedUnicode(
PyObject *unicode, /* Unicode object */
const char *encoding, /* encoding */
const char *errors /* error handling */
);
/* Encodes a Unicode object and returns the result as Python
object.
This API is DEPRECATED. It is superseded by PyUnicode_AsEncodedString()
since all standard encodings (except rot13) encode str to bytes.
Use PyCodec_Encode() for encoding with rot13 and non-standard codecs
that encode form str to non-bytes. */
Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedObject(
PyObject *unicode, /* Unicode object */
const char *encoding, /* encoding */
const char *errors /* error handling */
);
/* Encodes a Unicode object and returns the result as Python string
object. */
PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedString(
PyObject *unicode, /* Unicode object */
const char *encoding, /* encoding */
const char *errors /* error handling */
);
/* Encodes a Unicode object and returns the result as Unicode
object.
This API is DEPRECATED. The only supported standard encodings is rot13.
Use PyCodec_Encode() to encode with rot13 and non-standard codecs
that encode from str to str. */
Py_DEPRECATED(3.6) PyAPI_FUNC(PyObject*) PyUnicode_AsEncodedUnicode(
PyObject *unicode, /* Unicode object */
const char *encoding, /* encoding */
const char *errors /* error handling */
);
/* Build an encoding map. */
PyAPI_FUNC(PyObject*) PyUnicode_BuildEncodingMap(
PyObject* string /* 256 character map */
);
/* --- UTF-7 Codecs ------------------------------------------------------- */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7(
const char *string, /* UTF-7 encoded string */
Py_ssize_t length, /* size of string */
const char *errors /* error handling */
);
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF7Stateful(
const char *string, /* UTF-7 encoded string */
Py_ssize_t length, /* size of string */
const char *errors, /* error handling */
Py_ssize_t *consumed /* bytes consumed */
);
/* --- UTF-8 Codecs ------------------------------------------------------- */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8(
const char *string, /* UTF-8 encoded string */
Py_ssize_t length, /* size of string */
const char *errors /* error handling */
);
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF8Stateful(
const char *string, /* UTF-8 encoded string */
Py_ssize_t length, /* size of string */
const char *errors, /* error handling */
Py_ssize_t *consumed /* bytes consumed */
);
PyAPI_FUNC(PyObject*) PyUnicode_AsUTF8String(
PyObject *unicode /* Unicode object */
);
/* Returns a pointer to the default encoding (UTF-8) of the
Unicode object unicode and the size of the encoded representation
in bytes stored in *size.
In case of an error, no *size is set.
This function caches the UTF-8 encoded string in the unicodeobject
and subsequent calls will return the same string. The memory is released
when the unicodeobject is deallocated.
*/
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 466 "./Include/unicodeobject.h"
PyAPI_FUNC(const char *) PyUnicode_AsUTF8AndSize(
PyObject *unicode,
Py_ssize_t *size);
#endif
# 470 "./Include/unicodeobject.h"
/* --- UTF-32 Codecs ------------------------------------------------------ */
/* Decodes length bytes from a UTF-32 encoded buffer string and returns
the corresponding Unicode object.
errors (if non-NULL) defines the error handling. It defaults
to "strict".
If byteorder is non-NULL, the decoder starts decoding using the
given byte order:
*byteorder == -1: little endian
*byteorder == 0: native order
*byteorder == 1: big endian
In native mode, the first four bytes of the stream are checked for a
BOM mark. If found, the BOM mark is analysed, the byte order
adjusted and the BOM skipped. In the other modes, no BOM mark
interpretation is done. After completion, *byteorder is set to the
current byte order at the end of input data.
If byteorder is NULL, the codec starts in native order mode.
*/
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32(
const char *string, /* UTF-32 encoded string */
Py_ssize_t length, /* size of string */
const char *errors, /* error handling */
int *byteorder /* pointer to byteorder to use
0=native;-1=LE,1=BE; updated on
exit */
);
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF32Stateful(
const char *string, /* UTF-32 encoded string */
Py_ssize_t length, /* size of string */
const char *errors, /* error handling */
int *byteorder, /* pointer to byteorder to use
0=native;-1=LE,1=BE; updated on
exit */
Py_ssize_t *consumed /* bytes consumed */
);
/* Returns a Python string using the UTF-32 encoding in native byte
order. The string always starts with a BOM mark. */
PyAPI_FUNC(PyObject*) PyUnicode_AsUTF32String(
PyObject *unicode /* Unicode object */
);
/* Returns a Python string object holding the UTF-32 encoded value of
the Unicode data.
If byteorder is not 0, output is written according to the following
byte order:
byteorder == -1: little endian
byteorder == 0: native byte order (writes a BOM mark)
byteorder == 1: big endian
If byteorder is 0, the output string will always start with the
Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is
prepended.
*/
/* --- UTF-16 Codecs ------------------------------------------------------ */
/* Decodes length bytes from a UTF-16 encoded buffer string and returns
the corresponding Unicode object.
errors (if non-NULL) defines the error handling. It defaults
to "strict".
If byteorder is non-NULL, the decoder starts decoding using the
given byte order:
*byteorder == -1: little endian
*byteorder == 0: native order
*byteorder == 1: big endian
In native mode, the first two bytes of the stream are checked for a
BOM mark. If found, the BOM mark is analysed, the byte order
adjusted and the BOM skipped. In the other modes, no BOM mark
interpretation is done. After completion, *byteorder is set to the
current byte order at the end of input data.
If byteorder is NULL, the codec starts in native order mode.
*/
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16(
const char *string, /* UTF-16 encoded string */
Py_ssize_t length, /* size of string */
const char *errors, /* error handling */
int *byteorder /* pointer to byteorder to use
0=native;-1=LE,1=BE; updated on
exit */
);
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUTF16Stateful(
const char *string, /* UTF-16 encoded string */
Py_ssize_t length, /* size of string */
const char *errors, /* error handling */
int *byteorder, /* pointer to byteorder to use
0=native;-1=LE,1=BE; updated on
exit */
Py_ssize_t *consumed /* bytes consumed */
);
/* Returns a Python string using the UTF-16 encoding in native byte
order. The string always starts with a BOM mark. */
PyAPI_FUNC(PyObject*) PyUnicode_AsUTF16String(
PyObject *unicode /* Unicode object */
);
/* --- Unicode-Escape Codecs ---------------------------------------------- */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeUnicodeEscape(
const char *string, /* Unicode-Escape encoded string */
Py_ssize_t length, /* size of string */
const char *errors /* error handling */
);
PyAPI_FUNC(PyObject*) PyUnicode_AsUnicodeEscapeString(
PyObject *unicode /* Unicode object */
);
/* --- Raw-Unicode-Escape Codecs ------------------------------------------ */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeRawUnicodeEscape(
const char *string, /* Raw-Unicode-Escape encoded string */
Py_ssize_t length, /* size of string */
const char *errors /* error handling */
);
PyAPI_FUNC(PyObject*) PyUnicode_AsRawUnicodeEscapeString(
PyObject *unicode /* Unicode object */
);
/* --- Latin-1 Codecs -----------------------------------------------------
Note: Latin-1 corresponds to the first 256 Unicode ordinals. */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeLatin1(
const char *string, /* Latin-1 encoded string */
Py_ssize_t length, /* size of string */
const char *errors /* error handling */
);
PyAPI_FUNC(PyObject*) PyUnicode_AsLatin1String(
PyObject *unicode /* Unicode object */
);
/* --- ASCII Codecs -------------------------------------------------------
Only 7-bit ASCII data is expected. All other codes generate errors.
*/
PyAPI_FUNC(PyObject*) PyUnicode_DecodeASCII(
const char *string, /* ASCII encoded string */
Py_ssize_t length, /* size of string */
const char *errors /* error handling */
);
PyAPI_FUNC(PyObject*) PyUnicode_AsASCIIString(
PyObject *unicode /* Unicode object */
);
/* --- Character Map Codecs -----------------------------------------------
This codec uses mappings to encode and decode characters.
Decoding mappings must map byte ordinals (integers in the range from 0 to
255) to Unicode strings, integers (which are then interpreted as Unicode
ordinals) or None. Unmapped data bytes (ones which cause a LookupError)
as well as mapped to None, 0xFFFE or '\ufffe' are treated as "undefined
mapping" and cause an error.
Encoding mappings must map Unicode ordinal integers to bytes objects,
integers in the range from 0 to 255 or None. Unmapped character
ordinals (ones which cause a LookupError) as well as mapped to
None are treated as "undefined mapping" and cause an error.
*/
PyAPI_FUNC(PyObject*) PyUnicode_DecodeCharmap(
const char *string, /* Encoded string */
Py_ssize_t length, /* size of string */
PyObject *mapping, /* decoding mapping */
const char *errors /* error handling */
);
PyAPI_FUNC(PyObject*) PyUnicode_AsCharmapString(
PyObject *unicode, /* Unicode object */
PyObject *mapping /* encoding mapping */
);
/* --- MBCS codecs for Windows -------------------------------------------- */
#ifdef MS_WINDOWS
PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCS(
const char *string, /* MBCS encoded string */
Py_ssize_t length, /* size of string */
const char *errors /* error handling */
);
PyAPI_FUNC(PyObject*) PyUnicode_DecodeMBCSStateful(
const char *string, /* MBCS encoded string */
Py_ssize_t length, /* size of string */
const char *errors, /* error handling */
Py_ssize_t *consumed /* bytes consumed */
);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 689 "./Include/unicodeobject.h"
PyAPI_FUNC(PyObject*) PyUnicode_DecodeCodePageStateful(
int code_page, /* code page number */
const char *string, /* encoded string */
Py_ssize_t length, /* size of string */
const char *errors, /* error handling */
Py_ssize_t *consumed /* bytes consumed */
);
#endif
# 697 "./Include/unicodeobject.h"
PyAPI_FUNC(PyObject*) PyUnicode_AsMBCSString(
PyObject *unicode /* Unicode object */
);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 703 "./Include/unicodeobject.h"
PyAPI_FUNC(PyObject*) PyUnicode_EncodeCodePage(
int code_page, /* code page number */
PyObject *unicode, /* Unicode object */
const char *errors /* error handling */
);
#endif
# 709 "./Include/unicodeobject.h"
#endif /* MS_WINDOWS */
# 711 "./Include/unicodeobject.h"
/* --- Locale encoding --------------------------------------------------- */
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 715 "./Include/unicodeobject.h"
/* Decode a string from the current locale encoding. The decoder is strict if
*surrogateescape* is equal to zero, otherwise it uses the 'surrogateescape'
error handler (PEP 383) to escape undecodable bytes. If a byte sequence can
be decoded as a surrogate character and *surrogateescape* is not equal to
zero, the byte sequence is escaped using the 'surrogateescape' error handler
instead of being decoded. *str* must end with a null character but cannot
contain embedded null characters. */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocaleAndSize(
const char *str,
Py_ssize_t len,
const char *errors);
/* Similar to PyUnicode_DecodeLocaleAndSize(), but compute the string
length using strlen(). */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeLocale(
const char *str,
const char *errors);
/* Encode a Unicode object to the current locale encoding. The encoder is
strict is *surrogateescape* is equal to zero, otherwise the
"surrogateescape" error handler is used. Return a bytes object. The string
cannot contain embedded null characters. */
PyAPI_FUNC(PyObject*) PyUnicode_EncodeLocale(
PyObject *unicode,
const char *errors
);
#endif
# 745 "./Include/unicodeobject.h"
/* --- File system encoding ---------------------------------------------- */
/* ParseTuple converter: encode str objects to bytes using
PyUnicode_EncodeFSDefault(); bytes objects are output as-is. */
PyAPI_FUNC(int) PyUnicode_FSConverter(PyObject*, void*);
/* ParseTuple converter: decode bytes objects to unicode using
PyUnicode_DecodeFSDefaultAndSize(); str objects are output as-is. */
PyAPI_FUNC(int) PyUnicode_FSDecoder(PyObject*, void*);
/* Decode a null-terminated string from the Python filesystem encoding
and error handler.
If the string length is known, use PyUnicode_DecodeFSDefaultAndSize(). */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefault(
const char *s /* encoded string */
);
/* Decode a string from the Python filesystem encoding and error handler. */
PyAPI_FUNC(PyObject*) PyUnicode_DecodeFSDefaultAndSize(
const char *s, /* encoded string */
Py_ssize_t size /* size */
);
/* Encode a Unicode object to the Python filesystem encoding and error handler.
Return bytes. */
PyAPI_FUNC(PyObject*) PyUnicode_EncodeFSDefault(
PyObject *unicode
);
/* --- Methods & Slots ----------------------------------------------------
These are capable of handling Unicode objects and strings on input
(we refer to them as strings in the descriptions) and return
Unicode objects or integers as appropriate. */
/* Concat two strings giving a new Unicode string. */
PyAPI_FUNC(PyObject*) PyUnicode_Concat(
PyObject *left, /* Left string */
PyObject *right /* Right string */
);
/* Concat two strings and put the result in *pleft
(sets *pleft to NULL on error) */
PyAPI_FUNC(void) PyUnicode_Append(
PyObject **pleft, /* Pointer to left string */
PyObject *right /* Right string */
);
/* Concat two strings, put the result in *pleft and drop the right object
(sets *pleft to NULL on error) */
PyAPI_FUNC(void) PyUnicode_AppendAndDel(
PyObject **pleft, /* Pointer to left string */
PyObject *right /* Right string */
);
/* Split a string giving a list of Unicode strings.
If sep is NULL, splitting will be done at all whitespace
substrings. Otherwise, splits occur at the given separator.
At most maxsplit splits will be done. If negative, no limit is set.
Separators are not included in the resulting list.
*/
PyAPI_FUNC(PyObject*) PyUnicode_Split(
PyObject *s, /* String to split */
PyObject *sep, /* String separator */
Py_ssize_t maxsplit /* Maxsplit count */
);
/* Dito, but split at line breaks.
CRLF is considered to be one line break. Line breaks are not
included in the resulting list. */
PyAPI_FUNC(PyObject*) PyUnicode_Splitlines(
PyObject *s, /* String to split */
int keepends /* If true, line end markers are included */
);
/* Partition a string using a given separator. */
PyAPI_FUNC(PyObject*) PyUnicode_Partition(
PyObject *s, /* String to partition */
PyObject *sep /* String separator */
);
/* Partition a string using a given separator, searching from the end of the
string. */
PyAPI_FUNC(PyObject*) PyUnicode_RPartition(
PyObject *s, /* String to partition */
PyObject *sep /* String separator */
);
/* Split a string giving a list of Unicode strings.
If sep is NULL, splitting will be done at all whitespace
substrings. Otherwise, splits occur at the given separator.
At most maxsplit splits will be done. But unlike PyUnicode_Split
PyUnicode_RSplit splits from the end of the string. If negative,
no limit is set.
Separators are not included in the resulting list.
*/
PyAPI_FUNC(PyObject*) PyUnicode_RSplit(
PyObject *s, /* String to split */
PyObject *sep, /* String separator */
Py_ssize_t maxsplit /* Maxsplit count */
);
/* Translate a string by applying a character mapping table to it and
return the resulting Unicode object.
The mapping table must map Unicode ordinal integers to Unicode strings,
Unicode ordinal integers or None (causing deletion of the character).
Mapping tables may be dictionaries or sequences. Unmapped character
ordinals (ones which cause a LookupError) are left untouched and
are copied as-is.
*/
PyAPI_FUNC(PyObject *) PyUnicode_Translate(
PyObject *str, /* String */
PyObject *table, /* Translate table */
const char *errors /* error handling */
);
/* Join a sequence of strings using the given separator and return
the resulting Unicode string. */
PyAPI_FUNC(PyObject*) PyUnicode_Join(
PyObject *separator, /* Separator string */
PyObject *seq /* Sequence object */
);
/* Return 1 if substr matches str[start:end] at the given tail end, 0
otherwise. */
PyAPI_FUNC(Py_ssize_t) PyUnicode_Tailmatch(
PyObject *str, /* String */
PyObject *substr, /* Prefix or Suffix string */
Py_ssize_t start, /* Start index */
Py_ssize_t end, /* Stop index */
int direction /* Tail end: -1 prefix, +1 suffix */
);
/* Return the first position of substr in str[start:end] using the
given search direction or -1 if not found. -2 is returned in case
an error occurred and an exception is set. */
PyAPI_FUNC(Py_ssize_t) PyUnicode_Find(
PyObject *str, /* String */
PyObject *substr, /* Substring to find */
Py_ssize_t start, /* Start index */
Py_ssize_t end, /* Stop index */
int direction /* Find direction: +1 forward, -1 backward */
);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 918 "./Include/unicodeobject.h"
/* Like PyUnicode_Find, but search for single character only. */
PyAPI_FUNC(Py_ssize_t) PyUnicode_FindChar(
PyObject *str,
Py_UCS4 ch,
Py_ssize_t start,
Py_ssize_t end,
int direction
);
#endif
# 927 "./Include/unicodeobject.h"
/* Count the number of occurrences of substr in str[start:end]. */
PyAPI_FUNC(Py_ssize_t) PyUnicode_Count(
PyObject *str, /* String */
PyObject *substr, /* Substring to count */
Py_ssize_t start, /* Start index */
Py_ssize_t end /* Stop index */
);
/* Replace at most maxcount occurrences of substr in str with replstr
and return the resulting Unicode object. */
PyAPI_FUNC(PyObject *) PyUnicode_Replace(
PyObject *str, /* String */
PyObject *substr, /* Substring to find */
PyObject *replstr, /* Substring to replace */
Py_ssize_t maxcount /* Max. number of replacements to apply;
-1 = all */
);
/* Compare two strings and return -1, 0, 1 for less than, equal,
greater than resp.
Raise an exception and return -1 on error. */
PyAPI_FUNC(int) PyUnicode_Compare(
PyObject *left, /* Left string */
PyObject *right /* Right string */
);
/* Compare a Unicode object with C string and return -1, 0, 1 for less than,
equal, and greater than, respectively. It is best to pass only
ASCII-encoded strings, but the function interprets the input string as
ISO-8859-1 if it contains non-ASCII characters.
This function does not raise exceptions. */
PyAPI_FUNC(int) PyUnicode_CompareWithASCIIString(
PyObject *left,
const char *right /* ASCII-encoded string */
);
/* Rich compare two strings and return one of the following:
- NULL in case an exception was raised
- Py_True or Py_False for successful comparisons
- Py_NotImplemented in case the type combination is unknown
Possible values for op:
Py_GT, Py_GE, Py_EQ, Py_NE, Py_LT, Py_LE
*/
PyAPI_FUNC(PyObject *) PyUnicode_RichCompare(
PyObject *left, /* Left string */
PyObject *right, /* Right string */
int op /* Operation: Py_EQ, Py_NE, Py_GT, etc. */
);
/* Apply an argument tuple or dictionary to a format string and return
the resulting Unicode string. */
PyAPI_FUNC(PyObject *) PyUnicode_Format(
PyObject *format, /* Format string */
PyObject *args /* Argument tuple or dictionary */
);
/* Checks whether element is contained in container and return 1/0
accordingly.
element has to coerce to a one element Unicode string. -1 is
returned in case of an error. */
PyAPI_FUNC(int) PyUnicode_Contains(
PyObject *container, /* Container string */
PyObject *element /* Element string */
);
/* Checks whether argument is a valid identifier. */
PyAPI_FUNC(int) PyUnicode_IsIdentifier(PyObject *s);
/* === Characters Type APIs =============================================== */
#ifndef Py_LIMITED_API
# define Py_CPYTHON_UNICODEOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/unicodeobject.h"
#endif /* expanded by -frewrite-includes */
# 1013 "./Include/unicodeobject.h"
# 1 "./Include/cpython/unicodeobject.h" 1
#ifndef Py_CPYTHON_UNICODEOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/unicodeobject.h"
/* Py_UNICODE was the native Unicode storage format (code unit) used by
Python and represents a single Unicode element in the Unicode type.
With PEP 393, Py_UNICODE is deprecated and replaced with a
typedef to wchar_t. */
#define PY_UNICODE_TYPE wchar_t
/* Py_DEPRECATED(3.3) */ typedef wchar_t Py_UNICODE;
/* --- Internal Unicode Operations ---------------------------------------- */
// Static inline functions to work with surrogates
static inline int Py_UNICODE_IS_SURROGATE(Py_UCS4 ch) {
return (0xD800 <= ch && ch <= 0xDFFF);
}
static inline int Py_UNICODE_IS_HIGH_SURROGATE(Py_UCS4 ch) {
return (0xD800 <= ch && ch <= 0xDBFF);
}
static inline int Py_UNICODE_IS_LOW_SURROGATE(Py_UCS4 ch) {
return (0xDC00 <= ch && ch <= 0xDFFF);
}
// Join two surrogate characters and return a single Py_UCS4 value.
static inline Py_UCS4 Py_UNICODE_JOIN_SURROGATES(Py_UCS4 high, Py_UCS4 low) {
assert(Py_UNICODE_IS_HIGH_SURROGATE(high));
assert(Py_UNICODE_IS_LOW_SURROGATE(low));
return 0x10000 + (((high & 0x03FF) << 10) | (low & 0x03FF));
}
// High surrogate = top 10 bits added to 0xD800.
// The character must be in the range [U+10000; U+10ffff].
static inline Py_UCS4 Py_UNICODE_HIGH_SURROGATE(Py_UCS4 ch) {
assert(0x10000 <= ch && ch <= 0x10ffff);
return (0xD800 - (0x10000 >> 10) + (ch >> 10));
}
// Low surrogate = bottom 10 bits added to 0xDC00.
// The character must be in the range [U+10000; U+10ffff].
static inline Py_UCS4 Py_UNICODE_LOW_SURROGATE(Py_UCS4 ch) {
assert(0x10000 <= ch && ch <= 0x10ffff);
return (0xDC00 + (ch & 0x3FF));
}
/* --- Unicode Type ------------------------------------------------------- */
/* ASCII-only strings created through PyUnicode_New use the PyASCIIObject
structure. state.ascii and state.compact are set, and the data
immediately follow the structure. utf8_length can be found
in the length field; the utf8 pointer is equal to the data pointer. */
typedef struct {
/* There are 4 forms of Unicode strings:
- compact ascii:
* structure = PyASCIIObject
* test: PyUnicode_IS_COMPACT_ASCII(op)
* kind = PyUnicode_1BYTE_KIND
* compact = 1
* ascii = 1
* (length is the length of the utf8)
* (data starts just after the structure)
* (since ASCII is decoded from UTF-8, the utf8 string are the data)
- compact:
* structure = PyCompactUnicodeObject
* test: PyUnicode_IS_COMPACT(op) && !PyUnicode_IS_ASCII(op)
* kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or
PyUnicode_4BYTE_KIND
* compact = 1
* ascii = 0
* utf8 is not shared with data
* utf8_length = 0 if utf8 is NULL
* (data starts just after the structure)
- legacy string:
* structure = PyUnicodeObject structure
* test: !PyUnicode_IS_COMPACT(op)
* kind = PyUnicode_1BYTE_KIND, PyUnicode_2BYTE_KIND or
PyUnicode_4BYTE_KIND
* compact = 0
* data.any is not NULL
* utf8 is shared and utf8_length = length with data.any if ascii = 1
* utf8_length = 0 if utf8 is NULL
Compact strings use only one memory block (structure + characters),
whereas legacy strings use one block for the structure and one block
for characters.
Legacy strings are created by subclasses of Unicode.
See also _PyUnicode_CheckConsistency().
*/
PyObject_HEAD
Py_ssize_t length; /* Number of code points in the string */
Py_hash_t hash; /* Hash value; -1 if not set */
struct {
/* If interned is non-zero, the two references from the
dictionary to this object are *not* counted in ob_refcnt.
The possible values here are:
0: Not Interned
1: Interned
2: Interned and Immortal
3: Interned, Immortal, and Static
This categorization allows the runtime to determine the right
cleanup mechanism at runtime shutdown. */
unsigned int interned:2;
/* Character size:
- PyUnicode_1BYTE_KIND (1):
* character type = Py_UCS1 (8 bits, unsigned)
* all characters are in the range U+0000-U+00FF (latin1)
* if ascii is set, all characters are in the range U+0000-U+007F
(ASCII), otherwise at least one character is in the range
U+0080-U+00FF
- PyUnicode_2BYTE_KIND (2):
* character type = Py_UCS2 (16 bits, unsigned)
* all characters are in the range U+0000-U+FFFF (BMP)
* at least one character is in the range U+0100-U+FFFF
- PyUnicode_4BYTE_KIND (4):
* character type = Py_UCS4 (32 bits, unsigned)
* all characters are in the range U+0000-U+10FFFF
* at least one character is in the range U+10000-U+10FFFF
*/
unsigned int kind:3;
/* Compact is with respect to the allocation scheme. Compact unicode
objects only require one memory block while non-compact objects use
one block for the PyUnicodeObject struct and another for its data
buffer. */
unsigned int compact:1;
/* The string only contains characters in the range U+0000-U+007F (ASCII)
and the kind is PyUnicode_1BYTE_KIND. If ascii is set and compact is
set, use the PyASCIIObject structure. */
unsigned int ascii:1;
/* The object is statically allocated. */
unsigned int statically_allocated:1;
/* Padding to ensure that PyUnicode_DATA() is always aligned to
4 bytes (see issue #19537 on m68k). */
unsigned int :24;
} state;
} PyASCIIObject;
/* Non-ASCII strings allocated through PyUnicode_New use the
PyCompactUnicodeObject structure. state.compact is set, and the data
immediately follow the structure. */
typedef struct {
PyASCIIObject _base;
Py_ssize_t utf8_length; /* Number of bytes in utf8, excluding the
* terminating \0. */
char *utf8; /* UTF-8 representation (null-terminated) */
} PyCompactUnicodeObject;
/* Object format for Unicode subclasses. */
typedef struct {
PyCompactUnicodeObject _base;
union {
void *any;
Py_UCS1 *latin1;
Py_UCS2 *ucs2;
Py_UCS4 *ucs4;
} data; /* Canonical, smallest-form Unicode buffer */
} PyUnicodeObject;
PyAPI_FUNC(int) _PyUnicode_CheckConsistency(
PyObject *op,
int check_content);
#define _PyASCIIObject_CAST(op) \
(assert(PyUnicode_Check(op)), \
_Py_CAST(PyASCIIObject*, (op)))
#define _PyCompactUnicodeObject_CAST(op) \
(assert(PyUnicode_Check(op)), \
_Py_CAST(PyCompactUnicodeObject*, (op)))
#define _PyUnicodeObject_CAST(op) \
(assert(PyUnicode_Check(op)), \
_Py_CAST(PyUnicodeObject*, (op)))
/* --- Flexible String Representation Helper Macros (PEP 393) -------------- */
/* Values for PyASCIIObject.state: */
/* Interning state. */
#define SSTATE_NOT_INTERNED 0
#define SSTATE_INTERNED_MORTAL 1
#define SSTATE_INTERNED_IMMORTAL 2
#define SSTATE_INTERNED_IMMORTAL_STATIC 3
/* Use only if you know it's a string */
static inline unsigned int PyUnicode_CHECK_INTERNED(PyObject *op) {
return _PyASCIIObject_CAST(op)->state.interned;
}
#define PyUnicode_CHECK_INTERNED(op) PyUnicode_CHECK_INTERNED(_PyObject_CAST(op))
/* For backward compatibility */
static inline unsigned int PyUnicode_IS_READY(PyObject* Py_UNUSED(op)) {
return 1;
}
#define PyUnicode_IS_READY(op) PyUnicode_IS_READY(_PyObject_CAST(op))
/* Return true if the string contains only ASCII characters, or 0 if not. The
string may be compact (PyUnicode_IS_COMPACT_ASCII) or not, but must be
ready. */
static inline unsigned int PyUnicode_IS_ASCII(PyObject *op) {
return _PyASCIIObject_CAST(op)->state.ascii;
}
#define PyUnicode_IS_ASCII(op) PyUnicode_IS_ASCII(_PyObject_CAST(op))
/* Return true if the string is compact or 0 if not.
No type checks or Ready calls are performed. */
static inline unsigned int PyUnicode_IS_COMPACT(PyObject *op) {
return _PyASCIIObject_CAST(op)->state.compact;
}
#define PyUnicode_IS_COMPACT(op) PyUnicode_IS_COMPACT(_PyObject_CAST(op))
/* Return true if the string is a compact ASCII string (use PyASCIIObject
structure), or 0 if not. No type checks or Ready calls are performed. */
static inline int PyUnicode_IS_COMPACT_ASCII(PyObject *op) {
return (_PyASCIIObject_CAST(op)->state.ascii && PyUnicode_IS_COMPACT(op));
}
#define PyUnicode_IS_COMPACT_ASCII(op) PyUnicode_IS_COMPACT_ASCII(_PyObject_CAST(op))
enum PyUnicode_Kind {
/* Return values of the PyUnicode_KIND() function: */
PyUnicode_1BYTE_KIND = 1,
PyUnicode_2BYTE_KIND = 2,
PyUnicode_4BYTE_KIND = 4
};
// PyUnicode_KIND(): Return one of the PyUnicode_*_KIND values defined above.
//
// gh-89653: Converting this macro to a static inline function would introduce
// new compiler warnings on "kind < PyUnicode_KIND(str)" (compare signed and
// unsigned numbers) where kind type is an int or on
// "unsigned int kind = PyUnicode_KIND(str)" (cast signed to unsigned).
#define PyUnicode_KIND(op) _Py_RVALUE(_PyASCIIObject_CAST(op)->state.kind)
/* Return a void pointer to the raw unicode buffer. */
static inline void* _PyUnicode_COMPACT_DATA(PyObject *op) {
if (PyUnicode_IS_ASCII(op)) {
return _Py_STATIC_CAST(void*, (_PyASCIIObject_CAST(op) + 1));
}
return _Py_STATIC_CAST(void*, (_PyCompactUnicodeObject_CAST(op) + 1));
}
static inline void* _PyUnicode_NONCOMPACT_DATA(PyObject *op) {
void *data;
assert(!PyUnicode_IS_COMPACT(op));
data = _PyUnicodeObject_CAST(op)->data.any;
assert(data != NULL);
return data;
}
static inline void* PyUnicode_DATA(PyObject *op) {
if (PyUnicode_IS_COMPACT(op)) {
return _PyUnicode_COMPACT_DATA(op);
}
return _PyUnicode_NONCOMPACT_DATA(op);
}
#define PyUnicode_DATA(op) PyUnicode_DATA(_PyObject_CAST(op))
/* Return pointers to the canonical representation cast to unsigned char,
Py_UCS2, or Py_UCS4 for direct character access.
No checks are performed, use PyUnicode_KIND() before to ensure
these will work correctly. */
#define PyUnicode_1BYTE_DATA(op) _Py_STATIC_CAST(Py_UCS1*, PyUnicode_DATA(op))
#define PyUnicode_2BYTE_DATA(op) _Py_STATIC_CAST(Py_UCS2*, PyUnicode_DATA(op))
#define PyUnicode_4BYTE_DATA(op) _Py_STATIC_CAST(Py_UCS4*, PyUnicode_DATA(op))
/* Returns the length of the unicode string. */
static inline Py_ssize_t PyUnicode_GET_LENGTH(PyObject *op) {
return _PyASCIIObject_CAST(op)->length;
}
#define PyUnicode_GET_LENGTH(op) PyUnicode_GET_LENGTH(_PyObject_CAST(op))
/* Write into the canonical representation, this function does not do any sanity
checks and is intended for usage in loops. The caller should cache the
kind and data pointers obtained from other function calls.
index is the index in the string (starts at 0) and value is the new
code point value which should be written to that location. */
static inline void PyUnicode_WRITE(int kind, void *data,
Py_ssize_t index, Py_UCS4 value)
{
assert(index >= 0);
if (kind == PyUnicode_1BYTE_KIND) {
assert(value <= 0xffU);
_Py_STATIC_CAST(Py_UCS1*, data)[index] = _Py_STATIC_CAST(Py_UCS1, value);
}
else if (kind == PyUnicode_2BYTE_KIND) {
assert(value <= 0xffffU);
_Py_STATIC_CAST(Py_UCS2*, data)[index] = _Py_STATIC_CAST(Py_UCS2, value);
}
else {
assert(kind == PyUnicode_4BYTE_KIND);
assert(value <= 0x10ffffU);
_Py_STATIC_CAST(Py_UCS4*, data)[index] = value;
}
}
#define PyUnicode_WRITE(kind, data, index, value) \
PyUnicode_WRITE(_Py_STATIC_CAST(int, kind), _Py_CAST(void*, data), \
(index), _Py_STATIC_CAST(Py_UCS4, value))
/* Read a code point from the string's canonical representation. No checks
or ready calls are performed. */
static inline Py_UCS4 PyUnicode_READ(int kind,
const void *data, Py_ssize_t index)
{
assert(index >= 0);
if (kind == PyUnicode_1BYTE_KIND) {
return _Py_STATIC_CAST(const Py_UCS1*, data)[index];
}
if (kind == PyUnicode_2BYTE_KIND) {
return _Py_STATIC_CAST(const Py_UCS2*, data)[index];
}
assert(kind == PyUnicode_4BYTE_KIND);
return _Py_STATIC_CAST(const Py_UCS4*, data)[index];
}
#define PyUnicode_READ(kind, data, index) \
PyUnicode_READ(_Py_STATIC_CAST(int, kind), \
_Py_STATIC_CAST(const void*, data), \
(index))
/* PyUnicode_READ_CHAR() is less efficient than PyUnicode_READ() because it
calls PyUnicode_KIND() and might call it twice. For single reads, use
PyUnicode_READ_CHAR, for multiple consecutive reads callers should
cache kind and use PyUnicode_READ instead. */
static inline Py_UCS4 PyUnicode_READ_CHAR(PyObject *unicode, Py_ssize_t index)
{
int kind;
assert(index >= 0);
// Tolerate reading the NUL character at str[len(str)]
assert(index <= PyUnicode_GET_LENGTH(unicode));
kind = PyUnicode_KIND(unicode);
if (kind == PyUnicode_1BYTE_KIND) {
return PyUnicode_1BYTE_DATA(unicode)[index];
}
if (kind == PyUnicode_2BYTE_KIND) {
return PyUnicode_2BYTE_DATA(unicode)[index];
}
assert(kind == PyUnicode_4BYTE_KIND);
return PyUnicode_4BYTE_DATA(unicode)[index];
}
#define PyUnicode_READ_CHAR(unicode, index) \
PyUnicode_READ_CHAR(_PyObject_CAST(unicode), (index))
/* Return a maximum character value which is suitable for creating another
string based on op. This is always an approximation but more efficient
than iterating over the string. */
static inline Py_UCS4 PyUnicode_MAX_CHAR_VALUE(PyObject *op)
{
int kind;
if (PyUnicode_IS_ASCII(op)) {
return 0x7fU;
}
kind = PyUnicode_KIND(op);
if (kind == PyUnicode_1BYTE_KIND) {
return 0xffU;
}
if (kind == PyUnicode_2BYTE_KIND) {
return 0xffffU;
}
assert(kind == PyUnicode_4BYTE_KIND);
return 0x10ffffU;
}
#define PyUnicode_MAX_CHAR_VALUE(op) \
PyUnicode_MAX_CHAR_VALUE(_PyObject_CAST(op))
/* === Public API ========================================================= */
/* --- Plain Py_UNICODE --------------------------------------------------- */
/* With PEP 393, this is the recommended way to allocate a new unicode object.
This function will allocate the object and its buffer in a single memory
block. Objects created using this function are not resizable. */
PyAPI_FUNC(PyObject*) PyUnicode_New(
Py_ssize_t size, /* Number of code points in the new string */
Py_UCS4 maxchar /* maximum code point value in the string */
);
/* For backward compatibility */
static inline int PyUnicode_READY(PyObject* Py_UNUSED(op))
{
return 0;
}
#define PyUnicode_READY(op) PyUnicode_READY(_PyObject_CAST(op))
/* Get a copy of a Unicode string. */
PyAPI_FUNC(PyObject*) _PyUnicode_Copy(
PyObject *unicode
);
/* Copy character from one unicode object into another, this function performs
character conversion when necessary and falls back to memcpy() if possible.
Fail if to is too small (smaller than *how_many* or smaller than
len(from)-from_start), or if kind(from[from_start:from_start+how_many]) >
kind(to), or if *to* has more than 1 reference.
Return the number of written character, or return -1 and raise an exception
on error.
Pseudo-code:
how_many = min(how_many, len(from) - from_start)
to[to_start:to_start+how_many] = from[from_start:from_start+how_many]
return how_many
Note: The function doesn't write a terminating null character.
*/
PyAPI_FUNC(Py_ssize_t) PyUnicode_CopyCharacters(
PyObject *to,
Py_ssize_t to_start,
PyObject *from,
Py_ssize_t from_start,
Py_ssize_t how_many
);
/* Unsafe version of PyUnicode_CopyCharacters(): don't check arguments and so
may crash if parameters are invalid (e.g. if the output string
is too short). */
PyAPI_FUNC(void) _PyUnicode_FastCopyCharacters(
PyObject *to,
Py_ssize_t to_start,
PyObject *from,
Py_ssize_t from_start,
Py_ssize_t how_many
);
/* Fill a string with a character: write fill_char into
unicode[start:start+length].
Fail if fill_char is bigger than the string maximum character, or if the
string has more than 1 reference.
Return the number of written character, or return -1 and raise an exception
on error. */
PyAPI_FUNC(Py_ssize_t) PyUnicode_Fill(
PyObject *unicode,
Py_ssize_t start,
Py_ssize_t length,
Py_UCS4 fill_char
);
/* Unsafe version of PyUnicode_Fill(): don't check arguments and so may crash
if parameters are invalid (e.g. if length is longer than the string). */
PyAPI_FUNC(void) _PyUnicode_FastFill(
PyObject *unicode,
Py_ssize_t start,
Py_ssize_t length,
Py_UCS4 fill_char
);
/* Create a new string from a buffer of Py_UCS1, Py_UCS2 or Py_UCS4 characters.
Scan the string to find the maximum character. */
PyAPI_FUNC(PyObject*) PyUnicode_FromKindAndData(
int kind,
const void *buffer,
Py_ssize_t size);
/* Create a new string from a buffer of ASCII characters.
WARNING: Don't check if the string contains any non-ASCII character. */
PyAPI_FUNC(PyObject*) _PyUnicode_FromASCII(
const char *buffer,
Py_ssize_t size);
/* Compute the maximum character of the substring unicode[start:end].
Return 127 for an empty string. */
PyAPI_FUNC(Py_UCS4) _PyUnicode_FindMaxChar (
PyObject *unicode,
Py_ssize_t start,
Py_ssize_t end);
/* --- _PyUnicodeWriter API ----------------------------------------------- */
typedef struct {
PyObject *buffer;
void *data;
int kind;
Py_UCS4 maxchar;
Py_ssize_t size;
Py_ssize_t pos;
/* minimum number of allocated characters (default: 0) */
Py_ssize_t min_length;
/* minimum character (default: 127, ASCII) */
Py_UCS4 min_char;
/* If non-zero, overallocate the buffer (default: 0). */
unsigned char overallocate;
/* If readonly is 1, buffer is a shared string (cannot be modified)
and size is set to 0. */
unsigned char readonly;
} _PyUnicodeWriter ;
/* Initialize a Unicode writer.
*
* By default, the minimum buffer size is 0 character and overallocation is
* disabled. Set min_length, min_char and overallocate attributes to control
* the allocation of the buffer. */
PyAPI_FUNC(void)
_PyUnicodeWriter_Init(_PyUnicodeWriter *writer);
/* Prepare the buffer to write 'length' characters
with the specified maximum character.
Return 0 on success, raise an exception and return -1 on error. */
#define _PyUnicodeWriter_Prepare(WRITER, LENGTH, MAXCHAR) \
(((MAXCHAR) <= (WRITER)->maxchar \
&& (LENGTH) <= (WRITER)->size - (WRITER)->pos) \
? 0 \
: (((LENGTH) == 0) \
? 0 \
: _PyUnicodeWriter_PrepareInternal((WRITER), (LENGTH), (MAXCHAR))))
/* Don't call this function directly, use the _PyUnicodeWriter_Prepare() macro
instead. */
PyAPI_FUNC(int)
_PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
Py_ssize_t length, Py_UCS4 maxchar);
/* Prepare the buffer to have at least the kind KIND.
For example, kind=PyUnicode_2BYTE_KIND ensures that the writer will
support characters in range U+000-U+FFFF.
Return 0 on success, raise an exception and return -1 on error. */
#define _PyUnicodeWriter_PrepareKind(WRITER, KIND) \
((KIND) <= (WRITER)->kind \
? 0 \
: _PyUnicodeWriter_PrepareKindInternal((WRITER), (KIND)))
/* Don't call this function directly, use the _PyUnicodeWriter_PrepareKind()
macro instead. */
PyAPI_FUNC(int)
_PyUnicodeWriter_PrepareKindInternal(_PyUnicodeWriter *writer,
int kind);
/* Append a Unicode character.
Return 0 on success, raise an exception and return -1 on error. */
PyAPI_FUNC(int)
_PyUnicodeWriter_WriteChar(_PyUnicodeWriter *writer,
Py_UCS4 ch
);
/* Append a Unicode string.
Return 0 on success, raise an exception and return -1 on error. */
PyAPI_FUNC(int)
_PyUnicodeWriter_WriteStr(_PyUnicodeWriter *writer,
PyObject *str /* Unicode string */
);
/* Append a substring of a Unicode string.
Return 0 on success, raise an exception and return -1 on error. */
PyAPI_FUNC(int)
_PyUnicodeWriter_WriteSubstring(_PyUnicodeWriter *writer,
PyObject *str, /* Unicode string */
Py_ssize_t start,
Py_ssize_t end
);
/* Append an ASCII-encoded byte string.
Return 0 on success, raise an exception and return -1 on error. */
PyAPI_FUNC(int)
_PyUnicodeWriter_WriteASCIIString(_PyUnicodeWriter *writer,
const char *str, /* ASCII-encoded byte string */
Py_ssize_t len /* number of bytes, or -1 if unknown */
);
/* Append a latin1-encoded byte string.
Return 0 on success, raise an exception and return -1 on error. */
PyAPI_FUNC(int)
_PyUnicodeWriter_WriteLatin1String(_PyUnicodeWriter *writer,
const char *str, /* latin1-encoded byte string */
Py_ssize_t len /* length in bytes */
);
/* Get the value of the writer as a Unicode string. Clear the
buffer of the writer. Raise an exception and return NULL
on error. */
PyAPI_FUNC(PyObject *)
_PyUnicodeWriter_Finish(_PyUnicodeWriter *writer);
/* Deallocate memory of a writer (clear its internal buffer). */
PyAPI_FUNC(void)
_PyUnicodeWriter_Dealloc(_PyUnicodeWriter *writer);
/* Format the object based on the format_spec, as defined in PEP 3101
(Advanced String Formatting). */
PyAPI_FUNC(int) _PyUnicode_FormatAdvancedWriter(
_PyUnicodeWriter *writer,
PyObject *obj,
PyObject *format_spec,
Py_ssize_t start,
Py_ssize_t end);
/* --- Manage the default encoding ---------------------------------------- */
/* Returns a pointer to the default encoding (UTF-8) of the
Unicode object unicode.
Like PyUnicode_AsUTF8AndSize(), this also caches the UTF-8 representation
in the unicodeobject.
_PyUnicode_AsString is a #define for PyUnicode_AsUTF8 to
support the previous internal function with the same behaviour.
Use of this API is DEPRECATED since no size information can be
extracted from the returned data.
*/
PyAPI_FUNC(const char *) PyUnicode_AsUTF8(PyObject *unicode);
#define _PyUnicode_AsString PyUnicode_AsUTF8
/* --- UTF-7 Codecs ------------------------------------------------------- */
PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF7(
PyObject *unicode, /* Unicode object */
int base64SetO, /* Encode RFC2152 Set O characters in base64 */
int base64WhiteSpace, /* Encode whitespace (sp, ht, nl, cr) in base64 */
const char *errors /* error handling */
);
/* --- UTF-8 Codecs ------------------------------------------------------- */
PyAPI_FUNC(PyObject*) _PyUnicode_AsUTF8String(
PyObject *unicode,
const char *errors);
/* --- UTF-32 Codecs ------------------------------------------------------ */
PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF32(
PyObject *object, /* Unicode object */
const char *errors, /* error handling */
int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
);
/* --- UTF-16 Codecs ------------------------------------------------------ */
/* Returns a Python string object holding the UTF-16 encoded value of
the Unicode data.
If byteorder is not 0, output is written according to the following
byte order:
byteorder == -1: little endian
byteorder == 0: native byte order (writes a BOM mark)
byteorder == 1: big endian
If byteorder is 0, the output string will always start with the
Unicode BOM mark (U+FEFF). In the other two modes, no BOM mark is
prepended.
*/
PyAPI_FUNC(PyObject*) _PyUnicode_EncodeUTF16(
PyObject* unicode, /* Unicode object */
const char *errors, /* error handling */
int byteorder /* byteorder to use 0=BOM+native;-1=LE,1=BE */
);
/* --- Unicode-Escape Codecs ---------------------------------------------- */
/* Variant of PyUnicode_DecodeUnicodeEscape that supports partial decoding. */
PyAPI_FUNC(PyObject*) _PyUnicode_DecodeUnicodeEscapeStateful(
const char *string, /* Unicode-Escape encoded string */
Py_ssize_t length, /* size of string */
const char *errors, /* error handling */
Py_ssize_t *consumed /* bytes consumed */
);
/* Helper for PyUnicode_DecodeUnicodeEscape that detects invalid escape
chars. */
PyAPI_FUNC(PyObject*) _PyUnicode_DecodeUnicodeEscapeInternal(
const char *string, /* Unicode-Escape encoded string */
Py_ssize_t length, /* size of string */
const char *errors, /* error handling */
Py_ssize_t *consumed, /* bytes consumed */
const char **first_invalid_escape /* on return, points to first
invalid escaped char in
string. */
);
/* --- Raw-Unicode-Escape Codecs ---------------------------------------------- */
/* Variant of PyUnicode_DecodeRawUnicodeEscape that supports partial decoding. */
PyAPI_FUNC(PyObject*) _PyUnicode_DecodeRawUnicodeEscapeStateful(
const char *string, /* Unicode-Escape encoded string */
Py_ssize_t length, /* size of string */
const char *errors, /* error handling */
Py_ssize_t *consumed /* bytes consumed */
);
/* --- Latin-1 Codecs ----------------------------------------------------- */
PyAPI_FUNC(PyObject*) _PyUnicode_AsLatin1String(
PyObject* unicode,
const char* errors);
/* --- ASCII Codecs ------------------------------------------------------- */
PyAPI_FUNC(PyObject*) _PyUnicode_AsASCIIString(
PyObject* unicode,
const char* errors);
/* --- Character Map Codecs ----------------------------------------------- */
/* Translate an Unicode object by applying a character mapping table to
it and return the resulting Unicode object.
The mapping table must map Unicode ordinal integers to Unicode strings,
Unicode ordinal integers or None (causing deletion of the character).
Mapping tables may be dictionaries or sequences. Unmapped character
ordinals (ones which cause a LookupError) are left untouched and
are copied as-is.
*/
PyAPI_FUNC(PyObject*) _PyUnicode_EncodeCharmap(
PyObject *unicode, /* Unicode object */
PyObject *mapping, /* encoding mapping */
const char *errors /* error handling */
);
/* --- Decimal Encoder ---------------------------------------------------- */
/* Coverts a Unicode object holding a decimal value to an ASCII string
for using in int, float and complex parsers.
Transforms code points that have decimal digit property to the
corresponding ASCII digit code points. Transforms spaces to ASCII.
Transforms code points starting from the first non-ASCII code point that
is neither a decimal digit nor a space to the end into '?'. */
PyAPI_FUNC(PyObject*) _PyUnicode_TransformDecimalAndSpaceToASCII(
PyObject *unicode /* Unicode object */
);
/* --- Methods & Slots ---------------------------------------------------- */
PyAPI_FUNC(PyObject *) _PyUnicode_JoinArray(
PyObject *separator,
PyObject *const *items,
Py_ssize_t seqlen
);
/* Test whether a unicode is equal to ASCII identifier. Return 1 if true,
0 otherwise. The right argument must be ASCII identifier.
Any error occurs inside will be cleared before return. */
PyAPI_FUNC(int) _PyUnicode_EqualToASCIIId(
PyObject *left, /* Left string */
_Py_Identifier *right /* Right identifier */
);
/* Test whether a unicode is equal to ASCII string. Return 1 if true,
0 otherwise. The right argument must be ASCII-encoded string.
Any error occurs inside will be cleared before return. */
PyAPI_FUNC(int) _PyUnicode_EqualToASCIIString(
PyObject *left,
const char *right /* ASCII-encoded string */
);
/* Externally visible for str.strip(unicode) */
PyAPI_FUNC(PyObject *) _PyUnicode_XStrip(
PyObject *self,
int striptype,
PyObject *sepobj
);
/* Using explicit passed-in values, insert the thousands grouping
into the string pointed to by buffer. For the argument descriptions,
see Objects/stringlib/localeutil.h */
PyAPI_FUNC(Py_ssize_t) _PyUnicode_InsertThousandsGrouping(
_PyUnicodeWriter *writer,
Py_ssize_t n_buffer,
PyObject *digits,
Py_ssize_t d_pos,
Py_ssize_t n_digits,
Py_ssize_t min_width,
const char *grouping,
PyObject *thousands_sep,
Py_UCS4 *maxchar);
/* === Characters Type APIs =============================================== */
/* These should not be used directly. Use the Py_UNICODE_IS* and
Py_UNICODE_TO* macros instead.
These APIs are implemented in Objects/unicodectype.c.
*/
PyAPI_FUNC(int) _PyUnicode_IsLowercase(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsUppercase(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsTitlecase(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsXidStart(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsXidContinue(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsWhitespace(
const Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsLinebreak(
const Py_UCS4 ch /* Unicode character */
);
/* Py_DEPRECATED(3.3) */ PyAPI_FUNC(Py_UCS4) _PyUnicode_ToLowercase(
Py_UCS4 ch /* Unicode character */
);
/* Py_DEPRECATED(3.3) */ PyAPI_FUNC(Py_UCS4) _PyUnicode_ToUppercase(
Py_UCS4 ch /* Unicode character */
);
Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UCS4) _PyUnicode_ToTitlecase(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_ToLowerFull(
Py_UCS4 ch, /* Unicode character */
Py_UCS4 *res
);
PyAPI_FUNC(int) _PyUnicode_ToTitleFull(
Py_UCS4 ch, /* Unicode character */
Py_UCS4 *res
);
PyAPI_FUNC(int) _PyUnicode_ToUpperFull(
Py_UCS4 ch, /* Unicode character */
Py_UCS4 *res
);
PyAPI_FUNC(int) _PyUnicode_ToFoldedFull(
Py_UCS4 ch, /* Unicode character */
Py_UCS4 *res
);
PyAPI_FUNC(int) _PyUnicode_IsCaseIgnorable(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsCased(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_ToDecimalDigit(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_ToDigit(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(double) _PyUnicode_ToNumeric(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsDecimalDigit(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsDigit(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsNumeric(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsPrintable(
Py_UCS4 ch /* Unicode character */
);
PyAPI_FUNC(int) _PyUnicode_IsAlpha(
Py_UCS4 ch /* Unicode character */
);
// Helper array used by Py_UNICODE_ISSPACE().
PyAPI_DATA(const unsigned char) _Py_ascii_whitespace[];
// Since splitting on whitespace is an important use case, and
// whitespace in most situations is solely ASCII whitespace, we
// optimize for the common case by using a quick look-up table
// _Py_ascii_whitespace (see below) with an inlined check.
static inline int Py_UNICODE_ISSPACE(Py_UCS4 ch) {
if (ch < 128) {
return _Py_ascii_whitespace[ch];
}
return _PyUnicode_IsWhitespace(ch);
}
#define Py_UNICODE_ISLOWER(ch) _PyUnicode_IsLowercase(ch)
#define Py_UNICODE_ISUPPER(ch) _PyUnicode_IsUppercase(ch)
#define Py_UNICODE_ISTITLE(ch) _PyUnicode_IsTitlecase(ch)
#define Py_UNICODE_ISLINEBREAK(ch) _PyUnicode_IsLinebreak(ch)
#define Py_UNICODE_TOLOWER(ch) _PyUnicode_ToLowercase(ch)
#define Py_UNICODE_TOUPPER(ch) _PyUnicode_ToUppercase(ch)
#define Py_UNICODE_TOTITLE(ch) _PyUnicode_ToTitlecase(ch)
#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch)
#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch)
#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch)
#define Py_UNICODE_ISPRINTABLE(ch) _PyUnicode_IsPrintable(ch)
#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch)
#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch)
#define Py_UNICODE_TONUMERIC(ch) _PyUnicode_ToNumeric(ch)
#define Py_UNICODE_ISALPHA(ch) _PyUnicode_IsAlpha(ch)
static inline int Py_UNICODE_ISALNUM(Py_UCS4 ch) {
return (Py_UNICODE_ISALPHA(ch)
|| Py_UNICODE_ISDECIMAL(ch)
|| Py_UNICODE_ISDIGIT(ch)
|| Py_UNICODE_ISNUMERIC(ch));
}
/* === Misc functions ===================================================== */
PyAPI_FUNC(PyObject*) _PyUnicode_FormatLong(PyObject *, int, int, int);
/* Return an interned Unicode object for an Identifier; may fail if there is no memory.*/
PyAPI_FUNC(PyObject*) _PyUnicode_FromId(_Py_Identifier*);
/* Fast equality check when the inputs are known to be exact unicode types
and where the hash values are equal (i.e. a very probable match) */
PyAPI_FUNC(int) _PyUnicode_EQ(PyObject *, PyObject *);
/* Equality check. */
PyAPI_FUNC(int) _PyUnicode_Equal(PyObject *, PyObject *);
PyAPI_FUNC(int) _PyUnicode_WideCharString_Converter(PyObject *, void *);
PyAPI_FUNC(int) _PyUnicode_WideCharString_Opt_Converter(PyObject *, void *);
PyAPI_FUNC(Py_ssize_t) _PyUnicode_ScanIdentifier(PyObject *);
# 1014 "./Include/unicodeobject.h" 2
# undef Py_CPYTHON_UNICODEOBJECT_H
#endif
# 1016 "./Include/unicodeobject.h"
#ifdef __cplusplus
}
#endif
# 1020 "./Include/unicodeobject.h"
#endif /* !Py_UNICODEOBJECT_H */
# 1021 "./Include/unicodeobject.h"
# 52 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "longobject.h"
#endif /* expanded by -frewrite-includes */
# 52 "./Include/Python.h"
# 1 "./Include/longobject.h" 1
#ifndef Py_LONGOBJECT_H
#define Py_LONGOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 6 "./Include/longobject.h"
/* Long (arbitrary precision) integer object interface */
// PyLong_Type is declared by object.h
#define PyLong_Check(op) \
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LONG_SUBCLASS)
#define PyLong_CheckExact(op) Py_IS_TYPE((op), &PyLong_Type)
PyAPI_FUNC(PyObject *) PyLong_FromLong(long);
PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLong(unsigned long);
PyAPI_FUNC(PyObject *) PyLong_FromSize_t(size_t);
PyAPI_FUNC(PyObject *) PyLong_FromSsize_t(Py_ssize_t);
PyAPI_FUNC(PyObject *) PyLong_FromDouble(double);
PyAPI_FUNC(long) PyLong_AsLong(PyObject *);
PyAPI_FUNC(long) PyLong_AsLongAndOverflow(PyObject *, int *);
PyAPI_FUNC(Py_ssize_t) PyLong_AsSsize_t(PyObject *);
PyAPI_FUNC(size_t) PyLong_AsSize_t(PyObject *);
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLong(PyObject *);
PyAPI_FUNC(unsigned long) PyLong_AsUnsignedLongMask(PyObject *);
PyAPI_FUNC(PyObject *) PyLong_GetInfo(void);
/* It may be useful in the future. I've added it in the PyInt -> PyLong
cleanup to keep the extra information. [CH] */
#define PyLong_AS_LONG(op) PyLong_AsLong(op)
/* Issue #1983: pid_t can be longer than a C long on some systems */
#if 0 /* disabled by -frewrite-includes */
#if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 35 "./Include/longobject.h"
#define _Py_PARSE_PID "i"
#define PyLong_FromPid PyLong_FromLong
#define PyLong_AsPid PyLong_AsLong
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif SIZEOF_PID_T == SIZEOF_LONG
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 39 "./Include/longobject.h"
#define _Py_PARSE_PID "l"
#define PyLong_FromPid PyLong_FromLong
#define PyLong_AsPid PyLong_AsLong
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(SIZEOF_LONG_LONG) && SIZEOF_PID_T == SIZEOF_LONG_LONG
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 43 "./Include/longobject.h"
#define _Py_PARSE_PID "L"
#define PyLong_FromPid PyLong_FromLongLong
#define PyLong_AsPid PyLong_AsLongLong
#else
# 47 "./Include/longobject.h"
#error "sizeof(pid_t) is neither sizeof(int), sizeof(long) or sizeof(long long)"
#endif /* SIZEOF_PID_T */
# 49 "./Include/longobject.h"
#if 0 /* disabled by -frewrite-includes */
#if SIZEOF_VOID_P == SIZEOF_INT
#endif
#endif /* disabled by -frewrite-includes */
#if 0 /* evaluated by -frewrite-includes */
# 51 "./Include/longobject.h"
# define _Py_PARSE_INTPTR "i"
# define _Py_PARSE_UINTPTR "I"
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif SIZEOF_VOID_P == SIZEOF_LONG
#endif
#endif /* disabled by -frewrite-includes */
#elif 1 /* evaluated by -frewrite-includes */
# 54 "./Include/longobject.h"
# define _Py_PARSE_INTPTR "l"
# define _Py_PARSE_UINTPTR "k"
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif defined(SIZEOF_LONG_LONG) && SIZEOF_VOID_P == SIZEOF_LONG_LONG
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 57 "./Include/longobject.h"
# define _Py_PARSE_INTPTR "L"
# define _Py_PARSE_UINTPTR "K"
#else
# 60 "./Include/longobject.h"
# error "void* different in size from int, long and long long"
#endif /* SIZEOF_VOID_P */
# 62 "./Include/longobject.h"
PyAPI_FUNC(double) PyLong_AsDouble(PyObject *);
PyAPI_FUNC(PyObject *) PyLong_FromVoidPtr(void *);
PyAPI_FUNC(void *) PyLong_AsVoidPtr(PyObject *);
PyAPI_FUNC(PyObject *) PyLong_FromLongLong(long long);
PyAPI_FUNC(PyObject *) PyLong_FromUnsignedLongLong(unsigned long long);
PyAPI_FUNC(long long) PyLong_AsLongLong(PyObject *);
PyAPI_FUNC(unsigned long long) PyLong_AsUnsignedLongLong(PyObject *);
PyAPI_FUNC(unsigned long long) PyLong_AsUnsignedLongLongMask(PyObject *);
PyAPI_FUNC(long long) PyLong_AsLongLongAndOverflow(PyObject *, int *);
PyAPI_FUNC(PyObject *) PyLong_FromString(const char *, char **, int);
/* These aren't really part of the int object, but they're handy. The
functions are in Python/mystrtoul.c.
*/
PyAPI_FUNC(unsigned long) PyOS_strtoul(const char *, char **, int);
PyAPI_FUNC(long) PyOS_strtol(const char *, char **, int);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_LONGOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/longobject.h"
#endif /* expanded by -frewrite-includes */
# 84 "./Include/longobject.h"
# 1 "./Include/cpython/longobject.h" 1
#ifndef Py_CPYTHON_LONGOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/longobject.h"
PyAPI_FUNC(int) _PyLong_AsInt(PyObject *);
PyAPI_FUNC(int) _PyLong_UnsignedShort_Converter(PyObject *, void *);
PyAPI_FUNC(int) _PyLong_UnsignedInt_Converter(PyObject *, void *);
PyAPI_FUNC(int) _PyLong_UnsignedLong_Converter(PyObject *, void *);
PyAPI_FUNC(int) _PyLong_UnsignedLongLong_Converter(PyObject *, void *);
PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *);
/* _PyLong_Frexp returns a double x and an exponent e such that the
true value is approximately equal to x * 2**e. e is >= 0. x is
0.0 if and only if the input is 0 (in which case, e and x are both
zeroes); otherwise, 0.5 <= abs(x) < 1.0. On overflow, which is
possible if the number of bits doesn't fit into a Py_ssize_t, sets
OverflowError and returns -1.0 for x, 0 for e. */
PyAPI_FUNC(double) _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e);
PyAPI_FUNC(PyObject *) PyLong_FromUnicodeObject(PyObject *u, int base);
PyAPI_FUNC(PyObject *) _PyLong_FromBytes(const char *, Py_ssize_t, int);
/* _PyLong_Sign. Return 0 if v is 0, -1 if v < 0, +1 if v > 0.
v must not be NULL, and must be a normalized long.
There are no error cases.
*/
PyAPI_FUNC(int) _PyLong_Sign(PyObject *v);
/* _PyLong_NumBits. Return the number of bits needed to represent the
absolute value of a long. For example, this returns 1 for 1 and -1, 2
for 2 and -2, and 2 for 3 and -3. It returns 0 for 0.
v must not be NULL, and must be a normalized long.
(size_t)-1 is returned and OverflowError set if the true result doesn't
fit in a size_t.
*/
PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v);
/* _PyLong_DivmodNear. Given integers a and b, compute the nearest
integer q to the exact quotient a / b, rounding to the nearest even integer
in the case of a tie. Return (q, r), where r = a - q*b. The remainder r
will satisfy abs(r) <= abs(b)/2, with equality possible only if q is
even.
*/
PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *);
/* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in
base 256, and return a Python int with the same numeric value.
If n is 0, the integer is 0. Else:
If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB;
else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the
LSB.
If is_signed is 0/false, view the bytes as a non-negative integer.
If is_signed is 1/true, view the bytes as a 2's-complement integer,
non-negative if bit 0x80 of the MSB is clear, negative if set.
Error returns:
+ Return NULL with the appropriate exception set if there's not
enough memory to create the Python int.
*/
PyAPI_FUNC(PyObject *) _PyLong_FromByteArray(
const unsigned char* bytes, size_t n,
int little_endian, int is_signed);
/* _PyLong_AsByteArray: Convert the least-significant 8*n bits of long
v to a base-256 integer, stored in array bytes. Normally return 0,
return -1 on error.
If little_endian is 1/true, store the MSB at bytes[n-1] and the LSB at
bytes[0]; else (little_endian is 0/false) store the MSB at bytes[0] and
the LSB at bytes[n-1].
If is_signed is 0/false, it's an error if v < 0; else (v >= 0) n bytes
are filled and there's nothing special about bit 0x80 of the MSB.
If is_signed is 1/true, bytes is filled with the 2's-complement
representation of v's value. Bit 0x80 of the MSB is the sign bit.
Error returns (-1):
+ is_signed is 0 and v < 0. TypeError is set in this case, and bytes
isn't altered.
+ n isn't big enough to hold the full mathematical value of v. For
example, if is_signed is 0 and there are more digits in the v than
fit in n; or if is_signed is 1, v < 0, and n is just 1 bit shy of
being large enough to hold a sign bit. OverflowError is set in this
case, but bytes holds the least-significant n bytes of the true value.
*/
PyAPI_FUNC(int) _PyLong_AsByteArray(PyLongObject* v,
unsigned char* bytes, size_t n,
int little_endian, int is_signed);
/* _PyLong_Format: Convert the long to a string object with given base,
appending a base prefix of 0[box] if base is 2, 8 or 16. */
PyAPI_FUNC(PyObject *) _PyLong_Format(PyObject *obj, int base);
/* For use by the gcd function in mathmodule.c */
PyAPI_FUNC(PyObject *) _PyLong_GCD(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyLong_Rshift(PyObject *, size_t);
PyAPI_FUNC(PyObject *) _PyLong_Lshift(PyObject *, size_t);
PyAPI_FUNC(int) PyUnstable_Long_IsCompact(const PyLongObject* op);
PyAPI_FUNC(Py_ssize_t) PyUnstable_Long_CompactValue(const PyLongObject* op);
# 85 "./Include/longobject.h" 2
# undef Py_CPYTHON_LONGOBJECT_H
#endif
# 87 "./Include/longobject.h"
#ifdef __cplusplus
}
#endif
# 91 "./Include/longobject.h"
#endif /* !Py_LONGOBJECT_H */
# 92 "./Include/longobject.h"
# 53 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "cpython/longintrepr.h"
#endif /* expanded by -frewrite-includes */
# 53 "./Include/Python.h"
# 1 "./Include/cpython/longintrepr.h" 1
#ifndef Py_LIMITED_API
#ifndef Py_LONGINTREPR_H
#define Py_LONGINTREPR_H
#ifdef __cplusplus
extern "C" {
#endif
# 7 "./Include/cpython/longintrepr.h"
/* This is published for the benefit of "friends" marshal.c and _decimal.c. */
/* Parameters of the integer representation. There are two different
sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit
integer type, and one set for 15-bit digits with each digit stored in an
unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at
configure time or in pyport.h, is used to decide which digit size to use.
Type 'digit' should be able to hold 2*PyLong_BASE-1, and type 'twodigits'
should be an unsigned integer type able to hold all integers up to
PyLong_BASE*PyLong_BASE-1. x_sub assumes that 'digit' is an unsigned type,
and that overflow is handled by taking the result modulo 2**N for some N >
PyLong_SHIFT. The majority of the code doesn't care about the precise
value of PyLong_SHIFT, but there are some notable exceptions:
- PyLong_{As,From}ByteArray require that PyLong_SHIFT be at least 8
- long_hash() requires that PyLong_SHIFT is *strictly* less than the number
of bits in an unsigned long, as do the PyLong <-> long (or unsigned long)
conversion functions
- the Python int <-> size_t/Py_ssize_t conversion functions expect that
PyLong_SHIFT is strictly less than the number of bits in a size_t
- the marshal code currently expects that PyLong_SHIFT is a multiple of 15
- NSMALLNEGINTS and NSMALLPOSINTS should be small enough to fit in a single
digit; with the current values this forces PyLong_SHIFT >= 9
The values 15 and 30 should fit all of the above requirements, on any
platform.
*/
#if 0 /* disabled by -frewrite-includes */
#if PYLONG_BITS_IN_DIGIT == 30
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 43 "./Include/cpython/longintrepr.h"
typedef uint32_t digit;
typedef int32_t sdigit; /* signed variant of digit */
typedef uint64_t twodigits;
typedef int64_t stwodigits; /* signed variant of twodigits */
#define PyLong_SHIFT 30
#define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */
#define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */
#if 0 /* disabled by -frewrite-includes */
#if 0
#elif PYLONG_BITS_IN_DIGIT == 15
#endif
#endif /* disabled by -frewrite-includes */
#elif 0 /* evaluated by -frewrite-includes */
# 51 "./Include/cpython/longintrepr.h"
typedef unsigned short digit;
typedef short sdigit; /* signed variant of digit */
typedef unsigned long twodigits;
typedef long stwodigits; /* signed variant of twodigits */
#define PyLong_SHIFT 15
#define _PyLong_DECIMAL_SHIFT 4 /* max(e such that 10**e fits in a digit) */
#define _PyLong_DECIMAL_BASE ((digit)10000) /* 10 ** DECIMAL_SHIFT */
#else
# 59 "./Include/cpython/longintrepr.h"
#error "PYLONG_BITS_IN_DIGIT should be 15 or 30"
#endif
# 61 "./Include/cpython/longintrepr.h"
#define PyLong_BASE ((digit)1 << PyLong_SHIFT)
#define PyLong_MASK ((digit)(PyLong_BASE - 1))
/* Long integer representation.
The absolute value of a number is equal to
SUM(for i=0 through abs(ob_size)-1) ob_digit[i] * 2**(SHIFT*i)
Negative numbers are represented with ob_size < 0;
zero is represented by ob_size == 0.
In a normalized number, ob_digit[abs(ob_size)-1] (the most significant
digit) is never zero. Also, in all cases, for all valid i,
0 <= ob_digit[i] <= MASK.
The allocation function takes care of allocating extra memory
so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available.
We always allocate memory for at least one digit, so accessing ob_digit[0]
is always safe. However, in the case ob_size == 0, the contents of
ob_digit[0] may be undefined.
CAUTION: Generic code manipulating subtypes of PyVarObject has to
aware that ints abuse ob_size's sign bit.
*/
typedef struct _PyLongValue {
uintptr_t lv_tag; /* Number of digits, sign and flags */
digit ob_digit[1];
} _PyLongValue;
struct _longobject {
PyObject_HEAD
_PyLongValue long_value;
};
PyAPI_FUNC(PyLongObject *) _PyLong_New(Py_ssize_t);
/* Return a copy of src. */
PyAPI_FUNC(PyObject *) _PyLong_Copy(PyLongObject *src);
PyAPI_FUNC(PyLongObject *)
_PyLong_FromDigits(int negative, Py_ssize_t digit_count, digit *digits);
/* Inline some internals for speed. These should be in pycore_long.h
* if user code didn't need them inlined. */
#define _PyLong_SIGN_MASK 3
#define _PyLong_NON_SIZE_BITS 3
static inline int
_PyLong_IsCompact(const PyLongObject* op) {
assert(PyType_HasFeature((op)->ob_base.ob_type, Py_TPFLAGS_LONG_SUBCLASS));
return op->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS);
}
#define PyUnstable_Long_IsCompact _PyLong_IsCompact
static inline Py_ssize_t
_PyLong_CompactValue(const PyLongObject *op)
{
assert(PyType_HasFeature((op)->ob_base.ob_type, Py_TPFLAGS_LONG_SUBCLASS));
assert(PyUnstable_Long_IsCompact(op));
Py_ssize_t sign = 1 - (op->long_value.lv_tag & _PyLong_SIGN_MASK);
return sign * (Py_ssize_t)op->long_value.ob_digit[0];
}
#define PyUnstable_Long_CompactValue _PyLong_CompactValue
#ifdef __cplusplus
}
#endif
# 131 "./Include/cpython/longintrepr.h"
#endif /* !Py_LONGINTREPR_H */
# 132 "./Include/cpython/longintrepr.h"
#endif /* Py_LIMITED_API */
# 133 "./Include/cpython/longintrepr.h"
# 54 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "boolobject.h"
#endif /* expanded by -frewrite-includes */
# 54 "./Include/Python.h"
# 1 "./Include/boolobject.h" 1
/* Boolean object interface */
#ifndef Py_BOOLOBJECT_H
#define Py_BOOLOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 8 "./Include/boolobject.h"
// PyBool_Type is declared by object.h
#define PyBool_Check(x) Py_IS_TYPE((x), &PyBool_Type)
/* Py_False and Py_True are the only two bools in existence. */
/* Don't use these directly */
PyAPI_DATA(PyLongObject) _Py_FalseStruct;
PyAPI_DATA(PyLongObject) _Py_TrueStruct;
/* Use these macros */
#define Py_False _PyObject_CAST(&_Py_FalseStruct)
#define Py_True _PyObject_CAST(&_Py_TrueStruct)
// Test if an object is the True singleton, the same as "x is True" in Python.
PyAPI_FUNC(int) Py_IsTrue(PyObject *x);
#define Py_IsTrue(x) Py_Is((x), Py_True)
// Test if an object is the False singleton, the same as "x is False" in Python.
PyAPI_FUNC(int) Py_IsFalse(PyObject *x);
#define Py_IsFalse(x) Py_Is((x), Py_False)
/* Macros for returning Py_True or Py_False, respectively */
#define Py_RETURN_TRUE return Py_True
#define Py_RETURN_FALSE return Py_False
/* Function to return a bool from a C long */
PyAPI_FUNC(PyObject *) PyBool_FromLong(long);
#ifdef __cplusplus
}
#endif
# 42 "./Include/boolobject.h"
#endif /* !Py_BOOLOBJECT_H */
# 43 "./Include/boolobject.h"
# 55 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "floatobject.h"
#endif /* expanded by -frewrite-includes */
# 55 "./Include/Python.h"
# 1 "./Include/floatobject.h" 1
/* Float object interface */
/*
PyFloatObject represents a (double precision) floating point number.
*/
#ifndef Py_FLOATOBJECT_H
#define Py_FLOATOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 13 "./Include/floatobject.h"
PyAPI_DATA(PyTypeObject) PyFloat_Type;
#define PyFloat_Check(op) PyObject_TypeCheck(op, &PyFloat_Type)
#define PyFloat_CheckExact(op) Py_IS_TYPE((op), &PyFloat_Type)
#define Py_RETURN_NAN return PyFloat_FromDouble(Py_NAN)
#define Py_RETURN_INF(sign) \
do { \
if (copysign(1., sign) == 1.) { \
return PyFloat_FromDouble(Py_HUGE_VAL); \
} \
else { \
return PyFloat_FromDouble(-Py_HUGE_VAL); \
} \
} while(0)
PyAPI_FUNC(double) PyFloat_GetMax(void);
PyAPI_FUNC(double) PyFloat_GetMin(void);
PyAPI_FUNC(PyObject*) PyFloat_GetInfo(void);
/* Return Python float from string PyObject. */
PyAPI_FUNC(PyObject*) PyFloat_FromString(PyObject*);
/* Return Python float from C double. */
PyAPI_FUNC(PyObject*) PyFloat_FromDouble(double);
/* Extract C double from Python float. The macro version trades safety for
speed. */
PyAPI_FUNC(double) PyFloat_AsDouble(PyObject*);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_FLOATOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/floatobject.h"
#endif /* expanded by -frewrite-includes */
# 47 "./Include/floatobject.h"
# 1 "./Include/cpython/floatobject.h" 1
#ifndef Py_CPYTHON_FLOATOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/floatobject.h"
typedef struct {
PyObject_HEAD
double ob_fval;
} PyFloatObject;
#define _PyFloat_CAST(op) \
(assert(PyFloat_Check(op)), _Py_CAST(PyFloatObject*, op))
// Static inline version of PyFloat_AsDouble() trading safety for speed.
// It doesn't check if op is a double object.
static inline double PyFloat_AS_DOUBLE(PyObject *op) {
return _PyFloat_CAST(op)->ob_fval;
}
#define PyFloat_AS_DOUBLE(op) PyFloat_AS_DOUBLE(_PyObject_CAST(op))
PyAPI_FUNC(int) PyFloat_Pack2(double x, char *p, int le);
PyAPI_FUNC(int) PyFloat_Pack4(double x, char *p, int le);
PyAPI_FUNC(int) PyFloat_Pack8(double x, char *p, int le);
PyAPI_FUNC(double) PyFloat_Unpack2(const char *p, int le);
PyAPI_FUNC(double) PyFloat_Unpack4(const char *p, int le);
PyAPI_FUNC(double) PyFloat_Unpack8(const char *p, int le);
# 48 "./Include/floatobject.h" 2
# undef Py_CPYTHON_FLOATOBJECT_H
#endif
# 50 "./Include/floatobject.h"
#ifdef __cplusplus
}
#endif
# 54 "./Include/floatobject.h"
#endif /* !Py_FLOATOBJECT_H */
# 55 "./Include/floatobject.h"
# 56 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "complexobject.h"
#endif /* expanded by -frewrite-includes */
# 56 "./Include/Python.h"
# 1 "./Include/complexobject.h" 1
/* Complex number structure */
#ifndef Py_COMPLEXOBJECT_H
#define Py_COMPLEXOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 8 "./Include/complexobject.h"
/* Complex object interface */
PyAPI_DATA(PyTypeObject) PyComplex_Type;
#define PyComplex_Check(op) PyObject_TypeCheck((op), &PyComplex_Type)
#define PyComplex_CheckExact(op) Py_IS_TYPE((op), &PyComplex_Type)
PyAPI_FUNC(PyObject *) PyComplex_FromDoubles(double real, double imag);
PyAPI_FUNC(double) PyComplex_RealAsDouble(PyObject *op);
PyAPI_FUNC(double) PyComplex_ImagAsDouble(PyObject *op);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_COMPLEXOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/complexobject.h"
#endif /* expanded by -frewrite-includes */
# 23 "./Include/complexobject.h"
# 1 "./Include/cpython/complexobject.h" 1
#ifndef Py_CPYTHON_COMPLEXOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/complexobject.h"
typedef struct {
double real;
double imag;
} Py_complex;
/* Operations on complex numbers from complexmodule.c */
PyAPI_FUNC(Py_complex) _Py_c_sum(Py_complex, Py_complex);
PyAPI_FUNC(Py_complex) _Py_c_diff(Py_complex, Py_complex);
PyAPI_FUNC(Py_complex) _Py_c_neg(Py_complex);
PyAPI_FUNC(Py_complex) _Py_c_prod(Py_complex, Py_complex);
PyAPI_FUNC(Py_complex) _Py_c_quot(Py_complex, Py_complex);
PyAPI_FUNC(Py_complex) _Py_c_pow(Py_complex, Py_complex);
PyAPI_FUNC(double) _Py_c_abs(Py_complex);
/* Complex object interface */
/*
PyComplexObject represents a complex number with double-precision
real and imaginary parts.
*/
typedef struct {
PyObject_HEAD
Py_complex cval;
} PyComplexObject;
PyAPI_FUNC(PyObject *) PyComplex_FromCComplex(Py_complex);
PyAPI_FUNC(Py_complex) PyComplex_AsCComplex(PyObject *op);
#ifdef Py_BUILD_CORE
/* Format the object based on the format_spec, as defined in PEP 3101
(Advanced String Formatting). */
extern int _PyComplex_FormatAdvancedWriter(
_PyUnicodeWriter *writer,
PyObject *obj,
PyObject *format_spec,
Py_ssize_t start,
Py_ssize_t end);
#endif // Py_BUILD_CORE
# 45 "./Include/cpython/complexobject.h"
# 24 "./Include/complexobject.h" 2
# undef Py_CPYTHON_COMPLEXOBJECT_H
#endif
# 26 "./Include/complexobject.h"
#ifdef __cplusplus
}
#endif
# 30 "./Include/complexobject.h"
#endif /* !Py_COMPLEXOBJECT_H */
# 31 "./Include/complexobject.h"
# 57 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "rangeobject.h"
#endif /* expanded by -frewrite-includes */
# 57 "./Include/Python.h"
# 1 "./Include/rangeobject.h" 1
/* Range object interface */
#ifndef Py_RANGEOBJECT_H
#define Py_RANGEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 9 "./Include/rangeobject.h"
/*
A range object represents an integer range. This is an immutable object;
a range cannot change its value after creation.
Range objects behave like the corresponding tuple objects except that
they are represented by a start, stop, and step datamembers.
*/
PyAPI_DATA(PyTypeObject) PyRange_Type;
PyAPI_DATA(PyTypeObject) PyRangeIter_Type;
PyAPI_DATA(PyTypeObject) PyLongRangeIter_Type;
#define PyRange_Check(op) Py_IS_TYPE((op), &PyRange_Type)
#ifdef __cplusplus
}
#endif
# 27 "./Include/rangeobject.h"
#endif /* !Py_RANGEOBJECT_H */
# 28 "./Include/rangeobject.h"
# 58 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "memoryobject.h"
#endif /* expanded by -frewrite-includes */
# 58 "./Include/Python.h"
# 1 "./Include/memoryobject.h" 1
/* Memory view object. In Python this is available as "memoryview". */
#ifndef Py_MEMORYOBJECT_H
#define Py_MEMORYOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 8 "./Include/memoryobject.h"
PyAPI_DATA(PyTypeObject) PyMemoryView_Type;
#define PyMemoryView_Check(op) Py_IS_TYPE((op), &PyMemoryView_Type)
PyAPI_FUNC(PyObject *) PyMemoryView_FromObject(PyObject *base);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 15 "./Include/memoryobject.h"
PyAPI_FUNC(PyObject *) PyMemoryView_FromMemory(char *mem, Py_ssize_t size,
int flags);
#endif
# 18 "./Include/memoryobject.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030b0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 19 "./Include/memoryobject.h"
PyAPI_FUNC(PyObject *) PyMemoryView_FromBuffer(const Py_buffer *info);
#endif
# 21 "./Include/memoryobject.h"
PyAPI_FUNC(PyObject *) PyMemoryView_GetContiguous(PyObject *base,
int buffertype,
char order);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_MEMORYOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/memoryobject.h"
#endif /* expanded by -frewrite-includes */
# 27 "./Include/memoryobject.h"
# 1 "./Include/cpython/memoryobject.h" 1
#ifndef Py_CPYTHON_MEMORYOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/memoryobject.h"
PyAPI_DATA(PyTypeObject) _PyManagedBuffer_Type;
/* The structs are declared here so that macros can work, but they shouldn't
be considered public. Don't access their fields directly, use the macros
and functions instead! */
#define _Py_MANAGED_BUFFER_RELEASED 0x001 /* access to exporter blocked */
#define _Py_MANAGED_BUFFER_FREE_FORMAT 0x002 /* free format */
typedef struct {
PyObject_HEAD
int flags; /* state flags */
Py_ssize_t exports; /* number of direct memoryview exports */
Py_buffer master; /* snapshot buffer obtained from the original exporter */
} _PyManagedBufferObject;
/* memoryview state flags */
#define _Py_MEMORYVIEW_RELEASED 0x001 /* access to master buffer blocked */
#define _Py_MEMORYVIEW_C 0x002 /* C-contiguous layout */
#define _Py_MEMORYVIEW_FORTRAN 0x004 /* Fortran contiguous layout */
#define _Py_MEMORYVIEW_SCALAR 0x008 /* scalar: ndim = 0 */
#define _Py_MEMORYVIEW_PIL 0x010 /* PIL-style layout */
#define _Py_MEMORYVIEW_RESTRICTED 0x020 /* Disallow new references to the memoryview's buffer */
typedef struct {
PyObject_VAR_HEAD
_PyManagedBufferObject *mbuf; /* managed buffer */
Py_hash_t hash; /* hash value for read-only views */
int flags; /* state flags */
Py_ssize_t exports; /* number of buffer re-exports */
Py_buffer view; /* private copy of the exporter's view */
PyObject *weakreflist;
Py_ssize_t ob_array[1]; /* shape, strides, suboffsets */
} PyMemoryViewObject;
#define _PyMemoryView_CAST(op) _Py_CAST(PyMemoryViewObject*, op)
/* Get a pointer to the memoryview's private copy of the exporter's buffer. */
static inline Py_buffer* PyMemoryView_GET_BUFFER(PyObject *op) {
return (&_PyMemoryView_CAST(op)->view);
}
#define PyMemoryView_GET_BUFFER(op) PyMemoryView_GET_BUFFER(_PyObject_CAST(op))
/* Get a pointer to the exporting object (this may be NULL!). */
static inline PyObject* PyMemoryView_GET_BASE(PyObject *op) {
return _PyMemoryView_CAST(op)->view.obj;
}
#define PyMemoryView_GET_BASE(op) PyMemoryView_GET_BASE(_PyObject_CAST(op))
# 28 "./Include/memoryobject.h" 2
# undef Py_CPYTHON_MEMORYOBJECT_H
#endif
# 30 "./Include/memoryobject.h"
#ifdef __cplusplus
}
#endif
# 34 "./Include/memoryobject.h"
#endif /* !Py_MEMORYOBJECT_H */
# 35 "./Include/memoryobject.h"
# 59 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "tupleobject.h"
#endif /* expanded by -frewrite-includes */
# 59 "./Include/Python.h"
# 1 "./Include/tupleobject.h" 1
/* Tuple object interface */
#ifndef Py_TUPLEOBJECT_H
#define Py_TUPLEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 8 "./Include/tupleobject.h"
/*
Another generally useful object type is a tuple of object pointers.
For Python, this is an immutable type. C code can change the tuple items
(but not their number), and even use tuples as general-purpose arrays of
object references, but in general only brand new tuples should be mutated,
not ones that might already have been exposed to Python code.
*** WARNING *** PyTuple_SetItem does not increment the new item's reference
count, but does decrement the reference count of the item it replaces,
if not nil. It does *decrement* the reference count if it is *not*
inserted in the tuple. Similarly, PyTuple_GetItem does not increment the
returned item's reference count.
*/
PyAPI_DATA(PyTypeObject) PyTuple_Type;
PyAPI_DATA(PyTypeObject) PyTupleIter_Type;
#define PyTuple_Check(op) \
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_TUPLE_SUBCLASS)
#define PyTuple_CheckExact(op) Py_IS_TYPE((op), &PyTuple_Type)
PyAPI_FUNC(PyObject *) PyTuple_New(Py_ssize_t size);
PyAPI_FUNC(Py_ssize_t) PyTuple_Size(PyObject *);
PyAPI_FUNC(PyObject *) PyTuple_GetItem(PyObject *, Py_ssize_t);
PyAPI_FUNC(int) PyTuple_SetItem(PyObject *, Py_ssize_t, PyObject *);
PyAPI_FUNC(PyObject *) PyTuple_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
PyAPI_FUNC(PyObject *) PyTuple_Pack(Py_ssize_t, ...);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_TUPLEOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/tupleobject.h"
#endif /* expanded by -frewrite-includes */
# 39 "./Include/tupleobject.h"
# 1 "./Include/cpython/tupleobject.h" 1
#ifndef Py_CPYTHON_TUPLEOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/tupleobject.h"
typedef struct {
PyObject_VAR_HEAD
/* ob_item contains space for 'ob_size' elements.
Items must normally not be NULL, except during construction when
the tuple is not yet visible outside the function that builds it. */
PyObject *ob_item[1];
} PyTupleObject;
PyAPI_FUNC(int) _PyTuple_Resize(PyObject **, Py_ssize_t);
PyAPI_FUNC(void) _PyTuple_MaybeUntrack(PyObject *);
/* Cast argument to PyTupleObject* type. */
#define _PyTuple_CAST(op) \
(assert(PyTuple_Check(op)), _Py_CAST(PyTupleObject*, (op)))
// Macros and static inline functions, trading safety for speed
static inline Py_ssize_t PyTuple_GET_SIZE(PyObject *op) {
PyTupleObject *tuple = _PyTuple_CAST(op);
return Py_SIZE(tuple);
}
#define PyTuple_GET_SIZE(op) PyTuple_GET_SIZE(_PyObject_CAST(op))
#define PyTuple_GET_ITEM(op, index) (_PyTuple_CAST(op)->ob_item[(index)])
/* Function *only* to be used to fill in brand new tuples */
static inline void
PyTuple_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) {
PyTupleObject *tuple = _PyTuple_CAST(op);
tuple->ob_item[index] = value;
}
#define PyTuple_SET_ITEM(op, index, value) \
PyTuple_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value))
PyAPI_FUNC(void) _PyTuple_DebugMallocStats(FILE *out);
# 40 "./Include/tupleobject.h" 2
# undef Py_CPYTHON_TUPLEOBJECT_H
#endif
# 42 "./Include/tupleobject.h"
#ifdef __cplusplus
}
#endif
# 46 "./Include/tupleobject.h"
#endif /* !Py_TUPLEOBJECT_H */
# 47 "./Include/tupleobject.h"
# 60 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "listobject.h"
#endif /* expanded by -frewrite-includes */
# 60 "./Include/Python.h"
# 1 "./Include/listobject.h" 1
/* List object interface
Another generally useful object type is a list of object pointers.
This is a mutable type: the list items can be changed, and items can be
added or removed. Out-of-range indices or non-list objects are ignored.
WARNING: PyList_SetItem does not increment the new item's reference count,
but does decrement the reference count of the item it replaces, if not nil.
It does *decrement* the reference count if it is *not* inserted in the list.
Similarly, PyList_GetItem does not increment the returned item's reference
count.
*/
#ifndef Py_LISTOBJECT_H
#define Py_LISTOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 19 "./Include/listobject.h"
PyAPI_DATA(PyTypeObject) PyList_Type;
PyAPI_DATA(PyTypeObject) PyListIter_Type;
PyAPI_DATA(PyTypeObject) PyListRevIter_Type;
#define PyList_Check(op) \
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_LIST_SUBCLASS)
#define PyList_CheckExact(op) Py_IS_TYPE((op), &PyList_Type)
PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size);
PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *);
PyAPI_FUNC(PyObject *) PyList_GetItem(PyObject *, Py_ssize_t);
PyAPI_FUNC(int) PyList_SetItem(PyObject *, Py_ssize_t, PyObject *);
PyAPI_FUNC(int) PyList_Insert(PyObject *, Py_ssize_t, PyObject *);
PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyList_GetSlice(PyObject *, Py_ssize_t, Py_ssize_t);
PyAPI_FUNC(int) PyList_SetSlice(PyObject *, Py_ssize_t, Py_ssize_t, PyObject *);
PyAPI_FUNC(int) PyList_Sort(PyObject *);
PyAPI_FUNC(int) PyList_Reverse(PyObject *);
PyAPI_FUNC(PyObject *) PyList_AsTuple(PyObject *);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_LISTOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/listobject.h"
#endif /* expanded by -frewrite-includes */
# 45 "./Include/listobject.h"
# 1 "./Include/cpython/listobject.h" 1
#ifndef Py_CPYTHON_LISTOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/listobject.h"
typedef struct {
PyObject_VAR_HEAD
/* Vector of pointers to list elements. list[0] is ob_item[0], etc. */
PyObject **ob_item;
/* ob_item contains space for 'allocated' elements. The number
* currently in use is ob_size.
* Invariants:
* 0 <= ob_size <= allocated
* len(list) == ob_size
* ob_item == NULL implies ob_size == allocated == 0
* list.sort() temporarily sets allocated to -1 to detect mutations.
*
* Items must normally not be NULL, except during construction when
* the list is not yet visible outside the function that builds it.
*/
Py_ssize_t allocated;
} PyListObject;
PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *);
PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out);
/* Cast argument to PyListObject* type. */
#define _PyList_CAST(op) \
(assert(PyList_Check(op)), _Py_CAST(PyListObject*, (op)))
// Macros and static inline functions, trading safety for speed
static inline Py_ssize_t PyList_GET_SIZE(PyObject *op) {
PyListObject *list = _PyList_CAST(op);
return Py_SIZE(list);
}
#define PyList_GET_SIZE(op) PyList_GET_SIZE(_PyObject_CAST(op))
#define PyList_GET_ITEM(op, index) (_PyList_CAST(op)->ob_item[(index)])
static inline void
PyList_SET_ITEM(PyObject *op, Py_ssize_t index, PyObject *value) {
PyListObject *list = _PyList_CAST(op);
list->ob_item[index] = value;
}
#define PyList_SET_ITEM(op, index, value) \
PyList_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value))
# 46 "./Include/listobject.h" 2
# undef Py_CPYTHON_LISTOBJECT_H
#endif
# 48 "./Include/listobject.h"
#ifdef __cplusplus
}
#endif
# 52 "./Include/listobject.h"
#endif /* !Py_LISTOBJECT_H */
# 53 "./Include/listobject.h"
# 61 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "dictobject.h"
#endif /* expanded by -frewrite-includes */
# 61 "./Include/Python.h"
# 1 "./Include/dictobject.h" 1
#ifndef Py_DICTOBJECT_H
#define Py_DICTOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 6 "./Include/dictobject.h"
/* Dictionary object type -- mapping from hashable object to object */
/* The distribution includes a separate file, Objects/dictnotes.txt,
describing explorations into dictionary design and optimization.
It covers typical dictionary use patterns, the parameters for
tuning dictionaries, and several ideas for possible optimizations.
*/
PyAPI_DATA(PyTypeObject) PyDict_Type;
#define PyDict_Check(op) \
PyType_FastSubclass(Py_TYPE(op), Py_TPFLAGS_DICT_SUBCLASS)
#define PyDict_CheckExact(op) Py_IS_TYPE((op), &PyDict_Type)
PyAPI_FUNC(PyObject *) PyDict_New(void);
PyAPI_FUNC(PyObject *) PyDict_GetItem(PyObject *mp, PyObject *key);
PyAPI_FUNC(PyObject *) PyDict_GetItemWithError(PyObject *mp, PyObject *key);
PyAPI_FUNC(int) PyDict_SetItem(PyObject *mp, PyObject *key, PyObject *item);
PyAPI_FUNC(int) PyDict_DelItem(PyObject *mp, PyObject *key);
PyAPI_FUNC(void) PyDict_Clear(PyObject *mp);
PyAPI_FUNC(int) PyDict_Next(
PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value);
PyAPI_FUNC(PyObject *) PyDict_Keys(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Values(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Items(PyObject *mp);
PyAPI_FUNC(Py_ssize_t) PyDict_Size(PyObject *mp);
PyAPI_FUNC(PyObject *) PyDict_Copy(PyObject *mp);
PyAPI_FUNC(int) PyDict_Contains(PyObject *mp, PyObject *key);
/* PyDict_Update(mp, other) is equivalent to PyDict_Merge(mp, other, 1). */
PyAPI_FUNC(int) PyDict_Update(PyObject *mp, PyObject *other);
/* PyDict_Merge updates/merges from a mapping object (an object that
supports PyMapping_Keys() and PyObject_GetItem()). If override is true,
the last occurrence of a key wins, else the first. The Python
dict.update(other) is equivalent to PyDict_Merge(dict, other, 1).
*/
PyAPI_FUNC(int) PyDict_Merge(PyObject *mp,
PyObject *other,
int override);
/* PyDict_MergeFromSeq2 updates/merges from an iterable object producing
iterable objects of length 2. If override is true, the last occurrence
of a key wins, else the first. The Python dict constructor dict(seq2)
is equivalent to dict={}; PyDict_MergeFromSeq(dict, seq2, 1).
*/
PyAPI_FUNC(int) PyDict_MergeFromSeq2(PyObject *d,
PyObject *seq2,
int override);
PyAPI_FUNC(PyObject *) PyDict_GetItemString(PyObject *dp, const char *key);
PyAPI_FUNC(int) PyDict_SetItemString(PyObject *dp, const char *key, PyObject *item);
PyAPI_FUNC(int) PyDict_DelItemString(PyObject *dp, const char *key);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 61 "./Include/dictobject.h"
PyAPI_FUNC(PyObject *) PyObject_GenericGetDict(PyObject *, void *);
#endif
# 63 "./Include/dictobject.h"
/* Dictionary (keys, values, items) views */
PyAPI_DATA(PyTypeObject) PyDictKeys_Type;
PyAPI_DATA(PyTypeObject) PyDictValues_Type;
PyAPI_DATA(PyTypeObject) PyDictItems_Type;
#define PyDictKeys_Check(op) PyObject_TypeCheck((op), &PyDictKeys_Type)
#define PyDictValues_Check(op) PyObject_TypeCheck((op), &PyDictValues_Type)
#define PyDictItems_Check(op) PyObject_TypeCheck((op), &PyDictItems_Type)
/* This excludes Values, since they are not sets. */
# define PyDictViewSet_Check(op) \
(PyDictKeys_Check(op) || PyDictItems_Check(op))
/* Dictionary (key, value, items) iterators */
PyAPI_DATA(PyTypeObject) PyDictIterKey_Type;
PyAPI_DATA(PyTypeObject) PyDictIterValue_Type;
PyAPI_DATA(PyTypeObject) PyDictIterItem_Type;
PyAPI_DATA(PyTypeObject) PyDictRevIterKey_Type;
PyAPI_DATA(PyTypeObject) PyDictRevIterItem_Type;
PyAPI_DATA(PyTypeObject) PyDictRevIterValue_Type;
#ifndef Py_LIMITED_API
# define Py_CPYTHON_DICTOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/dictobject.h"
#endif /* expanded by -frewrite-includes */
# 90 "./Include/dictobject.h"
# 1 "./Include/cpython/dictobject.h" 1
#ifndef Py_CPYTHON_DICTOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/dictobject.h"
typedef struct _dictkeysobject PyDictKeysObject;
typedef struct _dictvalues PyDictValues;
/* The ma_values pointer is NULL for a combined table
* or points to an array of PyObject* for a split table
*/
typedef struct {
PyObject_HEAD
/* Number of items in the dictionary */
Py_ssize_t ma_used;
/* Dictionary version: globally unique, value change each time
the dictionary is modified */
#ifdef Py_BUILD_CORE
uint64_t ma_version_tag;
#else
# 22 "./Include/cpython/dictobject.h"
Py_DEPRECATED(3.12) uint64_t ma_version_tag;
#endif
# 24 "./Include/cpython/dictobject.h"
PyDictKeysObject *ma_keys;
/* If ma_values is NULL, the table is "combined": keys and values
are stored in ma_keys.
If ma_values is not NULL, the table is split:
keys are stored in ma_keys and values are stored in ma_values */
PyDictValues *ma_values;
} PyDictObject;
PyAPI_FUNC(PyObject *) _PyDict_GetItem_KnownHash(PyObject *mp, PyObject *key,
Py_hash_t hash);
PyAPI_FUNC(PyObject *) _PyDict_GetItemWithError(PyObject *dp, PyObject *key);
PyAPI_FUNC(PyObject *) _PyDict_GetItemIdWithError(PyObject *dp,
_Py_Identifier *key);
PyAPI_FUNC(PyObject *) _PyDict_GetItemStringWithError(PyObject *, const char *);
PyAPI_FUNC(PyObject *) PyDict_SetDefault(
PyObject *mp, PyObject *key, PyObject *defaultobj);
PyAPI_FUNC(int) _PyDict_SetItem_KnownHash(PyObject *mp, PyObject *key,
PyObject *item, Py_hash_t hash);
PyAPI_FUNC(int) _PyDict_DelItem_KnownHash(PyObject *mp, PyObject *key,
Py_hash_t hash);
PyAPI_FUNC(int) _PyDict_DelItemIf(PyObject *mp, PyObject *key,
int (*predicate)(PyObject *value));
PyAPI_FUNC(int) _PyDict_Next(
PyObject *mp, Py_ssize_t *pos, PyObject **key, PyObject **value, Py_hash_t *hash);
/* Get the number of items of a dictionary. */
static inline Py_ssize_t PyDict_GET_SIZE(PyObject *op) {
PyDictObject *mp;
assert(PyDict_Check(op));
mp = _Py_CAST(PyDictObject*, op);
return mp->ma_used;
}
#define PyDict_GET_SIZE(op) PyDict_GET_SIZE(_PyObject_CAST(op))
PyAPI_FUNC(int) _PyDict_Contains_KnownHash(PyObject *, PyObject *, Py_hash_t);
PyAPI_FUNC(int) _PyDict_ContainsId(PyObject *, _Py_Identifier *);
PyAPI_FUNC(PyObject *) _PyDict_NewPresized(Py_ssize_t minused);
PyAPI_FUNC(void) _PyDict_MaybeUntrack(PyObject *mp);
PyAPI_FUNC(int) _PyDict_HasOnlyStringKeys(PyObject *mp);
PyAPI_FUNC(Py_ssize_t) _PyDict_SizeOf(PyDictObject *);
PyAPI_FUNC(PyObject *) _PyDict_Pop(PyObject *, PyObject *, PyObject *);
#define _PyDict_HasSplitTable(d) ((d)->ma_values != NULL)
/* Like PyDict_Merge, but override can be 0, 1 or 2. If override is 0,
the first occurrence of a key wins, if override is 1, the last occurrence
of a key wins, if override is 2, a KeyError with conflicting key as
argument is raised.
*/
PyAPI_FUNC(int) _PyDict_MergeEx(PyObject *mp, PyObject *other, int override);
PyAPI_FUNC(int) _PyDict_SetItemId(PyObject *dp, _Py_Identifier *key, PyObject *item);
PyAPI_FUNC(int) _PyDict_DelItemId(PyObject *mp, _Py_Identifier *key);
PyAPI_FUNC(void) _PyDict_DebugMallocStats(FILE *out);
/* _PyDictView */
typedef struct {
PyObject_HEAD
PyDictObject *dv_dict;
} _PyDictViewObject;
PyAPI_FUNC(PyObject *) _PyDictView_New(PyObject *, PyTypeObject *);
PyAPI_FUNC(PyObject *) _PyDictView_Intersect(PyObject* self, PyObject *other);
/* Dictionary watchers */
#define PY_FOREACH_DICT_EVENT(V) \
V(ADDED) \
V(MODIFIED) \
V(DELETED) \
V(CLONED) \
V(CLEARED) \
V(DEALLOCATED)
typedef enum {
#define PY_DEF_EVENT(EVENT) PyDict_EVENT_##EVENT,
PY_FOREACH_DICT_EVENT(PY_DEF_EVENT)
#undef PY_DEF_EVENT
} PyDict_WatchEvent;
// Callback to be invoked when a watched dict is cleared, dealloced, or modified.
// In clear/dealloc case, key and new_value will be NULL. Otherwise, new_value will be the
// new value for key, NULL if key is being deleted.
typedef int(*PyDict_WatchCallback)(PyDict_WatchEvent event, PyObject* dict, PyObject* key, PyObject* new_value);
// Register/unregister a dict-watcher callback
PyAPI_FUNC(int) PyDict_AddWatcher(PyDict_WatchCallback callback);
PyAPI_FUNC(int) PyDict_ClearWatcher(int watcher_id);
// Mark given dictionary as "watched" (callback will be called if it is modified)
PyAPI_FUNC(int) PyDict_Watch(int watcher_id, PyObject* dict);
PyAPI_FUNC(int) PyDict_Unwatch(int watcher_id, PyObject* dict);
# 91 "./Include/dictobject.h" 2
# undef Py_CPYTHON_DICTOBJECT_H
#endif
# 93 "./Include/dictobject.h"
#ifdef __cplusplus
}
#endif
# 97 "./Include/dictobject.h"
#endif /* !Py_DICTOBJECT_H */
# 98 "./Include/dictobject.h"
# 62 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "cpython/odictobject.h"
#endif /* expanded by -frewrite-includes */
# 62 "./Include/Python.h"
# 1 "./Include/cpython/odictobject.h" 1
#ifndef Py_ODICTOBJECT_H
#define Py_ODICTOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 6 "./Include/cpython/odictobject.h"
/* OrderedDict */
/* This API is optional and mostly redundant. */
#ifndef Py_LIMITED_API
typedef struct _odictobject PyODictObject;
PyAPI_DATA(PyTypeObject) PyODict_Type;
PyAPI_DATA(PyTypeObject) PyODictIter_Type;
PyAPI_DATA(PyTypeObject) PyODictKeys_Type;
PyAPI_DATA(PyTypeObject) PyODictItems_Type;
PyAPI_DATA(PyTypeObject) PyODictValues_Type;
#define PyODict_Check(op) PyObject_TypeCheck((op), &PyODict_Type)
#define PyODict_CheckExact(op) Py_IS_TYPE((op), &PyODict_Type)
#define PyODict_SIZE(op) PyDict_GET_SIZE((op))
PyAPI_FUNC(PyObject *) PyODict_New(void);
PyAPI_FUNC(int) PyODict_SetItem(PyObject *od, PyObject *key, PyObject *item);
PyAPI_FUNC(int) PyODict_DelItem(PyObject *od, PyObject *key);
/* wrappers around PyDict* functions */
#define PyODict_GetItem(od, key) PyDict_GetItem(_PyObject_CAST(od), (key))
#define PyODict_GetItemWithError(od, key) \
PyDict_GetItemWithError(_PyObject_CAST(od), (key))
#define PyODict_Contains(od, key) PyDict_Contains(_PyObject_CAST(od), (key))
#define PyODict_Size(od) PyDict_Size(_PyObject_CAST(od))
#define PyODict_GetItemString(od, key) \
PyDict_GetItemString(_PyObject_CAST(od), (key))
#endif
# 39 "./Include/cpython/odictobject.h"
#ifdef __cplusplus
}
#endif
# 43 "./Include/cpython/odictobject.h"
#endif /* !Py_ODICTOBJECT_H */
# 44 "./Include/cpython/odictobject.h"
# 63 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "enumobject.h"
#endif /* expanded by -frewrite-includes */
# 63 "./Include/Python.h"
# 1 "./Include/enumobject.h" 1
#ifndef Py_ENUMOBJECT_H
#define Py_ENUMOBJECT_H
/* Enumerate Object */
#ifdef __cplusplus
extern "C" {
#endif
# 9 "./Include/enumobject.h"
PyAPI_DATA(PyTypeObject) PyEnum_Type;
PyAPI_DATA(PyTypeObject) PyReversed_Type;
#ifdef __cplusplus
}
#endif
# 16 "./Include/enumobject.h"
#endif /* !Py_ENUMOBJECT_H */
# 18 "./Include/enumobject.h"
# 64 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "setobject.h"
#endif /* expanded by -frewrite-includes */
# 64 "./Include/Python.h"
# 1 "./Include/setobject.h" 1
/* Set object interface */
#ifndef Py_SETOBJECT_H
#define Py_SETOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 8 "./Include/setobject.h"
PyAPI_DATA(PyTypeObject) PySet_Type;
PyAPI_DATA(PyTypeObject) PyFrozenSet_Type;
PyAPI_DATA(PyTypeObject) PySetIter_Type;
PyAPI_FUNC(PyObject *) PySet_New(PyObject *);
PyAPI_FUNC(PyObject *) PyFrozenSet_New(PyObject *);
PyAPI_FUNC(int) PySet_Add(PyObject *set, PyObject *key);
PyAPI_FUNC(int) PySet_Clear(PyObject *set);
PyAPI_FUNC(int) PySet_Contains(PyObject *anyset, PyObject *key);
PyAPI_FUNC(int) PySet_Discard(PyObject *set, PyObject *key);
PyAPI_FUNC(PyObject *) PySet_Pop(PyObject *set);
PyAPI_FUNC(Py_ssize_t) PySet_Size(PyObject *anyset);
#define PyFrozenSet_CheckExact(ob) Py_IS_TYPE((ob), &PyFrozenSet_Type)
#define PyFrozenSet_Check(ob) \
(Py_IS_TYPE((ob), &PyFrozenSet_Type) || \
PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
#define PyAnySet_CheckExact(ob) \
(Py_IS_TYPE((ob), &PySet_Type) || Py_IS_TYPE((ob), &PyFrozenSet_Type))
#define PyAnySet_Check(ob) \
(Py_IS_TYPE((ob), &PySet_Type) || Py_IS_TYPE((ob), &PyFrozenSet_Type) || \
PyType_IsSubtype(Py_TYPE(ob), &PySet_Type) || \
PyType_IsSubtype(Py_TYPE(ob), &PyFrozenSet_Type))
#define PySet_CheckExact(op) Py_IS_TYPE(op, &PySet_Type)
#define PySet_Check(ob) \
(Py_IS_TYPE((ob), &PySet_Type) || \
PyType_IsSubtype(Py_TYPE(ob), &PySet_Type))
#ifndef Py_LIMITED_API
# define Py_CPYTHON_SETOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/setobject.h"
#endif /* expanded by -frewrite-includes */
# 42 "./Include/setobject.h"
# 1 "./Include/cpython/setobject.h" 1
#ifndef Py_CPYTHON_SETOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/setobject.h"
/* There are three kinds of entries in the table:
1. Unused: key == NULL and hash == 0
2. Dummy: key == dummy and hash == -1
3. Active: key != NULL and key != dummy and hash != -1
The hash field of Unused slots is always zero.
The hash field of Dummy slots are set to -1
meaning that dummy entries can be detected by
either entry->key==dummy or by entry->hash==-1.
*/
#define PySet_MINSIZE 8
typedef struct {
PyObject *key;
Py_hash_t hash; /* Cached hash code of the key */
} setentry;
/* The SetObject data structure is shared by set and frozenset objects.
Invariant for sets:
- hash is -1
Invariants for frozensets:
- data is immutable.
- hash is the hash of the frozenset or -1 if not computed yet.
*/
typedef struct {
PyObject_HEAD
Py_ssize_t fill; /* Number active and dummy entries*/
Py_ssize_t used; /* Number active entries */
/* The table contains mask + 1 slots, and that's a power of 2.
* We store the mask instead of the size because the mask is more
* frequently needed.
*/
Py_ssize_t mask;
/* The table points to a fixed-size smalltable for small tables
* or to additional malloc'ed memory for bigger tables.
* The table pointer is never NULL which saves us from repeated
* runtime null-tests.
*/
setentry *table;
Py_hash_t hash; /* Only used by frozenset objects */
Py_ssize_t finger; /* Search finger for pop() */
setentry smalltable[PySet_MINSIZE];
PyObject *weakreflist; /* List of weak references */
} PySetObject;
#define _PySet_CAST(so) \
(assert(PyAnySet_Check(so)), _Py_CAST(PySetObject*, so))
static inline Py_ssize_t PySet_GET_SIZE(PyObject *so) {
return _PySet_CAST(so)->used;
}
#define PySet_GET_SIZE(so) PySet_GET_SIZE(_PyObject_CAST(so))
PyAPI_DATA(PyObject *) _PySet_Dummy;
PyAPI_FUNC(int) _PySet_NextEntry(PyObject *set, Py_ssize_t *pos, PyObject **key, Py_hash_t *hash);
PyAPI_FUNC(int) _PySet_Update(PyObject *set, PyObject *iterable);
# 43 "./Include/setobject.h" 2
# undef Py_CPYTHON_SETOBJECT_H
#endif
# 45 "./Include/setobject.h"
#ifdef __cplusplus
}
#endif
# 49 "./Include/setobject.h"
#endif /* !Py_SETOBJECT_H */
# 50 "./Include/setobject.h"
# 65 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "methodobject.h"
#endif /* expanded by -frewrite-includes */
# 65 "./Include/Python.h"
# 1 "./Include/methodobject.h" 1
/* Method object interface */
#ifndef Py_METHODOBJECT_H
#define Py_METHODOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 9 "./Include/methodobject.h"
/* This is about the type 'builtin_function_or_method',
not Python methods in user-defined classes. See classobject.h
for the latter. */
PyAPI_DATA(PyTypeObject) PyCFunction_Type;
#define PyCFunction_CheckExact(op) Py_IS_TYPE((op), &PyCFunction_Type)
#define PyCFunction_Check(op) PyObject_TypeCheck((op), &PyCFunction_Type)
typedef PyObject *(*PyCFunction)(PyObject *, PyObject *);
typedef PyObject *(*_PyCFunctionFast) (PyObject *, PyObject *const *, Py_ssize_t);
typedef PyObject *(*PyCFunctionWithKeywords)(PyObject *, PyObject *,
PyObject *);
typedef PyObject *(*_PyCFunctionFastWithKeywords) (PyObject *,
PyObject *const *, Py_ssize_t,
PyObject *);
typedef PyObject *(*PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *,
size_t, PyObject *);
// Cast an function to the PyCFunction type to use it with PyMethodDef.
//
// This macro can be used to prevent compiler warnings if the first parameter
// uses a different pointer type than PyObject* (ex: METH_VARARGS and METH_O
// calling conventions).
//
// The macro can also be used for METH_FASTCALL and METH_VARARGS|METH_KEYWORDS
// calling conventions to avoid compiler warnings because the function has more
// than 2 parameters. The macro first casts the function to the
// "void func(void)" type to prevent compiler warnings.
//
// If a function is declared with the METH_NOARGS calling convention, it must
// have 2 parameters. Since the second parameter is unused, Py_UNUSED() can be
// used to prevent a compiler warning. If the function has a single parameter,
// it triggers an undefined behavior when Python calls it with 2 parameters
// (bpo-33012).
#define _PyCFunction_CAST(func) \
_Py_CAST(PyCFunction, _Py_CAST(void(*)(void), (func)))
PyAPI_FUNC(PyCFunction) PyCFunction_GetFunction(PyObject *);
PyAPI_FUNC(PyObject *) PyCFunction_GetSelf(PyObject *);
PyAPI_FUNC(int) PyCFunction_GetFlags(PyObject *);
Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyCFunction_Call(PyObject *, PyObject *, PyObject *);
struct PyMethodDef {
const char *ml_name; /* The name of the built-in function/method */
PyCFunction ml_meth; /* The C function that implements it */
int ml_flags; /* Combination of METH_xxx flags, which mostly
describe the args expected by the C func */
const char *ml_doc; /* The __doc__ attribute, or NULL */
};
/* PyCFunction_New is declared as a function for stable ABI (declaration is
* needed for e.g. GCC with -fvisibility=hidden), but redefined as a macro
* that calls PyCFunction_NewEx. */
PyAPI_FUNC(PyObject *) PyCFunction_New(PyMethodDef *, PyObject *);
#define PyCFunction_New(ML, SELF) PyCFunction_NewEx((ML), (SELF), NULL)
/* PyCFunction_NewEx is similar: on 3.9+, this calls PyCMethod_New. */
PyAPI_FUNC(PyObject *) PyCFunction_NewEx(PyMethodDef *, PyObject *,
PyObject *);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 73 "./Include/methodobject.h"
#define PyCFunction_NewEx(ML, SELF, MOD) PyCMethod_New((ML), (SELF), (MOD), NULL)
PyAPI_FUNC(PyObject *) PyCMethod_New(PyMethodDef *, PyObject *,
PyObject *, PyTypeObject *);
#endif
# 77 "./Include/methodobject.h"
/* Flag passed to newmethodobject */
/* #define METH_OLDARGS 0x0000 -- unsupported now */
#define METH_VARARGS 0x0001
#define METH_KEYWORDS 0x0002
/* METH_NOARGS and METH_O must not be combined with the flags above. */
#define METH_NOARGS 0x0004
#define METH_O 0x0008
/* METH_CLASS and METH_STATIC are a little different; these control
the construction of methods for a class. These cannot be used for
functions in modules. */
#define METH_CLASS 0x0010
#define METH_STATIC 0x0020
/* METH_COEXIST allows a method to be entered even though a slot has
already filled the entry. When defined, the flag allows a separate
method, "__contains__" for example, to coexist with a defined
slot like sq_contains. */
#define METH_COEXIST 0x0040
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030a0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 101 "./Include/methodobject.h"
# define METH_FASTCALL 0x0080
#endif
# 103 "./Include/methodobject.h"
/* This bit is preserved for Stackless Python */
#ifdef STACKLESS
# define METH_STACKLESS 0x0100
#else
# 108 "./Include/methodobject.h"
# define METH_STACKLESS 0x0000
#endif
# 110 "./Include/methodobject.h"
/* METH_METHOD means the function stores an
* additional reference to the class that defines it;
* both self and class are passed to it.
* It uses PyCMethodObject instead of PyCFunctionObject.
* May not be combined with METH_NOARGS, METH_O, METH_CLASS or METH_STATIC.
*/
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 119 "./Include/methodobject.h"
#define METH_METHOD 0x0200
#endif
# 121 "./Include/methodobject.h"
#ifndef Py_LIMITED_API
# define Py_CPYTHON_METHODOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/methodobject.h"
#endif /* expanded by -frewrite-includes */
# 125 "./Include/methodobject.h"
# 1 "./Include/cpython/methodobject.h" 1
#ifndef Py_CPYTHON_METHODOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/methodobject.h"
// PyCFunctionObject structure
typedef struct {
PyObject_HEAD
PyMethodDef *m_ml; /* Description of the C function to call */
PyObject *m_self; /* Passed as 'self' arg to the C func, can be NULL */
PyObject *m_module; /* The __module__ attribute, can be anything */
PyObject *m_weakreflist; /* List of weak references */
vectorcallfunc vectorcall;
} PyCFunctionObject;
#define _PyCFunctionObject_CAST(func) \
(assert(PyCFunction_Check(func)), \
_Py_CAST(PyCFunctionObject*, (func)))
// PyCMethodObject structure
typedef struct {
PyCFunctionObject func;
PyTypeObject *mm_class; /* Class that defines this method */
} PyCMethodObject;
#define _PyCMethodObject_CAST(func) \
(assert(PyCMethod_Check(func)), \
_Py_CAST(PyCMethodObject*, (func)))
PyAPI_DATA(PyTypeObject) PyCMethod_Type;
#define PyCMethod_CheckExact(op) Py_IS_TYPE((op), &PyCMethod_Type)
#define PyCMethod_Check(op) PyObject_TypeCheck((op), &PyCMethod_Type)
/* Static inline functions for direct access to these values.
Type checks are *not* done, so use with care. */
static inline PyCFunction PyCFunction_GET_FUNCTION(PyObject *func) {
return _PyCFunctionObject_CAST(func)->m_ml->ml_meth;
}
#define PyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(_PyObject_CAST(func))
static inline PyObject* PyCFunction_GET_SELF(PyObject *func_obj) {
PyCFunctionObject *func = _PyCFunctionObject_CAST(func_obj);
if (func->m_ml->ml_flags & METH_STATIC) {
return _Py_NULL;
}
return func->m_self;
}
#define PyCFunction_GET_SELF(func) PyCFunction_GET_SELF(_PyObject_CAST(func))
static inline int PyCFunction_GET_FLAGS(PyObject *func) {
return _PyCFunctionObject_CAST(func)->m_ml->ml_flags;
}
#define PyCFunction_GET_FLAGS(func) PyCFunction_GET_FLAGS(_PyObject_CAST(func))
static inline PyTypeObject* PyCFunction_GET_CLASS(PyObject *func_obj) {
PyCFunctionObject *func = _PyCFunctionObject_CAST(func_obj);
if (func->m_ml->ml_flags & METH_METHOD) {
return _PyCMethodObject_CAST(func)->mm_class;
}
return _Py_NULL;
}
#define PyCFunction_GET_CLASS(func) PyCFunction_GET_CLASS(_PyObject_CAST(func))
# 126 "./Include/methodobject.h" 2
# undef Py_CPYTHON_METHODOBJECT_H
#endif
# 128 "./Include/methodobject.h"
#ifdef __cplusplus
}
#endif
# 132 "./Include/methodobject.h"
#endif /* !Py_METHODOBJECT_H */
# 133 "./Include/methodobject.h"
# 66 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "moduleobject.h"
#endif /* expanded by -frewrite-includes */
# 66 "./Include/Python.h"
# 1 "./Include/moduleobject.h" 1
/* Module object interface */
#ifndef Py_MODULEOBJECT_H
#define Py_MODULEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 9 "./Include/moduleobject.h"
PyAPI_DATA(PyTypeObject) PyModule_Type;
#define PyModule_Check(op) PyObject_TypeCheck((op), &PyModule_Type)
#define PyModule_CheckExact(op) Py_IS_TYPE((op), &PyModule_Type)
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 16 "./Include/moduleobject.h"
PyAPI_FUNC(PyObject *) PyModule_NewObject(
PyObject *name
);
#endif
# 20 "./Include/moduleobject.h"
PyAPI_FUNC(PyObject *) PyModule_New(
const char *name /* UTF-8 encoded string */
);
PyAPI_FUNC(PyObject *) PyModule_GetDict(PyObject *);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 25 "./Include/moduleobject.h"
PyAPI_FUNC(PyObject *) PyModule_GetNameObject(PyObject *);
#endif
# 27 "./Include/moduleobject.h"
PyAPI_FUNC(const char *) PyModule_GetName(PyObject *);
Py_DEPRECATED(3.2) PyAPI_FUNC(const char *) PyModule_GetFilename(PyObject *);
PyAPI_FUNC(PyObject *) PyModule_GetFilenameObject(PyObject *);
#ifndef Py_LIMITED_API
PyAPI_FUNC(void) _PyModule_Clear(PyObject *);
PyAPI_FUNC(void) _PyModule_ClearDict(PyObject *);
PyAPI_FUNC(int) _PyModuleSpec_IsInitializing(PyObject *);
#endif
# 35 "./Include/moduleobject.h"
PyAPI_FUNC(PyModuleDef*) PyModule_GetDef(PyObject*);
PyAPI_FUNC(void*) PyModule_GetState(PyObject*);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 39 "./Include/moduleobject.h"
/* New in 3.5 */
PyAPI_FUNC(PyObject *) PyModuleDef_Init(PyModuleDef*);
PyAPI_DATA(PyTypeObject) PyModuleDef_Type;
#endif
# 43 "./Include/moduleobject.h"
typedef struct PyModuleDef_Base {
PyObject_HEAD
/* The function used to re-initialize the module.
This is only set for legacy (single-phase init) extension modules
and only used for those that support multiple initializations
(m_size >= 0).
It is set by _PyImport_LoadDynamicModuleWithSpec()
and _imp.create_builtin(). */
PyObject* (*m_init)(void);
/* The module's index into its interpreter's modules_by_index cache.
This is set for all extension modules but only used for legacy ones.
(See PyInterpreterState.modules_by_index for more info.)
It is set by PyModuleDef_Init(). */
Py_ssize_t m_index;
/* A copy of the module's __dict__ after the first time it was loaded.
This is only set/used for legacy modules that do not support
multiple initializations.
It is set by _PyImport_FixupExtensionObject(). */
PyObject* m_copy;
} PyModuleDef_Base;
#define PyModuleDef_HEAD_INIT { \
PyObject_HEAD_INIT(_Py_NULL) \
_Py_NULL, /* m_init */ \
0, /* m_index */ \
_Py_NULL, /* m_copy */ \
}
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03050000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 73 "./Include/moduleobject.h"
/* New in 3.5 */
struct PyModuleDef_Slot {
int slot;
void *value;
};
#define Py_mod_create 1
#define Py_mod_exec 2
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 82 "./Include/moduleobject.h"
# define Py_mod_multiple_interpreters 3
#endif
# 84 "./Include/moduleobject.h"
#ifndef Py_LIMITED_API
#define _Py_mod_LAST_SLOT 3
#endif
# 88 "./Include/moduleobject.h"
#endif /* New in 3.5 */
# 90 "./Include/moduleobject.h"
/* for Py_mod_multiple_interpreters: */
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c0000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 93 "./Include/moduleobject.h"
# define Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED ((void *)0)
# define Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED ((void *)1)
# define Py_MOD_PER_INTERPRETER_GIL_SUPPORTED ((void *)2)
#endif
# 97 "./Include/moduleobject.h"
struct PyModuleDef {
PyModuleDef_Base m_base;
const char* m_name;
const char* m_doc;
Py_ssize_t m_size;
PyMethodDef *m_methods;
PyModuleDef_Slot *m_slots;
traverseproc m_traverse;
inquiry m_clear;
freefunc m_free;
};
// Internal C API
#ifdef Py_BUILD_CORE
extern int _PyModule_IsExtension(PyObject *obj);
#endif
# 115 "./Include/moduleobject.h"
#ifdef __cplusplus
}
#endif
# 119 "./Include/moduleobject.h"
#endif /* !Py_MODULEOBJECT_H */
# 120 "./Include/moduleobject.h"
# 67 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "cpython/funcobject.h"
#endif /* expanded by -frewrite-includes */
# 67 "./Include/Python.h"
# 1 "./Include/cpython/funcobject.h" 1
/* Function object interface */
#ifndef Py_LIMITED_API
#ifndef Py_FUNCOBJECT_H
#define Py_FUNCOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 9 "./Include/cpython/funcobject.h"
#define COMMON_FIELDS(PREFIX) \
PyObject *PREFIX ## globals; \
PyObject *PREFIX ## builtins; \
PyObject *PREFIX ## name; \
PyObject *PREFIX ## qualname; \
PyObject *PREFIX ## code; /* A code object, the __code__ attribute */ \
PyObject *PREFIX ## defaults; /* NULL or a tuple */ \
PyObject *PREFIX ## kwdefaults; /* NULL or a dict */ \
PyObject *PREFIX ## closure; /* NULL or a tuple of cell objects */
typedef struct {
COMMON_FIELDS(fc_)
} PyFrameConstructor;
/* Function objects and code objects should not be confused with each other:
*
* Function objects are created by the execution of the 'def' statement.
* They reference a code object in their __code__ attribute, which is a
* purely syntactic object, i.e. nothing more than a compiled version of some
* source code lines. There is one code object per source code "fragment",
* but each code object can be referenced by zero or many function objects
* depending only on how many times the 'def' statement in the source was
* executed so far.
*/
typedef struct {
PyObject_HEAD
COMMON_FIELDS(func_)
PyObject *func_doc; /* The __doc__ attribute, can be anything */
PyObject *func_dict; /* The __dict__ attribute, a dict or NULL */
PyObject *func_weakreflist; /* List of weak references */
PyObject *func_module; /* The __module__ attribute, can be anything */
PyObject *func_annotations; /* Annotations, a dict or NULL */
PyObject *func_typeparams; /* Tuple of active type variables or NULL */
vectorcallfunc vectorcall;
/* Version number for use by specializer.
* Can set to non-zero when we want to specialize.
* Will be set to zero if any of these change:
* defaults
* kwdefaults (only if the object changes, not the contents of the dict)
* code
* annotations
* vectorcall function pointer */
uint32_t func_version;
/* Invariant:
* func_closure contains the bindings for func_code->co_freevars, so
* PyTuple_Size(func_closure) == PyCode_GetNumFree(func_code)
* (func_closure may be NULL if PyCode_GetNumFree(func_code) == 0).
*/
} PyFunctionObject;
PyAPI_DATA(PyTypeObject) PyFunction_Type;
#define PyFunction_Check(op) Py_IS_TYPE((op), &PyFunction_Type)
PyAPI_FUNC(PyObject *) PyFunction_New(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyFunction_NewWithQualName(PyObject *, PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyFunction_GetCode(PyObject *);
PyAPI_FUNC(PyObject *) PyFunction_GetGlobals(PyObject *);
PyAPI_FUNC(PyObject *) PyFunction_GetModule(PyObject *);
PyAPI_FUNC(PyObject *) PyFunction_GetDefaults(PyObject *);
PyAPI_FUNC(int) PyFunction_SetDefaults(PyObject *, PyObject *);
PyAPI_FUNC(void) PyFunction_SetVectorcall(PyFunctionObject *, vectorcallfunc);
PyAPI_FUNC(PyObject *) PyFunction_GetKwDefaults(PyObject *);
PyAPI_FUNC(int) PyFunction_SetKwDefaults(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyFunction_GetClosure(PyObject *);
PyAPI_FUNC(int) PyFunction_SetClosure(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyFunction_GetAnnotations(PyObject *);
PyAPI_FUNC(int) PyFunction_SetAnnotations(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) _PyFunction_Vectorcall(
PyObject *func,
PyObject *const *stack,
size_t nargsf,
PyObject *kwnames);
#define _PyFunction_CAST(func) \
(assert(PyFunction_Check(func)), _Py_CAST(PyFunctionObject*, func))
/* Static inline functions for direct access to these values.
Type checks are *not* done, so use with care. */
static inline PyObject* PyFunction_GET_CODE(PyObject *func) {
return _PyFunction_CAST(func)->func_code;
}
#define PyFunction_GET_CODE(func) PyFunction_GET_CODE(_PyObject_CAST(func))
static inline PyObject* PyFunction_GET_GLOBALS(PyObject *func) {
return _PyFunction_CAST(func)->func_globals;
}
#define PyFunction_GET_GLOBALS(func) PyFunction_GET_GLOBALS(_PyObject_CAST(func))
static inline PyObject* PyFunction_GET_MODULE(PyObject *func) {
return _PyFunction_CAST(func)->func_module;
}
#define PyFunction_GET_MODULE(func) PyFunction_GET_MODULE(_PyObject_CAST(func))
static inline PyObject* PyFunction_GET_DEFAULTS(PyObject *func) {
return _PyFunction_CAST(func)->func_defaults;
}
#define PyFunction_GET_DEFAULTS(func) PyFunction_GET_DEFAULTS(_PyObject_CAST(func))
static inline PyObject* PyFunction_GET_KW_DEFAULTS(PyObject *func) {
return _PyFunction_CAST(func)->func_kwdefaults;
}
#define PyFunction_GET_KW_DEFAULTS(func) PyFunction_GET_KW_DEFAULTS(_PyObject_CAST(func))
static inline PyObject* PyFunction_GET_CLOSURE(PyObject *func) {
return _PyFunction_CAST(func)->func_closure;
}
#define PyFunction_GET_CLOSURE(func) PyFunction_GET_CLOSURE(_PyObject_CAST(func))
static inline PyObject* PyFunction_GET_ANNOTATIONS(PyObject *func) {
return _PyFunction_CAST(func)->func_annotations;
}
#define PyFunction_GET_ANNOTATIONS(func) PyFunction_GET_ANNOTATIONS(_PyObject_CAST(func))
/* The classmethod and staticmethod types lives here, too */
PyAPI_DATA(PyTypeObject) PyClassMethod_Type;
PyAPI_DATA(PyTypeObject) PyStaticMethod_Type;
PyAPI_FUNC(PyObject *) PyClassMethod_New(PyObject *);
PyAPI_FUNC(PyObject *) PyStaticMethod_New(PyObject *);
#define PY_FOREACH_FUNC_EVENT(V) \
V(CREATE) \
V(DESTROY) \
V(MODIFY_CODE) \
V(MODIFY_DEFAULTS) \
V(MODIFY_KWDEFAULTS)
typedef enum {
#define PY_DEF_EVENT(EVENT) PyFunction_EVENT_##EVENT,
PY_FOREACH_FUNC_EVENT(PY_DEF_EVENT)
#undef PY_DEF_EVENT
} PyFunction_WatchEvent;
/*
* A callback that is invoked for different events in a function's lifecycle.
*
* The callback is invoked with a borrowed reference to func, after it is
* created and before it is modified or destroyed. The callback should not
* modify func.
*
* When a function's code object, defaults, or kwdefaults are modified the
* callback will be invoked with the respective event and new_value will
* contain a borrowed reference to the new value that is about to be stored in
* the function. Otherwise the third argument is NULL.
*
* If the callback returns with an exception set, it must return -1. Otherwise
* it should return 0.
*/
typedef int (*PyFunction_WatchCallback)(
PyFunction_WatchEvent event,
PyFunctionObject *func,
PyObject *new_value);
/*
* Register a per-interpreter callback that will be invoked for function lifecycle
* events.
*
* Returns a handle that may be passed to PyFunction_ClearWatcher on success,
* or -1 and sets an error if no more handles are available.
*/
PyAPI_FUNC(int) PyFunction_AddWatcher(PyFunction_WatchCallback callback);
/*
* Clear the watcher associated with the watcher_id handle.
*
* Returns 0 on success or -1 if no watcher exists for the supplied id.
*/
PyAPI_FUNC(int) PyFunction_ClearWatcher(int watcher_id);
#ifdef __cplusplus
}
#endif
# 187 "./Include/cpython/funcobject.h"
#endif /* !Py_FUNCOBJECT_H */
# 188 "./Include/cpython/funcobject.h"
#endif /* Py_LIMITED_API */
# 189 "./Include/cpython/funcobject.h"
# 68 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "cpython/classobject.h"
#endif /* expanded by -frewrite-includes */
# 68 "./Include/Python.h"
# 1 "./Include/cpython/classobject.h" 1
/* Former class object interface -- now only bound methods are here */
/* Revealing some structures (not for general use) */
#ifndef Py_LIMITED_API
#ifndef Py_CLASSOBJECT_H
#define Py_CLASSOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 11 "./Include/cpython/classobject.h"
typedef struct {
PyObject_HEAD
PyObject *im_func; /* The callable object implementing the method */
PyObject *im_self; /* The instance it is bound to */
PyObject *im_weakreflist; /* List of weak references */
vectorcallfunc vectorcall;
} PyMethodObject;
PyAPI_DATA(PyTypeObject) PyMethod_Type;
#define PyMethod_Check(op) Py_IS_TYPE((op), &PyMethod_Type)
PyAPI_FUNC(PyObject *) PyMethod_New(PyObject *, PyObject *);
PyAPI_FUNC(PyObject *) PyMethod_Function(PyObject *);
PyAPI_FUNC(PyObject *) PyMethod_Self(PyObject *);
#define _PyMethod_CAST(meth) \
(assert(PyMethod_Check(meth)), _Py_CAST(PyMethodObject*, meth))
/* Static inline functions for direct access to these values.
Type checks are *not* done, so use with care. */
static inline PyObject* PyMethod_GET_FUNCTION(PyObject *meth) {
return _PyMethod_CAST(meth)->im_func;
}
#define PyMethod_GET_FUNCTION(meth) PyMethod_GET_FUNCTION(_PyObject_CAST(meth))
static inline PyObject* PyMethod_GET_SELF(PyObject *meth) {
return _PyMethod_CAST(meth)->im_self;
}
#define PyMethod_GET_SELF(meth) PyMethod_GET_SELF(_PyObject_CAST(meth))
typedef struct {
PyObject_HEAD
PyObject *func;
} PyInstanceMethodObject;
PyAPI_DATA(PyTypeObject) PyInstanceMethod_Type;
#define PyInstanceMethod_Check(op) Py_IS_TYPE((op), &PyInstanceMethod_Type)
PyAPI_FUNC(PyObject *) PyInstanceMethod_New(PyObject *);
PyAPI_FUNC(PyObject *) PyInstanceMethod_Function(PyObject *);
#define _PyInstanceMethod_CAST(meth) \
(assert(PyInstanceMethod_Check(meth)), \
_Py_CAST(PyInstanceMethodObject*, meth))
/* Static inline function for direct access to these values.
Type checks are *not* done, so use with care. */
static inline PyObject* PyInstanceMethod_GET_FUNCTION(PyObject *meth) {
return _PyInstanceMethod_CAST(meth)->func;
}
#define PyInstanceMethod_GET_FUNCTION(meth) PyInstanceMethod_GET_FUNCTION(_PyObject_CAST(meth))
#ifdef __cplusplus
}
#endif
# 70 "./Include/cpython/classobject.h"
#endif // !Py_CLASSOBJECT_H
# 71 "./Include/cpython/classobject.h"
#endif // !Py_LIMITED_API
# 72 "./Include/cpython/classobject.h"
# 69 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "fileobject.h"
#endif /* expanded by -frewrite-includes */
# 69 "./Include/Python.h"
# 1 "./Include/fileobject.h" 1
/* File object interface (what's left of it -- see io.py) */
#ifndef Py_FILEOBJECT_H
#define Py_FILEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 8 "./Include/fileobject.h"
#define PY_STDIOTEXTMODE "b"
PyAPI_FUNC(PyObject *) PyFile_FromFd(int, const char *, const char *, int,
const char *, const char *,
const char *, int);
PyAPI_FUNC(PyObject *) PyFile_GetLine(PyObject *, int);
PyAPI_FUNC(int) PyFile_WriteObject(PyObject *, PyObject *, int);
PyAPI_FUNC(int) PyFile_WriteString(const char *, PyObject *);
PyAPI_FUNC(int) PyObject_AsFileDescriptor(PyObject *);
/* The default encoding used by the platform file system APIs
If non-NULL, this is different than the default encoding for strings
*/
Py_DEPRECATED(3.12) PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 24 "./Include/fileobject.h"
Py_DEPRECATED(3.12) PyAPI_DATA(const char *) Py_FileSystemDefaultEncodeErrors;
#endif
# 26 "./Include/fileobject.h"
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_HasFileSystemDefaultEncoding;
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 29 "./Include/fileobject.h"
Py_DEPRECATED(3.12) PyAPI_DATA(int) Py_UTF8Mode;
#endif
# 31 "./Include/fileobject.h"
/* A routine to check if a file descriptor can be select()-ed. */
#ifdef _MSC_VER
/* On Windows, any socket fd can be select()-ed, no matter how high */
#define _PyIsSelectable_fd(FD) (1)
#else
# 37 "./Include/fileobject.h"
#define _PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE)
#endif
# 39 "./Include/fileobject.h"
#ifndef Py_LIMITED_API
# define Py_CPYTHON_FILEOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/fileobject.h"
#endif /* expanded by -frewrite-includes */
# 42 "./Include/fileobject.h"
# 1 "./Include/cpython/fileobject.h" 1
#ifndef Py_CPYTHON_FILEOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/fileobject.h"
PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
PyAPI_FUNC(char *) _Py_UniversalNewlineFgetsWithSize(char *, int, FILE*, PyObject *, size_t*);
/* The std printer acts as a preliminary sys.stderr until the new io
infrastructure is in place. */
PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
typedef PyObject * (*Py_OpenCodeHookFunction)(PyObject *, void *);
PyAPI_FUNC(PyObject *) PyFile_OpenCode(const char *utf8path);
PyAPI_FUNC(PyObject *) PyFile_OpenCodeObject(PyObject *path);
PyAPI_FUNC(int) PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction hook, void *userData);
PyAPI_FUNC(int) _PyLong_FileDescriptor_Converter(PyObject *, void *);
# 43 "./Include/fileobject.h" 2
# undef Py_CPYTHON_FILEOBJECT_H
#endif
# 45 "./Include/fileobject.h"
#ifdef __cplusplus
}
#endif
# 49 "./Include/fileobject.h"
#endif /* !Py_FILEOBJECT_H */
# 50 "./Include/fileobject.h"
# 70 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pycapsule.h"
#endif /* expanded by -frewrite-includes */
# 70 "./Include/Python.h"
# 1 "./Include/pycapsule.h" 1
/* Capsule objects let you wrap a C "void *" pointer in a Python
object. They're a way of passing data through the Python interpreter
without creating your own custom type.
Capsules are used for communication between extension modules.
They provide a way for an extension module to export a C interface
to other extension modules, so that extension modules can use the
Python import mechanism to link to one another.
For more information, please see "c-api/capsule.html" in the
documentation.
*/
#ifndef Py_CAPSULE_H
#define Py_CAPSULE_H
#ifdef __cplusplus
extern "C" {
#endif
# 20 "./Include/pycapsule.h"
PyAPI_DATA(PyTypeObject) PyCapsule_Type;
typedef void (*PyCapsule_Destructor)(PyObject *);
#define PyCapsule_CheckExact(op) Py_IS_TYPE((op), &PyCapsule_Type)
PyAPI_FUNC(PyObject *) PyCapsule_New(
void *pointer,
const char *name,
PyCapsule_Destructor destructor);
PyAPI_FUNC(void *) PyCapsule_GetPointer(PyObject *capsule, const char *name);
PyAPI_FUNC(PyCapsule_Destructor) PyCapsule_GetDestructor(PyObject *capsule);
PyAPI_FUNC(const char *) PyCapsule_GetName(PyObject *capsule);
PyAPI_FUNC(void *) PyCapsule_GetContext(PyObject *capsule);
PyAPI_FUNC(int) PyCapsule_IsValid(PyObject *capsule, const char *name);
PyAPI_FUNC(int) PyCapsule_SetPointer(PyObject *capsule, void *pointer);
PyAPI_FUNC(int) PyCapsule_SetDestructor(PyObject *capsule, PyCapsule_Destructor destructor);
PyAPI_FUNC(int) PyCapsule_SetName(PyObject *capsule, const char *name);
PyAPI_FUNC(int) PyCapsule_SetContext(PyObject *capsule, void *context);
PyAPI_FUNC(void *) PyCapsule_Import(
const char *name, /* UTF-8 encoded string */
int no_block);
#ifdef __cplusplus
}
#endif
# 59 "./Include/pycapsule.h"
#endif /* !Py_CAPSULE_H */
# 60 "./Include/pycapsule.h"
# 71 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "cpython/code.h"
#endif /* expanded by -frewrite-includes */
# 71 "./Include/Python.h"
# 1 "./Include/cpython/code.h" 1
/* Definitions for bytecode */
#ifndef Py_LIMITED_API
#ifndef Py_CODE_H
#define Py_CODE_H
#ifdef __cplusplus
extern "C" {
#endif
# 10 "./Include/cpython/code.h"
/* Count of all local monitoring events */
#define _PY_MONITORING_LOCAL_EVENTS 10
/* Count of all "real" monitoring events (not derived from other events) */
#define _PY_MONITORING_UNGROUPED_EVENTS 15
/* Count of all monitoring events */
#define _PY_MONITORING_EVENTS 17
/* Tables of which tools are active for each monitored event. */
/* For 3.12 ABI compatibility this is over sized */
typedef struct _Py_LocalMonitors {
/* Only _PY_MONITORING_LOCAL_EVENTS of these are used */
uint8_t tools[_PY_MONITORING_UNGROUPED_EVENTS];
} _Py_LocalMonitors;
typedef struct _Py_GlobalMonitors {
uint8_t tools[_PY_MONITORING_UNGROUPED_EVENTS];
} _Py_GlobalMonitors;
/* Each instruction in a code object is a fixed-width value,
* currently 2 bytes: 1-byte opcode + 1-byte oparg. The EXTENDED_ARG
* opcode allows for larger values but the current limit is 3 uses
* of EXTENDED_ARG (see Python/compile.c), for a maximum
* 32-bit value. This aligns with the note in Python/compile.c
* (compiler_addop_i_line) indicating that the max oparg value is
* 2**32 - 1, rather than INT_MAX.
*/
typedef union {
uint16_t cache;
struct {
uint8_t code;
uint8_t arg;
} op;
} _Py_CODEUNIT;
/* These macros only remain defined for compatibility. */
#define _Py_OPCODE(word) ((word).op.code)
#define _Py_OPARG(word) ((word).op.arg)
static inline _Py_CODEUNIT
_py_make_codeunit(uint8_t opcode, uint8_t oparg)
{
// No designated initialisers because of C++ compat
_Py_CODEUNIT word;
word.op.code = opcode;
word.op.arg = oparg;
return word;
}
static inline void
_py_set_opcode(_Py_CODEUNIT *word, uint8_t opcode)
{
word->op.code = opcode;
}
#define _Py_MAKE_CODEUNIT(opcode, oparg) _py_make_codeunit((opcode), (oparg))
#define _Py_SET_OPCODE(word, opcode) _py_set_opcode(&(word), (opcode))
typedef struct {
PyObject *_co_code;
PyObject *_co_varnames;
PyObject *_co_cellvars;
PyObject *_co_freevars;
} _PyCoCached;
/* Ancilliary data structure used for instrumentation.
Line instrumentation creates an array of
these. One entry per code unit.*/
typedef struct {
uint8_t original_opcode;
int8_t line_delta;
} _PyCoLineInstrumentationData;
/* Main data structure used for instrumentation.
* This is allocated when needed for instrumentation
*/
typedef struct {
/* Monitoring specific to this code object */
_Py_LocalMonitors local_monitors;
/* Monitoring that is active on this code object */
_Py_LocalMonitors active_monitors;
/* The tools that are to be notified for events for the matching code unit */
uint8_t *tools;
/* Information to support line events */
_PyCoLineInstrumentationData *lines;
/* The tools that are to be notified for line events for the matching code unit */
uint8_t *line_tools;
/* Information to support instruction events */
/* The underlying instructions, which can themselves be instrumented */
uint8_t *per_instruction_opcodes;
/* The tools that are to be notified for instruction events for the matching code unit */
uint8_t *per_instruction_tools;
} _PyCoMonitoringData;
// To avoid repeating ourselves in deepfreeze.py, all PyCodeObject members are
// defined in this macro:
#define _PyCode_DEF(SIZE) { \
PyObject_VAR_HEAD \
\
/* Note only the following fields are used in hash and/or comparisons \
* \
* - co_name \
* - co_argcount \
* - co_posonlyargcount \
* - co_kwonlyargcount \
* - co_nlocals \
* - co_stacksize \
* - co_flags \
* - co_firstlineno \
* - co_consts \
* - co_names \
* - co_localsplusnames \
* This is done to preserve the name and line number for tracebacks \
* and debuggers; otherwise, constant de-duplication would collapse \
* identical functions/lambdas defined on different lines. \
*/ \
\
/* These fields are set with provided values on new code objects. */ \
\
/* The hottest fields (in the eval loop) are grouped here at the top. */ \
PyObject *co_consts; /* list (constants used) */ \
PyObject *co_names; /* list of strings (names used) */ \
PyObject *co_exceptiontable; /* Byte string encoding exception handling \
table */ \
int co_flags; /* CO_..., see below */ \
\
/* The rest are not so impactful on performance. */ \
int co_argcount; /* #arguments, except *args */ \
int co_posonlyargcount; /* #positional only arguments */ \
int co_kwonlyargcount; /* #keyword only arguments */ \
int co_stacksize; /* #entries needed for evaluation stack */ \
int co_firstlineno; /* first source line number */ \
\
/* redundant values (derived from co_localsplusnames and \
co_localspluskinds) */ \
int co_nlocalsplus; /* number of local + cell + free variables */ \
int co_framesize; /* Size of frame in words */ \
int co_nlocals; /* number of local variables */ \
int co_ncellvars; /* total number of cell variables */ \
int co_nfreevars; /* number of free variables */ \
uint32_t co_version; /* version number */ \
\
PyObject *co_localsplusnames; /* tuple mapping offsets to names */ \
PyObject *co_localspluskinds; /* Bytes mapping to local kinds (one byte \
per variable) */ \
PyObject *co_filename; /* unicode (where it was loaded from) */ \
PyObject *co_name; /* unicode (name, for reference) */ \
PyObject *co_qualname; /* unicode (qualname, for reference) */ \
PyObject *co_linetable; /* bytes object that holds location info */ \
PyObject *co_weakreflist; /* to support weakrefs to code objects */ \
_PyCoCached *_co_cached; /* cached co_* attributes */ \
uint64_t _co_instrumentation_version; /* current instrumentation version */ \
_PyCoMonitoringData *_co_monitoring; /* Monitoring data */ \
int _co_firsttraceable; /* index of first traceable instruction */ \
/* Scratch space for extra data relating to the code object. \
Type is a void* to keep the format private in codeobject.c to force \
people to go through the proper APIs. */ \
void *co_extra; \
char co_code_adaptive[(SIZE)]; \
}
/* Bytecode object */
struct PyCodeObject _PyCode_DEF(1);
/* Masks for co_flags above */
#define CO_OPTIMIZED 0x0001
#define CO_NEWLOCALS 0x0002
#define CO_VARARGS 0x0004
#define CO_VARKEYWORDS 0x0008
#define CO_NESTED 0x0010
#define CO_GENERATOR 0x0020
/* The CO_COROUTINE flag is set for coroutine functions (defined with
``async def`` keywords) */
#define CO_COROUTINE 0x0080
#define CO_ITERABLE_COROUTINE 0x0100
#define CO_ASYNC_GENERATOR 0x0200
/* bpo-39562: These constant values are changed in Python 3.9
to prevent collision with compiler flags. CO_FUTURE_ and PyCF_
constants must be kept unique. PyCF_ constants can use bits from
0x0100 to 0x10000. CO_FUTURE_ constants use bits starting at 0x20000. */
#define CO_FUTURE_DIVISION 0x20000
#define CO_FUTURE_ABSOLUTE_IMPORT 0x40000 /* do absolute imports by default */
#define CO_FUTURE_WITH_STATEMENT 0x80000
#define CO_FUTURE_PRINT_FUNCTION 0x100000
#define CO_FUTURE_UNICODE_LITERALS 0x200000
#define CO_FUTURE_BARRY_AS_BDFL 0x400000
#define CO_FUTURE_GENERATOR_STOP 0x800000
#define CO_FUTURE_ANNOTATIONS 0x1000000
/* This should be defined if a future statement modifies the syntax.
For example, when a keyword is added.
*/
#define PY_PARSER_REQUIRES_FUTURE_KEYWORD
#define CO_MAXBLOCKS 20 /* Max static block nesting within a function */
PyAPI_DATA(PyTypeObject) PyCode_Type;
#define PyCode_Check(op) Py_IS_TYPE((op), &PyCode_Type)
static inline Py_ssize_t PyCode_GetNumFree(PyCodeObject *op) {
assert(PyCode_Check(op));
return op->co_nfreevars;
}
static inline int PyCode_GetFirstFree(PyCodeObject *op) {
assert(PyCode_Check(op));
return op->co_nlocalsplus - op->co_nfreevars;
}
#define _PyCode_CODE(CO) _Py_RVALUE((_Py_CODEUNIT *)(CO)->co_code_adaptive)
#define _PyCode_NBYTES(CO) (Py_SIZE(CO) * (Py_ssize_t)sizeof(_Py_CODEUNIT))
/* Unstable public interface */
PyAPI_FUNC(PyCodeObject *) PyUnstable_Code_New(
int, int, int, int, int, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, int, PyObject *,
PyObject *);
PyAPI_FUNC(PyCodeObject *) PyUnstable_Code_NewWithPosOnlyArgs(
int, int, int, int, int, int, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, PyObject *,
PyObject *, PyObject *, PyObject *, int, PyObject *,
PyObject *);
/* same as struct above */
// Old names -- remove when this API changes:
_Py_DEPRECATED_EXTERNALLY(3.12) static inline PyCodeObject *
PyCode_New(
int a, int b, int c, int d, int e, PyObject *f, PyObject *g,
PyObject *h, PyObject *i, PyObject *j, PyObject *k,
PyObject *l, PyObject *m, PyObject *n, int o, PyObject *p,
PyObject *q)
{
return PyUnstable_Code_New(
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q);
}
_Py_DEPRECATED_EXTERNALLY(3.12) static inline PyCodeObject *
PyCode_NewWithPosOnlyArgs(
int a, int poac, int b, int c, int d, int e, PyObject *f, PyObject *g,
PyObject *h, PyObject *i, PyObject *j, PyObject *k,
PyObject *l, PyObject *m, PyObject *n, int o, PyObject *p,
PyObject *q)
{
return PyUnstable_Code_NewWithPosOnlyArgs(
a, poac, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q);
}
/* Creates a new empty code object with the specified source location. */
PyAPI_FUNC(PyCodeObject *)
PyCode_NewEmpty(const char *filename, const char *funcname, int firstlineno);
/* Return the line number associated with the specified bytecode index
in this code object. If you just need the line number of a frame,
use PyFrame_GetLineNumber() instead. */
PyAPI_FUNC(int) PyCode_Addr2Line(PyCodeObject *, int);
PyAPI_FUNC(int) PyCode_Addr2Location(PyCodeObject *, int, int *, int *, int *, int *);
#define PY_FOREACH_CODE_EVENT(V) \
V(CREATE) \
V(DESTROY)
typedef enum {
#define PY_DEF_EVENT(op) PY_CODE_EVENT_##op,
PY_FOREACH_CODE_EVENT(PY_DEF_EVENT)
#undef PY_DEF_EVENT
} PyCodeEvent;
/*
* A callback that is invoked for different events in a code object's lifecycle.
*
* The callback is invoked with a borrowed reference to co, after it is
* created and before it is destroyed.
*
* If the callback sets an exception, it must return -1. Otherwise
* it should return 0.
*/
typedef int (*PyCode_WatchCallback)(
PyCodeEvent event,
PyCodeObject* co);
/*
* Register a per-interpreter callback that will be invoked for code object
* lifecycle events.
*
* Returns a handle that may be passed to PyCode_ClearWatcher on success,
* or -1 and sets an error if no more handles are available.
*/
PyAPI_FUNC(int) PyCode_AddWatcher(PyCode_WatchCallback callback);
/*
* Clear the watcher associated with the watcher_id handle.
*
* Returns 0 on success or -1 if no watcher exists for the provided id.
*/
PyAPI_FUNC(int) PyCode_ClearWatcher(int watcher_id);
/* for internal use only */
struct _opaque {
int computed_line;
const uint8_t *lo_next;
const uint8_t *limit;
};
typedef struct _line_offsets {
int ar_start;
int ar_end;
int ar_line;
struct _opaque opaque;
} PyCodeAddressRange;
/* Update *bounds to describe the first and one-past-the-last instructions in the
same line as lasti. Return the number of that line.
*/
PyAPI_FUNC(int) _PyCode_CheckLineNumber(int lasti, PyCodeAddressRange *bounds);
/* Create a comparable key used to compare constants taking in account the
* object type. It is used to make sure types are not coerced (e.g., float and
* complex) _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms
*
* Return (type(obj), obj, ...): a tuple with variable size (at least 2 items)
* depending on the type and the value. The type is the first item to not
* compare bytes and str which can raise a BytesWarning exception. */
PyAPI_FUNC(PyObject*) _PyCode_ConstantKey(PyObject *obj);
PyAPI_FUNC(PyObject*) PyCode_Optimize(PyObject *code, PyObject* consts,
PyObject *names, PyObject *lnotab);
PyAPI_FUNC(int) PyUnstable_Code_GetExtra(
PyObject *code, Py_ssize_t index, void **extra);
PyAPI_FUNC(int) PyUnstable_Code_SetExtra(
PyObject *code, Py_ssize_t index, void *extra);
// Old names -- remove when this API changes:
_Py_DEPRECATED_EXTERNALLY(3.12) static inline int
_PyCode_GetExtra(PyObject *code, Py_ssize_t index, void **extra)
{
return PyUnstable_Code_GetExtra(code, index, extra);
}
_Py_DEPRECATED_EXTERNALLY(3.12) static inline int
_PyCode_SetExtra(PyObject *code, Py_ssize_t index, void *extra)
{
return PyUnstable_Code_SetExtra(code, index, extra);
}
/* Equivalent to getattr(code, 'co_code') in Python.
Returns a strong reference to a bytes object. */
PyAPI_FUNC(PyObject *) PyCode_GetCode(PyCodeObject *code);
/* Equivalent to getattr(code, 'co_varnames') in Python. */
PyAPI_FUNC(PyObject *) PyCode_GetVarnames(PyCodeObject *code);
/* Equivalent to getattr(code, 'co_cellvars') in Python. */
PyAPI_FUNC(PyObject *) PyCode_GetCellvars(PyCodeObject *code);
/* Equivalent to getattr(code, 'co_freevars') in Python. */
PyAPI_FUNC(PyObject *) PyCode_GetFreevars(PyCodeObject *code);
typedef enum _PyCodeLocationInfoKind {
/* short forms are 0 to 9 */
PY_CODE_LOCATION_INFO_SHORT0 = 0,
/* one lineforms are 10 to 12 */
PY_CODE_LOCATION_INFO_ONE_LINE0 = 10,
PY_CODE_LOCATION_INFO_ONE_LINE1 = 11,
PY_CODE_LOCATION_INFO_ONE_LINE2 = 12,
PY_CODE_LOCATION_INFO_NO_COLUMNS = 13,
PY_CODE_LOCATION_INFO_LONG = 14,
PY_CODE_LOCATION_INFO_NONE = 15
} _PyCodeLocationInfoKind;
#ifdef __cplusplus
}
#endif
# 388 "./Include/cpython/code.h"
#endif // !Py_CODE_H
# 389 "./Include/cpython/code.h"
#endif // !Py_LIMITED_API
# 390 "./Include/cpython/code.h"
# 72 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pyframe.h"
#endif /* expanded by -frewrite-includes */
# 72 "./Include/Python.h"
# 1 "./Include/pyframe.h" 1
/* Limited C API of PyFrame API
*
* Include "frameobject.h" to get the PyFrameObject structure.
*/
#ifndef Py_PYFRAME_H
#define Py_PYFRAME_H
#ifdef __cplusplus
extern "C" {
#endif
# 11 "./Include/pyframe.h"
/* Return the line of code the frame is currently executing. */
PyAPI_FUNC(int) PyFrame_GetLineNumber(PyFrameObject *);
PyAPI_FUNC(PyCodeObject *) PyFrame_GetCode(PyFrameObject *frame);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_PYFRAME_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/pyframe.h"
#endif /* expanded by -frewrite-includes */
# 19 "./Include/pyframe.h"
# 1 "./Include/cpython/pyframe.h" 1
#ifndef Py_CPYTHON_PYFRAME_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/pyframe.h"
PyAPI_DATA(PyTypeObject) PyFrame_Type;
#define PyFrame_Check(op) Py_IS_TYPE((op), &PyFrame_Type)
PyAPI_FUNC(PyFrameObject *) PyFrame_GetBack(PyFrameObject *frame);
PyAPI_FUNC(PyObject *) PyFrame_GetLocals(PyFrameObject *frame);
PyAPI_FUNC(PyObject *) PyFrame_GetGlobals(PyFrameObject *frame);
PyAPI_FUNC(PyObject *) PyFrame_GetBuiltins(PyFrameObject *frame);
PyAPI_FUNC(PyObject *) PyFrame_GetGenerator(PyFrameObject *frame);
PyAPI_FUNC(int) PyFrame_GetLasti(PyFrameObject *frame);
PyAPI_FUNC(PyObject*) PyFrame_GetVar(PyFrameObject *frame, PyObject *name);
PyAPI_FUNC(PyObject*) PyFrame_GetVarString(PyFrameObject *frame, const char *name);
/* The following functions are for use by debuggers and other tools
* implementing custom frame evaluators with PEP 523. */
struct _PyInterpreterFrame;
/* Returns the code object of the frame (strong reference).
* Does not raise an exception. */
PyAPI_FUNC(PyObject *) PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame);
/* Returns a byte ofsset into the last executed instruction.
* Does not raise an exception. */
PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLasti(struct _PyInterpreterFrame *frame);
/* Returns the currently executing line number, or -1 if there is no line number.
* Does not raise an exception. */
PyAPI_FUNC(int) PyUnstable_InterpreterFrame_GetLine(struct _PyInterpreterFrame *frame);
# 20 "./Include/pyframe.h" 2
# undef Py_CPYTHON_PYFRAME_H
#endif
# 22 "./Include/pyframe.h"
#ifdef __cplusplus
}
#endif
# 26 "./Include/pyframe.h"
#endif /* !Py_PYFRAME_H */
# 27 "./Include/pyframe.h"
# 73 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "traceback.h"
#endif /* expanded by -frewrite-includes */
# 73 "./Include/Python.h"
# 1 "./Include/traceback.h" 1
#ifndef Py_TRACEBACK_H
#define Py_TRACEBACK_H
#ifdef __cplusplus
extern "C" {
#endif
# 6 "./Include/traceback.h"
/* Traceback interface */
PyAPI_FUNC(int) PyTraceBack_Here(PyFrameObject *);
PyAPI_FUNC(int) PyTraceBack_Print(PyObject *, PyObject *);
/* Reveal traceback type so we can typecheck traceback objects */
PyAPI_DATA(PyTypeObject) PyTraceBack_Type;
#define PyTraceBack_Check(v) Py_IS_TYPE((v), &PyTraceBack_Type)
#ifndef Py_LIMITED_API
# define Py_CPYTHON_TRACEBACK_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/traceback.h"
#endif /* expanded by -frewrite-includes */
# 19 "./Include/traceback.h"
# 1 "./Include/cpython/traceback.h" 1
#ifndef Py_CPYTHON_TRACEBACK_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/traceback.h"
typedef struct _traceback PyTracebackObject;
struct _traceback {
PyObject_HEAD
PyTracebackObject *tb_next;
PyFrameObject *tb_frame;
int tb_lasti;
int tb_lineno;
};
PyAPI_FUNC(int) _Py_DisplaySourceLine(PyObject *, PyObject *, int, int, int *, PyObject **);
PyAPI_FUNC(void) _PyTraceback_Add(const char *, const char *, int);
# 20 "./Include/traceback.h" 2
# undef Py_CPYTHON_TRACEBACK_H
#endif
# 22 "./Include/traceback.h"
#ifdef __cplusplus
}
#endif
# 26 "./Include/traceback.h"
#endif /* !Py_TRACEBACK_H */
# 27 "./Include/traceback.h"
# 74 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "sliceobject.h"
#endif /* expanded by -frewrite-includes */
# 74 "./Include/Python.h"
# 1 "./Include/sliceobject.h" 1
#ifndef Py_SLICEOBJECT_H
#define Py_SLICEOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 6 "./Include/sliceobject.h"
/* The unique ellipsis object "..." */
PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */
#define Py_Ellipsis (&_Py_EllipsisObject)
/* Slice object interface */
/*
A slice object containing start, stop, and step data members (the
names are from range). After much talk with Guido, it was decided to
let these be any arbitrary python type. Py_None stands for omitted values.
*/
#ifndef Py_LIMITED_API
typedef struct {
PyObject_HEAD
PyObject *start, *stop, *step; /* not NULL */
} PySliceObject;
#endif
# 27 "./Include/sliceobject.h"
PyAPI_DATA(PyTypeObject) PySlice_Type;
PyAPI_DATA(PyTypeObject) PyEllipsis_Type;
#define PySlice_Check(op) Py_IS_TYPE((op), &PySlice_Type)
PyAPI_FUNC(PyObject *) PySlice_New(PyObject* start, PyObject* stop,
PyObject* step);
#ifndef Py_LIMITED_API
PyAPI_FUNC(PyObject *) _PySlice_FromIndices(Py_ssize_t start, Py_ssize_t stop);
PyAPI_FUNC(int) _PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
PyObject **start_ptr, PyObject **stop_ptr,
PyObject **step_ptr);
#endif
# 41 "./Include/sliceobject.h"
PyAPI_FUNC(int) PySlice_GetIndices(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
Py_DEPRECATED(3.7)
PyAPI_FUNC(int) PySlice_GetIndicesEx(PyObject *r, Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop,
Py_ssize_t *step,
Py_ssize_t *slicelength);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || (Py_LIMITED_API+0 >= 0x03050400 && Py_LIMITED_API+0 < 0x03060000) || Py_LIMITED_API+0 >= 0x03060100
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 50 "./Include/sliceobject.h"
#define PySlice_GetIndicesEx(slice, length, start, stop, step, slicelen) ( \
PySlice_Unpack((slice), (start), (stop), (step)) < 0 ? \
((*(slicelen) = 0), -1) : \
((*(slicelen) = PySlice_AdjustIndices((length), (start), (stop), *(step))), \
0))
PyAPI_FUNC(int) PySlice_Unpack(PyObject *slice,
Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step);
PyAPI_FUNC(Py_ssize_t) PySlice_AdjustIndices(Py_ssize_t length,
Py_ssize_t *start, Py_ssize_t *stop,
Py_ssize_t step);
#endif
# 61 "./Include/sliceobject.h"
#ifdef __cplusplus
}
#endif
# 65 "./Include/sliceobject.h"
#endif /* !Py_SLICEOBJECT_H */
# 66 "./Include/sliceobject.h"
# 75 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "cpython/cellobject.h"
#endif /* expanded by -frewrite-includes */
# 75 "./Include/Python.h"
# 1 "./Include/cpython/cellobject.h" 1
/* Cell object interface */
#ifndef Py_LIMITED_API
#ifndef Py_CELLOBJECT_H
#define Py_CELLOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 9 "./Include/cpython/cellobject.h"
typedef struct {
PyObject_HEAD
/* Content of the cell or NULL when empty */
PyObject *ob_ref;
} PyCellObject;
PyAPI_DATA(PyTypeObject) PyCell_Type;
#define PyCell_Check(op) Py_IS_TYPE((op), &PyCell_Type)
PyAPI_FUNC(PyObject *) PyCell_New(PyObject *);
PyAPI_FUNC(PyObject *) PyCell_Get(PyObject *);
PyAPI_FUNC(int) PyCell_Set(PyObject *, PyObject *);
static inline PyObject* PyCell_GET(PyObject *op) {
PyCellObject *cell;
assert(PyCell_Check(op));
cell = _Py_CAST(PyCellObject*, op);
return cell->ob_ref;
}
#define PyCell_GET(op) PyCell_GET(_PyObject_CAST(op))
static inline void PyCell_SET(PyObject *op, PyObject *value) {
PyCellObject *cell;
assert(PyCell_Check(op));
cell = _Py_CAST(PyCellObject*, op);
cell->ob_ref = value;
}
#define PyCell_SET(op, value) PyCell_SET(_PyObject_CAST(op), (value))
#ifdef __cplusplus
}
#endif
# 43 "./Include/cpython/cellobject.h"
#endif /* !Py_TUPLEOBJECT_H */
# 44 "./Include/cpython/cellobject.h"
#endif /* Py_LIMITED_API */
# 45 "./Include/cpython/cellobject.h"
# 76 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "iterobject.h"
#endif /* expanded by -frewrite-includes */
# 76 "./Include/Python.h"
# 1 "./Include/iterobject.h" 1
#ifndef Py_ITEROBJECT_H
#define Py_ITEROBJECT_H
/* Iterators (the basic kind, over a sequence) */
#ifdef __cplusplus
extern "C" {
#endif
# 7 "./Include/iterobject.h"
PyAPI_DATA(PyTypeObject) PySeqIter_Type;
PyAPI_DATA(PyTypeObject) PyCallIter_Type;
#ifdef Py_BUILD_CORE
extern PyTypeObject _PyAnextAwaitable_Type;
#endif
# 13 "./Include/iterobject.h"
#define PySeqIter_Check(op) Py_IS_TYPE((op), &PySeqIter_Type)
PyAPI_FUNC(PyObject *) PySeqIter_New(PyObject *);
#define PyCallIter_Check(op) Py_IS_TYPE((op), &PyCallIter_Type)
PyAPI_FUNC(PyObject *) PyCallIter_New(PyObject *, PyObject *);
#ifdef __cplusplus
}
#endif
# 26 "./Include/iterobject.h"
#endif /* !Py_ITEROBJECT_H */
# 27 "./Include/iterobject.h"
# 77 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "cpython/initconfig.h"
#endif /* expanded by -frewrite-includes */
# 77 "./Include/Python.h"
# 1 "./Include/cpython/initconfig.h" 1
#ifndef Py_PYCORECONFIG_H
#define Py_PYCORECONFIG_H
#ifndef Py_LIMITED_API
#ifdef __cplusplus
extern "C" {
#endif
# 7 "./Include/cpython/initconfig.h"
/* --- PyStatus ----------------------------------------------- */
typedef struct {
enum {
_PyStatus_TYPE_OK=0,
_PyStatus_TYPE_ERROR=1,
_PyStatus_TYPE_EXIT=2
} _type;
const char *func;
const char *err_msg;
int exitcode;
} PyStatus;
PyAPI_FUNC(PyStatus) PyStatus_Ok(void);
PyAPI_FUNC(PyStatus) PyStatus_Error(const char *err_msg);
PyAPI_FUNC(PyStatus) PyStatus_NoMemory(void);
PyAPI_FUNC(PyStatus) PyStatus_Exit(int exitcode);
PyAPI_FUNC(int) PyStatus_IsError(PyStatus err);
PyAPI_FUNC(int) PyStatus_IsExit(PyStatus err);
PyAPI_FUNC(int) PyStatus_Exception(PyStatus err);
PyAPI_FUNC(PyObject *) _PyErr_SetFromPyStatus(PyStatus status);
/* --- PyWideStringList ------------------------------------------------ */
typedef struct {
/* If length is greater than zero, items must be non-NULL
and all items strings must be non-NULL */
Py_ssize_t length;
wchar_t **items;
} PyWideStringList;
PyAPI_FUNC(PyStatus) PyWideStringList_Append(PyWideStringList *list,
const wchar_t *item);
PyAPI_FUNC(PyStatus) PyWideStringList_Insert(PyWideStringList *list,
Py_ssize_t index,
const wchar_t *item);
/* --- PyPreConfig ----------------------------------------------- */
typedef struct PyPreConfig {
int _config_init; /* _PyConfigInitEnum value */
/* Parse Py_PreInitializeFromBytesArgs() arguments?
See PyConfig.parse_argv */
int parse_argv;
/* If greater than 0, enable isolated mode: sys.path contains
neither the script's directory nor the user's site-packages directory.
Set to 1 by the -I command line option. If set to -1 (default), inherit
Py_IsolatedFlag value. */
int isolated;
/* If greater than 0: use environment variables.
Set to 0 by -E command line option. If set to -1 (default), it is
set to !Py_IgnoreEnvironmentFlag. */
int use_environment;
/* Set the LC_CTYPE locale to the user preferred locale? If equals to 0,
set coerce_c_locale and coerce_c_locale_warn to 0. */
int configure_locale;
/* Coerce the LC_CTYPE locale if it's equal to "C"? (PEP 538)
Set to 0 by PYTHONCOERCECLOCALE=0. Set to 1 by PYTHONCOERCECLOCALE=1.
Set to 2 if the user preferred LC_CTYPE locale is "C".
If it is equal to 1, LC_CTYPE locale is read to decide if it should be
coerced or not (ex: PYTHONCOERCECLOCALE=1). Internally, it is set to 2
if the LC_CTYPE locale must be coerced.
Disable by default (set to 0). Set it to -1 to let Python decide if it
should be enabled or not. */
int coerce_c_locale;
/* Emit a warning if the LC_CTYPE locale is coerced?
Set to 1 by PYTHONCOERCECLOCALE=warn.
Disable by default (set to 0). Set it to -1 to let Python decide if it
should be enabled or not. */
int coerce_c_locale_warn;
#ifdef MS_WINDOWS
/* If greater than 1, use the "mbcs" encoding instead of the UTF-8
encoding for the filesystem encoding.
Set to 1 if the PYTHONLEGACYWINDOWSFSENCODING environment variable is
set to a non-empty string. If set to -1 (default), inherit
Py_LegacyWindowsFSEncodingFlag value.
See PEP 529 for more details. */
int legacy_windows_fs_encoding;
#endif
# 103 "./Include/cpython/initconfig.h"
/* Enable UTF-8 mode? (PEP 540)
Disabled by default (equals to 0).
Set to 1 by "-X utf8" and "-X utf8=1" command line options.
Set to 1 by PYTHONUTF8=1 environment variable.
Set to 0 by "-X utf8=0" and PYTHONUTF8=0.
If equals to -1, it is set to 1 if the LC_CTYPE locale is "C" or
"POSIX", otherwise it is set to 0. Inherit Py_UTF8Mode value value. */
int utf8_mode;
/* If non-zero, enable the Python Development Mode.
Set to 1 by the -X dev command line option. Set by the PYTHONDEVMODE
environment variable. */
int dev_mode;
/* Memory allocator: PYTHONMALLOC env var.
See PyMemAllocatorName for valid values. */
int allocator;
} PyPreConfig;
PyAPI_FUNC(void) PyPreConfig_InitPythonConfig(PyPreConfig *config);
PyAPI_FUNC(void) PyPreConfig_InitIsolatedConfig(PyPreConfig *config);
/* --- PyConfig ---------------------------------------------- */
/* This structure is best documented in the Doc/c-api/init_config.rst file. */
typedef struct PyConfig {
int _config_init; /* _PyConfigInitEnum value */
int isolated;
int use_environment;
int dev_mode;
int install_signal_handlers;
int use_hash_seed;
unsigned long hash_seed;
int faulthandler;
int tracemalloc;
int perf_profiling;
int import_time;
int code_debug_ranges;
int show_ref_count;
int dump_refs;
wchar_t *dump_refs_file;
int malloc_stats;
wchar_t *filesystem_encoding;
wchar_t *filesystem_errors;
wchar_t *pycache_prefix;
int parse_argv;
PyWideStringList orig_argv;
PyWideStringList argv;
PyWideStringList xoptions;
PyWideStringList warnoptions;
int site_import;
int bytes_warning;
int warn_default_encoding;
int inspect;
int interactive;
int optimization_level;
int parser_debug;
int write_bytecode;
int verbose;
int quiet;
int user_site_directory;
int configure_c_stdio;
int buffered_stdio;
wchar_t *stdio_encoding;
wchar_t *stdio_errors;
#ifdef MS_WINDOWS
int legacy_windows_stdio;
#endif
# 179 "./Include/cpython/initconfig.h"
wchar_t *check_hash_pycs_mode;
int use_frozen_modules;
int safe_path;
int int_max_str_digits;
/* --- Path configuration inputs ------------ */
int pathconfig_warnings;
wchar_t *program_name;
wchar_t *pythonpath_env;
wchar_t *home;
wchar_t *platlibdir;
/* --- Path configuration outputs ----------- */
int module_search_paths_set;
PyWideStringList module_search_paths;
wchar_t *stdlib_dir;
wchar_t *executable;
wchar_t *base_executable;
wchar_t *prefix;
wchar_t *base_prefix;
wchar_t *exec_prefix;
wchar_t *base_exec_prefix;
/* --- Parameter only used by Py_Main() ---------- */
int skip_source_first_line;
wchar_t *run_command;
wchar_t *run_module;
wchar_t *run_filename;
/* --- Private fields ---------------------------- */
// Install importlib? If equals to 0, importlib is not initialized at all.
// Needed by freeze_importlib.
int _install_importlib;
// If equal to 0, stop Python initialization before the "main" phase.
int _init_main;
// If non-zero, we believe we're running from a source tree.
int _is_python_build;
} PyConfig;
PyAPI_FUNC(void) PyConfig_InitPythonConfig(PyConfig *config);
PyAPI_FUNC(void) PyConfig_InitIsolatedConfig(PyConfig *config);
PyAPI_FUNC(void) PyConfig_Clear(PyConfig *);
PyAPI_FUNC(PyStatus) PyConfig_SetString(
PyConfig *config,
wchar_t **config_str,
const wchar_t *str);
PyAPI_FUNC(PyStatus) PyConfig_SetBytesString(
PyConfig *config,
wchar_t **config_str,
const char *str);
PyAPI_FUNC(PyStatus) PyConfig_Read(PyConfig *config);
PyAPI_FUNC(PyStatus) PyConfig_SetBytesArgv(
PyConfig *config,
Py_ssize_t argc,
char * const *argv);
PyAPI_FUNC(PyStatus) PyConfig_SetArgv(PyConfig *config,
Py_ssize_t argc,
wchar_t * const *argv);
PyAPI_FUNC(PyStatus) PyConfig_SetWideStringList(PyConfig *config,
PyWideStringList *list,
Py_ssize_t length, wchar_t **items);
/* --- Helper functions --------------------------------------- */
/* Get the original command line arguments, before Python modified them.
See also PyConfig.orig_argv. */
PyAPI_FUNC(void) Py_GetArgcArgv(int *argc, wchar_t ***argv);
#ifdef __cplusplus
}
#endif
# 255 "./Include/cpython/initconfig.h"
#endif /* !Py_LIMITED_API */
# 256 "./Include/cpython/initconfig.h"
#endif /* !Py_PYCORECONFIG_H */
# 257 "./Include/cpython/initconfig.h"
# 78 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "pystate.h"
#endif /* expanded by -frewrite-includes */
# 78 "./Include/Python.h"
# 1 "./Include/pystate.h" 1
/* Thread and interpreter state structures and their interfaces */
#ifndef Py_PYSTATE_H
#define Py_PYSTATE_H
#ifdef __cplusplus
extern "C" {
#endif
# 9 "./Include/pystate.h"
/* This limitation is for performance and simplicity. If needed it can be
removed (with effort). */
#define MAX_CO_EXTRA_USERS 255
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_New(void);
PyAPI_FUNC(void) PyInterpreterState_Clear(PyInterpreterState *);
PyAPI_FUNC(void) PyInterpreterState_Delete(PyInterpreterState *);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 19 "./Include/pystate.h"
/* New in 3.9 */
/* Get the current interpreter state.
Issue a fatal error if there no current Python thread state or no current
interpreter. It cannot return NULL.
The caller must hold the GIL. */
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Get(void);
#endif
# 28 "./Include/pystate.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03080000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 30 "./Include/pystate.h"
/* New in 3.8 */
PyAPI_FUNC(PyObject *) PyInterpreterState_GetDict(PyInterpreterState *);
#endif
# 33 "./Include/pystate.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03070000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 35 "./Include/pystate.h"
/* New in 3.7 */
PyAPI_FUNC(int64_t) PyInterpreterState_GetID(PyInterpreterState *);
#endif
# 38 "./Include/pystate.h"
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 39 "./Include/pystate.h"
/* State unique per thread */
/* New in 3.3 */
PyAPI_FUNC(int) PyState_AddModule(PyObject*, PyModuleDef*);
PyAPI_FUNC(int) PyState_RemoveModule(PyModuleDef*);
#endif
# 46 "./Include/pystate.h"
PyAPI_FUNC(PyObject*) PyState_FindModule(PyModuleDef*);
PyAPI_FUNC(PyThreadState *) PyThreadState_New(PyInterpreterState *);
PyAPI_FUNC(void) PyThreadState_Clear(PyThreadState *);
PyAPI_FUNC(void) PyThreadState_Delete(PyThreadState *);
/* Get the current thread state.
When the current thread state is NULL, this issues a fatal error (so that
the caller needn't check for NULL).
The caller must hold the GIL.
See also _PyThreadState_UncheckedGet() and _PyThreadState_GET(). */
PyAPI_FUNC(PyThreadState *) PyThreadState_Get(void);
// Alias to PyThreadState_Get()
#define PyThreadState_GET() PyThreadState_Get()
PyAPI_FUNC(PyThreadState *) PyThreadState_Swap(PyThreadState *);
PyAPI_FUNC(PyObject *) PyThreadState_GetDict(void);
PyAPI_FUNC(int) PyThreadState_SetAsyncExc(unsigned long, PyObject *);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 70 "./Include/pystate.h"
/* New in 3.9 */
PyAPI_FUNC(PyInterpreterState*) PyThreadState_GetInterpreter(PyThreadState *tstate);
PyAPI_FUNC(PyFrameObject*) PyThreadState_GetFrame(PyThreadState *tstate);
PyAPI_FUNC(uint64_t) PyThreadState_GetID(PyThreadState *tstate);
#endif
# 75 "./Include/pystate.h"
typedef
enum {PyGILState_LOCKED, PyGILState_UNLOCKED}
PyGILState_STATE;
/* Ensure that the current thread is ready to call the Python
C API, regardless of the current state of Python, or of its
thread lock. This may be called as many times as desired
by a thread so long as each call is matched with a call to
PyGILState_Release(). In general, other thread-state APIs may
be used between _Ensure() and _Release() calls, so long as the
thread-state is restored to its previous state before the Release().
For example, normal use of the Py_BEGIN_ALLOW_THREADS/
Py_END_ALLOW_THREADS macros are acceptable.
The return value is an opaque "handle" to the thread state when
PyGILState_Ensure() was called, and must be passed to
PyGILState_Release() to ensure Python is left in the same state. Even
though recursive calls are allowed, these handles can *not* be shared -
each unique call to PyGILState_Ensure must save the handle for its
call to PyGILState_Release.
When the function returns, the current thread will hold the GIL.
Failure is a fatal error.
*/
PyAPI_FUNC(PyGILState_STATE) PyGILState_Ensure(void);
/* Release any resources previously acquired. After this call, Python's
state will be the same as it was prior to the corresponding
PyGILState_Ensure() call (but generally this state will be unknown to
the caller, hence the use of the GILState API.)
Every call to PyGILState_Ensure must be matched by a call to
PyGILState_Release on the same thread.
*/
PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE);
/* Helper/diagnostic function - get the current thread state for
this thread. May return NULL if no GILState API has been used
on the current thread. Note that the main thread always has such a
thread-state, even if no auto-thread-state call has been made
on the main thread.
*/
PyAPI_FUNC(PyThreadState *) PyGILState_GetThisThreadState(void);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_PYSTATE_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/pystate.h"
#endif /* expanded by -frewrite-includes */
# 125 "./Include/pystate.h"
# 1 "./Include/cpython/pystate.h" 1
#ifndef Py_CPYTHON_PYSTATE_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/pystate.h"
/*
Runtime Feature Flags
Each flag indicate whether or not a specific runtime feature
is available in a given context. For example, forking the process
might not be allowed in the current interpreter (i.e. os.fork() would fail).
*/
/* Set if the interpreter share obmalloc runtime state
with the main interpreter. */
#define Py_RTFLAGS_USE_MAIN_OBMALLOC (1UL << 5)
/* Set if import should check a module for subinterpreter support. */
#define Py_RTFLAGS_MULTI_INTERP_EXTENSIONS (1UL << 8)
/* Set if threads are allowed. */
#define Py_RTFLAGS_THREADS (1UL << 10)
/* Set if daemon threads are allowed. */
#define Py_RTFLAGS_DAEMON_THREADS (1UL << 11)
/* Set if os.fork() is allowed. */
#define Py_RTFLAGS_FORK (1UL << 15)
/* Set if os.exec*() is allowed. */
#define Py_RTFLAGS_EXEC (1UL << 16)
PyAPI_FUNC(int) _PyInterpreterState_HasFeature(PyInterpreterState *interp,
unsigned long feature);
/* private interpreter helpers */
PyAPI_FUNC(int) _PyInterpreterState_RequiresIDRef(PyInterpreterState *);
PyAPI_FUNC(void) _PyInterpreterState_RequireIDRef(PyInterpreterState *, int);
PyAPI_FUNC(PyObject *) _PyInterpreterState_GetMainModule(PyInterpreterState *);
/* State unique per thread */
/* Py_tracefunc return -1 when raising an exception, or 0 for success. */
typedef int (*Py_tracefunc)(PyObject *, PyFrameObject *, int, PyObject *);
/* The following values are used for 'what' for tracefunc functions
*
* To add a new kind of trace event, also update "trace_init" in
* Python/sysmodule.c to define the Python level event name
*/
#define PyTrace_CALL 0
#define PyTrace_EXCEPTION 1
#define PyTrace_LINE 2
#define PyTrace_RETURN 3
#define PyTrace_C_CALL 4
#define PyTrace_C_EXCEPTION 5
#define PyTrace_C_RETURN 6
#define PyTrace_OPCODE 7
// Internal structure: you should not use it directly, but use public functions
// like PyThreadState_EnterTracing() and PyThreadState_LeaveTracing().
typedef struct _PyCFrame {
/* This struct will be threaded through the C stack
* allowing fast access to per-thread state that needs
* to be accessed quickly by the interpreter, but can
* be modified outside of the interpreter.
*
* WARNING: This makes data on the C stack accessible from
* heap objects. Care must be taken to maintain stack
* discipline and make sure that instances of this struct cannot
* accessed outside of their lifetime.
*/
/* Pointer to the currently executing frame (it can be NULL) */
struct _PyInterpreterFrame *current_frame;
struct _PyCFrame *previous;
} _PyCFrame;
typedef struct _err_stackitem {
/* This struct represents a single execution context where we might
* be currently handling an exception. It is a per-coroutine state
* (coroutine in the computer science sense, including the thread
* and generators).
*
* This is used as an entry on the exception stack, where each
* entry indicates if it is currently handling an exception.
* This ensures that the exception state is not impacted
* by "yields" from an except handler. The thread
* always has an entry (the bottom-most one).
*/
/* The exception currently being handled in this context, if any. */
PyObject *exc_value;
struct _err_stackitem *previous_item;
} _PyErr_StackItem;
typedef struct _stack_chunk {
struct _stack_chunk *previous;
size_t size;
size_t top;
PyObject * data[1]; /* Variable sized */
} _PyStackChunk;
struct _py_trashcan {
int delete_nesting;
PyObject *delete_later;
};
struct _ts {
/* See Python/ceval.c for comments explaining most fields */
PyThreadState *prev;
PyThreadState *next;
PyInterpreterState *interp;
struct {
/* Has been initialized to a safe state.
In order to be effective, this must be set to 0 during or right
after allocation. */
unsigned int initialized:1;
/* Has been bound to an OS thread. */
unsigned int bound:1;
/* Has been unbound from its OS thread. */
unsigned int unbound:1;
/* Has been bound aa current for the GILState API. */
unsigned int bound_gilstate:1;
/* Currently in use (maybe holds the GIL). */
unsigned int active:1;
/* various stages of finalization */
unsigned int finalizing:1;
unsigned int cleared:1;
unsigned int finalized:1;
/* padding to align to 4 bytes */
unsigned int :24;
} _status;
int py_recursion_remaining;
int py_recursion_limit;
int c_recursion_remaining;
int recursion_headroom; /* Allow 50 more calls to handle any errors. */
/* 'tracing' keeps track of the execution depth when tracing/profiling.
This is to prevent the actual trace/profile code from being recorded in
the trace/profile. */
int tracing;
int what_event; /* The event currently being monitored, if any. */
/* Pointer to current _PyCFrame in the C stack frame of the currently,
* or most recently, executing _PyEval_EvalFrameDefault. */
_PyCFrame *cframe;
Py_tracefunc c_profilefunc;
Py_tracefunc c_tracefunc;
PyObject *c_profileobj;
PyObject *c_traceobj;
/* The exception currently being raised */
PyObject *current_exception;
/* Pointer to the top of the exception stack for the exceptions
* we may be currently handling. (See _PyErr_StackItem above.)
* This is never NULL. */
_PyErr_StackItem *exc_info;
PyObject *dict; /* Stores per-thread state */
int gilstate_counter;
PyObject *async_exc; /* Asynchronous exception to raise */
unsigned long thread_id; /* Thread id where this tstate was created */
/* Native thread id where this tstate was created. This will be 0 except on
* those platforms that have the notion of native thread id, for which the
* macro PY_HAVE_THREAD_NATIVE_ID is then defined.
*/
unsigned long native_thread_id;
struct _py_trashcan trash;
/* Called when a thread state is deleted normally, but not when it
* is destroyed after fork().
* Pain: to prevent rare but fatal shutdown errors (issue 18808),
* Thread.join() must wait for the join'ed thread's tstate to be unlinked
* from the tstate chain. That happens at the end of a thread's life,
* in pystate.c.
* The obvious way doesn't quite work: create a lock which the tstate
* unlinking code releases, and have Thread.join() wait to acquire that
* lock. The problem is that we _are_ at the end of the thread's life:
* if the thread holds the last reference to the lock, decref'ing the
* lock will delete the lock, and that may trigger arbitrary Python code
* if there's a weakref, with a callback, to the lock. But by this time
* _PyRuntime.gilstate.tstate_current is already NULL, so only the simplest
* of C code can be allowed to run (in particular it must not be possible to
* release the GIL).
* So instead of holding the lock directly, the tstate holds a weakref to
* the lock: that's the value of on_delete_data below. Decref'ing a
* weakref is harmless.
* on_delete points to _threadmodule.c's static release_sentinel() function.
* After the tstate is unlinked, release_sentinel is called with the
* weakref-to-lock (on_delete_data) argument, and release_sentinel releases
* the indirectly held lock.
*/
void (*on_delete)(void *);
void *on_delete_data;
int coroutine_origin_tracking_depth;
PyObject *async_gen_firstiter;
PyObject *async_gen_finalizer;
PyObject *context;
uint64_t context_ver;
/* Unique thread state id. */
uint64_t id;
_PyStackChunk *datastack_chunk;
PyObject **datastack_top;
PyObject **datastack_limit;
/* XXX signal handlers should also be here */
/* The following fields are here to avoid allocation during init.
The data is exposed through PyThreadState pointer fields.
These fields should not be accessed directly outside of init.
This is indicated by an underscore prefix on the field names.
All other PyInterpreterState pointer fields are populated when
needed and default to NULL.
*/
// Note some fields do not have a leading underscore for backward
// compatibility. See https://bugs.python.org/issue45953#msg412046.
/* The thread's exception stack entry. (Always the last entry.) */
_PyErr_StackItem exc_state;
/* The bottom-most frame on the stack. */
_PyCFrame root_cframe;
};
/* WASI has limited call stack. Python's recursion limit depends on code
layout, optimization, and WASI runtime. Wasmtime can handle about 700
recursions, sometimes less. 500 is a more conservative limit. */
#ifndef C_RECURSION_LIMIT
# ifdef __wasi__
# define C_RECURSION_LIMIT 500
# else
# 258 "./Include/cpython/pystate.h"
// This value is duplicated in Lib/test/support/__init__.py
# define C_RECURSION_LIMIT 1500
# endif
# 261 "./Include/cpython/pystate.h"
#endif
# 262 "./Include/cpython/pystate.h"
/* other API */
// Alias for backward compatibility with Python 3.8
#define _PyInterpreterState_Get PyInterpreterState_Get
/* An alias for the internal _PyThreadState_New(),
kept for stable ABI compatibility. */
PyAPI_FUNC(PyThreadState *) _PyThreadState_Prealloc(PyInterpreterState *);
/* Similar to PyThreadState_Get(), but don't issue a fatal error
* if it is NULL. */
PyAPI_FUNC(PyThreadState *) _PyThreadState_UncheckedGet(void);
PyAPI_FUNC(PyObject *) _PyThreadState_GetDict(PyThreadState *tstate);
// Disable tracing and profiling.
PyAPI_FUNC(void) PyThreadState_EnterTracing(PyThreadState *tstate);
// Reset tracing and profiling: enable them if a trace function or a profile
// function is set, otherwise disable them.
PyAPI_FUNC(void) PyThreadState_LeaveTracing(PyThreadState *tstate);
/* PyGILState */
/* Helper/diagnostic function - return 1 if the current thread
currently holds the GIL, 0 otherwise.
The function returns 1 if _PyGILState_check_enabled is non-zero. */
PyAPI_FUNC(int) PyGILState_Check(void);
/* Get the single PyInterpreterState used by this process' GILState
implementation.
This function doesn't check for error. Return NULL before _PyGILState_Init()
is called and after _PyGILState_Fini() is called.
See also _PyInterpreterState_Get() and _PyInterpreterState_GET(). */
PyAPI_FUNC(PyInterpreterState *) _PyGILState_GetInterpreterStateUnsafe(void);
/* The implementation of sys._current_frames() Returns a dict mapping
thread id to that thread's current frame.
*/
PyAPI_FUNC(PyObject *) _PyThread_CurrentFrames(void);
/* The implementation of sys._current_exceptions() Returns a dict mapping
thread id to that thread's current exception.
*/
PyAPI_FUNC(PyObject *) _PyThread_CurrentExceptions(void);
/* Routines for advanced debuggers, requested by David Beazley.
Don't use unless you know what you are doing! */
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Main(void);
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Head(void);
PyAPI_FUNC(PyInterpreterState *) PyInterpreterState_Next(PyInterpreterState *);
PyAPI_FUNC(PyThreadState *) PyInterpreterState_ThreadHead(PyInterpreterState *);
PyAPI_FUNC(PyThreadState *) PyThreadState_Next(PyThreadState *);
PyAPI_FUNC(void) PyThreadState_DeleteCurrent(void);
/* Frame evaluation API */
typedef PyObject* (*_PyFrameEvalFunction)(PyThreadState *tstate, struct _PyInterpreterFrame *, int);
PyAPI_FUNC(_PyFrameEvalFunction) _PyInterpreterState_GetEvalFrameFunc(
PyInterpreterState *interp);
PyAPI_FUNC(void) _PyInterpreterState_SetEvalFrameFunc(
PyInterpreterState *interp,
_PyFrameEvalFunction eval_frame);
PyAPI_FUNC(const PyConfig*) _PyInterpreterState_GetConfig(PyInterpreterState *interp);
/* Get a copy of the current interpreter configuration.
Return 0 on success. Raise an exception and return -1 on error.
The caller must initialize 'config', using PyConfig_InitPythonConfig()
for example.
Python must be preinitialized to call this method.
The caller must hold the GIL.
Once done with the configuration, PyConfig_Clear() must be called to clear
it. */
PyAPI_FUNC(int) _PyInterpreterState_GetConfigCopy(
struct PyConfig *config);
/* Set the configuration of the current interpreter.
This function should be called during or just after the Python
initialization.
Update the sys module with the new configuration. If the sys module was
modified directly after the Python initialization, these changes are lost.
Some configuration like faulthandler or warnoptions can be updated in the
configuration, but don't reconfigure Python (don't enable/disable
faulthandler and don't reconfigure warnings filters).
Return 0 on success. Raise an exception and return -1 on error.
The configuration should come from _PyInterpreterState_GetConfigCopy(). */
PyAPI_FUNC(int) _PyInterpreterState_SetConfig(
const struct PyConfig *config);
// Get the configuration of the current interpreter.
// The caller must hold the GIL.
PyAPI_FUNC(const PyConfig*) _Py_GetConfig(void);
/* cross-interpreter data */
// _PyCrossInterpreterData is similar to Py_buffer as an effectively
// opaque struct that holds data outside the object machinery. This
// is necessary to pass safely between interpreters in the same process.
typedef struct _xid _PyCrossInterpreterData;
typedef PyObject *(*xid_newobjectfunc)(_PyCrossInterpreterData *);
typedef void (*xid_freefunc)(void *);
struct _xid {
// data is the cross-interpreter-safe derivation of a Python object
// (see _PyObject_GetCrossInterpreterData). It will be NULL if the
// new_object func (below) encodes the data.
void *data;
// obj is the Python object from which the data was derived. This
// is non-NULL only if the data remains bound to the object in some
// way, such that the object must be "released" (via a decref) when
// the data is released. In that case the code that sets the field,
// likely a registered "crossinterpdatafunc", is responsible for
// ensuring it owns the reference (i.e. incref).
PyObject *obj;
// interp is the ID of the owning interpreter of the original
// object. It corresponds to the active interpreter when
// _PyObject_GetCrossInterpreterData() was called. This should only
// be set by the cross-interpreter machinery.
//
// We use the ID rather than the PyInterpreterState to avoid issues
// with deleted interpreters. Note that IDs are never re-used, so
// each one will always correspond to a specific interpreter
// (whether still alive or not).
int64_t interp;
// new_object is a function that returns a new object in the current
// interpreter given the data. The resulting object (a new
// reference) will be equivalent to the original object. This field
// is required.
xid_newobjectfunc new_object;
// free is called when the data is released. If it is NULL then
// nothing will be done to free the data. For some types this is
// okay (e.g. bytes) and for those types this field should be set
// to NULL. However, for most the data was allocated just for
// cross-interpreter use, so it must be freed when
// _PyCrossInterpreterData_Release is called or the memory will
// leak. In that case, at the very least this field should be set
// to PyMem_RawFree (the default if not explicitly set to NULL).
// The call will happen with the original interpreter activated.
xid_freefunc free;
};
PyAPI_FUNC(void) _PyCrossInterpreterData_Init(
_PyCrossInterpreterData *data,
PyInterpreterState *interp, void *shared, PyObject *obj,
xid_newobjectfunc new_object);
PyAPI_FUNC(int) _PyCrossInterpreterData_InitWithSize(
_PyCrossInterpreterData *,
PyInterpreterState *interp, const size_t, PyObject *,
xid_newobjectfunc);
PyAPI_FUNC(void) _PyCrossInterpreterData_Clear(
PyInterpreterState *, _PyCrossInterpreterData *);
PyAPI_FUNC(int) _PyObject_GetCrossInterpreterData(PyObject *, _PyCrossInterpreterData *);
PyAPI_FUNC(PyObject *) _PyCrossInterpreterData_NewObject(_PyCrossInterpreterData *);
PyAPI_FUNC(int) _PyCrossInterpreterData_Release(_PyCrossInterpreterData *);
PyAPI_FUNC(int) _PyObject_CheckCrossInterpreterData(PyObject *);
/* cross-interpreter data registry */
typedef int (*crossinterpdatafunc)(PyThreadState *tstate, PyObject *,
_PyCrossInterpreterData *);
PyAPI_FUNC(int) _PyCrossInterpreterData_RegisterClass(PyTypeObject *, crossinterpdatafunc);
PyAPI_FUNC(int) _PyCrossInterpreterData_UnregisterClass(PyTypeObject *);
PyAPI_FUNC(crossinterpdatafunc) _PyCrossInterpreterData_Lookup(PyObject *);
# 126 "./Include/pystate.h" 2
# undef Py_CPYTHON_PYSTATE_H
#endif
# 128 "./Include/pystate.h"
#ifdef __cplusplus
}
#endif
# 132 "./Include/pystate.h"
#endif /* !Py_PYSTATE_H */
# 133 "./Include/pystate.h"
# 79 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "cpython/genobject.h"
#endif /* expanded by -frewrite-includes */
# 79 "./Include/Python.h"
# 1 "./Include/cpython/genobject.h" 1
/* Generator object interface */
#ifndef Py_LIMITED_API
#ifndef Py_GENOBJECT_H
#define Py_GENOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 9 "./Include/cpython/genobject.h"
/* --- Generators --------------------------------------------------------- */
/* _PyGenObject_HEAD defines the initial segment of generator
and coroutine objects. */
#define _PyGenObject_HEAD(prefix) \
PyObject_HEAD \
/* List of weak reference. */ \
PyObject *prefix##_weakreflist; \
/* Name of the generator. */ \
PyObject *prefix##_name; \
/* Qualified name of the generator. */ \
PyObject *prefix##_qualname; \
_PyErr_StackItem prefix##_exc_state; \
PyObject *prefix##_origin_or_finalizer; \
char prefix##_hooks_inited; \
char prefix##_closed; \
char prefix##_running_async; \
/* The frame */ \
int8_t prefix##_frame_state; \
PyObject *prefix##_iframe[1]; \
typedef struct {
/* The gi_ prefix is intended to remind of generator-iterator. */
_PyGenObject_HEAD(gi)
} PyGenObject;
PyAPI_DATA(PyTypeObject) PyGen_Type;
#define PyGen_Check(op) PyObject_TypeCheck((op), &PyGen_Type)
#define PyGen_CheckExact(op) Py_IS_TYPE((op), &PyGen_Type)
PyAPI_FUNC(PyObject *) PyGen_New(PyFrameObject *);
PyAPI_FUNC(PyObject *) PyGen_NewWithQualName(PyFrameObject *,
PyObject *name, PyObject *qualname);
PyAPI_FUNC(int) _PyGen_SetStopIterationValue(PyObject *);
PyAPI_FUNC(int) _PyGen_FetchStopIterationValue(PyObject **);
PyAPI_FUNC(void) _PyGen_Finalize(PyObject *self);
PyAPI_FUNC(PyCodeObject *) PyGen_GetCode(PyGenObject *gen);
/* --- PyCoroObject ------------------------------------------------------- */
typedef struct {
_PyGenObject_HEAD(cr)
} PyCoroObject;
PyAPI_DATA(PyTypeObject) PyCoro_Type;
PyAPI_DATA(PyTypeObject) _PyCoroWrapper_Type;
#define PyCoro_CheckExact(op) Py_IS_TYPE((op), &PyCoro_Type)
PyAPI_FUNC(PyObject *) PyCoro_New(PyFrameObject *,
PyObject *name, PyObject *qualname);
/* --- Asynchronous Generators -------------------------------------------- */
typedef struct {
_PyGenObject_HEAD(ag)
} PyAsyncGenObject;
PyAPI_DATA(PyTypeObject) PyAsyncGen_Type;
PyAPI_DATA(PyTypeObject) _PyAsyncGenASend_Type;
PyAPI_DATA(PyTypeObject) _PyAsyncGenWrappedValue_Type;
PyAPI_DATA(PyTypeObject) _PyAsyncGenAThrow_Type;
PyAPI_FUNC(PyObject *) PyAsyncGen_New(PyFrameObject *,
PyObject *name, PyObject *qualname);
#define PyAsyncGen_CheckExact(op) Py_IS_TYPE((op), &PyAsyncGen_Type)
#define PyAsyncGenASend_CheckExact(op) Py_IS_TYPE((op), &_PyAsyncGenASend_Type)
#undef _PyGenObject_HEAD
#ifdef __cplusplus
}
#endif
# 88 "./Include/cpython/genobject.h"
#endif /* !Py_GENOBJECT_H */
# 89 "./Include/cpython/genobject.h"
#endif /* Py_LIMITED_API */
# 90 "./Include/cpython/genobject.h"
# 80 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "descrobject.h"
#endif /* expanded by -frewrite-includes */
# 80 "./Include/Python.h"
# 1 "./Include/descrobject.h" 1
/* Descriptors */
#ifndef Py_DESCROBJECT_H
#define Py_DESCROBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 7 "./Include/descrobject.h"
typedef PyObject *(*getter)(PyObject *, void *);
typedef int (*setter)(PyObject *, PyObject *, void *);
struct PyGetSetDef {
const char *name;
getter get;
setter set;
const char *doc;
void *closure;
};
PyAPI_DATA(PyTypeObject) PyClassMethodDescr_Type;
PyAPI_DATA(PyTypeObject) PyGetSetDescr_Type;
PyAPI_DATA(PyTypeObject) PyMemberDescr_Type;
PyAPI_DATA(PyTypeObject) PyMethodDescr_Type;
PyAPI_DATA(PyTypeObject) PyWrapperDescr_Type;
PyAPI_DATA(PyTypeObject) PyDictProxy_Type;
PyAPI_DATA(PyTypeObject) PyProperty_Type;
PyAPI_FUNC(PyObject *) PyDescr_NewMethod(PyTypeObject *, PyMethodDef *);
PyAPI_FUNC(PyObject *) PyDescr_NewClassMethod(PyTypeObject *, PyMethodDef *);
PyAPI_FUNC(PyObject *) PyDescr_NewMember(PyTypeObject *, PyMemberDef *);
PyAPI_FUNC(PyObject *) PyDescr_NewGetSet(PyTypeObject *, PyGetSetDef *);
PyAPI_FUNC(PyObject *) PyDictProxy_New(PyObject *);
PyAPI_FUNC(PyObject *) PyWrapper_New(PyObject *, PyObject *);
/* An array of PyMemberDef structures defines the name, type and offset
of selected members of a C structure. These can be read by
PyMember_GetOne() and set by PyMember_SetOne() (except if their READONLY
flag is set). The array must be terminated with an entry whose name
pointer is NULL. */
struct PyMemberDef {
const char *name;
int type;
Py_ssize_t offset;
int flags;
const char *doc;
};
// These constants used to be in structmember.h, not prefixed by Py_.
// (structmember.h now has aliases to the new names.)
/* Types */
#define Py_T_SHORT 0
#define Py_T_INT 1
#define Py_T_LONG 2
#define Py_T_FLOAT 3
#define Py_T_DOUBLE 4
#define Py_T_STRING 5
#define _Py_T_OBJECT 6 // Deprecated, use Py_T_OBJECT_EX instead
/* the ordering here is weird for binary compatibility */
#define Py_T_CHAR 7 /* 1-character string */
#define Py_T_BYTE 8 /* 8-bit signed int */
/* unsigned variants: */
#define Py_T_UBYTE 9
#define Py_T_USHORT 10
#define Py_T_UINT 11
#define Py_T_ULONG 12
/* Added by Jack: strings contained in the structure */
#define Py_T_STRING_INPLACE 13
/* Added by Lillo: bools contained in the structure (assumed char) */
#define Py_T_BOOL 14
#define Py_T_OBJECT_EX 16
#define Py_T_LONGLONG 17
#define Py_T_ULONGLONG 18
#define Py_T_PYSSIZET 19 /* Py_ssize_t */
#define _Py_T_NONE 20 // Deprecated. Value is always None.
/* Flags */
#define Py_READONLY 1
#define Py_AUDIT_READ 2 // Added in 3.10, harmless no-op before that
#define _Py_WRITE_RESTRICTED 4 // Deprecated, no-op. Do not reuse the value.
#define Py_RELATIVE_OFFSET 8
PyAPI_FUNC(PyObject *) PyMember_GetOne(const char *, PyMemberDef *);
PyAPI_FUNC(int) PyMember_SetOne(char *, PyMemberDef *, PyObject *);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_DESCROBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/descrobject.h"
#endif /* expanded by -frewrite-includes */
# 93 "./Include/descrobject.h"
# 1 "./Include/cpython/descrobject.h" 1
#ifndef Py_CPYTHON_DESCROBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/descrobject.h"
typedef PyObject *(*wrapperfunc)(PyObject *self, PyObject *args,
void *wrapped);
typedef PyObject *(*wrapperfunc_kwds)(PyObject *self, PyObject *args,
void *wrapped, PyObject *kwds);
struct wrapperbase {
const char *name;
int offset;
void *function;
wrapperfunc wrapper;
const char *doc;
int flags;
PyObject *name_strobj;
};
/* Flags for above struct */
#define PyWrapperFlag_KEYWORDS 1 /* wrapper function takes keyword args */
/* Various kinds of descriptor objects */
typedef struct {
PyObject_HEAD
PyTypeObject *d_type;
PyObject *d_name;
PyObject *d_qualname;
} PyDescrObject;
#define PyDescr_COMMON PyDescrObject d_common
#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
typedef struct {
PyDescr_COMMON;
PyMethodDef *d_method;
vectorcallfunc vectorcall;
} PyMethodDescrObject;
typedef struct {
PyDescr_COMMON;
PyMemberDef *d_member;
} PyMemberDescrObject;
typedef struct {
PyDescr_COMMON;
PyGetSetDef *d_getset;
} PyGetSetDescrObject;
typedef struct {
PyDescr_COMMON;
struct wrapperbase *d_base;
void *d_wrapped; /* This can be any function pointer */
} PyWrapperDescrObject;
PyAPI_DATA(PyTypeObject) _PyMethodWrapper_Type;
PyAPI_FUNC(PyObject *) PyDescr_NewWrapper(PyTypeObject *,
struct wrapperbase *, void *);
PyAPI_FUNC(int) PyDescr_IsData(PyObject *);
# 94 "./Include/descrobject.h" 2
# undef Py_CPYTHON_DESCROBJECT_H
#endif
# 96 "./Include/descrobject.h"
#ifdef __cplusplus
}
#endif
# 100 "./Include/descrobject.h"
#endif /* !Py_DESCROBJECT_H */
# 101 "./Include/descrobject.h"
# 81 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "genericaliasobject.h"
#endif /* expanded by -frewrite-includes */
# 81 "./Include/Python.h"
# 1 "./Include/genericaliasobject.h" 1
// Implementation of PEP 585: support list[int] etc.
#ifndef Py_GENERICALIASOBJECT_H
#define Py_GENERICALIASOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 7 "./Include/genericaliasobject.h"
PyAPI_FUNC(PyObject *) Py_GenericAlias(PyObject *, PyObject *);
PyAPI_DATA(PyTypeObject) Py_GenericAliasType;
#ifdef __cplusplus
}
#endif
# 14 "./Include/genericaliasobject.h"
#endif /* !Py_GENERICALIASOBJECT_H */
# 15 "./Include/genericaliasobject.h"
# 82 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "warnings.h"
#endif /* expanded by -frewrite-includes */
# 82 "./Include/Python.h"
# 1 "./Include/warnings.h" 1
#ifndef Py_WARNINGS_H
#define Py_WARNINGS_H
#ifdef __cplusplus
extern "C" {
#endif
# 6 "./Include/warnings.h"
PyAPI_FUNC(int) PyErr_WarnEx(
PyObject *category,
const char *message, /* UTF-8 encoded string */
Py_ssize_t stack_level);
PyAPI_FUNC(int) PyErr_WarnFormat(
PyObject *category,
Py_ssize_t stack_level,
const char *format, /* ASCII-encoded string */
...);
#if 0 /* disabled by -frewrite-includes */
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03060000
#endif
#endif /* disabled by -frewrite-includes */
#if 1 /* evaluated by -frewrite-includes */
# 19 "./Include/warnings.h"
/* Emit a ResourceWarning warning */
PyAPI_FUNC(int) PyErr_ResourceWarning(
PyObject *source,
Py_ssize_t stack_level,
const char *format, /* ASCII-encoded string */
...);
#endif
# 26 "./Include/warnings.h"
PyAPI_FUNC(int) PyErr_WarnExplicit(
PyObject *category,
const char *message, /* UTF-8 encoded string */
const char *filename, /* decoded from the filesystem encoding */
int lineno,
const char *module, /* UTF-8 encoded string */
PyObject *registry);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_WARNINGS_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/warnings.h"
#endif /* expanded by -frewrite-includes */
# 37 "./Include/warnings.h"
# 1 "./Include/cpython/warnings.h" 1
#ifndef Py_CPYTHON_WARNINGS_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/warnings.h"
PyAPI_FUNC(int) PyErr_WarnExplicitObject(
PyObject *category,
PyObject *message,
PyObject *filename,
int lineno,
PyObject *module,
PyObject *registry);
PyAPI_FUNC(int) PyErr_WarnExplicitFormat(
PyObject *category,
const char *filename, int lineno,
const char *module, PyObject *registry,
const char *format, ...);
// DEPRECATED: Use PyErr_WarnEx() instead.
#define PyErr_Warn(category, msg) PyErr_WarnEx((category), (msg), 1)
# 38 "./Include/warnings.h" 2
# undef Py_CPYTHON_WARNINGS_H
#endif
# 40 "./Include/warnings.h"
#ifdef __cplusplus
}
#endif
# 44 "./Include/warnings.h"
#endif /* !Py_WARNINGS_H */
# 45 "./Include/warnings.h"
# 83 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "weakrefobject.h"
#endif /* expanded by -frewrite-includes */
# 83 "./Include/Python.h"
# 1 "./Include/weakrefobject.h" 1
/* Weak references objects for Python. */
#ifndef Py_WEAKREFOBJECT_H
#define Py_WEAKREFOBJECT_H
#ifdef __cplusplus
extern "C" {
#endif
# 8 "./Include/weakrefobject.h"
typedef struct _PyWeakReference PyWeakReference;
PyAPI_DATA(PyTypeObject) _PyWeakref_RefType;
PyAPI_DATA(PyTypeObject) _PyWeakref_ProxyType;
PyAPI_DATA(PyTypeObject) _PyWeakref_CallableProxyType;
#define PyWeakref_CheckRef(op) PyObject_TypeCheck((op), &_PyWeakref_RefType)
#define PyWeakref_CheckRefExact(op) \
Py_IS_TYPE((op), &_PyWeakref_RefType)
#define PyWeakref_CheckProxy(op) \
(Py_IS_TYPE((op), &_PyWeakref_ProxyType) \
|| Py_IS_TYPE((op), &_PyWeakref_CallableProxyType))
#define PyWeakref_Check(op) \
(PyWeakref_CheckRef(op) || PyWeakref_CheckProxy(op))
PyAPI_FUNC(PyObject *) PyWeakref_NewRef(PyObject *ob,
PyObject *callback);
PyAPI_FUNC(PyObject *) PyWeakref_NewProxy(PyObject *ob,
PyObject *callback);
PyAPI_FUNC(PyObject *) PyWeakref_GetObject(PyObject *ref);
#ifndef Py_LIMITED_API
# define Py_CPYTHON_WEAKREFOBJECT_H
#if 0 /* expanded by -frewrite-includes */
# include "cpython/weakrefobject.h"
#endif /* expanded by -frewrite-includes */
# 35 "./Include/weakrefobject.h"
# 1 "./Include/cpython/weakrefobject.h" 1
#ifndef Py_CPYTHON_WEAKREFOBJECT_H
# error "this header file must not be included directly"
#endif
# 4 "./Include/cpython/weakrefobject.h"
/* PyWeakReference is the base struct for the Python ReferenceType, ProxyType,
* and CallableProxyType.
*/
struct _PyWeakReference {
PyObject_HEAD
/* The object to which this is a weak reference, or Py_None if none.
* Note that this is a stealth reference: wr_object's refcount is
* not incremented to reflect this pointer.
*/
PyObject *wr_object;
/* A callable to invoke when wr_object dies, or NULL if none. */
PyObject *wr_callback;
/* A cache for wr_object's hash code. As usual for hashes, this is -1
* if the hash code isn't known yet.
*/
Py_hash_t hash;
/* If wr_object is weakly referenced, wr_object has a doubly-linked NULL-
* terminated list of weak references to it. These are the list pointers.
* If wr_object goes away, wr_object is set to Py_None, and these pointers
* have no meaning then.
*/
PyWeakReference *wr_prev;
PyWeakReference *wr_next;
vectorcallfunc vectorcall;
};
PyAPI_FUNC(Py_ssize_t) _PyWeakref_GetWeakrefCount(PyWeakReference *head);
PyAPI_FUNC(void) _PyWeakref_ClearRef(PyWeakReference *self);
static inline PyObject* PyWeakref_GET_OBJECT(PyObject *ref_obj) {
PyWeakReference *ref;
PyObject *obj;
assert(PyWeakref_Check(ref_obj));
ref = _Py_CAST(PyWeakReference*, ref_obj);
obj = ref->wr_object;
// Explanation for the Py_REFCNT() check: when a weakref's target is part
// of a long chain of deallocations which triggers the trashcan mechanism,
// clearing the weakrefs can be delayed long after the target's refcount
// has dropped to zero. In the meantime, code accessing the weakref will
// be able to "see" the target object even though it is supposed to be
// unreachable. See issue gh-60806.
if (Py_REFCNT(obj) > 0) {
return obj;
}
return Py_None;
}
#define PyWeakref_GET_OBJECT(ref) PyWeakref_GET_OBJECT(_PyObject_CAST(ref))
# 36 "./Include/weakrefobject.h" 2
# undef Py_CPYTHON_WEAKREFOBJECT_H
#endif
# 38 "./Include/weakrefobject.h"
#ifdef __cplusplus
}
#endif
# 42 "./Include/weakrefobject.h"
#endif /* !Py_WEAKREFOBJECT_H */
# 43 "./Include/weakrefobject.h"
# 84 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "structseq.h"
#endif /* expanded by -frewrite-includes */
# 84 "./Include/Python.h"
# 1 "./Include/structseq.h" 1
/* Named tuple object interface */
#ifndef Py_STRUCTSEQ_H
#define Py_STRUCTSEQ_H
#ifdef __cplusplus
extern "C" {
#endif
# 9 "./Include/structseq.h"
typedef struct PyStructSequence_Field {
const char *name;
const char *doc;
} PyStructSequence_Field;
typedef struct PyStructSequence_Desc {
const char *name;
const char *doc;
PyStructSequence_Field *fields;
int n_in_sequence;
} PyStructSequence_Desc;
PyAPI_DATA(const char * const) PyStructSequence_UnnamedField;
#ifndef Py_LIMITED_API
PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type,
PyStructSequence_Desc *desc);
PyAPI_FUNC(int) PyStructSequence_InitType2(PyTypeObject *type,
PyStructSequence_Desc *desc);
#endif
# 30 "./Include/structseq.h"
PyAPI_FUNC(PyTypeObject*) PyStructSequence_NewType(PyStructSequence_Desc *desc);
PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type);
#ifndef Py_LIMITED_API
typedef PyTupleObject PyStructSequence;
/* Macro, *only* to be used to fill in brand new objects */
#define PyStructSequence_SET_ITEM(op, i, v) PyTuple_SET_ITEM((op), (i), (v))
#define PyStructSequence_GET_ITEM(op, i) PyTuple_GET_ITEM((op), (i))
#endif
# 42 "./Include/structseq.h"
PyAPI_FUNC(void) PyStructSequence_SetItem(PyObject*, Py_ssize_t, PyObject*);
PyAPI_FUNC(PyObject*) PyStructSequence_GetItem(PyObject*, Py_ssize_t);
#ifdef __cplusplus
}
#endif
# 49 "./Include/structseq.h"
#endif /* !Py_STRUCTSEQ_H */
# 50 "./Include/structseq.h"
# 85 "./Include/Python.h" 2
#if 0 /* expanded by -frewrite-includes */
#include "cpython/picklebufobject.h"
#endif /* expanded by -frewrite-includes */
# 85 "./Include/Python.h"
# 1 "./Include/cpython/picklebufobject.h" 1
/* PickleBuffer object. This is built-in for ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment