From 59c6d0165146ae902730add30af06e8ef186a252 Mon Sep 17 00:00:00 2001 From: Samuel Audet Date: Thu, 17 Oct 2024 10:08:41 +0900 Subject: [PATCH] * Upgrade presets for FFmpeg 7.1, CPython 3.13.0, LLVM 19.1.2 --- CHANGELOG.md | 2 +- README.md | 6 +- cpython/README.md | 4 +- cpython/cppbuild.sh | 2 +- cpython/platform/pom.xml | 2 +- cpython/pom.xml | 4 +- cpython/samples/pom.xml | 2 +- .../Innerfunc_BytePointer_long_Pointer.java | 23 - .../Innerfunc_String_long_Pointer.java | 21 - .../org/bytedeco/cpython/PerfMapState.java | 1 - .../bytedeco/cpython/Predicate_PyObject.java | 21 - .../org/bytedeco/cpython/PyASCIIObject.java | 1 + ...FunctionFast.java => PyCFunctionFast.java} | 6 +- ....java => PyCFunctionFastWithKeywords.java} | 10 +- .../org/bytedeco/cpython/PyCodeObject.java | 3 +- .../java/org/bytedeco/cpython/PyConfig.java | 13 + .../cpython/PyFrameLocalsProxyObject.java | 35 + .../bytedeco/cpython/PyFutureFeatures.java | 36 - .../org/bytedeco/cpython/PyHash_FuncDef.java | 3 - .../org/bytedeco/cpython/PyModuleDef.java | 3 + .../bytedeco/cpython/PyModuleDef_Base.java | 2 +- .../org/bytedeco/cpython/PyNumberMethods.java | 1 + ...id_newobjectfunc.java => PyRefTracer.java} | 8 +- .../org/bytedeco/cpython/PySliceObject.java | 1 + .../org/bytedeco/cpython/PyThreadState.java | 73 +- .../org/bytedeco/cpython/PyTypeObject.java | 1 + .../cpython/Py_AuditHookFunction.java | 1 + .../org/bytedeco/cpython/Py_tracefunc.java | 1 - .../org/bytedeco/cpython/_PyBytesWriter.java | 57 - .../java/org/bytedeco/cpython/_PyCFrame.java | 47 - .../cpython/_PyCompilerSrcLocation.java | 37 - .../cpython/_PyCrossInterpreterData.java | 26 - .../bytedeco/cpython/_PyDictViewObject.java | 36 - .../bytedeco/cpython/_PyExecutorArray.java | 37 + .../org/bytedeco/cpython/_PyLongValue.java | 31 +- .../bytedeco/cpython/_PyUnicodeWriter.java | 1 + .../org/bytedeco/cpython/_Py_CODEUNIT.java | 44 - .../bytedeco/cpython/_Py_HashSecret_t.java | 69 - .../org/bytedeco/cpython/_Py_Identifier.java | 5 +- .../bytedeco/cpython/_Py_LocalMonitors.java | 2 - .../bytedeco/cpython/_Py_clock_info_t.java | 37 - .../java/org/bytedeco/cpython/_frozen.java | 9 - .../java/org/bytedeco/cpython/_object.java | 3 +- .../org/bytedeco/cpython/_py_trashcan.java | 34 - .../cpython/_specialization_cache.java | 3 +- .../gen/java/org/bytedeco/cpython/_xid.java | 68 - .../bytedeco/cpython/crossinterpdatafunc.java | 25 - .../bytedeco/cpython/gcvisitobjects_t.java | 1 - .../org/bytedeco/cpython/global/python.java | 3507 +++++------------ .../org/bytedeco/cpython/xid_freefunc.java | 21 - .../org/bytedeco/cpython/helper/python.java | 104 +- .../org/bytedeco/cpython/presets/python.java | 46 +- .../java/org/bytedeco/cpython/python.java | 4 +- ffmpeg/README.md | 6 +- ffmpeg/cppbuild.sh | 8 +- ffmpeg/ffmpeg.patch | 30 +- ffmpeg/platform/gpl/pom.xml | 2 +- ffmpeg/platform/pom.xml | 2 +- ffmpeg/pom.xml | 2 +- ffmpeg/samples/pom.xml | 4 +- .../org/bytedeco/ffmpeg/avcodec/AVCodec.java | 24 +- .../ffmpeg/avcodec/AVCodecContext.java | 7 +- .../ffmpeg/avcodec/AVPacketSideData.java | 1 + .../bytedeco/ffmpeg/avfilter/AVFilter.java | 23 + .../ffmpeg/avfilter/AVFilterLink.java | 70 - .../ffmpeg/avformat/AVFormatContext.java | 12 + .../ffmpeg/avformat/AVStreamGroup.java | 1 + .../ffmpeg/avformat/AVStreamGroupLCEVC.java | 60 + .../org/bytedeco/ffmpeg/avutil/AVFrame.java | 3 +- .../ffmpeg/avutil/AVSideDataDescriptor.java | 45 + .../bytedeco/ffmpeg/avutil/AVStereo3D.java | 22 + .../org/bytedeco/ffmpeg/global/avcodec.java | 88 +- .../org/bytedeco/ffmpeg/global/avdevice.java | 2 +- .../org/bytedeco/ffmpeg/global/avfilter.java | 8 +- .../org/bytedeco/ffmpeg/global/avformat.java | 34 +- .../org/bytedeco/ffmpeg/global/avutil.java | 555 ++- .../bytedeco/ffmpeg/global/swresample.java | 6 +- .../org/bytedeco/ffmpeg/global/swscale.java | 30 +- .../org/bytedeco/ffmpeg/presets/avcodec.java | 2 +- .../org/bytedeco/ffmpeg/presets/avformat.java | 2 +- .../org/bytedeco/ffmpeg/presets/avutil.java | 8 +- llvm/README.md | 4 +- llvm/cppbuild.sh | 2 +- llvm/platform/pom.xml | 2 +- llvm/pom.xml | 2 +- llvm/samples/clang/pom.xml | 2 +- llvm/samples/llvm/pom.xml | 2 +- llvm/samples/polly/pom.xml | 2 +- .../bytedeco/llvm/LLVM/LLVMDbgRecordRef.java | 23 + .../llvm/LLVM/LLVMOpaqueDbgRecord.java | 23 + .../LLVM/LLVMOrcCSymbolDependenceGroup.java | 38 + .../java/org/bytedeco/llvm/global/LLVM.java | 565 ++- .../java/org/bytedeco/llvm/global/clang.java | 83 +- .../java/org/bytedeco/llvm/presets/LLVM.java | 4 +- .../java/org/bytedeco/llvm/presets/clang.java | 2 +- .../java/org/bytedeco/llvm/program/clang.java | 2 +- numpy/cppbuild.sh | 24 +- numpy/platform/pom.xml | 2 +- numpy/pom.xml | 12 +- onnx/cppbuild.sh | 12 +- onnx/platform/pom.xml | 2 +- onnx/pom.xml | 4 +- opencv/cppbuild.sh | 18 +- platform/pom.xml | 6 +- pytorch/cppbuild.sh | 14 +- pytorch/pom.xml | 2 +- scipy/cppbuild.sh | 32 +- scipy/pom.xml | 8 +- tvm/cppbuild.sh | 18 +- tvm/platform/gpu/pom.xml | 2 +- tvm/platform/pom.xml | 2 +- tvm/pom.xml | 8 +- 112 files changed, 2865 insertions(+), 3654 deletions(-) delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/Innerfunc_BytePointer_long_Pointer.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/Innerfunc_String_long_Pointer.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/Predicate_PyObject.java rename cpython/src/gen/java/org/bytedeco/cpython/{_PyCFunctionFast.java => PyCFunctionFast.java} (79%) rename cpython/src/gen/java/org/bytedeco/cpython/{_PyCFunctionFastWithKeywords.java => PyCFunctionFastWithKeywords.java} (58%) create mode 100644 cpython/src/gen/java/org/bytedeco/cpython/PyFrameLocalsProxyObject.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/PyFutureFeatures.java rename cpython/src/gen/java/org/bytedeco/cpython/{xid_newobjectfunc.java => PyRefTracer.java} (68%) delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/_PyBytesWriter.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/_PyCFrame.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/_PyCompilerSrcLocation.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/_PyCrossInterpreterData.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/_PyDictViewObject.java create mode 100644 cpython/src/gen/java/org/bytedeco/cpython/_PyExecutorArray.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/_Py_CODEUNIT.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/_Py_HashSecret_t.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/_Py_clock_info_t.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/_py_trashcan.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/_xid.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/crossinterpdatafunc.java delete mode 100644 cpython/src/gen/java/org/bytedeco/cpython/xid_freefunc.java create mode 100644 ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVStreamGroupLCEVC.java create mode 100644 ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVSideDataDescriptor.java create mode 100644 llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMDbgRecordRef.java create mode 100644 llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMOpaqueDbgRecord.java create mode 100644 llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMOrcCSymbolDependenceGroup.java diff --git a/CHANGELOG.md b/CHANGELOG.md index cc05685b149..06e25cc914b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ * Build FFmpeg with zimg to enable zscale filter ([pull #1481](https://github.com/bytedeco/javacpp-presets/pull/1481)) * Enable PulseAudio support for FFmpeg on Linux ([pull #1472](https://github.com/bytedeco/javacpp-presets/pull/1472)) * Virtualize `btCollisionWorld`, `btOverlapFilterCallback`, `btOverlapCallback` from Bullet Physics SDK ([pull #1475](https://github.com/bytedeco/javacpp-presets/pull/1475)) - * Upgrade presets for OpenCV 4.10.0, FFmpeg 7.0.2, Spinnaker 4.0.0.116 ([pull #1524](https://github.com/bytedeco/javacpp-presets/pull/1524)), DNNL 3.5.3, OpenBLAS 0.3.28, CMINPACK 1.3.9, GSL 2.8, CPython 3.12.7, NumPy 2.1.2, SciPy 1.14.1, LLVM 18.1.8, LibRaw 0.21.2 ([pull #1520](https://github.com/bytedeco/javacpp-presets/pull/1520)), Tesseract 5.4.1, libffi 3.4.6, CUDA 12.6.0, cuDNN 9.3.0, NCCL 2.22.3, nvCOMP 4.0.0, OpenCL 3.0.16, NVIDIA Video Codec SDK 12.2.72, PyTorch 2.4.0 ([pull #1466](https://github.com/bytedeco/javacpp-presets/pull/1466)), SentencePiece 0.2.0, TensorFlow Lite 2.17.0, TensorRT 10.3.0.26, Triton Inference Server 2.48.0, ONNX 1.17.0, ONNX Runtime 1.19.2, TVM 0.17.0, and their dependencies + * Upgrade presets for OpenCV 4.10.0, FFmpeg 7.1, Spinnaker 4.0.0.116 ([pull #1524](https://github.com/bytedeco/javacpp-presets/pull/1524)), DNNL 3.5.3, OpenBLAS 0.3.28, CMINPACK 1.3.9, GSL 2.8, CPython 3.13.0, NumPy 2.1.2, SciPy 1.14.1, LLVM 19.1.2, LibRaw 0.21.2 ([pull #1520](https://github.com/bytedeco/javacpp-presets/pull/1520)), Tesseract 5.4.1, libffi 3.4.6, CUDA 12.6.0, cuDNN 9.3.0, NCCL 2.22.3, nvCOMP 4.0.0, OpenCL 3.0.16, NVIDIA Video Codec SDK 12.2.72, PyTorch 2.4.0 ([pull #1466](https://github.com/bytedeco/javacpp-presets/pull/1466)), SentencePiece 0.2.0, TensorFlow Lite 2.17.0, TensorRT 10.3.0.26, Triton Inference Server 2.48.0, ONNX 1.17.0, ONNX Runtime 1.19.2, TVM 0.17.0, and their dependencies ### January 29, 2024 version 1.5.10 * Introduce `macosx-arm64` builds for PyTorch ([pull #1463](https://github.com/bytedeco/javacpp-presets/pull/1463)) diff --git a/README.md b/README.md index 395e067615c..6d2c7defd3c 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,7 @@ The JavaCPP Presets depend on Maven, a powerful build system for Java, so before Each child module in turn relies by default on the included [`cppbuild.sh` scripts](#the-cppbuildsh-scripts), explained below, to install its corresponding native libraries in the `cppbuild` subdirectory. To use native libraries already installed somewhere else on the system, other installation directories than `cppbuild` can also be specified either in the `pom.xml` files or in the `.java` configuration files. The following versions are supported: * OpenCV 4.10.x https://opencv.org/releases/ - * FFmpeg 7.0.x http://ffmpeg.org/download.html + * FFmpeg 7.1.x http://ffmpeg.org/download.html * FlyCapture 2.13.x https://www.flir.com/products/flycapture-sdk * Spinnaker 4.0.x https://www.flir.com/products/spinnaker-sdk * libdc1394 2.2.6 http://sourceforge.net/projects/libdc1394/files/ @@ -204,11 +204,11 @@ Each child module in turn relies by default on the included [`cppbuild.sh` scrip * CMINPACK 1.3.9 https://github.com/devernay/cminpack * FFTW 3.3.10 http://www.fftw.org/download.html * GSL 2.8 http://www.gnu.org/software/gsl/#downloading - * CPython 3.12.x https://www.python.org/downloads/ + * CPython 3.13.x https://www.python.org/downloads/ * NumPy 2.1.x https://github.com/numpy/numpy * SciPy 1.14.x https://github.com/scipy/scipy * Gym 0.26.x https://github.com/openai/gym - * LLVM 18.1.x http://llvm.org/releases/download.html + * LLVM 19.1.x http://llvm.org/releases/download.html * libffi 3.4.x https://github.com/libffi/libffi * libpostal 1.1 https://github.com/openvenues/libpostal * LibRaw 0.21.x https://www.libraw.org/download diff --git a/cpython/README.md b/cpython/README.md index 5fe3145d75a..c8bddbfd6b5 100644 --- a/cpython/README.md +++ b/cpython/README.md @@ -14,7 +14,7 @@ Introduction ------------ This directory contains the JavaCPP Presets module for: - * CPython 3.12.7 https://www.python.org/ + * CPython 3.13.0 https://www.python.org/ Please refer to the parent README.md file for more detailed information about the JavaCPP Presets. @@ -54,7 +54,7 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic org.bytedeco cpython-platform - 3.12.7-1.5.11-SNAPSHOT + 3.13.0-1.5.11-SNAPSHOT diff --git a/cpython/cppbuild.sh b/cpython/cppbuild.sh index f1d2d87da9f..857768ae51a 100755 --- a/cpython/cppbuild.sh +++ b/cpython/cppbuild.sh @@ -8,7 +8,7 @@ if [[ -z "$PLATFORM" ]]; then fi OPENSSL=openssl-3.3.2 -CPYTHON_VERSION=3.12.7 +CPYTHON_VERSION=3.13.0 download https://www.openssl.org/source/$OPENSSL.tar.gz $OPENSSL.tar.gz download https://www.python.org/ftp/python/$CPYTHON_VERSION/Python-$CPYTHON_VERSION.tgz Python-$CPYTHON_VERSION.tgz diff --git a/cpython/platform/pom.xml b/cpython/platform/pom.xml index b3f3e5ce7ef..2b013b58341 100644 --- a/cpython/platform/pom.xml +++ b/cpython/platform/pom.xml @@ -12,7 +12,7 @@ org.bytedeco cpython-platform - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} JavaCPP Presets Platform for CPython diff --git a/cpython/pom.xml b/cpython/pom.xml index 21a73ec037e..28d9b3b6759 100644 --- a/cpython/pom.xml +++ b/cpython/pom.xml @@ -11,7 +11,7 @@ org.bytedeco cpython - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} JavaCPP Presets for CPython @@ -35,7 +35,7 @@ ${basedir}/cppbuild/${javacpp.platform}/include/ - ${basedir}/cppbuild/${javacpp.platform}/include/python3.12/ + ${basedir}/cppbuild/${javacpp.platform}/include/python3.13/ ${basedir}/cppbuild/${javacpp.platform}/lib/ diff --git a/cpython/samples/pom.xml b/cpython/samples/pom.xml index 58390199db4..57cbe363769 100644 --- a/cpython/samples/pom.xml +++ b/cpython/samples/pom.xml @@ -12,7 +12,7 @@ org.bytedeco cpython-platform - 3.12.7-1.5.11-SNAPSHOT + 3.13.0-1.5.11-SNAPSHOT diff --git a/cpython/src/gen/java/org/bytedeco/cpython/Innerfunc_BytePointer_long_Pointer.java b/cpython/src/gen/java/org/bytedeco/cpython/Innerfunc_BytePointer_long_Pointer.java deleted file mode 100644 index e62ad5ccbe0..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/Innerfunc_BytePointer_long_Pointer.java +++ /dev/null @@ -1,23 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - -// #ifndef Py_LIMITED_API -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class Innerfunc_BytePointer_long_Pointer extends FunctionPointer { - static { Loader.load(); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public Innerfunc_BytePointer_long_Pointer(Pointer p) { super(p); } - protected Innerfunc_BytePointer_long_Pointer() { allocate(); } - private native void allocate(); - public native PyObject call(@Cast("const char*") BytePointer arg0, @Cast("Py_ssize_t") long arg1, Pointer arg2); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/Innerfunc_String_long_Pointer.java b/cpython/src/gen/java/org/bytedeco/cpython/Innerfunc_String_long_Pointer.java deleted file mode 100644 index 1f15dd6386d..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/Innerfunc_String_long_Pointer.java +++ /dev/null @@ -1,21 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class Innerfunc_String_long_Pointer extends FunctionPointer { - static { Loader.load(); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public Innerfunc_String_long_Pointer(Pointer p) { super(p); } - protected Innerfunc_String_long_Pointer() { allocate(); } - private native void allocate(); - public native PyObject call(String arg0, @Cast("Py_ssize_t") long arg1, Pointer arg2); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PerfMapState.java b/cpython/src/gen/java/org/bytedeco/cpython/PerfMapState.java index 3fcd8da6312..51018164dc7 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/PerfMapState.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PerfMapState.java @@ -11,7 +11,6 @@ import static org.bytedeco.cpython.global.python.*; -// #if !defined(Py_LIMITED_API) @Properties(inherit = org.bytedeco.cpython.presets.python.class) public class PerfMapState extends Pointer { static { Loader.load(); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/Predicate_PyObject.java b/cpython/src/gen/java/org/bytedeco/cpython/Predicate_PyObject.java deleted file mode 100644 index bf664161770..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/Predicate_PyObject.java +++ /dev/null @@ -1,21 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class Predicate_PyObject extends FunctionPointer { - static { Loader.load(); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public Predicate_PyObject(Pointer p) { super(p); } - protected Predicate_PyObject() { allocate(); } - private native void allocate(); - public native int call(PyObject value); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PyASCIIObject.java b/cpython/src/gen/java/org/bytedeco/cpython/PyASCIIObject.java index f1ccd2a920c..a027ece281e 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/PyASCIIObject.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyASCIIObject.java @@ -11,6 +11,7 @@ import static org.bytedeco.cpython.global.python.*; + /* --- Unicode Type ------------------------------------------------------- */ /* ASCII-only strings created through PyUnicode_New use the PyASCIIObject diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_PyCFunctionFast.java b/cpython/src/gen/java/org/bytedeco/cpython/PyCFunctionFast.java similarity index 79% rename from cpython/src/gen/java/org/bytedeco/cpython/_PyCFunctionFast.java rename to cpython/src/gen/java/org/bytedeco/cpython/PyCFunctionFast.java index d20a5658d77..3befb3e430a 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/_PyCFunctionFast.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyCFunctionFast.java @@ -11,11 +11,11 @@ import static org.bytedeco.cpython.global.python.*; @Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _PyCFunctionFast extends FunctionPointer { +public class PyCFunctionFast extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _PyCFunctionFast(Pointer p) { super(p); } - protected _PyCFunctionFast() { allocate(); } + public PyCFunctionFast(Pointer p) { super(p); } + protected PyCFunctionFast() { allocate(); } private native void allocate(); public native PyObject call(PyObject arg0, @Cast("PyObject*const*") PointerPointer arg1, @Cast("Py_ssize_t") long arg2); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_PyCFunctionFastWithKeywords.java b/cpython/src/gen/java/org/bytedeco/cpython/PyCFunctionFastWithKeywords.java similarity index 58% rename from cpython/src/gen/java/org/bytedeco/cpython/_PyCFunctionFastWithKeywords.java rename to cpython/src/gen/java/org/bytedeco/cpython/PyCFunctionFastWithKeywords.java index cc2fb732686..83b5c795e1c 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/_PyCFunctionFastWithKeywords.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyCFunctionFastWithKeywords.java @@ -11,13 +11,13 @@ import static org.bytedeco.cpython.global.python.*; @Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _PyCFunctionFastWithKeywords extends FunctionPointer { +public class PyCFunctionFastWithKeywords extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _PyCFunctionFastWithKeywords(Pointer p) { super(p); } - protected _PyCFunctionFastWithKeywords() { allocate(); } + public PyCFunctionFastWithKeywords(Pointer p) { super(p); } + protected PyCFunctionFastWithKeywords() { allocate(); } private native void allocate(); public native PyObject call(PyObject arg0, - @Cast("PyObject*const*") PointerPointer arg1, @Cast("Py_ssize_t") long arg2, - PyObject arg3); + @Cast("PyObject*const*") PointerPointer arg1, @Cast("Py_ssize_t") long arg2, + PyObject arg3); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PyCodeObject.java b/cpython/src/gen/java/org/bytedeco/cpython/PyCodeObject.java index 57f557aa161..28838acf51a 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/PyCodeObject.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyCodeObject.java @@ -83,8 +83,9 @@ public class PyCodeObject extends Pointer { public native PyObject co_qualname(); public native PyCodeObject co_qualname(PyObject setter); /* unicode (qualname, for reference) */ public native PyObject co_linetable(); public native PyCodeObject co_linetable(PyObject setter); /* bytes object that holds location info */ public native PyObject co_weakreflist(); public native PyCodeObject co_weakreflist(PyObject setter); /* to support weakrefs to code objects */ + public native _PyExecutorArray co_executors(); public native PyCodeObject co_executors(_PyExecutorArray setter); /* executors from optimizer */ public native _PyCoCached _co_cached(); public native PyCodeObject _co_cached(_PyCoCached setter); /* cached co_* attributes */ - public native @Cast("uint64_t") long _co_instrumentation_version(); public native PyCodeObject _co_instrumentation_version(long setter); /* current instrumentation version */ + public native @Cast("uintptr_t") long _co_instrumentation_version(); public native PyCodeObject _co_instrumentation_version(long setter); /* current instrumentation version */ public native _PyCoMonitoringData _co_monitoring(); public native PyCodeObject _co_monitoring(_PyCoMonitoringData setter); /* Monitoring data */ public native int _co_firsttraceable(); public native PyCodeObject _co_firsttraceable(int setter); /* index of first traceable instruction */ /* Scratch space for extra data relating to the code object. \ diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PyConfig.java b/cpython/src/gen/java/org/bytedeco/cpython/PyConfig.java index 5fc0141f5ed..fb4efd04fae 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/PyConfig.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyConfig.java @@ -80,6 +80,10 @@ public class PyConfig extends Pointer { public native int safe_path(); public native PyConfig safe_path(int setter); public native int int_max_str_digits(); public native PyConfig int_max_str_digits(int setter); + public native int cpu_count(); public native PyConfig cpu_count(int setter); +// #ifdef Py_GIL_DISABLED +// #endif + /* --- Path configuration inputs ------------ */ public native int pathconfig_warnings(); public native PyConfig pathconfig_warnings(int setter); public native @Cast("wchar_t*") Pointer program_name(); public native PyConfig program_name(Pointer setter); @@ -104,6 +108,9 @@ public class PyConfig extends Pointer { public native @Cast("wchar_t*") Pointer run_module(); public native PyConfig run_module(Pointer setter); public native @Cast("wchar_t*") Pointer run_filename(); public native PyConfig run_filename(Pointer setter); + /* --- Set by Py_Main() -------------------------- */ + public native @Cast("wchar_t*") Pointer sys_path_0(); public native PyConfig sys_path_0(Pointer setter); + /* --- Private fields ---------------------------- */ // Install importlib? If equals to 0, importlib is not initialized at all. @@ -115,4 +122,10 @@ public class PyConfig extends Pointer { // If non-zero, we believe we're running from a source tree. public native int _is_python_build(); public native PyConfig _is_python_build(int setter); + +// #ifdef Py_STATS +// #endif + +// #ifdef Py_DEBUG +// #endif } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PyFrameLocalsProxyObject.java b/cpython/src/gen/java/org/bytedeco/cpython/PyFrameLocalsProxyObject.java new file mode 100644 index 00000000000..a36e41e4ccf --- /dev/null +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyFrameLocalsProxyObject.java @@ -0,0 +1,35 @@ +// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.cpython; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.cpython.global.python.*; + + + +@Properties(inherit = org.bytedeco.cpython.presets.python.class) +public class PyFrameLocalsProxyObject extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public PyFrameLocalsProxyObject() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public PyFrameLocalsProxyObject(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public PyFrameLocalsProxyObject(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public PyFrameLocalsProxyObject position(long position) { + return (PyFrameLocalsProxyObject)super.position(position); + } + @Override public PyFrameLocalsProxyObject getPointer(long i) { + return new PyFrameLocalsProxyObject((Pointer)this).offsetAddress(i); + } + + public native @ByRef PyObject ob_base(); public native PyFrameLocalsProxyObject ob_base(PyObject setter); + public native PyFrameObject frame(); public native PyFrameLocalsProxyObject frame(PyFrameObject setter); +} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PyFutureFeatures.java b/cpython/src/gen/java/org/bytedeco/cpython/PyFutureFeatures.java deleted file mode 100644 index ec9e24b79e3..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/PyFutureFeatures.java +++ /dev/null @@ -1,36 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - -/* Future feature support */ - -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class PyFutureFeatures extends Pointer { - static { Loader.load(); } - /** Default native constructor. */ - public PyFutureFeatures() { super((Pointer)null); allocate(); } - /** Native array allocator. Access with {@link Pointer#position(long)}. */ - public PyFutureFeatures(long size) { super((Pointer)null); allocateArray(size); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public PyFutureFeatures(Pointer p) { super(p); } - private native void allocate(); - private native void allocateArray(long size); - @Override public PyFutureFeatures position(long position) { - return (PyFutureFeatures)super.position(position); - } - @Override public PyFutureFeatures getPointer(long i) { - return new PyFutureFeatures((Pointer)this).offsetAddress(i); - } - - public native int ff_features(); public native PyFutureFeatures ff_features(int setter); /* flags set by future statements */ - public native @ByRef _PyCompilerSrcLocation ff_location(); public native PyFutureFeatures ff_location(_PyCompilerSrcLocation setter); /* location of last future statement */ -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PyHash_FuncDef.java b/cpython/src/gen/java/org/bytedeco/cpython/PyHash_FuncDef.java index 70da55ea627..f539f860d6c 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/PyHash_FuncDef.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyHash_FuncDef.java @@ -11,9 +11,6 @@ import static org.bytedeco.cpython.global.python.*; -// #ifdef Py_DEBUG -// #endif - /* hash function definition */ @Properties(inherit = org.bytedeco.cpython.presets.python.class) diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PyModuleDef.java b/cpython/src/gen/java/org/bytedeco/cpython/PyModuleDef.java index 816aa7169a6..0094fea6b34 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/PyModuleDef.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyModuleDef.java @@ -12,6 +12,9 @@ // #endif +// #if !defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED) +// #endif + @Properties(inherit = org.bytedeco.cpython.presets.python.class) public class PyModuleDef extends Pointer { static { Loader.load(); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PyModuleDef_Base.java b/cpython/src/gen/java/org/bytedeco/cpython/PyModuleDef_Base.java index 561fb7f24ca..a471302ec22 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/PyModuleDef_Base.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyModuleDef_Base.java @@ -54,6 +54,6 @@ It is set by PyModuleDef_Init(). */ /* 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(). */ + It is set by fix_up_extension() in import.c. */ public native PyObject m_copy(); public native PyModuleDef_Base m_copy(PyObject setter); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PyNumberMethods.java b/cpython/src/gen/java/org/bytedeco/cpython/PyNumberMethods.java index 82dda3e097e..4be615907b6 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/PyNumberMethods.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyNumberMethods.java @@ -13,6 +13,7 @@ // #endif /* !Py_BUILD_CORE */ + @Properties(inherit = org.bytedeco.cpython.presets.python.class) public class PyNumberMethods extends Pointer { static { Loader.load(); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/xid_newobjectfunc.java b/cpython/src/gen/java/org/bytedeco/cpython/PyRefTracer.java similarity index 68% rename from cpython/src/gen/java/org/bytedeco/cpython/xid_newobjectfunc.java rename to cpython/src/gen/java/org/bytedeco/cpython/PyRefTracer.java index 70790aed4fb..ec221161fd0 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/xid_newobjectfunc.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyRefTracer.java @@ -12,11 +12,11 @@ @Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class xid_newobjectfunc extends FunctionPointer { +public class PyRefTracer extends FunctionPointer { static { Loader.load(); } /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public xid_newobjectfunc(Pointer p) { super(p); } - protected xid_newobjectfunc() { allocate(); } + public PyRefTracer(Pointer p) { super(p); } + protected PyRefTracer() { allocate(); } private native void allocate(); - public native PyObject call(_PyCrossInterpreterData arg0); + public native int call(PyObject arg0, @Cast("PyRefTracerEvent") int event, Pointer arg2); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PySliceObject.java b/cpython/src/gen/java/org/bytedeco/cpython/PySliceObject.java index 73ef6c00473..24220f5e10f 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/PySliceObject.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PySliceObject.java @@ -10,6 +10,7 @@ import static org.bytedeco.cpython.global.python.*; +// #endif /* Slice object interface */ diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PyThreadState.java b/cpython/src/gen/java/org/bytedeco/cpython/PyThreadState.java index df0c682ce4c..b8a0c98d3b3 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/PyThreadState.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyThreadState.java @@ -35,6 +35,11 @@ public class PyThreadState extends Pointer { public native PyThreadState next(); public native PyThreadState next(PyThreadState setter); public native PyInterpreterState interp(); public native PyThreadState interp(PyInterpreterState setter); + /* The global instrumentation version in high bits, plus flags indicating + when to break out of the interpreter loop in lower bits. See details in + pycore_ceval.h. */ + public native @Cast("uintptr_t") long eval_breaker(); public native PyThreadState eval_breaker(long setter); + /* Has been initialized to a safe state. In order to be effective, this must be set to 0 during or right @@ -49,6 +54,8 @@ public class PyThreadState extends Pointer { @Name("_status.bound_gilstate") public native @Cast("unsigned int") @NoOffset int _status_bound_gilstate(); public native PyThreadState _status_bound_gilstate(int setter); /* Currently in use (maybe holds the GIL). */ @Name("_status.active") public native @Cast("unsigned int") @NoOffset int _status_active(); public native PyThreadState _status_active(int setter); + /* Currently holds the GIL. */ + @Name("_status.holds_gil") public native @Cast("unsigned int") @NoOffset int _status_holds_gil(); public native PyThreadState _status_holds_gil(int setter); /* various stages of finalization */ @Name("_status.finalizing") public native @Cast("unsigned int") @NoOffset int _status_finalizing(); public native PyThreadState _status_finalizing(int setter); @@ -57,6 +64,13 @@ public class PyThreadState extends Pointer { /* padding to align to 4 bytes */ +// #ifdef Py_BUILD_CORE +// #endif + public native int _whence(); public native PyThreadState _whence(int setter); + + /* Thread state (_Py_THREAD_ATTACHED, _Py_THREAD_DETACHED, _Py_THREAD_SUSPENDED). + See Include/internal/pycore_pystate.h for more details. */ + public native int state(); public native PyThreadState state(int setter); public native int py_recursion_remaining(); public native PyThreadState py_recursion_remaining(int setter); public native int py_recursion_limit(); public native PyThreadState py_recursion_limit(int setter); @@ -70,9 +84,8 @@ public class PyThreadState extends Pointer { public native int tracing(); public native PyThreadState tracing(int setter); public native int what_event(); public native PyThreadState what_event(int setter); /* 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. */ - public native _PyCFrame cframe(); public native PyThreadState cframe(_PyCFrame setter); + /* Pointer to currently executing frame. */ + public native @Cast("_PyInterpreterFrame*") Pointer current_frame(); public native PyThreadState current_frame(Pointer setter); public native Py_tracefunc c_profilefunc(); public native PyThreadState c_profilefunc(Py_tracefunc setter); public native Py_tracefunc c_tracefunc(); public native PyThreadState c_tracefunc(Py_tracefunc setter); @@ -100,41 +113,14 @@ public class PyThreadState extends Pointer { */ public native @Cast("unsigned long") long native_thread_id(); public native PyThreadState native_thread_id(long setter); - public native @ByRef _py_trashcan trash(); public native PyThreadState trash(_py_trashcan setter); - - /* 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. + public native PyObject delete_later(); public native PyThreadState delete_later(PyObject setter); + + /* Tagged pointer to top-most critical section, or zero if there is no + * active critical section. Critical sections are only used in + * `--disable-gil` builds (i.e., when Py_GIL_DISABLED is defined to 1). In the + * default build, this field is always zero. */ - public static class On_delete_Pointer extends FunctionPointer { - static { Loader.load(); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public On_delete_Pointer(Pointer p) { super(p); } - protected On_delete_Pointer() { allocate(); } - private native void allocate(); - public native void call(Pointer arg0); - } - public native On_delete_Pointer on_delete(); public native PyThreadState on_delete(On_delete_Pointer setter); - public native Pointer on_delete_data(); public native PyThreadState on_delete_data(Pointer setter); + public native @Cast("uintptr_t") long critical_section(); public native PyThreadState critical_section(long setter); public native int coroutine_origin_tracking_depth(); public native PyThreadState coroutine_origin_tracking_depth(int setter); @@ -168,6 +154,15 @@ public static class On_delete_Pointer extends FunctionPointer { /* The thread's exception stack entry. (Always the last entry.) */ public native @ByRef _PyErr_StackItem exc_state(); public native PyThreadState exc_state(_PyErr_StackItem setter); - /* The bottom-most frame on the stack. */ - public native @ByRef _PyCFrame root_cframe(); public native PyThreadState root_cframe(_PyCFrame setter); + public native PyObject previous_executor(); public native PyThreadState previous_executor(PyObject setter); + + public native @Cast("uint64_t") long dict_global_version(); public native PyThreadState dict_global_version(long setter); + + /* Used to store/retrieve `threading.local` keys/values for this thread */ + public native PyObject threading_local_key(); public native PyThreadState threading_local_key(PyObject setter); + + /* Used by `threading.local`s to be remove keys/values for dying threads. + The PyThreadObject must hold the only reference to this value. + */ + public native PyObject threading_local_sentinel(); public native PyThreadState threading_local_sentinel(PyObject setter); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/PyTypeObject.java b/cpython/src/gen/java/org/bytedeco/cpython/PyTypeObject.java index eedd1b74c77..f6f2f66c873 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/PyTypeObject.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/PyTypeObject.java @@ -116,4 +116,5 @@ or tp_reserved (Python 3) */ /* bitset of which type-watchers care about this type */ public native @Cast("unsigned char") byte tp_watched(); public native PyTypeObject tp_watched(byte setter); + public native @Cast("uint16_t") short tp_versions_used(); public native PyTypeObject tp_versions_used(short setter); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/Py_AuditHookFunction.java b/cpython/src/gen/java/org/bytedeco/cpython/Py_AuditHookFunction.java index a26e2932525..7ff4095e55d 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/Py_AuditHookFunction.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/Py_AuditHookFunction.java @@ -10,6 +10,7 @@ import static org.bytedeco.cpython.global.python.*; +// #endif @Properties(inherit = org.bytedeco.cpython.presets.python.class) public class Py_AuditHookFunction extends FunctionPointer { diff --git a/cpython/src/gen/java/org/bytedeco/cpython/Py_tracefunc.java b/cpython/src/gen/java/org/bytedeco/cpython/Py_tracefunc.java index 207f2a79446..ac87beae047 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/Py_tracefunc.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/Py_tracefunc.java @@ -11,7 +11,6 @@ import static org.bytedeco.cpython.global.python.*; - /* State unique per thread */ /* Py_tracefunc return -1 when raising an exception, or 0 for success. */ diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_PyBytesWriter.java b/cpython/src/gen/java/org/bytedeco/cpython/_PyBytesWriter.java deleted file mode 100644 index a9623fae940..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/_PyBytesWriter.java +++ /dev/null @@ -1,57 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - - -/* 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. */ -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _PyBytesWriter extends Pointer { - static { Loader.load(); } - /** Default native constructor. */ - public _PyBytesWriter() { super((Pointer)null); allocate(); } - /** Native array allocator. Access with {@link Pointer#position(long)}. */ - public _PyBytesWriter(long size) { super((Pointer)null); allocateArray(size); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _PyBytesWriter(Pointer p) { super(p); } - private native void allocate(); - private native void allocateArray(long size); - @Override public _PyBytesWriter position(long position) { - return (_PyBytesWriter)super.position(position); - } - @Override public _PyBytesWriter getPointer(long i) { - return new _PyBytesWriter((Pointer)this).offsetAddress(i); - } - - /* bytes, bytearray or NULL (when the small buffer is used) */ - public native PyObject buffer(); public native _PyBytesWriter buffer(PyObject setter); - - /* Number of allocated size. */ - public native @Cast("Py_ssize_t") long allocated(); public native _PyBytesWriter allocated(long setter); - - /* Minimum number of allocated bytes, - incremented by _PyBytesWriter_Prepare() */ - public native @Cast("Py_ssize_t") long min_size(); public native _PyBytesWriter min_size(long setter); - - /* If non-zero, use a bytearray instead of a bytes object for buffer. */ - public native int use_bytearray(); public native _PyBytesWriter use_bytearray(int setter); - - /* If non-zero, overallocate the buffer (default: 0). - This flag must be zero if use_bytearray is non-zero. */ - public native int overallocate(); public native _PyBytesWriter overallocate(int setter); - - /* Stack buffer */ - public native int use_small_buffer(); public native _PyBytesWriter use_small_buffer(int setter); - public native @Cast("char") byte small_buffer(int i); public native _PyBytesWriter small_buffer(int i, byte setter); - @MemberGetter public native @Cast("char*") BytePointer small_buffer(); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_PyCFrame.java b/cpython/src/gen/java/org/bytedeco/cpython/_PyCFrame.java deleted file mode 100644 index 8bf4260711c..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/_PyCFrame.java +++ /dev/null @@ -1,47 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - -// Internal structure: you should not use it directly, but use public functions -// like PyThreadState_EnterTracing() and PyThreadState_LeaveTracing(). -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _PyCFrame extends Pointer { - static { Loader.load(); } - /** Default native constructor. */ - public _PyCFrame() { super((Pointer)null); allocate(); } - /** Native array allocator. Access with {@link Pointer#position(long)}. */ - public _PyCFrame(long size) { super((Pointer)null); allocateArray(size); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _PyCFrame(Pointer p) { super(p); } - private native void allocate(); - private native void allocateArray(long size); - @Override public _PyCFrame position(long position) { - return (_PyCFrame)super.position(position); - } - @Override public _PyCFrame getPointer(long i) { - return new _PyCFrame((Pointer)this).offsetAddress(i); - } - - /* 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) */ - public native @Cast("_PyInterpreterFrame*") Pointer current_frame(); public native _PyCFrame current_frame(Pointer setter); - public native _PyCFrame previous(); public native _PyCFrame previous(_PyCFrame setter); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_PyCompilerSrcLocation.java b/cpython/src/gen/java/org/bytedeco/cpython/_PyCompilerSrcLocation.java deleted file mode 100644 index e8fbfa094b6..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/_PyCompilerSrcLocation.java +++ /dev/null @@ -1,37 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - -/* source location information */ -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _PyCompilerSrcLocation extends Pointer { - static { Loader.load(); } - /** Default native constructor. */ - public _PyCompilerSrcLocation() { super((Pointer)null); allocate(); } - /** Native array allocator. Access with {@link Pointer#position(long)}. */ - public _PyCompilerSrcLocation(long size) { super((Pointer)null); allocateArray(size); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _PyCompilerSrcLocation(Pointer p) { super(p); } - private native void allocate(); - private native void allocateArray(long size); - @Override public _PyCompilerSrcLocation position(long position) { - return (_PyCompilerSrcLocation)super.position(position); - } - @Override public _PyCompilerSrcLocation getPointer(long i) { - return new _PyCompilerSrcLocation((Pointer)this).offsetAddress(i); - } - - public native int lineno(); public native _PyCompilerSrcLocation lineno(int setter); - public native int end_lineno(); public native _PyCompilerSrcLocation end_lineno(int setter); - public native int col_offset(); public native _PyCompilerSrcLocation col_offset(int setter); - public native int end_col_offset(); public native _PyCompilerSrcLocation end_col_offset(int setter); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_PyCrossInterpreterData.java b/cpython/src/gen/java/org/bytedeco/cpython/_PyCrossInterpreterData.java deleted file mode 100644 index 9900c171bdf..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/_PyCrossInterpreterData.java +++ /dev/null @@ -1,26 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - - -/* 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. -@Opaque @Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _PyCrossInterpreterData extends Pointer { - /** Empty constructor. Calls {@code super((Pointer)null)}. */ - public _PyCrossInterpreterData() { super((Pointer)null); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _PyCrossInterpreterData(Pointer p) { super(p); } -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_PyDictViewObject.java b/cpython/src/gen/java/org/bytedeco/cpython/_PyDictViewObject.java deleted file mode 100644 index 24ec1bbc418..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/_PyDictViewObject.java +++ /dev/null @@ -1,36 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - -/* _PyDictView */ - -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _PyDictViewObject extends Pointer { - static { Loader.load(); } - /** Default native constructor. */ - public _PyDictViewObject() { super((Pointer)null); allocate(); } - /** Native array allocator. Access with {@link Pointer#position(long)}. */ - public _PyDictViewObject(long size) { super((Pointer)null); allocateArray(size); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _PyDictViewObject(Pointer p) { super(p); } - private native void allocate(); - private native void allocateArray(long size); - @Override public _PyDictViewObject position(long position) { - return (_PyDictViewObject)super.position(position); - } - @Override public _PyDictViewObject getPointer(long i) { - return new _PyDictViewObject((Pointer)this).offsetAddress(i); - } - - public native @ByRef PyObject ob_base(); public native _PyDictViewObject ob_base(PyObject setter); - public native PyDictObject dv_dict(); public native _PyDictViewObject dv_dict(PyDictObject setter); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_PyExecutorArray.java b/cpython/src/gen/java/org/bytedeco/cpython/_PyExecutorArray.java new file mode 100644 index 00000000000..a0079924d72 --- /dev/null +++ b/cpython/src/gen/java/org/bytedeco/cpython/_PyExecutorArray.java @@ -0,0 +1,37 @@ +// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.cpython; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.cpython.global.python.*; + + + +@Properties(inherit = org.bytedeco.cpython.presets.python.class) +public class _PyExecutorArray extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public _PyExecutorArray() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public _PyExecutorArray(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public _PyExecutorArray(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public _PyExecutorArray position(long position) { + return (_PyExecutorArray)super.position(position); + } + @Override public _PyExecutorArray getPointer(long i) { + return new _PyExecutorArray((Pointer)this).offsetAddress(i); + } + + public native int size(); public native _PyExecutorArray size(int setter); + public native @Name("capacity") int _capacity(); public native _PyExecutorArray _capacity(int setter); + public native @Cast("_PyExecutorObject*") Pointer executors(int i); public native _PyExecutorArray executors(int i, Pointer setter); + @MemberGetter public native @Cast("_PyExecutorObject**") PointerPointer executors(); +} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_PyLongValue.java b/cpython/src/gen/java/org/bytedeco/cpython/_PyLongValue.java index b39591bef8d..2e4f2a34923 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/_PyLongValue.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/_PyLongValue.java @@ -12,21 +12,32 @@ /* Long integer representation. + + Long integers are made up of a number of 30- or 15-bit digits, depending on + the platform. The number of digits (ndigits) is stored in the high bits of + the lv_tag field (lvtag >> _PyLong_NON_SIZE_BITS). + 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 + SUM(for i=0 through ndigits-1) ob_digit[i] * 2**(PyLong_SHIFT*i) + + The sign of the value is stored in the lower 2 bits of lv_tag. + + - 0: Positive + - 1: Zero + - 2: Negative + + The third lowest bit of lv_tag is reserved for an immortality flag, but is + not currently used. + + In a normalized number, ob_digit[ndigits-1] (the most significant digit) is never zero. Also, in all cases, for all valid i, - 0 <= ob_digit[i] <= MASK. + 0 <= ob_digit[i] <= PyLong_MASK. + The allocation function takes care of allocating extra memory - so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available. + so that ob_digit[0] ... ob_digit[ndigits-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 + is always safe. However, in the case ndigits == 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. */ @Properties(inherit = org.bytedeco.cpython.presets.python.class) diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_PyUnicodeWriter.java b/cpython/src/gen/java/org/bytedeco/cpython/_PyUnicodeWriter.java index 371003fda5d..0a6d5eb6df8 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/_PyUnicodeWriter.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/_PyUnicodeWriter.java @@ -11,6 +11,7 @@ import static org.bytedeco.cpython.global.python.*; + /* --- _PyUnicodeWriter API ----------------------------------------------- */ @Properties(inherit = org.bytedeco.cpython.presets.python.class) diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_Py_CODEUNIT.java b/cpython/src/gen/java/org/bytedeco/cpython/_Py_CODEUNIT.java deleted file mode 100644 index d778d28860b..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/_Py_CODEUNIT.java +++ /dev/null @@ -1,44 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - -/* 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. - */ - -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _Py_CODEUNIT extends Pointer { - static { Loader.load(); } - /** Default native constructor. */ - public _Py_CODEUNIT() { super((Pointer)null); allocate(); } - /** Native array allocator. Access with {@link Pointer#position(long)}. */ - public _Py_CODEUNIT(long size) { super((Pointer)null); allocateArray(size); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _Py_CODEUNIT(Pointer p) { super(p); } - private native void allocate(); - private native void allocateArray(long size); - @Override public _Py_CODEUNIT position(long position) { - return (_Py_CODEUNIT)super.position(position); - } - @Override public _Py_CODEUNIT getPointer(long i) { - return new _Py_CODEUNIT((Pointer)this).offsetAddress(i); - } - - public native @Cast("uint16_t") short cache(); public native _Py_CODEUNIT cache(short setter); - @Name("op.code") public native @Cast("uint8_t") byte op_code(); public native _Py_CODEUNIT op_code(byte setter); - @Name("op.arg") public native @Cast("uint8_t") byte op_arg(); public native _Py_CODEUNIT op_arg(byte setter); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_Py_HashSecret_t.java b/cpython/src/gen/java/org/bytedeco/cpython/_Py_HashSecret_t.java deleted file mode 100644 index 386366f9490..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/_Py_HashSecret_t.java +++ /dev/null @@ -1,69 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - - -/* 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 -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _Py_HashSecret_t extends Pointer { - static { Loader.load(); } - /** Default native constructor. */ - public _Py_HashSecret_t() { super((Pointer)null); allocate(); } - /** Native array allocator. Access with {@link Pointer#position(long)}. */ - public _Py_HashSecret_t(long size) { super((Pointer)null); allocateArray(size); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _Py_HashSecret_t(Pointer p) { super(p); } - private native void allocate(); - private native void allocateArray(long size); - @Override public _Py_HashSecret_t position(long position) { - return (_Py_HashSecret_t)super.position(position); - } - @Override public _Py_HashSecret_t getPointer(long i) { - return new _Py_HashSecret_t((Pointer)this).offsetAddress(i); - } - - /* ensure 24 bytes */ - public native @Cast("unsigned char") byte uc(int i); public native _Py_HashSecret_t uc(int i, byte setter); - @MemberGetter public native @Cast("unsigned char*") BytePointer uc(); - /* two Py_hash_t for FNV */ - @Name("fnv.prefix") public native @Cast("Py_hash_t") long fnv_prefix(); public native _Py_HashSecret_t fnv_prefix(long setter); - @Name("fnv.suffix") public native @Cast("Py_hash_t") long fnv_suffix(); public native _Py_HashSecret_t fnv_suffix(long setter); - /* two uint64 for SipHash24 */ - @Name("siphash.k0") public native @Cast("uint64_t") long siphash_k0(); public native _Py_HashSecret_t siphash_k0(long setter); - @Name("siphash.k1") public native @Cast("uint64_t") long siphash_k1(); public native _Py_HashSecret_t siphash_k1(long setter); - /* a different (!) Py_hash_t for small string optimization */ - @Name("djbx33a.padding") public native @Cast("unsigned char") byte djbx33a_padding(int i); public native _Py_HashSecret_t djbx33a_padding(int i, byte setter); - @Name("djbx33a.padding") @MemberGetter public native @Cast("unsigned char*") BytePointer djbx33a_padding(); - @Name("djbx33a.suffix") public native @Cast("Py_hash_t") long djbx33a_suffix(); public native _Py_HashSecret_t djbx33a_suffix(long setter); - @Name("expat.padding") public native @Cast("unsigned char") byte expat_padding(int i); public native _Py_HashSecret_t expat_padding(int i, byte setter); - @Name("expat.padding") @MemberGetter public native @Cast("unsigned char*") BytePointer expat_padding(); - @Name("expat.hashsalt") public native @Cast("Py_hash_t") long expat_hashsalt(); public native _Py_HashSecret_t expat_hashsalt(long setter); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_Py_Identifier.java b/cpython/src/gen/java/org/bytedeco/cpython/_Py_Identifier.java index f2ee2a90996..e8d52382849 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/_Py_Identifier.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/_Py_Identifier.java @@ -11,9 +11,6 @@ import static org.bytedeco.cpython.global.python.*; -// #ifdef Py_TRACE_REFS -// #endif - // #ifdef Py_REF_DEBUG // #endif @@ -60,4 +57,6 @@ public class _Py_Identifier extends Pointer { // Index in PyInterpreterState.unicode.ids.array. It is process-wide // unique and must be initialized to -1. public native @Cast("Py_ssize_t") long index(); public native _Py_Identifier index(long setter); + // Hidden PyMutex struct for non free-threaded build. + @Name("mutex.v") public native @Cast("uint8_t") byte mutex_v(); public native _Py_Identifier mutex_v(byte setter); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_Py_LocalMonitors.java b/cpython/src/gen/java/org/bytedeco/cpython/_Py_LocalMonitors.java index 06797cc40aa..9771e58fefe 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/_Py_LocalMonitors.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/_Py_LocalMonitors.java @@ -12,7 +12,6 @@ /* Tables of which tools are active for each monitored event. */ -/* For 3.12 ABI compatibility this is over sized */ @Properties(inherit = org.bytedeco.cpython.presets.python.class) public class _Py_LocalMonitors extends Pointer { static { Loader.load(); } @@ -31,7 +30,6 @@ public class _Py_LocalMonitors extends Pointer { return new _Py_LocalMonitors((Pointer)this).offsetAddress(i); } - /* Only _PY_MONITORING_LOCAL_EVENTS of these are used */ public native @Cast("uint8_t") byte tools(int i); public native _Py_LocalMonitors tools(int i, byte setter); @MemberGetter public native @Cast("uint8_t*") BytePointer tools(); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_Py_clock_info_t.java b/cpython/src/gen/java/org/bytedeco/cpython/_Py_clock_info_t.java deleted file mode 100644 index 50d922c2b13..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/_Py_clock_info_t.java +++ /dev/null @@ -1,37 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - -/* Structure used by time.get_clock_info() */ -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _Py_clock_info_t extends Pointer { - static { Loader.load(); } - /** Default native constructor. */ - public _Py_clock_info_t() { super((Pointer)null); allocate(); } - /** Native array allocator. Access with {@link Pointer#position(long)}. */ - public _Py_clock_info_t(long size) { super((Pointer)null); allocateArray(size); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _Py_clock_info_t(Pointer p) { super(p); } - private native void allocate(); - private native void allocateArray(long size); - @Override public _Py_clock_info_t position(long position) { - return (_Py_clock_info_t)super.position(position); - } - @Override public _Py_clock_info_t getPointer(long i) { - return new _Py_clock_info_t((Pointer)this).offsetAddress(i); - } - - public native @Cast("const char*") BytePointer implementation(); public native _Py_clock_info_t implementation(BytePointer setter); - public native int monotonic(); public native _Py_clock_info_t monotonic(int setter); - public native int adjustable(); public native _Py_clock_info_t adjustable(int setter); - public native double resolution(); public native _Py_clock_info_t resolution(double setter); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_frozen.java b/cpython/src/gen/java/org/bytedeco/cpython/_frozen.java index 3f2d492785a..807a34bdd50 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/_frozen.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/_frozen.java @@ -33,13 +33,4 @@ public class _frozen extends Pointer { public native @Cast("const unsigned char*") BytePointer code(); public native _frozen code(BytePointer setter); public native int size(); public native _frozen size(int setter); public native int is_package(); public native _frozen is_package(int setter); - public static class PyObject_Get_code extends FunctionPointer { - static { Loader.load(); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public PyObject_Get_code(Pointer p) { super(p); } - protected PyObject_Get_code() { allocate(); } - private native void allocate(); - public native PyObject call(); - } - public native PyObject_Get_code get_code(); public native _frozen get_code(PyObject_Get_code setter); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_object.java b/cpython/src/gen/java/org/bytedeco/cpython/_object.java index 331ace35803..be8319ee9e3 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/_object.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/_object.java @@ -16,6 +16,7 @@ * by hand. Similarly every pointer to a variable-size Python object can, * in addition, be cast to PyVarObject*. */ +// #ifndef Py_GIL_DISABLED @Properties(inherit = org.bytedeco.cpython.presets.python.class) public class _object extends Pointer { static { Loader.load(); } @@ -34,7 +35,7 @@ public class _object extends Pointer { return new _object((Pointer)this).offsetAddress(i); } -// #if (defined(__GNUC__) || defined(__clang__)) +// #if (defined(__GNUC__) || defined(__clang__)) // && !(defined __STDC_VERSION__ && __STDC_VERSION__ >= 201112L) // On C99 and older, anonymous union is a GCC and clang extension // #endif diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_py_trashcan.java b/cpython/src/gen/java/org/bytedeco/cpython/_py_trashcan.java deleted file mode 100644 index a76245566a6..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/_py_trashcan.java +++ /dev/null @@ -1,34 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _py_trashcan extends Pointer { - static { Loader.load(); } - /** Default native constructor. */ - public _py_trashcan() { super((Pointer)null); allocate(); } - /** Native array allocator. Access with {@link Pointer#position(long)}. */ - public _py_trashcan(long size) { super((Pointer)null); allocateArray(size); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _py_trashcan(Pointer p) { super(p); } - private native void allocate(); - private native void allocateArray(long size); - @Override public _py_trashcan position(long position) { - return (_py_trashcan)super.position(position); - } - @Override public _py_trashcan getPointer(long i) { - return new _py_trashcan((Pointer)this).offsetAddress(i); - } - - public native int delete_nesting(); public native _py_trashcan delete_nesting(int setter); - public native PyObject delete_later(); public native _py_trashcan delete_later(PyObject setter); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_specialization_cache.java b/cpython/src/gen/java/org/bytedeco/cpython/_specialization_cache.java index 9bd2d3796ea..68f4cff13bc 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/_specialization_cache.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/_specialization_cache.java @@ -12,7 +12,7 @@ /* This struct is used by the specializer - * It should should be treated as an opaque blob + * It should be treated as an opaque blob * by code other than the specializer and interpreter. */ @Properties(inherit = org.bytedeco.cpython.presets.python.class) public class _specialization_cache extends Pointer { @@ -44,4 +44,5 @@ public class _specialization_cache extends Pointer { // *args nor **kwargs (as required by BINARY_SUBSCR_GETITEM): public native PyObject getitem(); public native _specialization_cache getitem(PyObject setter); public native @Cast("uint32_t") int getitem_version(); public native _specialization_cache getitem_version(int setter); + public native PyObject init(); public native _specialization_cache init(PyObject setter); } diff --git a/cpython/src/gen/java/org/bytedeco/cpython/_xid.java b/cpython/src/gen/java/org/bytedeco/cpython/_xid.java deleted file mode 100644 index ad322dc875a..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/_xid.java +++ /dev/null @@ -1,68 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class _xid extends Pointer { - static { Loader.load(); } - /** Default native constructor. */ - public _xid() { super((Pointer)null); allocate(); } - /** Native array allocator. Access with {@link Pointer#position(long)}. */ - public _xid(long size) { super((Pointer)null); allocateArray(size); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public _xid(Pointer p) { super(p); } - private native void allocate(); - private native void allocateArray(long size); - @Override public _xid position(long position) { - return (_xid)super.position(position); - } - @Override public _xid getPointer(long i) { - return new _xid((Pointer)this).offsetAddress(i); - } - - // 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. - public native Pointer data(); public native _xid data(Pointer setter); - // 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). - public native PyObject obj(); public native _xid obj(PyObject setter); - // 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). - public native @Cast("int64_t") long interp(); public native _xid interp(long setter); - // 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. - public native xid_newobjectfunc new_object(); public native _xid new_object(xid_newobjectfunc setter); - // 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. - public native @Name("free") xid_freefunc _free(); public native _xid _free(xid_freefunc setter); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/crossinterpdatafunc.java b/cpython/src/gen/java/org/bytedeco/cpython/crossinterpdatafunc.java deleted file mode 100644 index 0cc22be2bbd..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/crossinterpdatafunc.java +++ /dev/null @@ -1,25 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - - -/* cross-interpreter data registry */ - -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class crossinterpdatafunc extends FunctionPointer { - static { Loader.load(); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public crossinterpdatafunc(Pointer p) { super(p); } - protected crossinterpdatafunc() { allocate(); } - private native void allocate(); - public native int call(PyThreadState tstate, PyObject arg1, - _PyCrossInterpreterData arg2); -} diff --git a/cpython/src/gen/java/org/bytedeco/cpython/gcvisitobjects_t.java b/cpython/src/gen/java/org/bytedeco/cpython/gcvisitobjects_t.java index c3536c61122..2cfe9b8def0 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/gcvisitobjects_t.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/gcvisitobjects_t.java @@ -12,7 +12,6 @@ -// #if !defined(Py_LIMITED_API) /* 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 diff --git a/cpython/src/gen/java/org/bytedeco/cpython/global/python.java b/cpython/src/gen/java/org/bytedeco/cpython/global/python.java index 0559c346d66..16c6db38465 100644 --- a/cpython/src/gen/java/org/bytedeco/cpython/global/python.java +++ b/cpython/src/gen/java/org/bytedeco/cpython/global/python.java @@ -22,38 +22,66 @@ public class python extends org.bytedeco.cpython.helper.python { // #ifndef Py_PYTHON_H // #define Py_PYTHON_H -// Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { +// Since this is a "meta-include" file, "#ifdef __cplusplus / extern "C" {" +// is not needed. + // Include Python header files // #include "patchlevel.h" // #include "pyconfig.h" // #include "pymacconfig.h" -// #if defined(__sgi) && !defined(_SGI_MP_SOURCE) -// # define _SGI_MP_SOURCE + +// Include standard header files +// #include // assert() +// #include // uintptr_t +// #include // INT_MAX +// #include // HUGE_VAL +// #include // va_list +// #include // wchar_t +// #ifdef HAVE_SYS_TYPES_H +// # include // ssize_t // #endif -// 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. +// , , and headers are no longer used +// by Python, but kept for the backward compatibility of existing third party C +// extensions. They are not included by limited C API version 3.11 and newer. +// +// The and headers are not included by limited C API +// version 3.13 and newer. // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 // #endif -// #ifndef MS_WINDOWS -// # include +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030d0000 +// # include // tolower() +// # ifndef MS_WINDOWS +// # include // close() +// # endif // #endif -// #ifdef HAVE_STDDEF_H -// # include // size_t + +// gh-111506: The free-threaded build is not compatible with the limited API +// or the stable ABI. +// #if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED) +// # error "The limited API is not currently supported in the free-threaded build" // #endif -// #include // assert() -// #include // wchar_t +// #if defined(Py_GIL_DISABLED) && defined(_MSC_VER) +// # include // __readgsqword() +// #endif + +// #if defined(Py_GIL_DISABLED) && defined(__MINGW32__) +// # include // __readgsqword() +// #endif +// Include Python header files // #include "pyport.h" // #include "pymacro.h" // #include "pymath.h" // #include "pymem.h" // #include "pytypedefs.h" // #include "pybuffer.h" +// #include "pystats.h" +// #include "pyatomic.h" +// #include "lock.h" // #include "object.h" // #include "objimpl.h" // #include "typeslots.h" @@ -62,8 +90,6 @@ public class python extends org.bytedeco.cpython.helper.python { // #include "bytearrayobject.h" // #include "bytesobject.h" // #include "unicodeobject.h" -// #include "cpython/initconfig.h" -// #include "pystate.h" // #include "pyerrors.h" // #include "longobject.h" // #include "cpython/longintrepr.h" @@ -80,6 +106,7 @@ public class python extends org.bytedeco.cpython.helper.python { // #include "setobject.h" // #include "methodobject.h" // #include "moduleobject.h" +// #include "monitoring.h" // #include "cpython/funcobject.h" // #include "cpython/classobject.h" // #include "fileobject.h" @@ -90,6 +117,8 @@ public class python extends org.bytedeco.cpython.helper.python { // #include "sliceobject.h" // #include "cpython/cellobject.h" // #include "iterobject.h" +// #include "cpython/initconfig.h" +// #include "pystate.h" // #include "cpython/genobject.h" // #include "descrobject.h" // #include "genericaliasobject.h" @@ -112,12 +141,13 @@ public class python extends org.bytedeco.cpython.helper.python { // #include "import.h" // #include "abstract.h" // #include "bltinmodule.h" +// #include "critical_section.h" // #include "cpython/pyctype.h" // #include "pystrtod.h" // #include "pystrcmp.h" // #include "fileutils.h" // #include "cpython/pyfpe.h" -// #include "tracemalloc.h" +// #include "cpython/tracemalloc.h" // #endif /* !Py_PYTHON_H */ @@ -143,13 +173,13 @@ There is also (independent) API version information in modsupport.h. /* Version parsed out into numeric values */ /*--start constants--*/ public static final int PY_MAJOR_VERSION = 3; -public static final int PY_MINOR_VERSION = 12; -public static final int PY_MICRO_VERSION = 7; +public static final int PY_MINOR_VERSION = 13; +public static final int PY_MICRO_VERSION = 0; public static final int PY_RELEASE_LEVEL = PY_RELEASE_LEVEL_FINAL; public static final int PY_RELEASE_SERIAL = 0; /* Version as a string */ -public static final String PY_VERSION = "3.12.7"; +public static final String PY_VERSION = "3.13.0"; /*--end constants--*/ /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. @@ -323,6 +353,12 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the `clock_settime' function. */ public static final int HAVE_CLOCK_SETTIME = 1; +/* Define to 1 if the system has the type `clock_t'. */ +public static final int HAVE_CLOCK_T = 1; + +/* Define to 1 if you have the `closefrom' function. */ +public static final int HAVE_CLOSEFROM = 1; + /* Define to 1 if you have the `close_range' function. */ public static final int HAVE_CLOSE_RANGE = 1; @@ -341,12 +377,6 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the `copy_file_range' function. */ public static final int HAVE_COPY_FILE_RANGE = 1; -/* Define to 1 if you have the header file. */ -public static final int HAVE_CRYPT_H = 1; - -/* Define if you have the crypt_r() function. */ -public static final int HAVE_CRYPT_R = 1; - /* Define to 1 if you have the `ctermid' function. */ public static final int HAVE_CTERMID = 1; @@ -643,6 +673,9 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the `getgid' function. */ public static final int HAVE_GETGID = 1; +/* Define to 1 if you have the `getgrent' function. */ +public static final int HAVE_GETGRENT = 1; + /* Define to 1 if you have the `getgrgid' function. */ public static final int HAVE_GETGRGID = 1; @@ -770,6 +803,9 @@ There is also (independent) API version information in modsupport.h. bcopy. */ /* #undef HAVE_GLIBC_MEMMOVE_BUG */ +/* Define to 1 if you have the `grantpt' function. */ +public static final int HAVE_GRANTPT = 1; + /* Define to 1 if you have the header file. */ public static final int HAVE_GRP_H = 1; @@ -779,9 +815,6 @@ There is also (independent) API version information in modsupport.h. /* Define this if you have le64toh() */ public static final int HAVE_HTOLE64 = 1; -/* Define to 1 if you have the header file. */ -/* #undef HAVE_IEEEFP_H */ - /* Define to 1 if you have the `if_nameindex' function. */ public static final int HAVE_IF_NAMEINDEX = 1; @@ -992,12 +1025,33 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the `nanosleep' function. */ public static final int HAVE_NANOSLEEP = 1; -/* Define to 1 if you have the `ncursesw' library. */ +/* Define if you have the 'ncurses' library */ +/* #undef HAVE_NCURSES */ + +/* Define if you have the 'ncursesw' library */ /* #undef HAVE_NCURSESW */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSESW_CURSES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSESW_NCURSES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSESW_PANEL_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSES_CURSES_H */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_NCURSES_H */ +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSES_NCURSES_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NCURSES_PANEL_H */ + /* Define to 1 if you have the header file. */ public static final int HAVE_NDBM_H = 1; @@ -1013,6 +1067,9 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the header file. */ public static final int HAVE_NETINET_IN_H = 1; +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETLINK_NETLINK_H */ + /* Define to 1 if you have the header file. */ public static final int HAVE_NETPACKET_PACKET_H = 1; @@ -1038,6 +1095,12 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the `openpty' function. */ public static final int HAVE_OPENPTY = 1; +/* Define if you have the 'panel' library */ +/* #undef HAVE_PANEL */ + +/* Define if you have the 'panelw' library */ +/* #undef HAVE_PANELW */ + /* Define to 1 if you have the header file. */ /* #undef HAVE_PANEL_H */ @@ -1068,12 +1131,19 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the `posix_fallocate' function. */ public static final int HAVE_POSIX_FALLOCATE = 1; +/* Define to 1 if you have the `posix_openpt' function. */ +public static final int HAVE_POSIX_OPENPT = 1; + /* Define to 1 if you have the `posix_spawn' function. */ public static final int HAVE_POSIX_SPAWN = 1; /* Define to 1 if you have the `posix_spawnp' function. */ public static final int HAVE_POSIX_SPAWNP = 1; +/* Define to 1 if you have the `posix_spawn_file_actions_addclosefrom_np' + function. */ +public static final int HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSEFROM_NP = 1; + /* Define to 1 if you have the `pread' function. */ public static final int HAVE_PREAD = 1; @@ -1089,12 +1159,19 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the header file. */ /* #undef HAVE_PROCESS_H */ +/* Define to 1 if you have the `process_vm_readv' function. */ +public static final int HAVE_PROCESS_VM_READV = 1; + /* Define if your compiler supports function prototype */ public static final int HAVE_PROTOTYPES = 1; /* Define to 1 if you have the `pthread_condattr_setclock' function. */ public static final int HAVE_PTHREAD_CONDATTR_SETCLOCK = 1; +/* Define to 1 if you have the `pthread_cond_timedwait_relative_np' function. + */ +/* #undef HAVE_PTHREAD_COND_TIMEDWAIT_RELATIVE_NP */ + /* Defined for Solaris 2.6 bug in pthread header. */ /* #undef HAVE_PTHREAD_DESTRUCTOR */ @@ -1116,6 +1193,12 @@ There is also (independent) API version information in modsupport.h. /* Define if platform requires stubbed pthreads support */ /* #undef HAVE_PTHREAD_STUBS */ +/* Define to 1 if you have the `ptsname' function. */ +public static final int HAVE_PTSNAME = 1; + +/* Define to 1 if you have the `ptsname_r' function. */ +public static final int HAVE_PTSNAME_R = 1; + /* Define to 1 if you have the header file. */ public static final int HAVE_PTY_H = 1; @@ -1155,7 +1238,7 @@ There is also (independent) API version information in modsupport.h. /* Define if you can turn off readline's signal handling. */ /* #undef HAVE_RL_CATCH_SIGNAL */ -/* Define if readline supports rl_compdisp_func_t */ +/* Define to 1 if the system has the type `rl_compdisp_func_t'. */ /* #undef HAVE_RL_COMPDISP_FUNC_T */ /* Define if you have readline 2.2 */ @@ -1176,9 +1259,6 @@ There is also (independent) API version information in modsupport.h. /* Define if you have readline 4.0 */ /* #undef HAVE_RL_RESIZE_TERMINAL */ -/* Define to 1 if you have the header file. */ -/* #undef HAVE_RPC_RPC_H */ - /* Define to 1 if you have the `rtpSpawn' function. */ /* #undef HAVE_RTPSPAWN */ @@ -1344,13 +1424,16 @@ There is also (independent) API version information in modsupport.h. /* Define if you have the 'socketpair' function. */ public static final int HAVE_SOCKETPAIR = 1; +/* Define to 1 if the system has the type `socklen_t'. */ +public static final int HAVE_SOCKLEN_T = 1; + /* Define to 1 if you have the header file. */ public static final int HAVE_SPAWN_H = 1; /* Define to 1 if you have the `splice' function. */ public static final int HAVE_SPLICE = 1; -/* Define if your compiler provides ssize_t */ +/* Define to 1 if the system has the type `ssize_t'. */ public static final int HAVE_SSIZE_T = 1; /* Define to 1 if you have the `statvfs' function. */ @@ -1541,6 +1624,9 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the header file. */ /* #undef HAVE_SYS_TERMIO_H */ +/* Define to 1 if you have the header file. */ +public static final int HAVE_SYS_TIMERFD_H = 1; + /* Define to 1 if you have the header file. */ public static final int HAVE_SYS_TIMES_H = 1; @@ -1583,6 +1669,9 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the `timegm' function. */ public static final int HAVE_TIMEGM = 1; +/* Define if you have the 'timerfd_create' function. */ +public static final int HAVE_TIMERFD_CREATE = 1; + /* Define to 1 if you have the `times' function. */ public static final int HAVE_TIMES = 1; @@ -1621,6 +1710,9 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the `unlinkat' function. */ public static final int HAVE_UNLINKAT = 1; +/* Define to 1 if you have the `unlockpt' function. */ +public static final int HAVE_UNLOCKPT = 1; + /* Define to 1 if you have the `unshare' function. */ public static final int HAVE_UNSHARE = 1; @@ -1708,6 +1800,9 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if you have the `_getpty' function. */ /* #undef HAVE__GETPTY */ +/* Define to 1 if the system has the type `__uint128_t'. */ +public static final int HAVE___UINT128_T = 1; + /* Define to 1 if `major', `minor', and `makedev' are declared in . */ /* #undef MAJOR_IN_MKDEV */ @@ -1717,7 +1812,7 @@ There is also (independent) API version information in modsupport.h. public static final int MAJOR_IN_SYSMACROS = 1; /* Define if mvwdelch in curses.h is an expression. */ -/* #undef MVWDELCH_IS_EXPRESSION */ +public static final int MVWDELCH_IS_EXPRESSION = 1; /* Define to the address where bug reports for this package should be sent. */ /* #undef PACKAGE_BUGREPORT */ @@ -1780,10 +1875,16 @@ There is also (independent) API version information in modsupport.h. /* Defined if Python is built as a shared library. */ public static final int Py_ENABLE_SHARED = 1; +/* Define if you want to disable the GIL */ +/* #undef Py_GIL_DISABLED */ + /* Define hash algorithm for str, bytes and memoryview. SipHash24: 1, FNV: 2, SipHash13: 3, externally defined: 0 */ /* #undef Py_HASH_ALGORITHM */ +/* Define if rl_startup_hook takes arguments */ +/* #undef Py_RL_STARTUP_HOOK_TAKES_ARGS */ + /* Define if you want to enable internal statistics gathering. */ /* #undef Py_STATS */ @@ -1990,6 +2091,9 @@ There is also (independent) API version information in modsupport.h. /* Define to 1 if libintl is needed for locale functions. */ /* #undef WITH_LIBINTL */ +/* Define if you want to compile in mimalloc memory allocator. */ +public static final int WITH_MIMALLOC = 1; + /* Define if you want to produce an OpenStep/Rhapsody framework (shared library plus accessory files). */ /* #undef WITH_NEXT_FRAMEWORK */ @@ -2062,7 +2166,7 @@ significant byte first (like Motorola and SPARC, unlike Intel). */ /* Define on FreeBSD to activate all library features */ public static final int __BSD_VISIBLE = 1; -/* Define to 'long' if doesn't define. */ +/* Define to 'long' if does not define clock_t. */ /* #undef clock_t */ /* Define to empty if `const' does not conform to ANSI C. */ @@ -2086,7 +2190,7 @@ significant byte first (like Motorola and SPARC, unlike Intel). */ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ -/* Define to `int' if does not define. */ +/* Define to 'int' if does not define. */ /* #undef socklen_t */ /* Define to `int' if doesn't define. */ @@ -2104,81 +2208,73 @@ significant byte first (like Motorola and SPARC, unlike Intel). */ // Parsed from pymacconfig.h -// #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 defined(__APPLE__) - -// # undef ALIGNOF_MAX_ALIGN_T -// # undef SIZEOF_LONG -// # undef SIZEOF_LONG_DOUBLE -// # 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 HAVE_GCC_ASM_FOR_X64 - -// # undef VA_LIST_IS_ARRAY -// # if defined(__LP64__) && defined(__x86_64__) +// This file moves some of the autoconf magic to compile-time when building on +// macOS. 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. + +// #ifndef PY_MACCONFIG_H +// #define PY_MACCONFIG_H +// #ifdef __APPLE__ + +// #undef ALIGNOF_MAX_ALIGN_T +// #undef SIZEOF_LONG +// #undef SIZEOF_LONG_DOUBLE +// #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 HAVE_GCC_ASM_FOR_X64 + +// #undef VA_LIST_IS_ARRAY +// #if defined(__LP64__) && defined(__x86_64__) public static final int VA_LIST_IS_ARRAY = 1; -// # endif +// #endif -// # undef HAVE_LARGEFILE_SUPPORT -// # ifndef __LP64__ +// #undef HAVE_LARGEFILE_SUPPORT +// #ifndef __LP64__ public static final int HAVE_LARGEFILE_SUPPORT = 1; -// # endif - -// # undef SIZEOF_LONG -// # ifdef __LP64__ -// # else -// # ifdef __ppc__ -// # else -// # endif -// # endif - -// # if defined(__LP64__) - /* 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. - */ +// #endif - /* In 64-bit mode setpgrp always has no arguments, in 32-bit - * mode that depends on the compilation environment - */ -// # undef SETPGRP_HAVE_ARG +// #undef SIZEOF_LONG +// #ifdef __LP64__ +// #else +// # ifdef __ppc__ +// # else +// # endif +// #endif -// # endif +// macOS 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 +// #if defined(__LP64__) +// # undef SETPGRP_HAVE_ARG +// #endif // #ifdef __BIG_ENDIAN__ -// #define DOUBLE_IS_BIG_ENDIAN_IEEE754 +// # define DOUBLE_IS_BIG_ENDIAN_IEEE754 // #else -// #define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 -// #endif /* __BIG_ENDIAN */ +// # define DOUBLE_IS_LITTLE_ENDIAN_IEEE754 +// #endif // #if defined(__i386__) || defined(__x86_64__) -// # define HAVE_GCC_ASM_FOR_X87 +// # define HAVE_GCC_ASM_FOR_X87 // #else // #endif - -// #endif /* defined(_APPLE__) */ - -// #endif /* PYMACCONFIG_H */ +// #endif // __APPLE__ +// #endif // !PY_MACCONFIG_H // Parsed from pyport.h @@ -2186,13 +2282,8 @@ significant byte first (like Motorola and SPARC, unlike Intel). */ // #ifndef Py_PYPORT_H // #define Py_PYPORT_H -// #include "pyconfig.h" /* include for defines */ - -// #include - -// #include // #ifndef UCHAR_MAX -// # error "limits.h must define UCHAR_MAX" +// # error " header must define UCHAR_MAX" // #endif // #if UCHAR_MAX != 255 // # error "Python's source code assumes C's unsigned char is an 8-bit type" @@ -2209,9 +2300,10 @@ significant byte first (like Motorola and SPARC, unlike Intel). */ // #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 defined(__cplusplus) && __cplusplus >= 201103 +// to prevent C++ compiler warnings. On C23 and newer and on C++11 and newer, +// _Py_NULL is defined as nullptr. +// #if (defined (__STDC_VERSION__) && __STDC_VERSION__ > 201710L) +// || (defined(__cplusplus) && __cplusplus >= 201103) // # define _Py_NULL nullptr // #else // # define _Py_NULL NULL @@ -2371,67 +2463,6 @@ significant byte first (like Motorola and SPARC, unlike Intel). */ // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 // #endif -// #ifdef HAVE_IEEEFP_H -// #include /* needed for 'finite' declaration on some platforms */ -// #endif - -// #include /* Moved here from the math section, before extern "C" */ - -/******************************************** - * WRAPPER FOR and/or * - ********************************************/ - -// #ifdef HAVE_SYS_TIME_H -// #include -// #endif -// #include - -/****************************** - * WRAPPER FOR * - ******************************/ - -/* NB caller must include */ - -// #ifdef HAVE_SYS_SELECT_H -// #include -// #endif /* !HAVE_SYS_SELECT_H */ - -/******************************* - * stat() and fstat() fiddling * - *******************************/ - -// #ifdef HAVE_SYS_STAT_H -// #include -// #elif defined(HAVE_STAT_H) -// #endif - -// #ifndef S_IFMT -/* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */ -public static final int S_IFMT = 0170000; -// #endif - -// #ifndef S_IFLNK -/* Windows doesn't define S_IFLNK but posixmodule.c maps - * IO_REPARSE_TAG_SYMLINK to S_IFLNK */ -public static final int S_IFLNK = 0120000; -// #endif - -// #ifndef S_ISREG -// #define S_ISREG(x) (((x) & S_IFMT) == S_IFREG) -// #endif - -// #ifndef S_ISDIR -// #define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR) -// #endif - -// #ifndef S_ISCHR -// #define S_ISCHR(x) (((x) & S_IFMT) == S_IFCHR) -// #endif - -// #ifndef S_ISLNK -// #define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK) -// #endif - // #ifdef __cplusplus /* Move this down here since some C++ #include's don't like to be included inside an extern "C" */ @@ -2598,111 +2629,15 @@ significant byte first (like Motorola and SPARC, unlike Intel). */ // # define Py_NO_INLINE // #endif -/************************************************************************** -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 -// #endif - -/* 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 defined(HAVE_SYS_TERMIO_H) && !defined(__hpux) -// #include -// #endif - - -/* 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 defined(__APPLE__) -// # define _PY_PORT_CTYPE_UTF8_ISSUE -// #endif - -// #ifdef _PY_PORT_CTYPE_UTF8_ISSUE -// #endif - - -/* 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 defined(__CYGWIN__) -// # define HAVE_DECLSPEC_DLL -// #endif - // #include "exports.h" -/* only get special linkage if built as shared or platform is Cygwin */ -// #if defined(Py_ENABLE_SHARED) || defined(__CYGWIN__) -// # if defined(HAVE_DECLSPEC_DLL) -// # if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE) -// # 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 defined(__CYGWIN__) -// # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject* -// # else /* __CYGWIN__ */ -// # define PyMODINIT_FUNC PyObject* -// # endif /* __CYGWIN__ */ -// # else /* Py_BUILD_CORE */ - /* 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 !defined(__CYGWIN__) -// # define PyAPI_FUNC(RTYPE) Py_IMPORTED_SYMBOL RTYPE -// # endif /* !__CYGWIN__ */ -// # define PyAPI_DATA(RTYPE) extern Py_IMPORTED_SYMBOL RTYPE - /* module init functions outside the core must be exported */ -// # if defined(__cplusplus) -// # define PyMODINIT_FUNC extern "C" Py_EXPORTED_SYMBOL PyObject* -// # else /* __cplusplus */ -// # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject* -// # endif /* __cplusplus */ -// # endif /* Py_BUILD_CORE */ -// # endif /* HAVE_DECLSPEC_DLL */ -// #endif /* Py_ENABLE_SHARED */ - -/* If no external linkage macros defined by now, create defaults */ -// #ifndef PyAPI_FUNC -// # define PyAPI_FUNC(RTYPE) Py_EXPORTED_SYMBOL RTYPE -// #endif -// #ifndef PyAPI_DATA -// # define PyAPI_DATA(RTYPE) extern Py_EXPORTED_SYMBOL RTYPE -// #endif -// #ifndef PyMODINIT_FUNC -// # if defined(__cplusplus) -// # define PyMODINIT_FUNC extern "C" Py_EXPORTED_SYMBOL PyObject* -// # else /* __cplusplus */ -// # define PyMODINIT_FUNC Py_EXPORTED_SYMBOL PyObject* -// # endif /* __cplusplus */ +// #ifdef Py_LIMITED_API + // The internal C API must not be used with the limited C API: make sure + // that Py_BUILD_CORE macro is not defined in this case. These 3 macros are + // used by exports.h, so only undefine them afterwards. +// # undef Py_BUILD_CORE +// # undef Py_BUILD_CORE_BUILTIN +// # undef Py_BUILD_CORE_MODULE // #endif /* limits.h constants that may be missing */ @@ -2805,17 +2740,19 @@ linkage handling and it uses __declspec(). // #ifndef WITH_THREAD // #endif +/* Some WebAssembly platforms do not provide a working pthread implementation. + * Thread support is stubbed and any attempt to create a new thread fails. + */ +// #if (!defined(HAVE_PTHREAD_STUBS) && +// (!defined(__EMSCRIPTEN__) || defined(__EMSCRIPTEN_PTHREADS__))) +public static final int Py_CAN_START_THREADS = 1; +// #endif + // #ifdef WITH_THREAD // # ifdef Py_BUILD_CORE // # endif // #endif -/* Check that ALT_SOABI is consistent with Py_TRACE_REFS: - ./configure --with-trace-refs should must be used to define Py_TRACE_REFS */ -// #if defined(ALT_SOABI) && defined(Py_TRACE_REFS) -// # error "Py_TRACE_REFS ABI is not compatible with release and debug ABI" -// #endif - // #if defined(__ANDROID__) || defined(__VXWORKS__) // Use UTF-8 as the locale encoding, ignore the LC_CTYPE locale. // See _Py_GetLocaleEncoding(), PyUnicode_DecodeLocale() @@ -2910,6 +2847,18 @@ linkage handling and it uses __declspec(). // # undef ALIGNOF_MAX_ALIGN_T // #endif +// #ifndef PY_CXX_CONST +// # ifdef __cplusplus +// # define PY_CXX_CONST const +// # else +// # define PY_CXX_CONST +// # endif +// #endif + +// #if defined(__sgi) && !defined(_SGI_MP_SOURCE) +// # define _SGI_MP_SOURCE +// #endif + // #endif /* Py_PYPORT_H */ @@ -2963,24 +2912,42 @@ For example Py_STRINGIFY(__LINE__) is replaced by the line number, not /* 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) +// #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L +// && !defined(__cplusplus)) +// # define Py_BUILD_ASSERT_EXPR(cond) +// ((void)sizeof(struct { int dummy; _Static_assert(cond, #cond); }), +// 0) +// #else + /* 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) +// #endif -// #define Py_BUILD_ASSERT(cond) do { -// (void)Py_BUILD_ASSERT_EXPR(cond); -// } while(0) +// #if ((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) +// || (defined(__cplusplus) && __cplusplus >= 201103L)) + // Use static_assert() on C11 and newer +// # define Py_BUILD_ASSERT(cond) +// do { +// static_assert((cond), #cond); +// } while (0) +// #else +// # define Py_BUILD_ASSERT(cond) +// do { +// (void)Py_BUILD_ASSERT_EXPR(cond); +// } while(0) +// #endif /* Get the number of elements in a visible array @@ -3034,6 +3001,15 @@ For example Py_STRINGIFY(__LINE__) is replaced by the line number, not */ // #if defined(__GNUC__) || defined(__clang__) // # define Py_UNUSED(name) _unused_ ## name __attribute__((unused)) +// #elif defined(_MSC_VER) + // Disable warning C4100: unreferenced formal parameter, + // declare the parameter, + // restore old compiler warnings. +// # define Py_UNUSED(name) +// __pragma(warning(push)) +// __pragma(warning(suppress: 4100)) +// _unused_ ## name +// __pragma(warning(pop)) // #else // # define Py_UNUSED(name) _unused_ ## name // #endif @@ -3067,6 +3043,9 @@ For example Py_STRINGIFY(__LINE__) is replaced by the line number, not // Py_FatalError("Unreachable C code path reached") // #endif +// #define _Py_CONTAINER_OF(ptr, type, member) +// (type*)((char*)ptr - offsetof(type, member)) + // 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)) @@ -3148,370 +3127,52 @@ For example Py_STRINGIFY(__LINE__) is replaced by the line number, not // Parsed from cpython/pytime.h -// The _PyTime_t API is written to use timestamp and timeout values stored in -// various formats and to read clocks. -// -// The _PyTime_t type is an integer to support directly common arithmetic -// operations like t1 + t2. -// -// The _PyTime_t API supports a resolution of 1 nanosecond. The _PyTime_t type -// is signed to support negative timestamps. The supported range is around -// [-292.3 years; +292.3 years]. Using the Unix epoch (January 1st, 1970), the -// supported date range is around [1677-09-21; 2262-04-11]. -// -// Formats: -// -// * seconds -// * seconds as a floating pointer number (C double) -// * milliseconds (10^-3 seconds) -// * microseconds (10^-6 seconds) -// * 100 nanoseconds (10^-7 seconds) -// * nanoseconds (10^-9 seconds) -// * timeval structure, 1 microsecond resolution (10^-6 seconds) -// * timespec structure, 1 nanosecond resolution (10^-9 seconds) -// -// Integer overflows are detected and raise OverflowError. Conversion to a -// resolution worse than 1 nanosecond is rounded correctly with the requested -// rounding mode. There are 4 rounding modes: floor (towards -inf), ceiling -// (towards +inf), half even and up (away from zero). -// -// Some functions clamp the result in the range [_PyTime_MIN; _PyTime_MAX], so -// the caller doesn't have to handle errors and doesn't need to hold the GIL. -// For example, _PyTime_Add(t1, t2) computes t1+t2 and clamp the result on -// overflow. -// -// Clocks: -// -// * System clock -// * Monotonic clock -// * Performance counter -// -// Operations like (t * k / q) with integers are implemented in a way to reduce -// the risk of integer overflow. Such operation is used to convert a clock -// value expressed in ticks with a frequency to _PyTime_t, like -// QueryPerformanceCounter() with QueryPerformanceFrequency(). +// PyTime_t C API: see Doc/c-api/time.rst for the documentation. // #ifndef Py_LIMITED_API // #ifndef Py_PYTIME_H // #define Py_PYTIME_H - -/************************************************************************** -Symbols and macros to supply platform-independent interfaces to time related -functions and constants -**************************************************************************/ // #ifdef __cplusplus // #endif +public static native @MemberGetter long PyTime_MIN(); +public static final long PyTime_MIN = PyTime_MIN(); +public static native @MemberGetter long PyTime_MAX(); +public static final long PyTime_MAX = PyTime_MAX(); -// #ifdef __clang__ -// #endif - -/* _PyTime_t: Python timestamp with subsecond precision. It can be used to - store a duration, and so indirectly a date (related to another date, like - UNIX epoch). */ -// _PyTime_MIN nanoseconds is around -292.3 years -// #define _PyTime_MIN INT64_MIN -// _PyTime_MAX nanoseconds is around +292.3 years -// #define _PyTime_MAX INT64_MAX -public static final int _SIZEOF_PYTIME_T = 8; - -/** enum _PyTime_round_t */ -public static final int - /* Round towards minus infinity (-inf). - For example, used to read a clock. */ - _PyTime_ROUND_FLOOR = 0, - /* Round towards infinity (+inf). - For example, used for timeout to wait "at least" N seconds. */ - _PyTime_ROUND_CEILING = 1, - /* Round to nearest with ties going to nearest even integer. - For example, used to round from a Python float. */ - _PyTime_ROUND_HALF_EVEN = 2, - /* Round away from zero - For example, used for timeout. _PyTime_ROUND_CEILING rounds - -1e-9 to 0 milliseconds which causes bpo-31786 issue. - _PyTime_ROUND_UP rounds -1e-9 to -1 millisecond which keeps - the timeout sign as expected. select.poll(timeout) must block - for negative values." */ - _PyTime_ROUND_UP = 3, - /* _PyTime_ROUND_TIMEOUT (an alias for _PyTime_ROUND_UP) should be - used for timeouts. */ - _PyTime_ROUND_TIMEOUT = _PyTime_ROUND_UP; - - -/* Convert a time_t to a PyLong. */ -@NoException public static native PyObject _PyLong_FromTime_t( - @ByVal @Cast("time_t*") Pointer sec); - -/* Convert a PyLong to a time_t. */ -@NoException public static native @ByVal @Cast("time_t*") Pointer _PyLong_AsTime_t( - PyObject obj); - -/* Convert a number of seconds, int or float, to time_t. */ -@NoException public static native int _PyTime_ObjectToTime_t( - PyObject obj, - @Cast("time_t*") Pointer sec, - @Cast("_PyTime_round_t") int arg2); - -/* Convert a number of seconds, int or float, to a timeval structure. - usec is in the range [0; 999999] and rounded towards zero. - For example, -1.2 is converted to (-2, 800000). */ -@NoException public static native int _PyTime_ObjectToTimeval( - PyObject obj, - @Cast("time_t*") Pointer sec, - CLongPointer usec, - @Cast("_PyTime_round_t") int arg3); - -/* Convert a number of seconds, int or float, to a timespec structure. - nsec is in the range [0; 999999999] and rounded towards zero. - For example, -1.2 is converted to (-2, 800000000). */ -@NoException public static native int _PyTime_ObjectToTimespec( - PyObject obj, - @Cast("time_t*") Pointer sec, - CLongPointer nsec, - @Cast("_PyTime_round_t") int arg3); - - -/* Create a timestamp from a number of seconds. */ -@NoException public static native @Cast("_PyTime_t") long _PyTime_FromSeconds(int seconds); - -/* Macro to create a timestamp from a number of seconds, no integer overflow. - Only use the macro for small values, prefer _PyTime_FromSeconds(). */ -// #define _PYTIME_FROMSECONDS(seconds) -// ((_PyTime_t)(seconds) * (1000 * 1000 * 1000)) - -/* Create a timestamp from a number of nanoseconds. */ -@NoException public static native @Cast("_PyTime_t") long _PyTime_FromNanoseconds(@Cast("_PyTime_t") long ns); - -/* Create a timestamp from a number of microseconds. - * Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow. */ -@NoException public static native @Cast("_PyTime_t") long _PyTime_FromMicrosecondsClamp(@Cast("_PyTime_t") long us); - -/* Create a timestamp from nanoseconds (Python int). */ -@NoException public static native int _PyTime_FromNanosecondsObject(@Cast("_PyTime_t*") LongPointer t, - PyObject obj); -@NoException public static native int _PyTime_FromNanosecondsObject(@Cast("_PyTime_t*") LongBuffer t, - PyObject obj); -@NoException public static native int _PyTime_FromNanosecondsObject(@Cast("_PyTime_t*") long[] t, - PyObject obj); - -/* Convert a number of seconds (Python float or int) to a timestamp. - Raise an exception and return -1 on error, return 0 on success. */ -@NoException public static native int _PyTime_FromSecondsObject(@Cast("_PyTime_t*") LongPointer t, - PyObject obj, - @Cast("_PyTime_round_t") int round); -@NoException public static native int _PyTime_FromSecondsObject(@Cast("_PyTime_t*") LongBuffer t, - PyObject obj, - @Cast("_PyTime_round_t") int round); -@NoException public static native int _PyTime_FromSecondsObject(@Cast("_PyTime_t*") long[] t, - PyObject obj, - @Cast("_PyTime_round_t") int round); - -/* Convert a number of milliseconds (Python float or int, 10^-3) to a timestamp. - Raise an exception and return -1 on error, return 0 on success. */ -@NoException public static native int _PyTime_FromMillisecondsObject(@Cast("_PyTime_t*") LongPointer t, - PyObject obj, - @Cast("_PyTime_round_t") int round); -@NoException public static native int _PyTime_FromMillisecondsObject(@Cast("_PyTime_t*") LongBuffer t, - PyObject obj, - @Cast("_PyTime_round_t") int round); -@NoException public static native int _PyTime_FromMillisecondsObject(@Cast("_PyTime_t*") long[] t, - PyObject obj, - @Cast("_PyTime_round_t") int round); - -/* Convert a timestamp to a number of seconds as a C double. */ -@NoException public static native double _PyTime_AsSecondsDouble(@Cast("_PyTime_t") long t); - -/* Convert timestamp to a number of milliseconds (10^-3 seconds). */ -@NoException public static native @Cast("_PyTime_t") long _PyTime_AsMilliseconds(@Cast("_PyTime_t") long t, - @Cast("_PyTime_round_t") int round); - -/* Convert timestamp to a number of microseconds (10^-6 seconds). */ -@NoException public static native @Cast("_PyTime_t") long _PyTime_AsMicroseconds(@Cast("_PyTime_t") long t, - @Cast("_PyTime_round_t") int round); - -/* Convert timestamp to a number of nanoseconds (10^-9 seconds). */ -@NoException public static native @Cast("_PyTime_t") long _PyTime_AsNanoseconds(@Cast("_PyTime_t") long t); - -// #ifdef MS_WINDOWS -// #endif - -/* Convert timestamp to a number of nanoseconds (10^-9 seconds) as a Python int - object. */ -@NoException public static native PyObject _PyTime_AsNanosecondsObject(@Cast("_PyTime_t") long t); - -// #ifndef MS_WINDOWS -/* Create a timestamp from a timeval structure. - Raise an exception and return -1 on overflow, return 0 on success. */ - -// #endif - -/* Convert a timestamp to a timeval structure (microsecond resolution). - tv_usec is always positive. - Raise an exception and return -1 if the conversion overflowed, - return 0 on success. */ -@NoException public static native int _PyTime_AsTimeval(@Cast("_PyTime_t") long t, - @Cast("timeval*") Pointer tv, - @Cast("_PyTime_round_t") int round); - -/* Similar to _PyTime_AsTimeval() but don't raise an exception on overflow. - On overflow, clamp tv_sec to _PyTime_t min/max. */ -@NoException public static native void _PyTime_AsTimeval_clamp(@Cast("_PyTime_t") long t, - @Cast("timeval*") Pointer tv, - @Cast("_PyTime_round_t") int round); - -/* Convert a timestamp to a number of seconds (secs) and microseconds (us). - us is always positive. This function is similar to _PyTime_AsTimeval() - except that secs is always a time_t type, whereas the timeval structure - uses a C long for tv_sec on Windows. - Raise an exception and return -1 if the conversion overflowed, - return 0 on success. */ -@NoException public static native int _PyTime_AsTimevalTime_t( - @Cast("_PyTime_t") long t, - @Cast("time_t*") Pointer secs, - IntPointer us, - @Cast("_PyTime_round_t") int round); -@NoException public static native int _PyTime_AsTimevalTime_t( - @Cast("_PyTime_t") long t, - @Cast("time_t*") Pointer secs, - IntBuffer us, - @Cast("_PyTime_round_t") int round); -@NoException public static native int _PyTime_AsTimevalTime_t( - @Cast("_PyTime_t") long t, - @Cast("time_t*") Pointer secs, - int[] us, - @Cast("_PyTime_round_t") int round); - -// #if defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE) -// #endif - - -// Compute t1 + t2. Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow. -@NoException public static native @Cast("_PyTime_t") long _PyTime_Add(@Cast("_PyTime_t") long t1, @Cast("_PyTime_t") long t2); - -/* Compute ticks * mul / div. - Clamp to [_PyTime_MIN; _PyTime_MAX] on overflow. - The caller must ensure that ((div - 1) * mul) cannot overflow. */ -@NoException public static native @Cast("_PyTime_t") long _PyTime_MulDiv(@Cast("_PyTime_t") long ticks, - @Cast("_PyTime_t") long mul, - @Cast("_PyTime_t") long div); -// Targeting ../_Py_clock_info_t.java - - - -/* Get the current time from the system clock. - - If the internal clock fails, silently ignore the error and return 0. - On integer overflow, silently ignore the overflow and clamp the clock to - [_PyTime_MIN; _PyTime_MAX]. - - Use _PyTime_GetSystemClockWithInfo() to check for failure. */ -@NoException public static native @Cast("_PyTime_t") long _PyTime_GetSystemClock(); - -/* Get the current time from the system clock. - * On success, set *t and *info (if not NULL), and return 0. - * On error, raise an exception and return -1. - */ -@NoException public static native int _PyTime_GetSystemClockWithInfo( - @Cast("_PyTime_t*") LongPointer t, - _Py_clock_info_t info); -@NoException public static native int _PyTime_GetSystemClockWithInfo( - @Cast("_PyTime_t*") LongBuffer t, - _Py_clock_info_t info); -@NoException public static native int _PyTime_GetSystemClockWithInfo( - @Cast("_PyTime_t*") long[] t, - _Py_clock_info_t info); - -/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards. - The clock is not affected by system clock updates. The reference point of - the returned value is undefined, so that only the difference between the - results of consecutive calls is valid. - - If the internal clock fails, silently ignore the error and return 0. - On integer overflow, silently ignore the overflow and clamp the clock to - [_PyTime_MIN; _PyTime_MAX]. - - Use _PyTime_GetMonotonicClockWithInfo() to check for failure. */ -@NoException public static native @Cast("_PyTime_t") long _PyTime_GetMonotonicClock(); - -/* Get the time of a monotonic clock, i.e. a clock that cannot go backwards. - The clock is not affected by system clock updates. The reference point of - the returned value is undefined, so that only the difference between the - results of consecutive calls is valid. - - Fill info (if set) with information of the function used to get the time. - - Return 0 on success, raise an exception and return -1 on error. */ -@NoException public static native int _PyTime_GetMonotonicClockWithInfo( - @Cast("_PyTime_t*") LongPointer t, - _Py_clock_info_t info); -@NoException public static native int _PyTime_GetMonotonicClockWithInfo( - @Cast("_PyTime_t*") LongBuffer t, - _Py_clock_info_t info); -@NoException public static native int _PyTime_GetMonotonicClockWithInfo( - @Cast("_PyTime_t*") long[] t, - _Py_clock_info_t info); - - -/* Converts a timestamp to the Gregorian time, using the local time zone. - Return 0 on success, raise an exception and return -1 on error. */ -@NoException public static native int _PyTime_localtime(@ByVal @Cast("time_t*") Pointer t, @Cast("tm*") Pointer tm); - -/* Converts a timestamp to the Gregorian time, assuming UTC. - Return 0 on success, raise an exception and return -1 on error. */ -@NoException public static native int _PyTime_gmtime(@ByVal @Cast("time_t*") Pointer t, @Cast("tm*") Pointer tm); - -/* Get the performance counter: clock with the highest available resolution to - measure a short duration. - - If the internal clock fails, silently ignore the error and return 0. - On integer overflow, silently ignore the overflow and clamp the clock to - [_PyTime_MIN; _PyTime_MAX]. - - Use _PyTime_GetPerfCounterWithInfo() to check for failure. */ -@NoException public static native @Cast("_PyTime_t") long _PyTime_GetPerfCounter(); - -/* Get the performance counter: clock with the highest available resolution to - measure a short duration. - - Fill info (if set) with information of the function used to get the time. - - Return 0 on success, raise an exception and return -1 on error. */ -@NoException public static native int _PyTime_GetPerfCounterWithInfo( - @Cast("_PyTime_t*") LongPointer t, - _Py_clock_info_t info); -@NoException public static native int _PyTime_GetPerfCounterWithInfo( - @Cast("_PyTime_t*") LongBuffer t, - _Py_clock_info_t info); -@NoException public static native int _PyTime_GetPerfCounterWithInfo( - @Cast("_PyTime_t*") long[] t, - _Py_clock_info_t info); +@NoException public static native double PyTime_AsSecondsDouble(@Cast("PyTime_t") long t); +@NoException public static native int PyTime_Monotonic(@Cast("PyTime_t*") LongPointer result); +@NoException public static native int PyTime_Monotonic(@Cast("PyTime_t*") LongBuffer result); +@NoException public static native int PyTime_Monotonic(@Cast("PyTime_t*") long[] result); +@NoException public static native int PyTime_PerfCounter(@Cast("PyTime_t*") LongPointer result); +@NoException public static native int PyTime_PerfCounter(@Cast("PyTime_t*") LongBuffer result); +@NoException public static native int PyTime_PerfCounter(@Cast("PyTime_t*") long[] result); +@NoException public static native int PyTime_Time(@Cast("PyTime_t*") LongPointer result); +@NoException public static native int PyTime_Time(@Cast("PyTime_t*") LongBuffer result); +@NoException public static native int PyTime_Time(@Cast("PyTime_t*") long[] result); - -// Create a deadline. -// Pseudo code: _PyTime_GetMonotonicClock() + timeout. -@NoException public static native @Cast("_PyTime_t") long _PyDeadline_Init(@Cast("_PyTime_t") long timeout); - -// Get remaining time from a deadline. -// Pseudo code: deadline - _PyTime_GetMonotonicClock(). -@NoException public static native @Cast("_PyTime_t") long _PyDeadline_Get(@Cast("_PyTime_t") long deadline); +@NoException public static native int PyTime_MonotonicRaw(@Cast("PyTime_t*") LongPointer result); +@NoException public static native int PyTime_MonotonicRaw(@Cast("PyTime_t*") LongBuffer result); +@NoException public static native int PyTime_MonotonicRaw(@Cast("PyTime_t*") long[] result); +@NoException public static native int PyTime_PerfCounterRaw(@Cast("PyTime_t*") LongPointer result); +@NoException public static native int PyTime_PerfCounterRaw(@Cast("PyTime_t*") LongBuffer result); +@NoException public static native int PyTime_PerfCounterRaw(@Cast("PyTime_t*") long[] result); +@NoException public static native int PyTime_TimeRaw(@Cast("PyTime_t*") LongPointer result); +@NoException public static native int PyTime_TimeRaw(@Cast("PyTime_t*") LongBuffer result); +@NoException public static native int PyTime_TimeRaw(@Cast("PyTime_t*") long[] result); // #ifdef __cplusplus // #endif - // #endif /* Py_PYTIME_H */ // #endif /* Py_LIMITED_API */ // Parsed from pymem.h -/* The PyMem_ family: low-level memory allocation interfaces. - See objimpl.h for the PyObject_ memory family. -*/ +// The PyMem_ family: low-level memory allocation interfaces. +// See objimpl.h for the PyObject_ memory family. // #ifndef Py_PYMEM_H // #define Py_PYMEM_H - -// #include "pyport.h" - // #ifdef __cplusplus // #endif @@ -3595,6 +3256,17 @@ performed on failure (no exception is set, no warning is printed, etc). // #define PyMem_DEL(p) PyMem_Free((p)) +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +// Memory allocator which doesn't require the GIL to be held. +// Usually, it's just a thin wrapper to functions of the standard C library: +// malloc(), calloc(), realloc() and free(). The difference is that +// tracemalloc can track these memory allocations. +@NoException public static native Pointer PyMem_RawMalloc(@Cast("size_t") long size); +@NoException public static native Pointer PyMem_RawCalloc(@Cast("size_t") long nelem, @Cast("size_t") long elsize); +@NoException public static native Pointer PyMem_RawRealloc(Pointer ptr, @Cast("size_t") long new_size); +@NoException public static native void PyMem_RawFree(Pointer ptr); +// #endif + // #ifndef Py_LIMITED_API // # define Py_CPYTHON_PYMEM_H // # include "cpython/pymem.h" @@ -3603,8 +3275,7 @@ performed on failure (no exception is set, no warning is printed, etc). // #ifdef __cplusplus // #endif - -// #endif /* !Py_PYMEM_H */ +// #endif // !Py_PYMEM_H // Parsed from pytypedefs.h @@ -3767,26 +3438,6 @@ performed on failure (no exception is set, no warning is printed, etc). // # error "this header file must not be included directly" // #endif -@NoException public static native Pointer PyMem_RawMalloc(@Cast("size_t") long size); -@NoException public static native Pointer PyMem_RawCalloc(@Cast("size_t") long nelem, @Cast("size_t") long elsize); -@NoException public static native Pointer PyMem_RawRealloc(Pointer ptr, @Cast("size_t") long new_size); -@NoException public static native void PyMem_RawFree(Pointer ptr); - -/* Try to get the allocators name set by _PyMem_SetupAllocators(). */ -@NoException public static native @Cast("const char*") BytePointer _PyMem_GetCurrentAllocatorName(); - -/* strdup() using PyMem_RawMalloc() */ -@NoException public static native @Cast("char*") BytePointer _PyMem_RawStrdup(@Cast("const char*") BytePointer str); -@NoException public static native @Cast("char*") ByteBuffer _PyMem_RawStrdup(String str); - -/* strdup() using PyMem_Malloc() */ -@NoException public static native @Cast("char*") BytePointer _PyMem_Strdup(@Cast("const char*") BytePointer str); -@NoException public static native @Cast("char*") ByteBuffer _PyMem_Strdup(String str); - -/* wcsdup() using PyMem_RawMalloc() */ -@NoException public static native @Cast("wchar_t*") Pointer _PyMem_RawWcsdup(@Cast("const wchar_t*") Pointer str); - - /** enum PyMemAllocatorDomain */ public static final int /* PyMem_RawMalloc(), PyMem_RawRealloc() and PyMem_RawFree() */ @@ -3807,7 +3458,11 @@ performed on failure (no exception is set, no warning is printed, etc). PYMEM_ALLOCATOR_MALLOC_DEBUG = 4, // #ifdef WITH_PYMALLOC PYMEM_ALLOCATOR_PYMALLOC = 5, - PYMEM_ALLOCATOR_PYMALLOC_DEBUG = 6; + PYMEM_ALLOCATOR_PYMALLOC_DEBUG = 6, +// #endif +// #ifdef WITH_MIMALLOC + PYMEM_ALLOCATOR_MIMALLOC = 7, + PYMEM_ALLOCATOR_MIMALLOC_DEBUG = 8; // #endif // Targeting ../PyMemAllocatorEx.java @@ -3850,21 +3505,105 @@ by PyMem_Malloc() @NoException public static native void PyMem_SetupDebugHooks(); -// Parsed from object.h +// Parsed from pystats.h -// #ifndef Py_OBJECT_H -// #define Py_OBJECT_H +// Statistics on Python performance (public API). +// +// Define _Py_INCREF_STAT_INC() and _Py_DECREF_STAT_INC() used by Py_INCREF() +// and Py_DECREF(). +// +// See Include/cpython/pystats.h for the full API. + +// #ifndef Py_PYSTATS_H +// #define Py_PYSTATS_H // #ifdef __cplusplus // #endif +// #if defined(Py_STATS) && !defined(Py_LIMITED_API) +// # define Py_CPYTHON_PYSTATS_H +// # include "cpython/pystats.h" +// # undef Py_CPYTHON_PYSTATS_H +// #else +// # define _Py_INCREF_STAT_INC() ((void)0) +// # define _Py_DECREF_STAT_INC() ((void)0) +// #endif // !Py_STATS -/* Object and type object interface */ +// #ifdef __cplusplus +// #endif +// #endif // !Py_PYSTATS_H -/* -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 + +// Parsed from lock.h + +// #ifndef Py_LOCK_H +// #define Py_LOCK_H +// #ifdef __cplusplus +// #endif + +// #ifndef Py_LIMITED_API +// # define Py_CPYTHON_LOCK_H +// # include "cpython/lock.h" +// # undef Py_CPYTHON_LOCK_H +// #endif + +// #ifdef __cplusplus +// #endif +// #endif /* !Py_LOCK_H */ + + +// Parsed from monitoring.h + +// #ifndef Py_MONITORING_H +// #define Py_MONITORING_H +// #ifdef __cplusplus +// #endif + +// There is currently no limited API for monitoring + +// #ifndef Py_LIMITED_API +// # define Py_CPYTHON_MONITORING_H +// # include "cpython/monitoring.h" +// # undef Py_CPYTHON_MONITORING_H +// #endif + +// #ifdef __cplusplus +// #endif +// #endif /* !Py_MONITORING_H */ + + +// Parsed from critical_section.h + +// #ifndef Py_CRITICAL_SECTION_H +// #define Py_CRITICAL_SECTION_H +// #ifdef __cplusplus +// #endif + +// #ifndef Py_LIMITED_API +// # define Py_CPYTHON_CRITICAL_SECTION_H +// # include "cpython/critical_section.h" +// # undef Py_CPYTHON_CRITICAL_SECTION_H +// #endif + +// #ifdef __cplusplus +// #endif +// #endif /* !Py_CRITICAL_SECTION_H */ + + +// Parsed from object.h + +// #ifndef Py_OBJECT_H +// #define Py_OBJECT_H +// #ifdef __cplusplus +// #endif + + +/* 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). @@ -3904,24 +3643,11 @@ used for this (to accommodate for future changes). The implementation whose size is determined when the object is allocated. */ -// #include "pystats.h" - /* Py_DEBUG implies Py_REF_DEBUG. */ // #if defined(Py_DEBUG) && !defined(Py_REF_DEBUG) // # define Py_REF_DEBUG // #endif -// #if defined(Py_LIMITED_API) && defined(Py_TRACE_REFS) -// # error Py_LIMITED_API is incompatible with Py_TRACE_REFS -// #endif - -// #ifdef Py_TRACE_REFS - -// #else -// # define _PyObject_HEAD_EXTRA -// # define _PyObject_EXTRA_INIT -// #endif - /* PyObject_HEAD defines the initial segment of every PyObject. */ // #define PyObject_HEAD PyObject ob_base; @@ -3972,17 +3698,27 @@ used for this (to accommodate for future changes). The implementation */ // #endif -// 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 +// Py_GIL_DISABLED builds indicate immortal objects using `ob_ref_local`, which is +// always 32-bits. +// #ifdef Py_GIL_DISABLED +// #endif + +// Kept for backward compatibility. It was needed by Py_TRACE_REFS build. +// #define _PyObject_EXTRA_INIT + +/* Make all uses of PyObject_HEAD_INIT immortal. + * + * Statically allocated objects might be shared between + * interpreters, so must be marked as immortal. + */ +// #if defined(Py_GIL_DISABLED) // #else // #define PyObject_HEAD_INIT(type) // { -// _PyObject_EXTRA_INIT -// { 1 }, +// { _Py_IMMORTAL_REFCNT }, // (type) // }, -// #endif /* Py_BUILD_CORE */ +// #endif // #define PyVarObject_HEAD_INIT(type, size) // { @@ -4001,6 +3737,8 @@ used for this (to accommodate for future changes). The implementation // Targeting ../_object.java +// #else +// #endif /* Cast argument to PyObject* type. */ // #define _PyObject_CAST(op) _Py_CAST(PyObject*, (op)) @@ -4016,6 +3754,8 @@ used for this (to accommodate for future changes). The implementation @NoException public static native int Py_Is(PyObject x, PyObject y); // #define Py_Is(x, y) ((x) == (y)) +// #if defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API) +// #endif @NoException public static native @Cast("Py_ssize_t") long Py_REFCNT(PyObject ob); // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 @@ -4043,6 +3783,9 @@ used for this (to accommodate for future changes). The implementation // #endif +// Py_SET_REFCNT() implementation for stable ABI +@NoException public static native void _Py_SetRefcnt(PyObject ob, @Cast("Py_ssize_t") long refcnt); + @NoException public static native void Py_SET_REFCNT(PyObject ob, @Cast("Py_ssize_t") long refcnt); // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 // #endif @@ -4166,6 +3909,10 @@ used for this (to accommodate for future changes). The implementation @NoException public static native PyObject PyType_GetName(PyTypeObject arg0); @NoException public static native PyObject PyType_GetQualName(PyTypeObject arg0); // #endif +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030D0000 +@NoException public static native PyObject PyType_GetFullyQualifiedName(PyTypeObject type); +@NoException public static native PyObject PyType_GetModuleName(PyTypeObject type); +// #endif // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030C0000 @NoException public static native PyObject PyType_FromMetaclass(PyTypeObject arg0, PyObject arg1, PyType_Spec arg2, PyObject arg3); @NoException public static native Pointer PyObject_GetTypeData(PyObject obj, PyTypeObject cls); @@ -4203,11 +3950,26 @@ used for this (to accommodate for future changes). The implementation @NoException public static native PyObject PyObject_GetAttrString(PyObject arg0, String arg1); @NoException public static native int PyObject_SetAttrString(PyObject arg0, @Cast("const char*") BytePointer arg1, PyObject arg2); @NoException public static native int PyObject_SetAttrString(PyObject arg0, String arg1, PyObject arg2); +@NoException public static native int PyObject_DelAttrString(PyObject v, @Cast("const char*") BytePointer name); +@NoException public static native int PyObject_DelAttrString(PyObject v, String name); @NoException public static native int PyObject_HasAttrString(PyObject arg0, @Cast("const char*") BytePointer arg1); @NoException public static native int PyObject_HasAttrString(PyObject arg0, String arg1); @NoException public static native PyObject PyObject_GetAttr(PyObject arg0, PyObject arg1); +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +@NoException public static native int PyObject_GetOptionalAttr(PyObject arg0, PyObject arg1, @Cast("PyObject**") PointerPointer arg2); +@NoException public static native int PyObject_GetOptionalAttr(PyObject arg0, PyObject arg1, @ByPtrPtr PyObject arg2); +@NoException public static native int PyObject_GetOptionalAttrString(PyObject arg0, @Cast("const char*") BytePointer arg1, @Cast("PyObject**") PointerPointer arg2); +@NoException public static native int PyObject_GetOptionalAttrString(PyObject arg0, @Cast("const char*") BytePointer arg1, @ByPtrPtr PyObject arg2); +@NoException public static native int PyObject_GetOptionalAttrString(PyObject arg0, String arg1, @ByPtrPtr PyObject arg2); +// #endif @NoException public static native int PyObject_SetAttr(PyObject arg0, PyObject arg1, PyObject arg2); +@NoException public static native int PyObject_DelAttr(PyObject v, PyObject name); @NoException public static native int PyObject_HasAttr(PyObject arg0, PyObject arg1); +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +@NoException public static native int PyObject_HasAttrWithError(PyObject arg0, PyObject arg1); +@NoException public static native int PyObject_HasAttrStringWithError(PyObject arg0, @Cast("const char*") BytePointer arg1); +@NoException public static native int PyObject_HasAttrStringWithError(PyObject arg0, String arg1); +// #endif @NoException public static native PyObject PyObject_SelfIter(PyObject arg0); @NoException public static native PyObject PyObject_GenericGetAttr(PyObject arg0, PyObject arg1); @NoException public static native int PyObject_GenericSetAttr(PyObject arg0, PyObject arg1, PyObject arg2); @@ -4228,12 +3990,6 @@ no current locals, NULL is returned, and PyErr_Occurred() is false. */ @NoException public static native PyObject PyObject_Dir(PyObject arg0); -/* Pickle support. */ -// #ifndef Py_LIMITED_API -@NoException public static native PyObject _PyObject_GetState(PyObject arg0); -// #endif - - /* Helpers for printing recursive container types */ @NoException public static native int Py_ReprEnter(PyObject arg0); @NoException public static native void Py_ReprLeave(PyObject arg0); @@ -4266,13 +4022,18 @@ Code can use PyType_HasFeature(type_ob, flag_value) to test whether the /* Track types initialized using _PyStaticType_InitBuiltin(). */ public static final int _Py_TPFLAGS_STATIC_BUILTIN = (1 << 1); +/* The values array is placed inline directly after the rest of + * the object. Implies Py_TPFLAGS_HAVE_GC. + */ +public static final int Py_TPFLAGS_INLINE_VALUES = (1 << 2); + /* Placement of weakref pointers are managed by the VM, not by the type. * The VM will automatically set tp_weaklistoffset. */ public static final int 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. + * The VM will automatically set tp_dictoffset. Implies Py_TPFLAGS_HAVE_GC. */ public static final int Py_TPFLAGS_MANAGED_DICT = (1 << 4); @@ -4324,7 +4085,7 @@ Code can use PyType_HasFeature(type_ob, flag_value) to test whether the /* Objects behave like an unbound method */ public static final long Py_TPFLAGS_METHOD_DESCRIPTOR = (1L << 17); -/* Object has up-to-date type attribute cache */ +/* Unused. Legacy flag */ public static final long Py_TPFLAGS_VALID_VERSION_TAG = (1L << 19); /* Type is abstract and cannot be instantiated */ @@ -4418,8 +4179,16 @@ in special builds (Py_REF_DEBUG, Py_TRACE_REFS) performs additional // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 // #endif + +// #if !defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED) +// #endif + // #if defined(Py_LIMITED_API) && (Py_LIMITED_API+0 >= 0x030c0000 || defined(Py_REF_DEBUG)) +// #elif defined(Py_GIL_DISABLED) && defined(Py_REF_DEBUG) + +// #elif defined(Py_GIL_DISABLED) + // #elif defined(Py_REF_DEBUG) // #else @@ -4521,14 +4290,34 @@ in special builds (Py_REF_DEBUG, Py_TRACE_REFS) performs additional // #endif +public static final int Py_CONSTANT_NONE = 0; +public static final int Py_CONSTANT_FALSE = 1; +public static final int Py_CONSTANT_TRUE = 2; +public static final int Py_CONSTANT_ELLIPSIS = 3; +public static final int Py_CONSTANT_NOT_IMPLEMENTED = 4; +public static final int Py_CONSTANT_ZERO = 5; +public static final int Py_CONSTANT_ONE = 6; +public static final int Py_CONSTANT_EMPTY_STR = 7; +public static final int Py_CONSTANT_EMPTY_BYTES = 8; +public static final int Py_CONSTANT_EMPTY_TUPLE = 9; + +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +@NoException public static native PyObject Py_GetConstant(@Cast("unsigned int") int constant_id); +@NoException public static native PyObject Py_GetConstantBorrowed(@Cast("unsigned int") int constant_id); +// #endif + + /* _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!!! */ public static native @ByRef PyObject _Py_NoneStruct(); public static native void _Py_NoneStruct(PyObject setter); /* Don't use this directly */ -// #define Py_None (&_Py_NoneStruct) + +// #if defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030D0000 +// # define Py_None Py_GetConstantBorrowed(Py_CONSTANT_NONE) +// #else +// # define Py_None (&_Py_NoneStruct) +// #endif // Test if an object is the None singleton, the same as "x is None" in Python. @NoException public static native int Py_IsNone(PyObject x); @@ -4542,7 +4331,12 @@ where NULL (nil) is not suitable (since NULL often means 'error'). not implemented for a given type combination. */ public static native @ByRef PyObject _Py_NotImplementedStruct(); public static native void _Py_NotImplementedStruct(PyObject setter); /* Don't use this directly */ -// #define Py_NotImplemented (&_Py_NotImplementedStruct) + +// #if defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030D0000 +// # define Py_NotImplemented Py_GetConstantBorrowed(Py_CONSTANT_NOT_IMPLEMENTED) +// #else +// # define Py_NotImplemented (&_Py_NotImplementedStruct) +// #endif /* Macro for returning Py_NotImplemented from a function */ // #define Py_RETURN_NOTIMPLEMENTED return Py_NotImplemented @@ -4658,6 +4452,10 @@ it carefully, it may save lots of calls to Py_INCREF() and Py_DECREF() at // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000 // #endif +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +@NoException public static native PyObject PyType_GetModuleByDef(PyTypeObject arg0, PyModuleDef arg1); +// #endif + // #ifdef __cplusplus // #endif // #endif // !Py_OBJECT_H @@ -4671,6 +4469,7 @@ it carefully, it may save lots of calls to Py_INCREF() and Py_DECREF() at @NoException public static native void _Py_NewReference(PyObject op); @NoException public static native void _Py_NewReferenceNoTotal(PyObject op); +@NoException public static native void _Py_ResurrectReference(PyObject op); // Targeting ../_Py_Identifier.java @@ -4715,51 +4514,21 @@ it carefully, it may save lots of calls to Py_INCREF() and Py_DECREF() at @NoException public static native @Cast("const char*") BytePointer _PyType_Name(PyTypeObject arg0); @NoException public static native PyObject _PyType_Lookup(PyTypeObject arg0, PyObject arg1); -@NoException public static native PyObject _PyType_LookupId(PyTypeObject arg0, _Py_Identifier arg1); -@NoException public static native PyObject _PyObject_LookupSpecialId(PyObject arg0, _Py_Identifier arg1); -// #ifndef Py_BUILD_CORE -// Backward compatibility for 3rd-party extensions -// that may be using the old name. -// #define _PyObject_LookupSpecial _PyObject_LookupSpecialId -// #endif -@NoException public static native PyTypeObject _PyType_CalculateMetaclass(PyTypeObject arg0, PyObject arg1); -@NoException public static native PyObject _PyType_GetDocFromInternalDoc(@Cast("const char*") BytePointer arg0, @Cast("const char*") BytePointer arg1); -@NoException public static native PyObject _PyType_GetDocFromInternalDoc(String arg0, String arg1); -@NoException public static native PyObject _PyType_GetTextSignatureFromInternalDoc(@Cast("const char*") BytePointer arg0, @Cast("const char*") BytePointer arg1); -@NoException public static native PyObject _PyType_GetTextSignatureFromInternalDoc(String arg0, String arg1); -@NoException public static native PyObject PyType_GetModuleByDef(PyTypeObject arg0, PyModuleDef arg1); +@NoException public static native PyObject _PyType_LookupRef(PyTypeObject arg0, PyObject arg1); @NoException public static native PyObject PyType_GetDict(PyTypeObject arg0); @NoException public static native int PyObject_Print(PyObject arg0, @Cast("FILE*") Pointer arg1, int arg2); @NoException public static native void _Py_BreakPoint(); @NoException public static native void _PyObject_Dump(PyObject arg0); -@NoException public static native int _PyObject_IsFreed(PyObject arg0); -@NoException public static native int _PyObject_IsAbstract(PyObject arg0); @NoException public static native PyObject _PyObject_GetAttrId(PyObject arg0, _Py_Identifier arg1); -@NoException public static native int _PyObject_SetAttrId(PyObject arg0, _Py_Identifier arg1, PyObject arg2); -/* 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. -*/ -@NoException public static native int _PyObject_LookupAttr(PyObject arg0, PyObject arg1, @Cast("PyObject**") PointerPointer arg2); -@NoException public static native int _PyObject_LookupAttr(PyObject arg0, PyObject arg1, @ByPtrPtr PyObject arg2); -@NoException public static native int _PyObject_LookupAttrId(PyObject arg0, _Py_Identifier arg1, @Cast("PyObject**") PointerPointer arg2); -@NoException public static native int _PyObject_LookupAttrId(PyObject arg0, _Py_Identifier arg1, @ByPtrPtr PyObject arg2); - -@NoException public static native int _PyObject_GetMethod(PyObject obj, PyObject name, @Cast("PyObject**") PointerPointer method); -@NoException public static native int _PyObject_GetMethod(PyObject obj, PyObject name, @ByPtrPtr PyObject method); @NoException public static native @Cast("PyObject**") PointerPointer _PyObject_GetDictPtr(PyObject arg0); -@NoException public static native PyObject _PyObject_NextNotImplemented(PyObject arg0); @NoException public static native void PyObject_CallFinalizer(PyObject arg0); @NoException public static native int PyObject_CallFinalizerFromDealloc(PyObject arg0); +@NoException public static native void PyUnstable_Object_ClearWeakRefsNoCallbacks(PyObject arg0); + /* Same as PyObject_Generic{Get,Set}Attr, but passing the attributes dict as the last parameter. */ @NoException public static native PyObject _PyObject_GenericGetAttrWithDict(PyObject arg0, PyObject arg1, PyObject arg2, int arg3); @@ -4819,21 +4588,6 @@ it carefully, it may save lots of calls to Py_INCREF() and Py_DECREF() at // #endif -public static native @ByRef PyTypeObject _PyNone_Type(); public static native void _PyNone_Type(PyTypeObject setter); -public static native @ByRef PyTypeObject _PyNotImplemented_Type(); public static native void _PyNotImplemented_Type(PyTypeObject setter); - -/* Maps Py_LT to Py_GT, ..., Py_GE to Py_LE. - * Defined in object.c. - */ -public static native int _Py_SwappedOp(int i); public static native void _Py_SwappedOp(int i, int setter); -@MemberGetter public static native IntPointer _Py_SwappedOp(); - -@NoException public static native void _PyDebugAllocatorStats(@Cast("FILE*") Pointer out, @Cast("const char*") BytePointer block_name, int num_blocks, - @Cast("size_t") long sizeof_block); -@NoException public static native void _PyDebugAllocatorStats(@Cast("FILE*") Pointer out, String block_name, int num_blocks, - @Cast("size_t") long sizeof_block); -@NoException public static native void _PyObject_DebugTypeStats(@Cast("FILE*") Pointer out); - /* Define a pair of assertion macros: _PyObject_ASSERT_FROM(), _PyObject_ASSERT_WITH_MSG() and _PyObject_ASSERT(). @@ -4889,21 +4643,6 @@ particular object is corrupt (e.g. buggy a tp_visit method in an extension int line, String 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)); */ -@NoException public static native int _PyObject_CheckConsistency( - PyObject op, - int check_content); - /* Trashcan mechanism, thanks to Christian Tismer. @@ -4942,8 +4681,8 @@ 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. +chain of N deallocations is broken into (N-1)/(Py_TRASHCAN_HEADROOM-1) pieces, +with the call stack never exceeding a depth of Py_TRASHCAN_HEADROOM. 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 @@ -4955,48 +4694,40 @@ passed as second argument to Py_TRASHCAN_BEGIN(). /* Python 3.9 private API, invoked by the macros below. */ @NoException public static native int _PyTrash_begin(PyThreadState tstate, PyObject op); @NoException public static native void _PyTrash_end(PyThreadState tstate); + +@NoException public static native void _PyTrash_thread_deposit_object(PyThreadState tstate, PyObject op); +@NoException public static native void _PyTrash_thread_destroy_chain(PyThreadState tstate); + + /* Python 3.10 private API, invoked by the Py_TRASHCAN_BEGIN(). */ -@NoException public static native 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); +/* To avoid raising recursion errors during dealloc trigger trashcan before we reach + * recursion limit. To avoid trashing, we don't attempt to empty the trashcan until + * we have headroom above the trigger limit */ +public static final int Py_TRASHCAN_HEADROOM = 50; // #define Py_TRASHCAN_BEGIN(op, dealloc) -// Py_TRASHCAN_BEGIN_CONDITION((op), -// _PyTrash_cond(_PyObject_CAST(op), (destructor)(dealloc))) +// do { +// PyThreadState *tstate = PyThreadState_Get(); +// if (tstate->c_recursion_remaining <= Py_TRASHCAN_HEADROOM && Py_TYPE(op)->tp_dealloc == (destructor)dealloc) { +// _PyTrash_thread_deposit_object(tstate, (PyObject *)op); +// break; +// } +// tstate->c_recursion_remaining--; + /* The body of the deallocator is here. */ +// #define Py_TRASHCAN_END +// tstate->c_recursion_remaining++; +// if (tstate->delete_later && tstate->c_recursion_remaining > (Py_TRASHCAN_HEADROOM*2)) { +// _PyTrash_thread_destroy_chain(tstate); +// } +// } while (0); -/* 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. - */ -// #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); @NoException public static native Pointer PyObject_GetItemData(PyObject obj); -@NoException public static native int _PyObject_VisitManagedDict(PyObject obj, visitproc visit, Pointer arg); -@NoException public static native void _PyObject_ClearManagedDict(PyObject obj); +@NoException public static native int PyObject_VisitManagedDict(PyObject obj, visitproc visit, Pointer arg); +@NoException public static native int _PyObject_SetManagedDict(PyObject obj, PyObject new_dict); +@NoException public static native void PyObject_ClearManagedDict(PyObject obj); public static final int TYPE_MAX_WATCHERS = 8; // Targeting ../PyType_WatchCallback.java @@ -5015,17 +4746,25 @@ passed as second argument to Py_TRASHCAN_BEGIN(). @NoException public static native int PyUnstable_Type_AssignVersionTag(PyTypeObject type); +/** enum PyRefTracerEvent */ +public static final int + PyRefTracer_CREATE = 0, + PyRefTracer_DESTROY = 1; +// Targeting ../PyRefTracer.java + + +@NoException public static native int PyRefTracer_SetTracer(PyRefTracer tracer, Pointer data); +@NoException public static native PyRefTracer PyRefTracer_GetTracer(@Cast("void**") PointerPointer arg0); +@NoException public static native PyRefTracer PyRefTracer_GetTracer(@Cast("void**") @ByPtrPtr Pointer arg0); + + // Parsed from objimpl.h -/* The PyObject_ memory family: high-level object memory interfaces. - See pymem.h for the low-level PyMem_ family. -*/ +// 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 - -// #include "pymem.h" - // #ifdef __cplusplus // #endif @@ -5057,7 +4796,7 @@ the macros may (or may not) expose details for speed, if you do use the 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. + run a destructor -- it only frees the memory. - 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 @@ -5174,11 +4913,6 @@ performed on failure other than to return NULL (no warning it printed, no @NoException public static native int PyGC_Enable(); @NoException public static native int PyGC_Disable(); @NoException public static native int PyGC_IsEnabled(); -// Targeting ../gcvisitobjects_t.java - - -@NoException public static native void PyUnstable_GC_VisitObjects(gcvisitobjects_t callback, Pointer arg); -// #endif /* Test if a type has a GC head */ // #define PyType_IS_GC(t) PyType_HasFeature((t), Py_TPFLAGS_HAVE_GC) @@ -5234,7 +4968,7 @@ performed on failure other than to return NULL (no warning it printed, no // #ifdef __cplusplus // #endif -// #endif /* !Py_OBJIMPL_H */ +// #endif // !Py_OBJIMPL_H // Parsed from cpython/objimpl.h @@ -5275,14 +5009,6 @@ value is rounded up to the closest multiple of sizeof(void *), in order to @NoException public static native 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 - - // Test if a type supports weak references @NoException public static native int PyType_SUPPORTS_WEAKREFS(PyTypeObject type); @@ -5290,6 +5016,10 @@ defines a different _PyGC_FINALIZED() macro. */ @NoException public static native PyObject PyUnstable_Object_GC_NewWithExtraData(PyTypeObject arg0, @Cast("size_t") long arg1); +// Targeting ../gcvisitobjects_t.java + + +@NoException public static native void PyUnstable_GC_VisitObjects(gcvisitobjects_t callback, Pointer arg); // Parsed from typeslots.h @@ -5387,48 +5117,11 @@ defines a different _PyGC_FINALIZED() macro. */ // Parsed from pyhash.h // #ifndef Py_HASH_H - // #define Py_HASH_H // #ifdef __cplusplus // #endif -/* Helpers for hash functions */ -// #ifndef Py_LIMITED_API -@NoException public static native @Cast("Py_hash_t") long _Py_HashDouble(PyObject arg0, double arg1); -@NoException public static native @Cast("Py_hash_t") long _Py_HashPointer(@Const Pointer arg0); -// Similar to _Py_HashPointer(), but don't replace -1 with -2 -@NoException public static native @Cast("Py_hash_t") long _Py_HashPointerRaw(@Const Pointer arg0); -@NoException public static native @Cast("Py_hash_t") long _Py_HashBytes(@Const Pointer arg0, @Cast("Py_ssize_t") long arg1); -// #endif - -/* Prime multiplier used in string and various other hashes. */ -public static final long _PyHASH_MULTIPLIER = 1000003L; /* 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 SIZEOF_VOID_P >= 8 -public static final int _PyHASH_BITS = 61; -// #else -// #endif - -public static final long _PyHASH_MODULUS = (((long)1 << _PyHASH_BITS) - 1); -public static final int _PyHASH_INF = 314159; -public static final long _PyHASH_IMAG = _PyHASH_MULTIPLIER; -// Targeting ../_Py_HashSecret_t.java - - -public static native @ByRef _Py_HashSecret_t _Py_HashSecret(); public static native void _Py_HashSecret(_Py_HashSecret_t setter); -// Targeting ../PyHash_FuncDef.java - - - -@NoException public static native PyHash_FuncDef PyHash_GetFuncDef(); -// #endif - - -/* cutoff for small string DJBX33A optimization in range [1, cutoff). +/* 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. @@ -5446,7 +5139,7 @@ defines a different _PyGC_FINALIZED() macro. */ // #endif /* Py_HASH_CUTOFF */ -/* hash algorithm selection +/* Hash algorithm selection * * The values for Py_HASH_* are hard-coded in the * configure script. @@ -5470,10 +5163,15 @@ defines a different _PyGC_FINALIZED() macro. */ // # endif /* uint64_t && uint32_t && aligned */ // #endif /* Py_HASH_ALGORITHM */ -// #ifdef __cplusplus +// #ifndef Py_LIMITED_API +// # define Py_CPYTHON_HASH_H +// # include "cpython/pyhash.h" +// # undef Py_CPYTHON_HASH_H // #endif -// #endif /* !Py_HASH_H */ +// #ifdef __cplusplus +// #endif +// #endif // !Py_HASH_H // Parsed from cpython/pydebug.h @@ -5677,16 +5375,13 @@ defines a different _PyGC_FINALIZED() macro. */ // Parsed from bytesobject.h - -/* Bytes object interface */ +// Bytes object interface // #ifndef Py_BYTESOBJECT_H // #define Py_BYTESOBJECT_H // #ifdef __cplusplus // #endif -// #include // va_list - /* 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 @@ -5778,35 +5473,6 @@ defines a different _PyGC_FINALIZED() macro. */ @NoException public static native int _PyBytes_Resize(@Cast("PyObject**") PointerPointer arg0, @Cast("Py_ssize_t") long arg1); @NoException public static native int _PyBytes_Resize(@ByPtrPtr PyObject arg0, @Cast("Py_ssize_t") long arg1); -@NoException public static native PyObject _PyBytes_FormatEx( - @Cast("const char*") BytePointer format, - @Cast("Py_ssize_t") long format_len, - PyObject args, - int use_bytearray); -@NoException public static native PyObject _PyBytes_FormatEx( - String format, - @Cast("Py_ssize_t") long format_len, - PyObject args, - int use_bytearray); -@NoException public static native PyObject _PyBytes_FromHex( - PyObject string, - int use_bytearray); - -/* Helper for PyBytes_DecodeEscape that detects invalid escape chars. */ -@NoException public static native PyObject _PyBytes_DecodeEscape(@Cast("const char*") BytePointer arg0, @Cast("Py_ssize_t") long arg1, - @Cast("const char*") BytePointer arg2, @Cast("const char**") PointerPointer arg3); -@NoException public static native PyObject _PyBytes_DecodeEscape(@Cast("const char*") BytePointer arg0, @Cast("Py_ssize_t") long arg1, - @Cast("const char*") BytePointer arg2, @Cast("const char**") @ByPtrPtr BytePointer arg3); -@NoException public static native PyObject _PyBytes_DecodeEscape(String arg0, @Cast("Py_ssize_t") long arg1, - String arg2, @Cast("const char**") @ByPtrPtr ByteBuffer arg3); -@NoException public static native PyObject _PyBytes_DecodeEscape(@Cast("const char*") BytePointer arg0, @Cast("Py_ssize_t") long arg1, - @Cast("const char*") BytePointer arg2, @Cast("const char**") @ByPtrPtr byte[] arg3); -@NoException public static native PyObject _PyBytes_DecodeEscape(String arg0, @Cast("Py_ssize_t") long arg1, - String arg2, @Cast("const char**") @ByPtrPtr BytePointer arg3); -@NoException public static native PyObject _PyBytes_DecodeEscape(@Cast("const char*") BytePointer arg0, @Cast("Py_ssize_t") long arg1, - @Cast("const char*") BytePointer arg2, @Cast("const char**") @ByPtrPtr ByteBuffer arg3); -@NoException public static native PyObject _PyBytes_DecodeEscape(String arg0, @Cast("Py_ssize_t") long arg1, - String arg2, @Cast("const char**") @ByPtrPtr byte[] arg3); /* Macros and static inline functions, trading safety for speed */ // #define _PyBytes_CAST(op) @@ -5821,62 +5487,6 @@ defines a different _PyGC_FINALIZED() macro. */ /* _PyBytes_Join(sep, x) is like sep.join(x). sep must be PyBytesObject*, x must be an iterable object. */ @NoException public static native PyObject _PyBytes_Join(PyObject sep, PyObject x); -// Targeting ../_PyBytesWriter.java - - - -/* Initialize a bytes writer - - By default, the overallocation is disabled. Set the overallocate attribute - to control the allocation of the buffer. */ -@NoException public static native 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. */ -@NoException public static native PyObject _PyBytesWriter_Finish(_PyBytesWriter writer, - Pointer str); - -/* Deallocate memory of a writer (clear its internal buffer). */ -@NoException public static native 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. */ -@NoException public static native Pointer _PyBytesWriter_Alloc(_PyBytesWriter writer, - @Cast("Py_ssize_t") long 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. */ -@NoException public static native Pointer _PyBytesWriter_Prepare(_PyBytesWriter writer, - Pointer str, - @Cast("Py_ssize_t") long 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(). - */ -@NoException public static native Pointer _PyBytesWriter_Resize(_PyBytesWriter writer, - Pointer str, - @Cast("Py_ssize_t") long size); - -/* Write bytes. - Raise an exception and return NULL on error. */ -@NoException public static native Pointer _PyBytesWriter_WriteBytes(_PyBytesWriter writer, - Pointer str, - @Const Pointer bytes, - @Cast("Py_ssize_t") long size); // Parsed from unicodeobject.h @@ -5884,8 +5494,6 @@ See also _PyBytesWriter_Prepare(). // #ifndef Py_UNICODEOBJECT_H // #define Py_UNICODEOBJECT_H -// #include // va_list - /* Unicode implementation based on original code by Fredrik Lundh, @@ -5938,8 +5546,6 @@ See also _PyBytesWriter_Prepare(). * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * -------------------------------------------------------------------- */ -// #include - /* === Internal API ======================================================= */ /* --- Internal Unicode Format -------------------------------------------- */ @@ -5975,10 +5581,6 @@ through the interface functions PyUnicode_FromWideChar(), // # endif // #endif -// #ifdef HAVE_WCHAR_H -// # include -// #endif - /* Py_UCS4 and Py_UCS2 are typedefs for the respective unicode representations. */ @@ -7080,6 +6682,17 @@ Unicode ordinal integers or None (causing deletion of the character). String right ); +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030D0000 +/* Compare a Unicode object with UTF-8 encoded C string. + Return 1 if they are equal, or 0 otherwise. + This function does not raise exceptions. */ + +@NoException public static native int PyUnicode_EqualToUTF8(PyObject arg0, @Cast("const char*") BytePointer arg1); +@NoException public static native int PyUnicode_EqualToUTF8(PyObject arg0, String arg1); +@NoException public static native int PyUnicode_EqualToUTF8AndSize(PyObject arg0, @Cast("const char*") BytePointer arg1, @Cast("Py_ssize_t") long arg2); +@NoException public static native int PyUnicode_EqualToUTF8AndSize(PyObject arg0, String arg1, @Cast("Py_ssize_t") long arg2); +// #endif + /* Rich compare two strings and return one of the following: - NULL in case an exception was raised @@ -7144,8 +6757,7 @@ Unicode ordinal integers or None (causing deletion of the character). 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) */ + /* --- Internal Unicode Operations ---------------------------------------- */ @@ -7174,10 +6786,6 @@ Unicode ordinal integers or None (causing deletion of the character). -@NoException public static native int _PyUnicode_CheckConsistency( - PyObject op, - int check_content); - // #define _PyASCIIObject_CAST(op) // (assert(PyUnicode_Check(op)), @@ -7295,9 +6903,8 @@ calls PyUnicode_KIND() and might call it twice. For single reads, use // #define PyUnicode_MAX_CHAR_VALUE(op) // PyUnicode_MAX_CHAR_VALUE(_PyObject_CAST(op)) -/* === Public API ========================================================= */ -/* --- Plain Py_UNICODE --------------------------------------------------- */ +/* === Public API ========================================================= */ /* 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 @@ -7311,11 +6918,6 @@ calls PyUnicode_KIND() and might call it twice. For single reads, use // #define PyUnicode_READY(op) PyUnicode_READY(_PyObject_CAST(op)) -/* Get a copy of a Unicode string. */ -@NoException public static native 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. @@ -7342,17 +6944,6 @@ Fail if to is too small (smaller than *how_many* or smaller than @Cast("Py_ssize_t") long 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). */ -@NoException public static native void _PyUnicode_FastCopyCharacters( - PyObject to, - @Cast("Py_ssize_t") long to_start, - PyObject from, - @Cast("Py_ssize_t") long from_start, - @Cast("Py_ssize_t") long how_many - ); - /* Fill a string with a character: write fill_char into unicode[start:start+length]. @@ -7368,46 +6959,21 @@ may crash if parameters are invalid (e.g. if the output string @Cast("Py_UCS4") int 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). */ -@NoException public static native void _PyUnicode_FastFill( - PyObject unicode, - @Cast("Py_ssize_t") long start, - @Cast("Py_ssize_t") long length, - @Cast("Py_UCS4") int 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. */ @NoException public static native PyObject PyUnicode_FromKindAndData( int kind, @Const Pointer buffer, @Cast("Py_ssize_t") long size); - -/* Create a new string from a buffer of ASCII characters. - WARNING: Don't check if the string contains any non-ASCII character. */ -@NoException public static native PyObject _PyUnicode_FromASCII( - @Cast("const char*") BytePointer buffer, - @Cast("Py_ssize_t") long size); -@NoException public static native PyObject _PyUnicode_FromASCII( - String buffer, - @Cast("Py_ssize_t") long size); - -/* Compute the maximum character of the substring unicode[start:end]. - Return 127 for an empty string. */ -@NoException public static native @Cast("Py_UCS4") int _PyUnicode_FindMaxChar( - PyObject unicode, - @Cast("Py_ssize_t") long start, - @Cast("Py_ssize_t") long end); // Targeting ../_PyUnicodeWriter.java -/* 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. */ +// 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. @NoException public static native void _PyUnicodeWriter_Init(_PyUnicodeWriter writer); /* Prepare the buffer to write 'length' characters @@ -7493,15 +7059,6 @@ may crash if parameters are invalid (e.g. if the output string @NoException public static native void _PyUnicodeWriter_Dealloc(_PyUnicodeWriter writer); -/* Format the object based on the format_spec, as defined in PEP 3101 - (Advanced String Formatting). */ -@NoException public static native int _PyUnicode_FormatAdvancedWriter( - _PyUnicodeWriter writer, - PyObject obj, - PyObject format_spec, - @Cast("Py_ssize_t") long start, - @Cast("Py_ssize_t") long end); - /* --- Manage the default encoding ---------------------------------------- */ /* Returns a pointer to the default encoding (UTF-8) of the @@ -7519,317 +7076,14 @@ Like PyUnicode_AsUTF8AndSize(), this also caches the UTF-8 representation @NoException public static native @Cast("const char*") BytePointer PyUnicode_AsUTF8(PyObject unicode); +// Alias kept for backward compatibility // #define _PyUnicode_AsString PyUnicode_AsUTF8 -/* --- UTF-7 Codecs ------------------------------------------------------- */ -@NoException public static native PyObject _PyUnicode_EncodeUTF7( - PyObject unicode, - int base64SetO, - int base64WhiteSpace, - @Cast("const char*") BytePointer errors - ); -@NoException public static native PyObject _PyUnicode_EncodeUTF7( - PyObject unicode, - int base64SetO, - int base64WhiteSpace, - String errors - ); +/* === Characters Type APIs =============================================== */ -/* --- UTF-8 Codecs ------------------------------------------------------- */ - -@NoException public static native PyObject _PyUnicode_AsUTF8String( - PyObject unicode, - @Cast("const char*") BytePointer errors); -@NoException public static native PyObject _PyUnicode_AsUTF8String( - PyObject unicode, - String errors); - -/* --- UTF-32 Codecs ------------------------------------------------------ */ - -@NoException public static native PyObject _PyUnicode_EncodeUTF32( - PyObject object, - @Cast("const char*") BytePointer errors, - int byteorder - ); -@NoException public static native PyObject _PyUnicode_EncodeUTF32( - PyObject object, - String errors, - int byteorder - ); - -/* --- 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. -*/ -@NoException public static native PyObject _PyUnicode_EncodeUTF16( - PyObject unicode, - @Cast("const char*") BytePointer errors, - int byteorder - ); -@NoException public static native PyObject _PyUnicode_EncodeUTF16( - PyObject unicode, - String errors, - int byteorder - ); - -/* --- Unicode-Escape Codecs ---------------------------------------------- */ - -/* Variant of PyUnicode_DecodeUnicodeEscape that supports partial decoding. */ -@NoException public static native PyObject _PyUnicode_DecodeUnicodeEscapeStateful( - @Cast("const char*") BytePointer string, - @Cast("Py_ssize_t") long length, - @Cast("const char*") BytePointer errors, - @Cast("Py_ssize_t*") SizeTPointer consumed -); -@NoException public static native PyObject _PyUnicode_DecodeUnicodeEscapeStateful( - String string, - @Cast("Py_ssize_t") long length, - String errors, - @Cast("Py_ssize_t*") SizeTPointer consumed -); -/* Helper for PyUnicode_DecodeUnicodeEscape that detects invalid escape - chars. */ -@NoException public static native PyObject _PyUnicode_DecodeUnicodeEscapeInternal( - @Cast("const char*") BytePointer string, - @Cast("Py_ssize_t") long length, - @Cast("const char*") BytePointer errors, - @Cast("Py_ssize_t*") SizeTPointer consumed, - @Cast("const char**") PointerPointer first_invalid_escape -); -@NoException public static native PyObject _PyUnicode_DecodeUnicodeEscapeInternal( - @Cast("const char*") BytePointer string, - @Cast("Py_ssize_t") long length, - @Cast("const char*") BytePointer errors, - @Cast("Py_ssize_t*") SizeTPointer consumed, - @Cast("const char**") @ByPtrPtr BytePointer first_invalid_escape -); -@NoException public static native PyObject _PyUnicode_DecodeUnicodeEscapeInternal( - String string, - @Cast("Py_ssize_t") long length, - String errors, - @Cast("Py_ssize_t*") SizeTPointer consumed, - @Cast("const char**") @ByPtrPtr ByteBuffer first_invalid_escape -); -@NoException public static native PyObject _PyUnicode_DecodeUnicodeEscapeInternal( - @Cast("const char*") BytePointer string, - @Cast("Py_ssize_t") long length, - @Cast("const char*") BytePointer errors, - @Cast("Py_ssize_t*") SizeTPointer consumed, - @Cast("const char**") @ByPtrPtr byte[] first_invalid_escape -); -@NoException public static native PyObject _PyUnicode_DecodeUnicodeEscapeInternal( - String string, - @Cast("Py_ssize_t") long length, - String errors, - @Cast("Py_ssize_t*") SizeTPointer consumed, - @Cast("const char**") @ByPtrPtr BytePointer first_invalid_escape -); -@NoException public static native PyObject _PyUnicode_DecodeUnicodeEscapeInternal( - @Cast("const char*") BytePointer string, - @Cast("Py_ssize_t") long length, - @Cast("const char*") BytePointer errors, - @Cast("Py_ssize_t*") SizeTPointer consumed, - @Cast("const char**") @ByPtrPtr ByteBuffer first_invalid_escape -); -@NoException public static native PyObject _PyUnicode_DecodeUnicodeEscapeInternal( - String string, - @Cast("Py_ssize_t") long length, - String errors, - @Cast("Py_ssize_t*") SizeTPointer consumed, - @Cast("const char**") @ByPtrPtr byte[] first_invalid_escape -); - -/* --- Raw-Unicode-Escape Codecs ---------------------------------------------- */ - -/* Variant of PyUnicode_DecodeRawUnicodeEscape that supports partial decoding. */ -@NoException public static native PyObject _PyUnicode_DecodeRawUnicodeEscapeStateful( - @Cast("const char*") BytePointer string, - @Cast("Py_ssize_t") long length, - @Cast("const char*") BytePointer errors, - @Cast("Py_ssize_t*") SizeTPointer consumed -); -@NoException public static native PyObject _PyUnicode_DecodeRawUnicodeEscapeStateful( - String string, - @Cast("Py_ssize_t") long length, - String errors, - @Cast("Py_ssize_t*") SizeTPointer consumed -); - -/* --- Latin-1 Codecs ----------------------------------------------------- */ - -@NoException public static native PyObject _PyUnicode_AsLatin1String( - PyObject unicode, - @Cast("const char*") BytePointer errors); -@NoException public static native PyObject _PyUnicode_AsLatin1String( - PyObject unicode, - String errors); - -/* --- ASCII Codecs ------------------------------------------------------- */ - -@NoException public static native PyObject _PyUnicode_AsASCIIString( - PyObject unicode, - @Cast("const char*") BytePointer errors); -@NoException public static native PyObject _PyUnicode_AsASCIIString( - PyObject unicode, - String 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. -*/ -@NoException public static native PyObject _PyUnicode_EncodeCharmap( - PyObject unicode, - PyObject mapping, - @Cast("const char*") BytePointer errors - ); -@NoException public static native PyObject _PyUnicode_EncodeCharmap( - PyObject unicode, - PyObject mapping, - String errors - ); - -/* --- 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 '?'. */ - -@NoException public static native PyObject _PyUnicode_TransformDecimalAndSpaceToASCII( - PyObject unicode - ); - -/* --- Methods & Slots ---------------------------------------------------- */ - -@NoException public static native PyObject _PyUnicode_JoinArray( - PyObject separator, - @Cast("PyObject*const*") PointerPointer items, - @Cast("Py_ssize_t") long seqlen - ); -@NoException public static native PyObject _PyUnicode_JoinArray( - PyObject separator, - @ByPtrPtr PyObject items, - @Cast("Py_ssize_t") long 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. */ -@NoException public static native int _PyUnicode_EqualToASCIIId( - PyObject left, - _Py_Identifier right - ); - -/* 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. */ -@NoException public static native int _PyUnicode_EqualToASCIIString( - PyObject left, - @Cast("const char*") BytePointer right - ); -@NoException public static native int _PyUnicode_EqualToASCIIString( - PyObject left, - String right - ); - -/* Externally visible for str.strip(unicode) */ -@NoException public static native 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 */ -@NoException public static native @Cast("Py_ssize_t") long _PyUnicode_InsertThousandsGrouping( - _PyUnicodeWriter writer, - @Cast("Py_ssize_t") long n_buffer, - PyObject digits, - @Cast("Py_ssize_t") long d_pos, - @Cast("Py_ssize_t") long n_digits, - @Cast("Py_ssize_t") long min_width, - @Cast("const char*") BytePointer grouping, - PyObject thousands_sep, - @Cast("Py_UCS4*") IntPointer maxchar); -@NoException public static native @Cast("Py_ssize_t") long _PyUnicode_InsertThousandsGrouping( - _PyUnicodeWriter writer, - @Cast("Py_ssize_t") long n_buffer, - PyObject digits, - @Cast("Py_ssize_t") long d_pos, - @Cast("Py_ssize_t") long n_digits, - @Cast("Py_ssize_t") long min_width, - String grouping, - PyObject thousands_sep, - @Cast("Py_UCS4*") IntBuffer maxchar); -@NoException public static native @Cast("Py_ssize_t") long _PyUnicode_InsertThousandsGrouping( - _PyUnicodeWriter writer, - @Cast("Py_ssize_t") long n_buffer, - PyObject digits, - @Cast("Py_ssize_t") long d_pos, - @Cast("Py_ssize_t") long n_digits, - @Cast("Py_ssize_t") long min_width, - @Cast("const char*") BytePointer grouping, - PyObject thousands_sep, - @Cast("Py_UCS4*") int[] maxchar); -@NoException public static native @Cast("Py_ssize_t") long _PyUnicode_InsertThousandsGrouping( - _PyUnicodeWriter writer, - @Cast("Py_ssize_t") long n_buffer, - PyObject digits, - @Cast("Py_ssize_t") long d_pos, - @Cast("Py_ssize_t") long n_digits, - @Cast("Py_ssize_t") long min_width, - String grouping, - PyObject thousands_sep, - @Cast("Py_UCS4*") IntPointer maxchar); -@NoException public static native @Cast("Py_ssize_t") long _PyUnicode_InsertThousandsGrouping( - _PyUnicodeWriter writer, - @Cast("Py_ssize_t") long n_buffer, - PyObject digits, - @Cast("Py_ssize_t") long d_pos, - @Cast("Py_ssize_t") long n_digits, - @Cast("Py_ssize_t") long min_width, - @Cast("const char*") BytePointer grouping, - PyObject thousands_sep, - @Cast("Py_UCS4*") IntBuffer maxchar); -@NoException public static native @Cast("Py_ssize_t") long _PyUnicode_InsertThousandsGrouping( - _PyUnicodeWriter writer, - @Cast("Py_ssize_t") long n_buffer, - PyObject digits, - @Cast("Py_ssize_t") long d_pos, - @Cast("Py_ssize_t") long n_digits, - @Cast("Py_ssize_t") long min_width, - String grouping, - PyObject thousands_sep, - @Cast("Py_UCS4*") int[] maxchar); - -/* === Characters Type APIs =============================================== */ - -/* These should not be used directly. Use the Py_UNICODE_IS* and - Py_UNICODE_TO* macros instead. +/* 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. @@ -7847,14 +7101,6 @@ Unicode ordinal integers or None (causing deletion of the character). @Cast("Py_UCS4") int ch ); -@NoException public static native int _PyUnicode_IsXidStart( - @Cast("Py_UCS4") int ch - ); - -@NoException public static native int _PyUnicode_IsXidContinue( - @Cast("Py_UCS4") int ch - ); - @NoException public static native int _PyUnicode_IsWhitespace( @Cast("const Py_UCS4") int ch ); @@ -7863,75 +7109,15 @@ Unicode ordinal integers or None (causing deletion of the character). @Cast("const Py_UCS4") int ch ); -/* Py_DEPRECATED(3.3) */ @NoException public static native @Cast("Py_UCS4") int _PyUnicode_ToLowercase( - @Cast("Py_UCS4") int ch - ); - -/* Py_DEPRECATED(3.3) */ @NoException public static native @Cast("Py_UCS4") int _PyUnicode_ToUppercase( - @Cast("Py_UCS4") int ch - ); - -@NoException public static native @Cast("Py_UCS4") @Deprecated int _PyUnicode_ToTitlecase( +@NoException public static native @Cast("Py_UCS4") int _PyUnicode_ToLowercase( @Cast("Py_UCS4") int ch ); -@NoException public static native int _PyUnicode_ToLowerFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") IntPointer res - ); -@NoException public static native int _PyUnicode_ToLowerFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") IntBuffer res - ); -@NoException public static native int _PyUnicode_ToLowerFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") int[] res - ); - -@NoException public static native int _PyUnicode_ToTitleFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") IntPointer res - ); -@NoException public static native int _PyUnicode_ToTitleFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") IntBuffer res - ); -@NoException public static native int _PyUnicode_ToTitleFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") int[] res - ); - -@NoException public static native int _PyUnicode_ToUpperFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") IntPointer res - ); -@NoException public static native int _PyUnicode_ToUpperFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") IntBuffer res - ); -@NoException public static native int _PyUnicode_ToUpperFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") int[] res - ); - -@NoException public static native int _PyUnicode_ToFoldedFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") IntPointer res - ); -@NoException public static native int _PyUnicode_ToFoldedFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") IntBuffer res - ); -@NoException public static native int _PyUnicode_ToFoldedFull( - @Cast("Py_UCS4") int ch, - @Cast("Py_UCS4*") int[] res - ); - -@NoException public static native int _PyUnicode_IsCaseIgnorable( +@NoException public static native @Cast("Py_UCS4") int _PyUnicode_ToUppercase( @Cast("Py_UCS4") int ch ); -@NoException public static native int _PyUnicode_IsCased( +@NoException public static native @Cast("Py_UCS4") int _PyUnicode_ToTitlecase( @Cast("Py_UCS4") int ch ); @@ -8002,23 +7188,10 @@ Unicode ordinal integers or None (causing deletion of the character). /* === Misc functions ===================================================== */ -@NoException public static native PyObject _PyUnicode_FormatLong(PyObject arg0, int arg1, int arg2, int arg3); - -/* Return an interned Unicode object for an Identifier; may fail if there is no memory.*/ +// Return an interned Unicode object for an Identifier; may fail if there is no +// memory. @NoException public static native PyObject _PyUnicode_FromId(_Py_Identifier arg0); -/* 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) */ -@NoException public static native int _PyUnicode_EQ(PyObject arg0, PyObject arg1); - -/* Equality check. */ -@NoException public static native int _PyUnicode_Equal(PyObject arg0, PyObject arg1); - -@NoException public static native int _PyUnicode_WideCharString_Converter(PyObject arg0, Pointer arg1); -@NoException public static native int _PyUnicode_WideCharString_Opt_Converter(PyObject arg0, Pointer arg1); - -@NoException public static native @Cast("Py_ssize_t") long _PyUnicode_ScanIdentifier(PyObject arg0); - // Parsed from longobject.h @@ -8041,6 +7214,7 @@ and where the hash values are equal (i.e. a very probable match) */ @NoException public static native PyObject PyLong_FromSize_t(@Cast("size_t") long arg0); @NoException public static native PyObject PyLong_FromSsize_t(@Cast("Py_ssize_t") long arg0); @NoException public static native PyObject PyLong_FromDouble(double arg0); + @NoException public static native long PyLong_AsLong(PyObject arg0); @NoException public static native long PyLong_AsLongAndOverflow(PyObject arg0, IntPointer arg1); @NoException public static native long PyLong_AsLongAndOverflow(PyObject arg0, IntBuffer arg1); @@ -8049,6 +7223,11 @@ and where the hash values are equal (i.e. a very probable match) */ @NoException public static native @Cast("size_t") long PyLong_AsSize_t(PyObject arg0); @NoException public static native @Cast("unsigned long") long PyLong_AsUnsignedLong(PyObject arg0); @NoException public static native @Cast("unsigned long") long PyLong_AsUnsignedLongMask(PyObject arg0); + +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +@NoException public static native int PyLong_AsInt(PyObject arg0); +// #endif + @NoException public static native PyObject PyLong_GetInfo(); /* It may be useful in the future. I've added it in the PyInt -> PyLong @@ -8059,10 +7238,9 @@ and where the hash values are equal (i.e. a very probable match) */ // #if !defined(SIZEOF_PID_T) || SIZEOF_PID_T == SIZEOF_INT public static final String _Py_PARSE_PID = "i"; // #define PyLong_FromPid PyLong_FromLong -// # ifndef Py_LIMITED_API -// # define PyLong_AsPid _PyLong_AsInt +// # if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +// # define PyLong_AsPid PyLong_AsInt // # elif SIZEOF_INT == SIZEOF_LONG -// # define PyLong_AsPid PyLong_AsLong // # else // # endif // #elif SIZEOF_PID_T == SIZEOF_LONG @@ -8197,12 +7375,21 @@ and where the hash values are equal (i.e. a very probable match) */ @NoException public static native PyLongObject _PyLong_New(@Cast("Py_ssize_t") long arg0); -/* Return a copy of src. */ +// Return a copy of src. @NoException public static native PyObject _PyLong_Copy(PyLongObject src); -@NoException public static native PyLongObject _PyLong_FromDigits(int negative, @Cast("Py_ssize_t") long digit_count, @Cast("digit*") IntPointer digits); -@NoException public static native PyLongObject _PyLong_FromDigits(int negative, @Cast("Py_ssize_t") long digit_count, @Cast("digit*") IntBuffer digits); -@NoException public static native PyLongObject _PyLong_FromDigits(int negative, @Cast("Py_ssize_t") long digit_count, @Cast("digit*") int[] digits); +@NoException public static native PyLongObject _PyLong_FromDigits( + int negative, + @Cast("Py_ssize_t") long digit_count, + @Cast("digit*") IntPointer digits); +@NoException public static native PyLongObject _PyLong_FromDigits( + int negative, + @Cast("Py_ssize_t") long digit_count, + @Cast("digit*") IntBuffer digits); +@NoException public static native PyLongObject _PyLong_FromDigits( + int negative, + @Cast("Py_ssize_t") long digit_count, + @Cast("digit*") int[] digits); /* Inline some internals for speed. These should be in pycore_long.h @@ -8248,8 +7435,13 @@ and where the hash values are equal (i.e. a very probable match) */ public static native @ByRef PyLongObject _Py_TrueStruct(); public static native void _Py_TrueStruct(PyLongObject setter); /* Use these macros */ -// #define Py_False _PyObject_CAST(&_Py_FalseStruct) -// #define Py_True _PyObject_CAST(&_Py_TrueStruct) +// #if defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030D0000 +// # define Py_False Py_GetConstantBorrowed(Py_CONSTANT_FALSE) +// # define Py_True Py_GetConstantBorrowed(Py_CONSTANT_TRUE) +// #else +// # define Py_False _PyObject_CAST(&_Py_FalseStruct) +// # define Py_True _PyObject_CAST(&_Py_TrueStruct) +// #endif // Test if an object is the True singleton, the same as "x is True" in Python. @NoException public static native int Py_IsTrue(PyObject x); @@ -8486,7 +7678,6 @@ PyFloatObject represents a (double precision) floating-point number. @NoException public static native int _PyTuple_Resize(@Cast("PyObject**") PointerPointer arg0, @Cast("Py_ssize_t") long arg1); @NoException public static native int _PyTuple_Resize(@ByPtrPtr PyObject arg0, @Cast("Py_ssize_t") long arg1); -@NoException public static native void _PyTuple_MaybeUntrack(PyObject arg0); /* Cast argument to PyTupleObject* type. */ // #define _PyTuple_CAST(op) @@ -8504,8 +7695,6 @@ PyFloatObject represents a (double precision) floating-point number. // #define PyTuple_SET_ITEM(op, index, value) // PyTuple_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value)) -@NoException public static native void _PyTuple_DebugMallocStats(@Cast("FILE*") Pointer out); - // Parsed from listobject.h @@ -8539,6 +7728,9 @@ PyFloatObject represents a (double precision) floating-point number. @NoException public static native @Cast("Py_ssize_t") long PyList_Size(PyObject arg0); @NoException public static native PyObject PyList_GetItem(PyObject arg0, @Cast("Py_ssize_t") long arg1); +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +@NoException public static native PyObject PyList_GetItemRef(PyObject arg0, @Cast("Py_ssize_t") long arg1); +// #endif @NoException public static native int PyList_SetItem(PyObject arg0, @Cast("Py_ssize_t") long arg1, PyObject arg2); @NoException public static native int PyList_Insert(PyObject arg0, @Cast("Py_ssize_t") long arg1, PyObject arg2); @NoException public static native int PyList_Append(PyObject arg0, PyObject arg1); @@ -8569,9 +7761,6 @@ PyFloatObject represents a (double precision) floating-point number. -@NoException public static native PyObject _PyList_Extend(PyListObject arg0, PyObject arg1); -@NoException public static native void _PyList_DebugMallocStats(@Cast("FILE*") Pointer out); - /* Cast argument to PyListObject* type. */ // #define _PyList_CAST(op) // (assert(PyList_Check(op)), _Py_CAST(PyListObject*, (op))) @@ -8587,6 +7776,9 @@ PyFloatObject represents a (double precision) floating-point number. // #define PyList_SET_ITEM(op, index, value) // PyList_SET_ITEM(_PyObject_CAST(op), (index), _PyObject_CAST(value)) +@NoException public static native int PyList_Extend(PyObject self, PyObject iterable); +@NoException public static native int PyList_Clear(PyObject self); + // Parsed from dictobject.h @@ -8653,6 +7845,20 @@ of a key wins, else the first. The Python dict constructor dict(seq2) @NoException public static native int PyDict_SetItemString(PyObject dp, String key, PyObject item); @NoException public static native int PyDict_DelItemString(PyObject dp, @Cast("const char*") BytePointer key); @NoException public static native int PyDict_DelItemString(PyObject dp, String key); + +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030D0000 +// Return the object from dictionary *op* which has a key *key*. +// - If the key is present, set *result to a new strong reference to the value +// and return 1. +// - If the key is missing, set *result to NULL and return 0 . +// - On error, raise an exception and return -1. +@NoException public static native int PyDict_GetItemRef(PyObject mp, PyObject key, @Cast("PyObject**") PointerPointer result); +@NoException public static native int PyDict_GetItemRef(PyObject mp, PyObject key, @ByPtrPtr PyObject result); +@NoException public static native int PyDict_GetItemStringRef(PyObject mp, @Cast("const char*") BytePointer key, @Cast("PyObject**") PointerPointer result); +@NoException public static native int PyDict_GetItemStringRef(PyObject mp, @Cast("const char*") BytePointer key, @ByPtrPtr PyObject result); +@NoException public static native int PyDict_GetItemStringRef(PyObject mp, String key, @ByPtrPtr PyObject result); +// #endif + // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000 @NoException public static native PyObject PyObject_GenericGetDict(PyObject arg0, Pointer arg1); // #endif @@ -8707,57 +7913,38 @@ of a key wins, else the first. The Python dict constructor dict(seq2) @NoException public static native PyObject _PyDict_GetItem_KnownHash(PyObject mp, PyObject key, - @Cast("Py_hash_t") long hash); -@NoException public static native PyObject _PyDict_GetItemWithError(PyObject dp, PyObject key); -@NoException public static native PyObject _PyDict_GetItemIdWithError(PyObject dp, - _Py_Identifier key); + @Cast("Py_hash_t") long hash); @NoException public static native PyObject _PyDict_GetItemStringWithError(PyObject arg0, @Cast("const char*") BytePointer arg1); @NoException public static native PyObject _PyDict_GetItemStringWithError(PyObject arg0, String arg1); @NoException public static native PyObject PyDict_SetDefault( PyObject mp, PyObject key, PyObject defaultobj); -@NoException public static native int _PyDict_SetItem_KnownHash(PyObject mp, PyObject key, - PyObject item, @Cast("Py_hash_t") long hash); -@NoException public static native int _PyDict_DelItem_KnownHash(PyObject mp, PyObject key, - @Cast("Py_hash_t") long hash); -// Targeting ../Predicate_PyObject.java - -@NoException public static native int _PyDict_DelItemIf(PyObject mp, PyObject key, - Predicate_PyObject predicate); -@NoException public static native int _PyDict_Next( - PyObject mp, @Cast("Py_ssize_t*") SizeTPointer pos, @Cast("PyObject**") PointerPointer key, @Cast("PyObject**") PointerPointer value, @Cast("Py_hash_t*") SizeTPointer hash); -@NoException public static native int _PyDict_Next( - PyObject mp, @Cast("Py_ssize_t*") SizeTPointer pos, @ByPtrPtr PyObject key, @ByPtrPtr PyObject value, @Cast("Py_hash_t*") SizeTPointer hash); +// Inserts `key` with a value `default_value`, if `key` is not already present +// in the dictionary. If `result` is not NULL, then the value associated +// with `key` is returned in `*result` (either the existing value, or the now +// inserted `default_value`). +// Returns: +// -1 on error +// 0 if `key` was not present and `default_value` was inserted +// 1 if `key` was present and `default_value` was not inserted +@NoException public static native int PyDict_SetDefaultRef(PyObject mp, PyObject key, PyObject default_value, @Cast("PyObject**") PointerPointer result); +@NoException public static native int PyDict_SetDefaultRef(PyObject mp, PyObject key, PyObject default_value, @ByPtrPtr PyObject result); /* Get the number of items of a dictionary. */ @NoException public static native @Cast("Py_ssize_t") long PyDict_GET_SIZE(PyObject op); // #define PyDict_GET_SIZE(op) PyDict_GET_SIZE(_PyObject_CAST(op)) -@NoException public static native int _PyDict_Contains_KnownHash(PyObject arg0, PyObject arg1, @Cast("Py_hash_t") long arg2); -@NoException public static native int _PyDict_ContainsId(PyObject arg0, _Py_Identifier arg1); -@NoException public static native PyObject _PyDict_NewPresized(@Cast("Py_ssize_t") long minused); -@NoException public static native void _PyDict_MaybeUntrack(PyObject mp); -@NoException public static native int _PyDict_HasOnlyStringKeys(PyObject mp); - -@NoException public static native PyObject _PyDict_Pop(PyObject arg0, PyObject arg1, PyObject arg2); -// #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. -*/ -@NoException public static native int _PyDict_MergeEx(PyObject mp, PyObject other, int override); -@NoException public static native int _PyDict_SetItemId(PyObject dp, _Py_Identifier key, PyObject item); - -@NoException public static native int _PyDict_DelItemId(PyObject mp, _Py_Identifier key); -@NoException public static native void _PyDict_DebugMallocStats(@Cast("FILE*") Pointer out); -// Targeting ../_PyDictViewObject.java - - +@NoException public static native int PyDict_ContainsString(PyObject mp, @Cast("const char*") BytePointer key); +@NoException public static native int PyDict_ContainsString(PyObject mp, String key); +@NoException public static native PyObject _PyDict_NewPresized(@Cast("Py_ssize_t") long minused); -@NoException public static native PyObject _PyDictView_Intersect(PyObject self, PyObject other); +@NoException public static native int PyDict_Pop(PyObject dict, PyObject key, @Cast("PyObject**") PointerPointer result); +@NoException public static native int PyDict_Pop(PyObject dict, PyObject key, @ByPtrPtr PyObject result); +@NoException public static native int PyDict_PopString(PyObject dict, @Cast("const char*") BytePointer key, @Cast("PyObject**") PointerPointer result); +@NoException public static native int PyDict_PopString(PyObject dict, @Cast("const char*") BytePointer key, @ByPtrPtr PyObject result); +@NoException public static native int PyDict_PopString(PyObject dict, String key, @ByPtrPtr PyObject result); +@NoException public static native PyObject _PyDict_Pop(PyObject dict, PyObject key, PyObject default_value); /* Dictionary watchers */ @@ -8981,19 +8168,24 @@ of a key wins, else the first. The Python dict constructor dict(seq2) // Targeting ../PyCFunction.java -// Targeting ../_PyCFunctionFast.java +// Targeting ../PyCFunctionFast.java // Targeting ../PyCFunctionWithKeywords.java -// Targeting ../_PyCFunctionFastWithKeywords.java +// Targeting ../PyCFunctionFastWithKeywords.java // Targeting ../PyCMethod.java +// For backwards compatibility. `METH_FASTCALL` was added to the stable API in +// 3.10 alongside `_PyCFunctionFastWithKeywords` and `_PyCFunctionFast`. +// Note that the underscore-prefixed names were documented in public docs; +// people may be using them. + // 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 @@ -9016,8 +8208,6 @@ of a key wins, else the first. The Python dict constructor dict(seq2) @NoException public static native PyCFunction PyCFunction_GetFunction(PyObject arg0); @NoException public static native PyObject PyCFunction_GetSelf(PyObject arg0); @NoException public static native int PyCFunction_GetFlags(PyObject arg0); - -@NoException public static native @Deprecated PyObject PyCFunction_Call(PyObject arg0, PyObject arg1, PyObject arg2); // Targeting ../PyMethodDef.java @@ -9166,11 +8356,6 @@ of a key wins, else the first. The Python dict constructor dict(seq2) @NoException public static native @Cast("const char*") BytePointer PyModule_GetName(PyObject arg0); @NoException public static native @Deprecated @Cast("const char*") BytePointer PyModule_GetFilename(PyObject arg0); @NoException public static native PyObject PyModule_GetFilenameObject(PyObject arg0); -// #ifndef Py_LIMITED_API -@NoException public static native void _PyModule_Clear(PyObject arg0); -@NoException public static native void _PyModule_ClearDict(PyObject arg0); -@NoException public static native int _PyModuleSpec_IsInitializing(PyObject arg0); -// #endif @NoException public static native PyModuleDef PyModule_GetDef(PyObject arg0); @NoException public static native Pointer PyModule_GetState(PyObject arg0); @@ -9197,9 +8382,13 @@ of a key wins, else the first. The Python dict constructor dict(seq2) // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030c0000 public static final int Py_mod_multiple_interpreters = 3; // #endif +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +public static final int Py_mod_gil = 4; +// #endif + // #ifndef Py_LIMITED_API -public static final int _Py_mod_LAST_SLOT = 3; +public static final int _Py_mod_LAST_SLOT = 4; // #endif // #endif /* New in 3.5 */ @@ -9212,14 +8401,17 @@ of a key wins, else the first. The Python dict constructor dict(seq2) public static final Pointer Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED = Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED(); public static native @MemberGetter Pointer Py_MOD_PER_INTERPRETER_GIL_SUPPORTED(); public static final Pointer Py_MOD_PER_INTERPRETER_GIL_SUPPORTED = Py_MOD_PER_INTERPRETER_GIL_SUPPORTED(); -// Targeting ../PyModuleDef.java - +// #endif +/* for Py_mod_gil: */ +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +public static native @MemberGetter Pointer Py_MOD_GIL_USED(); +public static final Pointer Py_MOD_GIL_USED = Py_MOD_GIL_USED(); +public static native @MemberGetter Pointer Py_MOD_GIL_NOT_USED(); +public static final Pointer Py_MOD_GIL_NOT_USED = Py_MOD_GIL_NOT_USED(); +// Targeting ../PyModuleDef.java -// Internal C API -// #ifdef Py_BUILD_CORE -// #endif // #ifdef __cplusplus // #endif @@ -9274,17 +8466,6 @@ of a key wins, else the first. The Python dict constructor dict(seq2) @NoException public static native PyObject PyFunction_GetAnnotations(PyObject arg0); @NoException public static native int PyFunction_SetAnnotations(PyObject arg0, PyObject arg1); -@NoException public static native PyObject _PyFunction_Vectorcall( - PyObject func, - @Cast("PyObject*const*") PointerPointer stack, - @Cast("size_t") long nargsf, - PyObject kwnames); -@NoException public static native PyObject _PyFunction_Vectorcall( - PyObject func, - @ByPtrPtr PyObject stack, - @Cast("size_t") long nargsf, - PyObject kwnames); - // #define _PyFunction_CAST(func) // (assert(PyFunction_Check(func)), _Py_CAST(PyFunctionObject*, func)) @@ -9456,14 +8637,6 @@ of a key wins, else the first. The Python dict constructor dict(seq2) public static native @Deprecated int Py_UTF8Mode(); public static native void Py_UTF8Mode(int setter); // #endif -/* 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 -// #define _PyIsSelectable_fd(FD) ((unsigned int)(FD) < (unsigned int)FD_SETSIZE) -// #endif - // #ifndef Py_LIMITED_API // # define Py_CPYTHON_FILEOBJECT_H // # include "cpython/fileobject.h" @@ -9484,9 +8657,6 @@ of a key wins, else the first. The Python dict constructor dict(seq2) @NoException public static native @Cast("char*") BytePointer Py_UniversalNewlineFgets(@Cast("char*") BytePointer arg0, int arg1, @Cast("FILE*") Pointer arg2, PyObject arg3); @NoException public static native @Cast("char*") ByteBuffer Py_UniversalNewlineFgets(@Cast("char*") ByteBuffer arg0, int arg1, @Cast("FILE*") Pointer arg2, PyObject arg3); @NoException public static native @Cast("char*") byte[] Py_UniversalNewlineFgets(@Cast("char*") byte[] arg0, int arg1, @Cast("FILE*") Pointer arg2, PyObject arg3); -@NoException public static native @Cast("char*") BytePointer _Py_UniversalNewlineFgetsWithSize(@Cast("char*") BytePointer arg0, int arg1, @Cast("FILE*") Pointer arg2, PyObject arg3, @Cast("size_t*") SizeTPointer arg4); -@NoException public static native @Cast("char*") ByteBuffer _Py_UniversalNewlineFgetsWithSize(@Cast("char*") ByteBuffer arg0, int arg1, @Cast("FILE*") Pointer arg2, PyObject arg3, @Cast("size_t*") SizeTPointer arg4); -@NoException public static native @Cast("char*") byte[] _Py_UniversalNewlineFgetsWithSize(@Cast("char*") byte[] arg0, int arg1, @Cast("FILE*") Pointer arg2, PyObject arg3, @Cast("size_t*") SizeTPointer arg4); /* The std printer acts as a preliminary sys.stderr until the new io infrastructure is in place. */ @@ -9501,8 +8671,6 @@ of a key wins, else the first. The Python dict constructor dict(seq2) @NoException public static native PyObject PyFile_OpenCodeObject(PyObject path); @NoException public static native int PyFile_SetOpenCodeHook(Py_OpenCodeHookFunction hook, Pointer userData); -@NoException public static native int _PyLong_FileDescriptor_Converter(PyObject arg0, Pointer arg1); - // Parsed from frameobject.h @@ -9557,6 +8725,9 @@ of a key wins, else the first. The Python dict constructor dict(seq2) @NoException public static native int PyFrame_FastToLocalsWithError(PyFrameObject f); @NoException public static native void PyFrame_FastToLocals(PyFrameObject arg0); +// Targeting ../PyFrameLocalsProxyObject.java + + // Parsed from pycapsule.h @@ -9625,7 +8796,6 @@ of a key wins, else the first. The Python dict constructor dict(seq2) String name, int no_block); - // #ifdef __cplusplus // #endif // #endif /* !Py_CAPSULE_H */ @@ -9695,13 +8865,6 @@ of a key wins, else the first. The Python dict constructor dict(seq2) -@NoException public static native int _Py_DisplaySourceLine(PyObject arg0, PyObject arg1, int arg2, int arg3, IntPointer arg4, @Cast("PyObject**") PointerPointer arg5); -@NoException public static native int _Py_DisplaySourceLine(PyObject arg0, PyObject arg1, int arg2, int arg3, IntPointer arg4, @ByPtrPtr PyObject arg5); -@NoException public static native int _Py_DisplaySourceLine(PyObject arg0, PyObject arg1, int arg2, int arg3, IntBuffer arg4, @ByPtrPtr PyObject arg5); -@NoException public static native int _Py_DisplaySourceLine(PyObject arg0, PyObject arg1, int arg2, int arg3, int[] arg4, @ByPtrPtr PyObject arg5); -@NoException public static native void _PyTraceback_Add(@Cast("const char*") BytePointer arg0, @Cast("const char*") BytePointer arg1, int arg2); -@NoException public static native void _PyTraceback_Add(String arg0, String arg1, int arg2); - // Parsed from sliceobject.h @@ -9714,7 +8877,10 @@ of a key wins, else the first. The Python dict constructor dict(seq2) public static native @ByRef PyObject _Py_EllipsisObject(); public static native void _Py_EllipsisObject(PyObject setter); /* Don't use this directly */ -// #define Py_Ellipsis (&_Py_EllipsisObject) +// #if defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030D0000 +// # define Py_Ellipsis Py_GetConstantBorrowed(Py_CONSTANT_ELLIPSIS) +// #else +// # define Py_Ellipsis (&_Py_EllipsisObject) // Targeting ../PySliceObject.java @@ -9803,8 +8969,6 @@ of a key wins, else the first. The Python dict constructor dict(seq2) public static native @ByRef PyTypeObject PySeqIter_Type(); public static native void PySeqIter_Type(PyTypeObject setter); public static native @ByRef PyTypeObject PyCallIter_Type(); public static native void PyCallIter_Type(PyTypeObject setter); -// #ifdef Py_BUILD_CORE -// #endif // #define PySeqIter_Check(op) Py_IS_TYPE((op), &PySeqIter_Type) @@ -9863,17 +9027,12 @@ of a key wins, else the first. The Python dict constructor dict(seq2) @NoException public static native PyObject PyGen_New(PyFrameObject arg0); @NoException public static native PyObject PyGen_NewWithQualName(PyFrameObject arg0, PyObject name, PyObject qualname); -@NoException public static native int _PyGen_SetStopIterationValue(PyObject arg0); -@NoException public static native int _PyGen_FetchStopIterationValue(@Cast("PyObject**") PointerPointer arg0); -@NoException public static native int _PyGen_FetchStopIterationValue(@ByPtrPtr PyObject arg0); -@NoException public static native void _PyGen_Finalize(PyObject self); @NoException public static native PyCodeObject PyGen_GetCode(PyGenObject gen); // Targeting ../PyCoroObject.java public static native @ByRef PyTypeObject PyCoro_Type(); public static native void PyCoro_Type(PyTypeObject setter); -public static native @ByRef PyTypeObject _PyCoroWrapper_Type(); public static native void _PyCoroWrapper_Type(PyTypeObject setter); // #define PyCoro_CheckExact(op) Py_IS_TYPE((op), &PyCoro_Type) @NoException public static native PyObject PyCoro_New(PyFrameObject arg0, @@ -9884,8 +9043,6 @@ of a key wins, else the first. The Python dict constructor dict(seq2) public static native @ByRef PyTypeObject PyAsyncGen_Type(); public static native void PyAsyncGen_Type(PyTypeObject setter); public static native @ByRef PyTypeObject _PyAsyncGenASend_Type(); public static native void _PyAsyncGenASend_Type(PyTypeObject setter); -public static native @ByRef PyTypeObject _PyAsyncGenWrappedValue_Type(); public static native void _PyAsyncGenWrappedValue_Type(PyTypeObject setter); -public static native @ByRef PyTypeObject _PyAsyncGenAThrow_Type(); public static native void _PyAsyncGenAThrow_Type(PyTypeObject setter); @NoException public static native PyObject PyAsyncGen_New(PyFrameObject arg0, PyObject name, PyObject qualname); @@ -10013,7 +9170,12 @@ of a key wins, else the first. The Python dict constructor dict(seq2) PyObject callback); @NoException public static native PyObject PyWeakref_NewProxy(PyObject ob, PyObject callback); -@NoException public static native PyObject PyWeakref_GetObject(PyObject ref); +@NoException public static native @Deprecated PyObject PyWeakref_GetObject(PyObject ref); + +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030D0000 +@NoException public static native int PyWeakref_GetRef(PyObject ref, @Cast("PyObject**") PointerPointer pobj); +@NoException public static native int PyWeakref_GetRef(PyObject ref, @ByPtrPtr PyObject pobj); +// #endif // #ifndef Py_LIMITED_API @@ -10054,17 +9216,14 @@ of a key wins, else the first. The Python dict constructor dict(seq2) @NoException public static native PyObject PyStructSequence_New(PyTypeObject type); -// #ifndef Py_LIMITED_API - -/* 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 - @NoException public static native void PyStructSequence_SetItem(PyObject arg0, @Cast("Py_ssize_t") long arg1, PyObject arg2); @NoException public static native PyObject PyStructSequence_GetItem(PyObject arg0, @Cast("Py_ssize_t") long arg1); +// #ifndef Py_LIMITED_API +// #define PyStructSequence_SET_ITEM PyStructSequence_SetItem +// #define PyStructSequence_GET_ITEM PyStructSequence_GetItem +// #endif + // #ifdef __cplusplus // #endif // #endif /* !Py_STRUCTSEQ_H */ @@ -10141,35 +9300,6 @@ of a key wins, else the first. The Python dict constructor dict(seq2) PyObject search_function ); -/* Codec registry lookup API. - - Looks up the given encoding and returns a CodecInfo object with - function attributes which implement the different aspects of - processing the encoding. - - The encoding string is looked up converted to all lower-case - characters. This makes encodings looked up through this mechanism - effectively case-insensitive. - - If no codec is found, a KeyError is set and NULL returned. - - As side effect, this tries to load the encodings package, if not - yet done. This is part of the lazy load strategy for the encodings - package. - - */ - -// #ifndef Py_LIMITED_API -@NoException public static native PyObject _PyCodec_Lookup( - @Cast("const char*") BytePointer encoding - ); -@NoException public static native PyObject _PyCodec_Lookup( - String encoding - ); - - -// #endif - /* Codec registry encoding check API. Returns 1/0 depending on whether there is a registered codec for @@ -10226,148 +9356,74 @@ of a key wins, else the first. The Python dict constructor dict(seq2) String errors ); -// #ifndef Py_LIMITED_API -/* Text codec specific encoding and decoding API. +// --- Codec Lookup APIs -------------------------------------------------- + +/* Codec registry lookup API. - Checks the encoding against a list of codecs which do not - implement a str<->bytes encoding before attempting the - operation. + Looks up the given encoding and returns a CodecInfo object with + function attributes which implement the different aspects of + processing the encoding. - Please note that these APIs are internal and should not - be used in Python C extensions. + The encoding string is looked up converted to all lower-case + characters. This makes encodings looked up through this mechanism + effectively case-insensitive. - XXX (ncoghlan): should we make these, or something like them, public - in Python 3.5+? + If no codec is found, a KeyError is set and NULL returned. + As side effect, this tries to load the encodings package, if not + yet done. This is part of the lazy load strategy for the encodings + package. */ -@NoException public static native PyObject _PyCodec_LookupTextEncoding( - @Cast("const char*") BytePointer encoding, - @Cast("const char*") BytePointer alternate_command - ); -@NoException public static native PyObject _PyCodec_LookupTextEncoding( - String encoding, - String alternate_command - ); - -@NoException public static native PyObject _PyCodec_EncodeText( - PyObject object, - @Cast("const char*") BytePointer encoding, - @Cast("const char*") BytePointer errors - ); -@NoException public static native PyObject _PyCodec_EncodeText( - PyObject object, - String encoding, - String errors - ); - -@NoException public static native PyObject _PyCodec_DecodeText( - PyObject object, - @Cast("const char*") BytePointer encoding, - @Cast("const char*") BytePointer errors - ); -@NoException public static native PyObject _PyCodec_DecodeText( - PyObject object, - String encoding, - String errors - ); - -/* These two aren't actually text encoding specific, but _io.TextIOWrapper - * is the only current API consumer. - */ -@NoException public static native PyObject _PyCodecInfo_GetIncrementalDecoder( - PyObject codec_info, - @Cast("const char*") BytePointer errors - ); -@NoException public static native PyObject _PyCodecInfo_GetIncrementalDecoder( - PyObject codec_info, - String errors - ); - -@NoException public static native PyObject _PyCodecInfo_GetIncrementalEncoder( - PyObject codec_info, - @Cast("const char*") BytePointer errors - ); -@NoException public static native PyObject _PyCodecInfo_GetIncrementalEncoder( - PyObject codec_info, - String errors - ); -// #endif - - - -/* --- Codec Lookup APIs -------------------------------------------------- - - All APIs return a codec object with incremented refcount and are - based on _PyCodec_Lookup(). The same comments w/r to the encoding - name also apply to these APIs. - -*/ /* Get an encoder function for the given encoding. */ -@NoException public static native PyObject PyCodec_Encoder( - @Cast("const char*") BytePointer encoding - ); -@NoException public static native PyObject PyCodec_Encoder( - String encoding - ); +@NoException public static native PyObject PyCodec_Encoder(@Cast("const char*") BytePointer encoding); +@NoException public static native PyObject PyCodec_Encoder(String encoding); /* Get a decoder function for the given encoding. */ -@NoException public static native PyObject PyCodec_Decoder( - @Cast("const char*") BytePointer encoding - ); -@NoException public static native PyObject PyCodec_Decoder( - String encoding - ); +@NoException public static native PyObject PyCodec_Decoder(@Cast("const char*") BytePointer encoding); +@NoException public static native PyObject PyCodec_Decoder(String encoding); /* Get an IncrementalEncoder object for the given encoding. */ @NoException public static native PyObject PyCodec_IncrementalEncoder( - @Cast("const char*") BytePointer encoding, - @Cast("const char*") BytePointer errors - ); + @Cast("const char*") BytePointer encoding, + @Cast("const char*") BytePointer errors); @NoException public static native PyObject PyCodec_IncrementalEncoder( - String encoding, - String errors - ); + String encoding, + String errors); /* Get an IncrementalDecoder object function for the given encoding. */ @NoException public static native PyObject PyCodec_IncrementalDecoder( - @Cast("const char*") BytePointer encoding, - @Cast("const char*") BytePointer errors - ); + @Cast("const char*") BytePointer encoding, + @Cast("const char*") BytePointer errors); @NoException public static native PyObject PyCodec_IncrementalDecoder( - String encoding, - String errors - ); + String encoding, + String errors); /* Get a StreamReader factory function for the given encoding. */ @NoException public static native PyObject PyCodec_StreamReader( - @Cast("const char*") BytePointer encoding, - PyObject stream, - @Cast("const char*") BytePointer errors - ); + @Cast("const char*") BytePointer encoding, + PyObject stream, + @Cast("const char*") BytePointer errors); @NoException public static native PyObject PyCodec_StreamReader( - String encoding, - PyObject stream, - String errors - ); + String encoding, + PyObject stream, + String errors); /* Get a StreamWriter factory function for the given encoding. */ @NoException public static native PyObject PyCodec_StreamWriter( - @Cast("const char*") BytePointer encoding, - PyObject stream, - @Cast("const char*") BytePointer errors - ); + @Cast("const char*") BytePointer encoding, + PyObject stream, + @Cast("const char*") BytePointer errors); @NoException public static native PyObject PyCodec_StreamWriter( - String encoding, - PyObject stream, - String errors - ); + String encoding, + PyObject stream, + String errors); /* Unicode encoding error handling callback registry API */ @@ -10417,15 +9473,13 @@ based on _PyCodec_Lookup(). The same comments w/r to the encoding // Parsed from pyerrors.h +// Error handling definitions + // #ifndef Py_ERRORS_H // #define Py_ERRORS_H // #ifdef __cplusplus // #endif -// #include // va_list - -/* Error handling definitions */ - @NoException public static native void PyErr_SetNone(PyObject arg0); @NoException public static native void PyErr_SetObject(PyObject arg0, PyObject arg1); @NoException public static native void PyErr_SetString( @@ -10846,38 +9900,12 @@ The Py_FatalError() function is replaced with a macro which logs // #ifdef MS_WINDOWS // #endif -/* Error handling definitions */ - -@NoException public static native void _PyErr_SetKeyError(PyObject arg0); - -@NoException public static native PyObject _PyErr_GetHandledException(PyThreadState arg0); -@NoException public static native void _PyErr_SetHandledException(PyThreadState arg0, PyObject arg1); -@NoException public static native void _PyErr_GetExcInfo(PyThreadState arg0, @Cast("PyObject**") PointerPointer arg1, @Cast("PyObject**") PointerPointer arg2, @Cast("PyObject**") PointerPointer arg3); -@NoException public static native void _PyErr_GetExcInfo(PyThreadState arg0, @ByPtrPtr PyObject arg1, @ByPtrPtr PyObject arg2, @ByPtrPtr PyObject arg3); - /* Context manipulation (PEP 3134) */ -@NoException public static native @Deprecated void _PyErr_ChainExceptions(PyObject arg0, PyObject arg1, PyObject arg2); @NoException public static native void _PyErr_ChainExceptions1(PyObject arg0); -/* Like PyErr_Format(), but saves current exception as __context__ and - __cause__. - */ -@NoException public static native PyObject _PyErr_FormatFromCause( - PyObject exception, - @Cast("const char*") BytePointer format - ); -@NoException public static native PyObject _PyErr_FormatFromCause( - PyObject exception, - String format - ); - /* In exceptions.c */ -@NoException public static native int _PyException_AddNote( - PyObject exc, - PyObject note); - @NoException public static native PyObject PyUnstable_Exc_PrepReraiseStar( PyObject orig, PyObject excs); @@ -10885,7 +9913,6 @@ The Py_FatalError() function is replaced with a macro which logs /* In signalmodule.c */ -@NoException public static native int _PyErr_CheckSignals(); /* Support for adding program text to SyntaxErrors */ @@ -10905,35 +9932,6 @@ The Py_FatalError() function is replaced with a macro which logs PyObject filename, int lineno); -@NoException public static native PyObject _PyErr_ProgramDecodedTextObject( - PyObject filename, - int lineno, - @Cast("const char*") BytePointer encoding); -@NoException public static native PyObject _PyErr_ProgramDecodedTextObject( - PyObject filename, - int lineno, - String encoding); - -@NoException public static native PyObject _PyUnicodeTranslateError_Create( - PyObject object, - @Cast("Py_ssize_t") long start, - @Cast("Py_ssize_t") long end, - @Cast("const char*") BytePointer reason - ); -@NoException public static native PyObject _PyUnicodeTranslateError_Create( - PyObject object, - @Cast("Py_ssize_t") long start, - @Cast("Py_ssize_t") long end, - String reason - ); - -@NoException public static native void _PyErr_WriteUnraisableMsg( - @Cast("const char*") BytePointer err_msg, - PyObject obj); -@NoException public static native void _PyErr_WriteUnraisableMsg( - String err_msg, - PyObject obj); - @NoException public static native void _Py_FatalErrorFunc( @Cast("const char*") BytePointer func, @Cast("const char*") BytePointer message); @@ -10941,15 +9939,10 @@ The Py_FatalError() function is replaced with a macro which logs String func, String message); -@NoException public static native void _Py_FatalErrorFormat( - @Cast("const char*") BytePointer func, - @Cast("const char*") BytePointer format); -@NoException public static native void _Py_FatalErrorFormat( - String func, - String format); - - +@NoException public static native void PyErr_FormatUnraisable(@Cast("const char*") BytePointer arg0); +@NoException public static native void PyErr_FormatUnraisable(String arg0); +public static native PyObject PyExc_PythonFinalizationError(); public static native void PyExc_PythonFinalizationError(PyObject setter); // #define Py_FatalError(message) _Py_FatalErrorFunc(__func__, (message)) @@ -10982,7 +9975,8 @@ The Py_FatalError() function is replaced with a macro which logs @NoException public static native @Cast("unsigned long") long PyThread_get_thread_ident(); // #if (defined(__APPLE__) || defined(__linux__) || defined(_WIN32) -// || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) +// || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +// || defined(__OpenBSD__) || defined(__NetBSD__) // || defined(__DragonFly__) || defined(_AIX)) // #define PY_HAVE_THREAD_NATIVE_ID @NoException public static native @Cast("unsigned long") long PyThread_get_thread_native_id(); @@ -10994,40 +9988,18 @@ The Py_FatalError() function is replaced with a macro which logs public static final int WAIT_LOCK = 1; public static final int NOWAIT_LOCK = 0; -/* PY_TIMEOUT_T is the integral type used to specify timeouts when waiting - on a lock (see PyThread_acquire_lock_timed() below). - PY_TIMEOUT_MAX is the highest usable value (in microseconds) of that - type, and depends on the system threading API. - - NOTE: this isn't the same value as `_thread.TIMEOUT_MAX`. The _thread - module exposes a higher-level API, with timeouts expressed in seconds - and floating-point numbers allowed. -*/ +// PY_TIMEOUT_T is the integral type used to specify timeouts when waiting +// on a lock (see PyThread_acquire_lock_timed() below). // #define PY_TIMEOUT_T long long -// #if defined(_POSIX_THREADS) - /* PyThread_acquire_lock_timed() uses _PyTime_FromNanoseconds(us * 1000), - convert microseconds to nanoseconds. */ -public static native @MemberGetter long PY_TIMEOUT_MAX(); -public static final long PY_TIMEOUT_MAX = PY_TIMEOUT_MAX(); -// #elif defined (NT_THREADS) - // WaitForSingleObject() accepts timeout in milliseconds in the range - // [0; 0xFFFFFFFE] (DWORD type). INFINITE value (0xFFFFFFFF) means no - // timeout. 0xFFFFFFFE milliseconds is around 49.7 days. -// # if 0xFFFFFFFEL * 1000 < LLONG_MAX -// # else -// # endif -// #else -// #endif - /* If microseconds == 0, the call is non-blocking: it returns immediately even when the lock can't be acquired. If microseconds > 0, the call waits up to the specified duration. If microseconds < 0, the call waits until success (or abnormal failure) - microseconds must be less than PY_TIMEOUT_MAX. Behaviour otherwise is - undefined. + If *microseconds* is greater than PY_TIMEOUT_MAX, clamp the timeout to + PY_TIMEOUT_MAX microseconds. If intr_flag is true and the acquire is interrupted by a signal, then the call will return PY_LOCK_INTR. The caller may reattempt to acquire the @@ -11148,7 +10120,7 @@ When the current thread state is NULL, this issues a fatal error (so that The caller must hold the GIL. - See also _PyThreadState_UncheckedGet() and _PyThreadState_GET(). */ + See also PyThreadState_GetUnchecked() and _PyThreadState_GET(). */ @NoException public static native PyThreadState PyThreadState_Get(); // Alias to PyThreadState_Get() @@ -11302,10 +10274,6 @@ be used between _Ensure() and _Release() calls, so long as the @NoException public static native int PyContextVar_Reset(PyObject var, PyObject token); -/* This method is exposed only for CPython tests. Don not use it. */ -@NoException public static native PyObject _PyContext_NewHamtForTests(); - - // #ifdef __cplusplus // #endif // #endif /* !Py_CONTEXT_H */ @@ -11330,7 +10298,6 @@ be used between _Ensure() and _Release() calls, so long as the @NoException public static native int PyStatus_IsError(@ByVal PyStatus err); @NoException public static native int PyStatus_IsExit(@ByVal PyStatus err); @NoException public static native int PyStatus_Exception(@ByVal PyStatus err); -@NoException public static native PyObject _PyErr_SetFromPyStatus(@ByVal PyStatus status); // Targeting ../PyWideStringList.java @@ -11426,44 +10393,12 @@ be used between _Ensure() and _Release() calls, so long as the // #endif -/* -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. */ -public static final long Py_RTFLAGS_USE_MAIN_OBMALLOC = (1L << 5); - -/* Set if import should check a module for subinterpreter support. */ -public static final long Py_RTFLAGS_MULTI_INTERP_EXTENSIONS = (1L << 8); - -/* Set if threads are allowed. */ -public static final long Py_RTFLAGS_THREADS = (1L << 10); - -/* Set if daemon threads are allowed. */ -public static final long Py_RTFLAGS_DAEMON_THREADS = (1L << 11); - -/* Set if os.fork() is allowed. */ -public static final long Py_RTFLAGS_FORK = (1L << 15); - -/* Set if os.exec*() is allowed. */ -public static final long Py_RTFLAGS_EXEC = (1L << 16); - - -@NoException public static native int _PyInterpreterState_HasFeature(PyInterpreterState interp, - @Cast("unsigned long") long feature); - - /* private interpreter helpers */ @NoException public static native int _PyInterpreterState_RequiresIDRef(PyInterpreterState arg0); @NoException public static native void _PyInterpreterState_RequireIDRef(PyInterpreterState arg0, int arg1); -@NoException public static native PyObject _PyInterpreterState_GetMainModule(PyInterpreterState arg0); +@NoException public static native PyObject PyUnstable_InterpreterState_GetMainModule(PyInterpreterState arg0); // Targeting ../Py_tracefunc.java @@ -11481,51 +10416,41 @@ might not be allowed in the current interpreter (i.e. os.fork() would fail). public static final int PyTrace_C_EXCEPTION = 5; public static final int PyTrace_C_RETURN = 6; public static final int PyTrace_OPCODE = 7; -// Targeting ../_PyCFrame.java - - // Targeting ../_PyErr_StackItem.java // Targeting ../_PyStackChunk.java -// Targeting ../_py_trashcan.java - - // Targeting ../PyThreadState.java -/* 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. */ // #ifdef Py_DEBUG +// #elif defined(__s390x__) +public static final int Py_C_RECURSION_LIMIT = 800; +// #elif defined(_WIN32) && defined(_M_ARM64) +// #elif defined(_WIN32) +// #elif defined(__ANDROID__) + // On an ARM64 emulator, API level 34 was OK with 10000, but API level 21 + // crashed in test_compiler_recursion_limit. +// #elif defined(_Py_ADDRESS_SANITIZER) +// #elif defined(__wasi__) + // Based on wasmtime 16. // #else -// # if defined(__wasi__) -public static final int C_RECURSION_LIMIT = 500; -// # elif defined(__s390x__) -// # elif defined(_WIN32) -// # elif defined(_Py_ADDRESS_SANITIZER) -// # else - // This value is duplicated in Lib/test/support/__init__.py -// # endif + // This value is duplicated in Lib/test/support/__init__.py // #endif -/* 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. */ -@NoException public static native PyThreadState _PyThreadState_Prealloc(PyInterpreterState arg0); +/* other API */ /* Similar to PyThreadState_Get(), but don't issue a fatal error * if it is NULL. */ -@NoException public static native PyThreadState _PyThreadState_UncheckedGet(); +@NoException public static native PyThreadState PyThreadState_GetUnchecked(); + +// Alias kept for backward compatibility +// #define _PyThreadState_UncheckedGet PyThreadState_GetUnchecked -@NoException public static native PyObject _PyThreadState_GetDict(PyThreadState tstate); // Disable tracing and profiling. @NoException public static native void PyThreadState_EnterTracing(PyThreadState tstate); @@ -11542,25 +10467,11 @@ might not be allowed in the current interpreter (i.e. os.fork() would fail). The function returns 1 if _PyGILState_check_enabled is non-zero. */ @NoException public static native int PyGILState_Check(); -/* 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(). */ -@NoException public static native PyInterpreterState _PyGILState_GetInterpreterStateUnsafe(); - /* The implementation of sys._current_frames() Returns a dict mapping thread id to that thread's current frame. */ @NoException public static native PyObject _PyThread_CurrentFrames(); -/* The implementation of sys._current_exceptions() Returns a dict mapping - thread id to that thread's current exception. -*/ -@NoException public static native PyObject _PyThread_CurrentExceptions(); - /* Routines for advanced debuggers, requested by David Beazley. Don't use unless you know what you are doing! */ @NoException public static native PyInterpreterState PyInterpreterState_Main(); @@ -11579,101 +10490,16 @@ See also _PyInterpreterState_Get() and _PyInterpreterState_GET(). */ PyInterpreterState interp, _PyFrameEvalFunction eval_frame); -@NoException public static native @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. */ -@NoException public static native int _PyInterpreterState_GetConfigCopy( - 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(). */ -@NoException public static native int _PyInterpreterState_SetConfig( - @Const PyConfig config); - -// Get the configuration of the current interpreter. -// The caller must hold the GIL. -@NoException public static native @Const PyConfig _Py_GetConfig(); -// Targeting ../_PyCrossInterpreterData.java - - -// Targeting ../xid_newobjectfunc.java - - -// Targeting ../xid_freefunc.java - - -// Targeting ../_xid.java - - - -@NoException public static native void _PyCrossInterpreterData_Init( - _PyCrossInterpreterData data, - PyInterpreterState interp, Pointer shared, PyObject obj, - xid_newobjectfunc new_object); -@NoException public static native int _PyCrossInterpreterData_InitWithSize( - _PyCrossInterpreterData arg0, - PyInterpreterState interp, @Cast("const size_t") long arg2, PyObject arg3, - xid_newobjectfunc arg4); -@NoException public static native void _PyCrossInterpreterData_Clear( - PyInterpreterState arg0, _PyCrossInterpreterData arg1); - -@NoException public static native int _PyObject_GetCrossInterpreterData(PyObject arg0, _PyCrossInterpreterData arg1); -@NoException public static native PyObject _PyCrossInterpreterData_NewObject(_PyCrossInterpreterData arg0); -@NoException public static native int _PyCrossInterpreterData_Release(_PyCrossInterpreterData arg0); - -@NoException public static native int _PyObject_CheckCrossInterpreterData(PyObject arg0); -// Targeting ../crossinterpdatafunc.java - - - -@NoException public static native int _PyCrossInterpreterData_RegisterClass(PyTypeObject arg0, crossinterpdatafunc arg1); -@NoException public static native int _PyCrossInterpreterData_UnregisterClass(PyTypeObject arg0); -@NoException public static native crossinterpdatafunc _PyCrossInterpreterData_Lookup(PyObject arg0); - // Parsed from modsupport.h +// Module support interface // #ifndef Py_MODSUPPORT_H // #define Py_MODSUPPORT_H // #ifdef __cplusplus // #endif -/* Module support interface */ - -// #include // va_list - -/* If PY_SSIZE_T_CLEAN is defined, each functions treats #-specifier - to mean Py_ssize_t */ -// #ifdef PY_SSIZE_T_CLEAN -// #endif - -/* Due to a glitch in 3.2, the _SizeT versions weren't exported from the DLL. */ -// #if !defined(PY_SSIZE_T_CLEAN) || !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03030000 public static native int PyArg_Parse(PyObject arg0, String arg1, Pointer vararg0); public static native int PyArg_Parse(PyObject arg0, String arg1, Pointer vararg0, Pointer vararg1); public static native int PyArg_Parse(PyObject arg0, String arg1, Pointer vararg0, Pointer vararg1, Pointer vararg2); @@ -11717,42 +10543,45 @@ public static native int PyArg_ParseTupleAndKeywords(PyObject arg0, PyObject arg @NoException public static native int PyArg_VaParse(PyObject arg0, @Cast("const char*") BytePointer arg1, @ByVal @Cast("va_list*") Pointer arg2); @NoException public static native int PyArg_VaParse(PyObject arg0, String arg1, @ByVal @Cast("va_list*") Pointer arg2); @NoException public static native int PyArg_VaParseTupleAndKeywords(PyObject arg0, PyObject arg1, - @Cast("const char*") BytePointer arg2, @Cast("char**") PointerPointer arg3, @ByVal @Cast("va_list*") Pointer arg4); + @Cast("const char*") BytePointer arg2, @Cast("char*const*") PointerPointer arg3, @ByVal @Cast("va_list*") Pointer arg4); @NoException public static native int PyArg_VaParseTupleAndKeywords(PyObject arg0, PyObject arg1, - @Cast("const char*") BytePointer arg2, @Cast("char**") @ByPtrPtr BytePointer arg3, @ByVal @Cast("va_list*") Pointer arg4); + @Cast("const char*") BytePointer arg2, @Cast("char*const*") @ByPtrPtr BytePointer arg3, @ByVal @Cast("va_list*") Pointer arg4); @NoException public static native int PyArg_VaParseTupleAndKeywords(PyObject arg0, PyObject arg1, - String arg2, @Cast("char**") @ByPtrPtr ByteBuffer arg3, @ByVal @Cast("va_list*") Pointer arg4); + String arg2, @Cast("char*const*") @ByPtrPtr ByteBuffer arg3, @ByVal @Cast("va_list*") Pointer arg4); @NoException public static native int PyArg_VaParseTupleAndKeywords(PyObject arg0, PyObject arg1, - @Cast("const char*") BytePointer arg2, @Cast("char**") @ByPtrPtr byte[] arg3, @ByVal @Cast("va_list*") Pointer arg4); + @Cast("const char*") BytePointer arg2, @Cast("char*const*") @ByPtrPtr byte[] arg3, @ByVal @Cast("va_list*") Pointer arg4); @NoException public static native int PyArg_VaParseTupleAndKeywords(PyObject arg0, PyObject arg1, - String arg2, @Cast("char**") @ByPtrPtr BytePointer arg3, @ByVal @Cast("va_list*") Pointer arg4); + String arg2, @Cast("char*const*") @ByPtrPtr BytePointer arg3, @ByVal @Cast("va_list*") Pointer arg4); @NoException public static native int PyArg_VaParseTupleAndKeywords(PyObject arg0, PyObject arg1, - @Cast("const char*") BytePointer arg2, @Cast("char**") @ByPtrPtr ByteBuffer arg3, @ByVal @Cast("va_list*") Pointer arg4); + @Cast("const char*") BytePointer arg2, @Cast("char*const*") @ByPtrPtr ByteBuffer arg3, @ByVal @Cast("va_list*") Pointer arg4); @NoException public static native int PyArg_VaParseTupleAndKeywords(PyObject arg0, PyObject arg1, - String arg2, @Cast("char**") @ByPtrPtr byte[] arg3, @ByVal @Cast("va_list*") Pointer arg4); -// #endif + String arg2, @Cast("char*const*") @ByPtrPtr byte[] arg3, @ByVal @Cast("va_list*") Pointer arg4); + @NoException public static native int PyArg_ValidateKeywordArguments(PyObject arg0); @NoException public static native int PyArg_UnpackTuple(PyObject arg0, @Cast("const char*") BytePointer arg1, @Cast("Py_ssize_t") long arg2, @Cast("Py_ssize_t") long arg3); @NoException public static native int PyArg_UnpackTuple(PyObject arg0, String arg1, @Cast("Py_ssize_t") long arg2, @Cast("Py_ssize_t") long arg3); @NoException public static native PyObject Py_BuildValue(@Cast("const char*") BytePointer arg0); @NoException public static native PyObject Py_BuildValue(String arg0); -@NoException public static native PyObject _Py_BuildValue_SizeT(@Cast("const char*") BytePointer arg0); -@NoException public static native PyObject _Py_BuildValue_SizeT(String arg0); - - @NoException public static native PyObject Py_VaBuildValue(@Cast("const char*") BytePointer arg0, @ByVal @Cast("va_list*") Pointer arg1); @NoException public static native PyObject Py_VaBuildValue(String arg0, @ByVal @Cast("va_list*") Pointer arg1); // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030a0000 // Add an attribute with name 'name' and value 'obj' to the module 'mod. -// On success, return 0 on success. +// On success, return 0. // On error, raise an exception and return -1. @NoException public static native int PyModule_AddObjectRef(PyObject mod, @Cast("const char*") BytePointer name, PyObject value); @NoException public static native int PyModule_AddObjectRef(PyObject mod, String name, PyObject value); // #endif /* Py_LIMITED_API */ -// Similar to PyModule_AddObjectRef() but steal a reference to 'obj' -// (Py_DECREF(obj)) on success (if it returns 0). +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +// Similar to PyModule_AddObjectRef() but steal a reference to 'value'. +@NoException public static native int PyModule_Add(PyObject mod, @Cast("const char*") BytePointer name, PyObject value); +@NoException public static native int PyModule_Add(PyObject mod, String name, PyObject value); +// #endif /* Py_LIMITED_API */ + +// Similar to PyModule_AddObjectRef() and PyModule_Add() but steal +// a reference to 'value' on success and only on success. +// Errorprone. Should not be used in new code. @NoException public static native int PyModule_AddObject(PyObject mod, @Cast("const char*") BytePointer arg1, PyObject value); @NoException public static native int PyModule_AddObject(PyObject mod, String arg1, PyObject value); @@ -11831,9 +10660,6 @@ the module is still loaded (because the mismatch can only be tested public static final int PYTHON_ABI_VERSION = 3; public static final String PYTHON_ABI_STRING = "3"; -// #ifdef Py_TRACE_REFS -// #endif - @NoException public static native PyObject PyModule_Create2(PyModuleDef arg0, int apiver); // #ifdef Py_LIMITED_API @@ -11898,35 +10724,14 @@ the module is still loaded (because the mismatch can only be tested @ByPtrPtr PyObject defs, int defc, PyObject kwdefs, PyObject closure); -/* PyEval_CallObjectWithKeywords(), PyEval_CallObject(), PyEval_CallFunction - * and PyEval_CallMethod are deprecated. Since they are officially part of the - * stable ABI (PEP 384), they must be kept for backward compatibility. - * PyObject_Call(), PyObject_CallFunction() and PyObject_CallMethod() are - * recommended to call a callable object. - */ - -@NoException public static native @Deprecated PyObject PyEval_CallObjectWithKeywords( - PyObject callable, - PyObject args, - PyObject kwargs); - -/* Deprecated since PyEval_CallObjectWithKeywords is deprecated */ -// #define PyEval_CallObject(callable, arg) -// PyEval_CallObjectWithKeywords((callable), (arg), _PyObject_CAST(_Py_NULL)) - -@NoException public static native @Deprecated PyObject PyEval_CallFunction( - PyObject callable, @Cast("const char*") BytePointer format); -@NoException public static native @Deprecated PyObject PyEval_CallFunction( - PyObject callable, String format); -@NoException public static native @Deprecated PyObject PyEval_CallMethod( - PyObject obj, @Cast("const char*") BytePointer name, @Cast("const char*") BytePointer format); -@NoException public static native @Deprecated PyObject PyEval_CallMethod( - PyObject obj, String name, String format); - @NoException public static native PyObject PyEval_GetBuiltins(); @NoException public static native PyObject PyEval_GetGlobals(); @NoException public static native PyObject PyEval_GetLocals(); @NoException public static native PyFrameObject PyEval_GetFrame(); + +@NoException public static native PyObject PyEval_GetFrameBuiltins(); +@NoException public static native PyObject PyEval_GetFrameGlobals(); +@NoException public static native PyObject PyEval_GetFrameLocals(); // Targeting ../Func_Pointer.java @@ -12016,14 +10821,8 @@ To leave the block in the middle (e.g., with return), you must insert @NoException public static native PyThreadState PyEval_SaveThread(); @NoException public static native void PyEval_RestoreThread(PyThreadState arg0); -@NoException public static native @Deprecated int PyEval_ThreadsInitialized(); @NoException public static native @Deprecated void PyEval_InitThreads(); -/* PyEval_AcquireLock() and PyEval_ReleaseLock() are part of stable ABI. - * They will be removed from this header file in the future version. - * But they will be remained in ABI until Python 4.0. - */ -@NoException public static native @Deprecated void PyEval_AcquireLock(); -@NoException public static native @Deprecated void PyEval_ReleaseLock(); + @NoException public static native void PyEval_AcquireThread(PyThreadState tstate); @NoException public static native void PyEval_ReleaseThread(PyThreadState tstate); @@ -12063,14 +10862,9 @@ To leave the block in the middle (e.g., with return), you must insert @NoException public static native void PyEval_SetProfile(Py_tracefunc arg0, PyObject arg1); @NoException public static native void PyEval_SetProfileAllThreads(Py_tracefunc arg0, PyObject arg1); -@NoException public static native int _PyEval_SetProfile(PyThreadState tstate, Py_tracefunc func, PyObject arg); @NoException public static native void PyEval_SetTrace(Py_tracefunc arg0, PyObject arg1); @NoException public static native void PyEval_SetTraceAllThreads(Py_tracefunc arg0, PyObject arg1); -@NoException public static native int _PyEval_SetTrace(PyThreadState tstate, Py_tracefunc func, PyObject arg); -/* Helper to look up a builtin object */ -@NoException public static native PyObject _PyEval_GetBuiltin(PyObject arg0); -@NoException public static native PyObject _PyEval_GetBuiltinId(_Py_Identifier arg0); /* Look at the current frame's (if any) code's co_flags, and turn on the corresponding compiler flags in cf->cf_flags. Return 1 if any flag was set, else return 0. */ @@ -12078,11 +10872,6 @@ To leave the block in the middle (e.g., with return), you must insert @NoException public static native PyObject _PyEval_EvalFrameDefault(PyThreadState tstate, @Cast("_PyInterpreterFrame*") Pointer f, int exc); -@NoException public static native void _PyEval_SetSwitchInterval(@Cast("unsigned long") long microseconds); -@NoException public static native @Cast("unsigned long") long _PyEval_GetSwitchInterval(); - -@NoException public static native int _PyEval_MakePendingCalls(PyThreadState arg0); - @NoException public static native @Cast("Py_ssize_t") long PyUnstable_Eval_RequestCodeExtraIndex(freefunc arg0); // Old name -- remove when this API changes: @NoException public static native @Cast("Py_ssize_t") @Deprecated long _PyEval_RequestCodeExtraIndex(freefunc f); @@ -12093,9 +10882,6 @@ To leave the block in the middle (e.g., with return), you must insert // Parsed from sysmodule.h - -/* System module interface */ - // #ifndef Py_SYSMODULE_H // #define Py_SYSMODULE_H // #ifdef __cplusplus @@ -12110,7 +10896,6 @@ To leave the block in the middle (e.g., with return), you must insert @NoException public static native @Deprecated void PySys_SetArgv(int arg0, @Cast("wchar_t**") @ByPtrPtr Pointer arg1); @NoException public static native @Deprecated void PySys_SetArgvEx(int arg0, @Cast("wchar_t**") PointerPointer arg1, int arg2); @NoException public static native @Deprecated void PySys_SetArgvEx(int arg0, @Cast("wchar_t**") @ByPtrPtr Pointer arg1, int arg2); -@NoException public static native @Deprecated void PySys_SetPath(@Cast("const wchar_t*") Pointer arg0); @NoException public static native void PySys_WriteStdout(@Cast("const char*") BytePointer format); @NoException public static native void PySys_WriteStdout(String format); @@ -12121,23 +10906,24 @@ To leave the block in the middle (e.g., with return), you must insert @NoException public static native void PySys_FormatStderr(@Cast("const char*") BytePointer format); @NoException public static native void PySys_FormatStderr(String format); -@NoException public static native void PySys_ResetWarnOptions(); -@NoException public static native @Deprecated void PySys_AddWarnOption(@Cast("const wchar_t*") Pointer arg0); -@NoException public static native @Deprecated void PySys_AddWarnOptionUnicode(PyObject arg0); -@NoException public static native @Deprecated int PySys_HasWarnOptions(); +@NoException public static native @Deprecated void PySys_ResetWarnOptions(); -@NoException public static native @Deprecated void PySys_AddXOption(@Cast("const wchar_t*") Pointer arg0); @NoException public static native PyObject PySys_GetXOptions(); -// Targeting ../PerfMapState.java - - - -@NoException public static native int PyUnstable_PerfMapState_Init(); -@NoException public static native int PyUnstable_WritePerfMapEntry(@Const Pointer code_addr, @Cast("unsigned int") int code_size, @Cast("const char*") BytePointer entry_name); -@NoException public static native int PyUnstable_WritePerfMapEntry(@Const Pointer code_addr, @Cast("unsigned int") int code_size, String entry_name); +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +@NoException public static native int PySys_Audit( + @Cast("const char*") BytePointer event, + @Cast("const char*") BytePointer argFormat); +@NoException public static native int PySys_Audit( + String event, + String argFormat); -@NoException public static native void PyUnstable_PerfMapState_Fini(); +@NoException public static native int PySys_AuditTuple( + @Cast("const char*") BytePointer event, + PyObject args); +@NoException public static native int PySys_AuditTuple( + String event, + PyObject args); // #endif // #ifndef Py_LIMITED_API @@ -12155,23 +10941,29 @@ To leave the block in the middle (e.g., with return), you must insert // #ifndef Py_CPYTHON_SYSMODULE_H // # error "this header file must not be included directly" -// #endif - -@NoException public static native PyObject _PySys_GetAttr(PyThreadState tstate, - PyObject name); - -@NoException public static native @Cast("size_t") long _PySys_GetSizeOf(PyObject arg0); // Targeting ../Py_AuditHookFunction.java -@NoException public static native int PySys_Audit( - @Cast("const char*") BytePointer event, - @Cast("const char*") BytePointer argFormat); -@NoException public static native int PySys_Audit( - String event, - String argFormat); @NoException public static native int PySys_AddAuditHook(Py_AuditHookFunction arg0, Pointer arg1); +// Targeting ../PerfMapState.java + + + +@NoException public static native int PyUnstable_PerfMapState_Init(); +@NoException public static native int PyUnstable_WritePerfMapEntry( + @Const Pointer code_addr, + @Cast("unsigned int") int code_size, + @Cast("const char*") BytePointer entry_name); +@NoException public static native int PyUnstable_WritePerfMapEntry( + @Const Pointer code_addr, + @Cast("unsigned int") int code_size, + String entry_name); +@NoException public static native void PyUnstable_PerfMapState_Fini(); +@NoException public static native int PyUnstable_CopyPerfMapFile(@Cast("const char*") BytePointer parent_filename); +@NoException public static native int PyUnstable_CopyPerfMapFile(String parent_filename); +@NoException public static native int PyUnstable_PerfTrampoline_CompileCode(PyCodeObject arg0); +@NoException public static native int PyUnstable_PerfTrampoline_SetPersistAfterFork(int enable); // Parsed from osmodule.h @@ -12201,18 +10993,13 @@ To leave the block in the middle (e.g., with return), you must insert // #endif @NoException public static native int PyOS_InterruptOccurred(); + // #ifdef HAVE_FORK // #endif + /* Deprecated, please use PyOS_AfterFork_Child() instead */ @NoException public static native @Deprecated void PyOS_AfterFork(); -// #ifndef Py_LIMITED_API -@NoException public static native int _PyOS_IsMainThread(); - -// #ifdef MS_WINDOWS -// #endif -// #endif /* !Py_LIMITED_API */ - // #ifdef __cplusplus // #endif // #endif /* !Py_INTRCHECK_H */ @@ -12282,16 +11069,24 @@ To leave the block in the middle (e.g., with return), you must insert @NoException public static native PyObject PyImport_AddModule( String name ); +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +@NoException public static native PyObject PyImport_AddModuleRef( + @Cast("const char*") BytePointer name + ); +@NoException public static native PyObject PyImport_AddModuleRef( + String name + ); +// #endif @NoException public static native PyObject PyImport_ImportModule( @Cast("const char*") BytePointer name ); @NoException public static native PyObject PyImport_ImportModule( String name ); -@NoException public static native PyObject PyImport_ImportModuleNoBlock( +@NoException public static native @Deprecated PyObject PyImport_ImportModuleNoBlock( @Cast("const char*") BytePointer name ); -@NoException public static native PyObject PyImport_ImportModuleNoBlock( +@NoException public static native @Deprecated PyObject PyImport_ImportModuleNoBlock( String name ); @NoException public static native PyObject PyImport_ImportModuleLevel( @@ -12365,29 +11160,6 @@ To leave the block in the middle (e.g., with return), you must insert // #endif - -@NoException public static native int _PyImport_IsInitialized(PyInterpreterState arg0); - -@NoException public static native PyObject _PyImport_GetModuleId(_Py_Identifier name); -@NoException public static native int _PyImport_SetModule(PyObject name, PyObject module); -@NoException public static native int _PyImport_SetModuleString(@Cast("const char*") BytePointer name, PyObject module); -@NoException public static native int _PyImport_SetModuleString(String name, PyObject module); - -@NoException public static native void _PyImport_AcquireLock(PyInterpreterState interp); -@NoException public static native int _PyImport_ReleaseLock(PyInterpreterState interp); - -@NoException public static native int _PyImport_FixupBuiltin( - PyObject mod, - @Cast("const char*") BytePointer name, - PyObject modules - ); -@NoException public static native int _PyImport_FixupBuiltin( - PyObject mod, - String name, - PyObject modules - ); -@NoException public static native int _PyImport_FixupExtensionObject(PyObject arg0, PyObject arg1, - PyObject arg2, PyObject arg3); // Targeting ../_inittab.java @@ -12403,10 +11175,6 @@ To leave the block in the middle (e.g., with return), you must insert public static native @Const _frozen PyImport_FrozenModules(); public static native void PyImport_FrozenModules(_frozen setter); -@NoException public static native PyObject _PyImport_GetModuleAttr(PyObject arg0, PyObject arg1); -@NoException public static native PyObject _PyImport_GetModuleAttrString(@Cast("const char*") BytePointer arg0, @Cast("const char*") BytePointer arg1); -@NoException public static native PyObject _PyImport_GetModuleAttrString(String arg0, String arg1); - // Parsed from abstract.h @@ -12461,6 +11229,25 @@ the object by calling PyObject_Repr(). If flags equals to Py_PRINT_RAW, it This function always succeeds. */ + +/* Implemented elsewhere: + + int PyObject_HasAttrStringWithError(PyObject *o, const char *attr_name); + + Returns 1 if object 'o' has the attribute attr_name, and 0 otherwise. + This is equivalent to the Python expression: hasattr(o,attr_name). + Returns -1 on failure. */ + + +/* Implemented elsewhere: + + int PyObject_HasAttrWithError(PyObject *o, PyObject *attr_name); + + Returns 1 if o has the attribute attr_name, and 0 otherwise. + This is equivalent to the Python expression: hasattr(o,attr_name). + Returns -1 on failure. */ + + /* Implemented elsewhere: PyObject* PyObject_GetAttr(PyObject *o, PyObject *attr_name); @@ -12471,6 +11258,38 @@ the object by calling PyObject_Repr(). If flags equals to Py_PRINT_RAW, it This is the equivalent of the Python expression: o.attr_name. */ +/* Implemented elsewhere: + + int PyObject_GetOptionalAttr(PyObject *obj, PyObject *attr_name, PyObject **result); + + Variant of PyObject_GetAttr() which doesn't raise AttributeError + if the attribute is not found. + + If the attribute is found, return 1 and set *result to a new strong + reference to the attribute. + If the attribute is not found, return 0 and set *result to NULL; + the AttributeError is silenced. + If an error other than AttributeError is raised, return -1 and + set *result to NULL. +*/ + + +/* Implemented elsewhere: + + int PyObject_GetOptionalAttrString(PyObject *obj, const char *attr_name, PyObject **result); + + Variant of PyObject_GetAttrString() which doesn't raise AttributeError + if the attribute is not found. + + If the attribute is found, return 1 and set *result to a new strong + reference to the attribute. + If the attribute is not found, return 0 and set *result to NULL; + the AttributeError is silenced. + If an error other than AttributeError is raised, return -1 and + set *result to NULL. +*/ + + /* Implemented elsewhere: int PyObject_SetAttrString(PyObject *o, const char *attr_name, PyObject *v); @@ -12491,7 +11310,7 @@ the object by calling PyObject_Repr(). If flags equals to Py_PRINT_RAW, it This is the equivalent of the Python statement o.attr_name=v. */ -/* Implemented as a macro: +/* Implemented elsewhere: int PyObject_DelAttrString(PyObject *o, const char *attr_name); @@ -12499,17 +11318,15 @@ the object by calling PyObject_Repr(). If flags equals to Py_PRINT_RAW, it -1 on failure. This is the equivalent of the Python statement: del o.attr_name. */ -// #define PyObject_DelAttrString(O, A) PyObject_SetAttrString((O), (A), NULL) -/* Implemented as a macro: +/* Implemented elsewhere: int PyObject_DelAttr(PyObject *o, PyObject *attr_name); Delete attribute named attr_name, for object o. Returns -1 on failure. This is the equivalent of the Python statement: del o.attr_name. */ -// #define PyObject_DelAttr(O, A) PyObject_SetAttr((O), (A), NULL) /* Implemented elsewhere: @@ -12546,10 +11363,6 @@ Called by the str() and print() built-in functions. */ This function always succeeds. */ -// #ifdef PY_SSIZE_T_CLEAN -// #endif - - // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x03090000 /* Call a callable Python object without any arguments */ @NoException public static native PyObject PyObject_CallNoArgs(PyObject func); @@ -12609,18 +11422,6 @@ Called by the str() and print() built-in functions. */ String name, String format); -@NoException public static native PyObject _PyObject_CallFunction_SizeT(PyObject callable, - @Cast("const char*") BytePointer format); -@NoException public static native PyObject _PyObject_CallFunction_SizeT(PyObject callable, - String format); - -@NoException public static native PyObject _PyObject_CallMethod_SizeT(PyObject obj, - @Cast("const char*") BytePointer name, - @Cast("const char*") BytePointer format); -@NoException public static native PyObject _PyObject_CallMethod_SizeT(PyObject obj, - String name, - String format); - /* Call a callable Python object 'callable' with a variable number of C arguments. The C arguments are provided as PyObject* values, terminated by a NULL. @@ -12758,67 +11559,6 @@ Called by the str() and print() built-in functions. */ @NoException public static native int PyObject_DelItem(PyObject o, PyObject key); -/* === Old Buffer API ============================================ */ - -/* FIXME: usage of these should all be replaced in Python itself - but for backwards compatibility we will implement them. - Their usage without a corresponding "unlock" mechanism - may create issues (but they would already be there). */ - -/* Takes an arbitrary object which must support the (character, single segment) - buffer interface and returns a pointer to a read-only memory location - usable as character based input for subsequent processing. - - Return 0 on success. buffer and buffer_len are only set in case no error - occurs. Otherwise, -1 is returned and an exception set. */ -@NoException public static native @Deprecated int PyObject_AsCharBuffer(PyObject obj, - @Cast("const char**") PointerPointer buffer, - @Cast("Py_ssize_t*") SizeTPointer buffer_len); -@NoException public static native @Deprecated int PyObject_AsCharBuffer(PyObject obj, - @Cast("const char**") @ByPtrPtr BytePointer buffer, - @Cast("Py_ssize_t*") SizeTPointer buffer_len); -@NoException public static native @Deprecated int PyObject_AsCharBuffer(PyObject obj, - @Cast("const char**") @ByPtrPtr ByteBuffer buffer, - @Cast("Py_ssize_t*") SizeTPointer buffer_len); -@NoException public static native @Deprecated int PyObject_AsCharBuffer(PyObject obj, - @Cast("const char**") @ByPtrPtr byte[] buffer, - @Cast("Py_ssize_t*") SizeTPointer buffer_len); - -/* Checks whether an arbitrary object supports the (character, single segment) - buffer interface. - - Returns 1 on success, 0 on failure. */ -@NoException public static native @Deprecated int PyObject_CheckReadBuffer(PyObject obj); - -/* Same as PyObject_AsCharBuffer() except that this API expects (readable, - single segment) buffer interface and returns a pointer to a read-only memory - location which can contain arbitrary data. - - 0 is returned on success. buffer and buffer_len are only set in case no - error occurs. Otherwise, -1 is returned and an exception set. */ -@NoException public static native @Deprecated int PyObject_AsReadBuffer(PyObject obj, - @Cast("const void**") PointerPointer buffer, - @Cast("Py_ssize_t*") SizeTPointer buffer_len); -@NoException public static native @Deprecated int PyObject_AsReadBuffer(PyObject obj, - @Cast("const void**") @ByPtrPtr Pointer buffer, - @Cast("Py_ssize_t*") SizeTPointer buffer_len); - -/* Takes an arbitrary object which must support the (writable, single segment) - buffer interface and returns a pointer to a writable memory location in - buffer of size 'buffer_len'. - - Return 0 on success. buffer and buffer_len are only set in case no error - occurs. Otherwise, -1 is returned and an exception set. */ -@NoException public static native @Deprecated int PyObject_AsWriteBuffer(PyObject obj, - @Cast("void**") PointerPointer buffer, - @Cast("Py_ssize_t*") SizeTPointer buffer_len); -@NoException public static native @Deprecated int PyObject_AsWriteBuffer(PyObject obj, - @Cast("void**") @ByPtrPtr Pointer buffer, - @Cast("Py_ssize_t*") SizeTPointer buffer_len); - - -/* === New Buffer API ============================================ */ - /* Takes an arbitrary object and returns the result of calling obj.__format__(format_spec). */ @NoException public static native PyObject PyObject_Format(PyObject obj, @@ -13290,6 +12030,19 @@ Use __contains__ if possible, else _PySequence_IterSearch(). */ This function always succeeds. */ @NoException public static native int PyMapping_HasKey(PyObject o, PyObject key); +/* Return 1 if the mapping object has the key 'key', and 0 otherwise. + This is equivalent to the Python expression: key in o. + On failure, return -1. */ + +@NoException public static native int PyMapping_HasKeyWithError(PyObject o, PyObject key); + +/* Return 1 if the mapping object has the key 'key', and 0 otherwise. + This is equivalent to the Python expression: key in o. + On failure, return -1. */ + +@NoException public static native int PyMapping_HasKeyStringWithError(PyObject o, @Cast("const char*") BytePointer key); +@NoException public static native int PyMapping_HasKeyStringWithError(PyObject o, String key); + /* On success, return a list or tuple of the keys in mapping object 'o'. On failure, return NULL. */ @NoException public static native PyObject PyMapping_Keys(PyObject o); @@ -13311,6 +12064,24 @@ Use __contains__ if possible, else _PySequence_IterSearch(). */ @NoException public static native PyObject PyMapping_GetItemString(PyObject o, String key); +/* Variants of PyObject_GetItem() and PyMapping_GetItemString() which don't + raise KeyError if the key is not found. + + If the key is found, return 1 and set *result to a new strong + reference to the corresponding value. + If the key is not found, return 0 and set *result to NULL; + the KeyError is silenced. + If an error other than KeyError is raised, return -1 and + set *result to NULL. +*/ +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000 +@NoException public static native int PyMapping_GetOptionalItem(PyObject arg0, PyObject arg1, @Cast("PyObject**") PointerPointer arg2); +@NoException public static native int PyMapping_GetOptionalItem(PyObject arg0, PyObject arg1, @ByPtrPtr PyObject arg2); +@NoException public static native int PyMapping_GetOptionalItemString(PyObject arg0, @Cast("const char*") BytePointer arg1, @Cast("PyObject**") PointerPointer arg2); +@NoException public static native int PyMapping_GetOptionalItemString(PyObject arg0, @Cast("const char*") BytePointer arg1, @ByPtrPtr PyObject arg2); +@NoException public static native int PyMapping_GetOptionalItemString(PyObject arg0, String arg1, @ByPtrPtr PyObject arg2); +// #endif + /* Map the string 'key' to the value 'v' in the mapping 'o'. Returns -1 on failure. @@ -13345,8 +12116,16 @@ Use __contains__ if possible, else _PySequence_IterSearch(). */ /* === Object Protocol ================================================== */ -// #ifdef PY_SSIZE_T_CLEAN -// #endif +/* Like PyObject_CallMethod(), but expect a _Py_Identifier* + as the method name. */ +@NoException public static native PyObject _PyObject_CallMethodId( + PyObject obj, + _Py_Identifier name, + @Cast("const char*") BytePointer format); +@NoException public static native PyObject _PyObject_CallMethodId( + PyObject obj, + _Py_Identifier name, + String format); /* Convert keyword arguments from the FASTCALL (stack: C array, kwnames: tuple) format to a Python dictionary ("kwargs" dict). @@ -13358,60 +12137,22 @@ Use __contains__ if possible, else _PySequence_IterSearch(). */ Duplicate keys are merged using the last value. If duplicate keys must raise an exception, the caller is responsible to implement an explicit keys on kwnames. */ -@NoException public static native PyObject _PyStack_AsDict( - @Cast("PyObject*const*") PointerPointer values, - PyObject kwnames); -@NoException public static native PyObject _PyStack_AsDict( - @ByPtrPtr PyObject values, - PyObject kwnames); - -/* Suggested size (number of positional arguments) for arrays of PyObject* - allocated on a C stack to avoid allocating memory on the heap memory. Such - array is used to pass positional arguments to call functions of the - PyObject_Vectorcall() family. +@NoException public static native PyObject _PyStack_AsDict(@Cast("PyObject*const*") PointerPointer values, PyObject kwnames); +@NoException public static native PyObject _PyStack_AsDict(@ByPtrPtr PyObject values, PyObject kwnames); - The size is chosen to not abuse the C stack and so limit the risk of stack - overflow. The size is also chosen to allow using the small stack for most - function calls of the Python standard library. On 64-bit CPU, it allocates - 40 bytes on the stack. */ -public static final int _PY_FASTCALL_SMALL_STACK = 5; - -@NoException public static native PyObject _Py_CheckFunctionResult( - PyThreadState tstate, - PyObject callable, - PyObject result, - @Cast("const char*") BytePointer where); -@NoException public static native PyObject _Py_CheckFunctionResult( - PyThreadState tstate, - PyObject callable, - PyObject result, - String where); /* === Vectorcall protocol (PEP 590) ============================= */ -/* Call callable using tp_call. Arguments are like PyObject_Vectorcall() - or PyObject_FastCallDict() (both forms are supported), - except that nargs is plainly the number of arguments without flags. */ -@NoException public static native PyObject _PyObject_MakeTpCall( - PyThreadState tstate, - PyObject callable, - @Cast("PyObject*const*") PointerPointer args, @Cast("Py_ssize_t") long nargs, - PyObject keywords); -@NoException public static native PyObject _PyObject_MakeTpCall( - PyThreadState tstate, - PyObject callable, - @ByPtrPtr PyObject args, @Cast("Py_ssize_t") long nargs, - PyObject keywords); - // PyVectorcall_NARGS() is exported as a function for the stable ABI. // Here (when we are not using the stable ABI), the name is overridden to // call a static inline function for best performance. -// #define PyVectorcall_NARGS(n) _PyVectorcall_NARGS(n) @NoException public static native @Cast("Py_ssize_t") long _PyVectorcall_NARGS(@Cast("size_t") long n); +// #define PyVectorcall_NARGS(n) _PyVectorcall_NARGS(n) @NoException public static native vectorcallfunc PyVectorcall_Function(PyObject callable); -// Backwards compatibility aliases for API that was provisional in Python 3.8 +// Backwards compatibility aliases (PEP 590) for API that was provisional +// in Python 3.8 // #define _PyObject_Vectorcall PyObject_Vectorcall // #define _PyObject_VectorcallMethod PyObject_VectorcallMethod // #define _PyObject_FastCallDict PyObject_VectorcallDict @@ -13433,62 +12174,12 @@ or PyObject_FastCallDict() (both forms are supported), @Cast("size_t") long nargsf, PyObject kwargs); -// Same as PyObject_Vectorcall(), except without keyword arguments -@NoException public static native PyObject _PyObject_FastCall( - PyObject func, - @Cast("PyObject*const*") PointerPointer args, - @Cast("Py_ssize_t") long nargs); -@NoException public static native PyObject _PyObject_FastCall( - PyObject func, - @ByPtrPtr PyObject args, - @Cast("Py_ssize_t") long nargs); - @NoException public static native PyObject PyObject_CallOneArg(PyObject func, PyObject arg); @NoException public static native PyObject PyObject_CallMethodNoArgs(PyObject self, PyObject name); @NoException public static native PyObject PyObject_CallMethodOneArg(PyObject self, PyObject name, PyObject arg); -@NoException public static native PyObject _PyObject_CallMethod(PyObject obj, - PyObject name, - @Cast("const char*") BytePointer format); -@NoException public static native PyObject _PyObject_CallMethod(PyObject obj, - PyObject name, - String format); - -/* Like PyObject_CallMethod(), but expect a _Py_Identifier* - as the method name. */ -@NoException public static native PyObject _PyObject_CallMethodId(PyObject obj, - _Py_Identifier name, - @Cast("const char*") BytePointer format); -@NoException public static native PyObject _PyObject_CallMethodId(PyObject obj, - _Py_Identifier name, - String format); - -@NoException public static native PyObject _PyObject_CallMethodId_SizeT(PyObject obj, - _Py_Identifier name, - @Cast("const char*") BytePointer format); -@NoException public static native PyObject _PyObject_CallMethodId_SizeT(PyObject obj, - _Py_Identifier name, - String format); - -@NoException public static native PyObject _PyObject_CallMethodIdObjArgs( - PyObject obj, - _Py_Identifier name); - -@NoException public static native PyObject _PyObject_VectorcallMethodId( - _Py_Identifier name, @Cast("PyObject*const*") PointerPointer args, - @Cast("size_t") long nargsf, PyObject kwnames); -@NoException public static native PyObject _PyObject_VectorcallMethodId( - _Py_Identifier name, @ByPtrPtr PyObject args, - @Cast("size_t") long nargsf, PyObject kwnames); - -@NoException public static native PyObject _PyObject_CallMethodIdNoArgs(PyObject self, _Py_Identifier name); - -@NoException public static native PyObject _PyObject_CallMethodIdOneArg(PyObject self, _Py_Identifier name, PyObject arg); - -@NoException public static native int _PyObject_HasLen(PyObject o); - /* Guess the size of object 'o' using len(o) or o.__length_hint__(). If neither of those return a non-negative value, then return the default value. If one of the calls fails, this function returns -1. */ @@ -13501,49 +12192,6 @@ or PyObject_FastCallDict() (both forms are supported), // #define PySequence_ITEM(o, i) // ( Py_TYPE(o)->tp_as_sequence->sq_item((o), (i)) ) -public static final int PY_ITERSEARCH_COUNT = 1; -public static final int PY_ITERSEARCH_INDEX = 2; -public static final int PY_ITERSEARCH_CONTAINS = 3; - -/* Iterate over seq. - - Result depends on the operation: - - PY_ITERSEARCH_COUNT: return # of times obj appears in seq; -1 if - error. - PY_ITERSEARCH_INDEX: return 0-based index of first occurrence of - obj in seq; set ValueError and return -1 if none found; - also return -1 on error. - PY_ITERSEARCH_CONTAINS: return 1 if obj in seq, else 0; -1 on - error. */ -@NoException public static native @Cast("Py_ssize_t") long _PySequence_IterSearch(PyObject seq, - PyObject obj, int operation); - -/* === Mapping protocol ================================================= */ - -@NoException public static native int _PyObject_RealIsInstance(PyObject inst, PyObject cls); - -@NoException public static native int _PyObject_RealIsSubclass(PyObject derived, PyObject cls); - -@NoException public static native @Cast("char*const*") PointerPointer _PySequence_BytesToCharpArray(PyObject self); - -@NoException public static native void _Py_FreeCharPArray(@Cast("char*const*") PointerPointer array); -@NoException public static native void _Py_FreeCharPArray(@Cast("char*const*") @ByPtrPtr BytePointer array); -@NoException public static native void _Py_FreeCharPArray(@Cast("char*const*") @ByPtrPtr ByteBuffer array); -@NoException public static native void _Py_FreeCharPArray(@Cast("char*const*") @ByPtrPtr byte[] array); - -/* For internal use by buffer API functions */ -@NoException public static native void _Py_add_one_to_index_F(int nd, @Cast("Py_ssize_t*") SizeTPointer index, - @Cast("const Py_ssize_t*") SizeTPointer shape); -@NoException public static native void _Py_add_one_to_index_C(int nd, @Cast("Py_ssize_t*") SizeTPointer index, - @Cast("const Py_ssize_t*") SizeTPointer shape); - -/* Convert Python int to Py_ssize_t. Do nothing if the argument is None. */ -@NoException public static native int _Py_convert_optional_to_ssize_t(PyObject arg0, Pointer arg1); - -/* Same as PyNumber_Index but can return an instance of a subclass of int. */ -@NoException public static native PyObject _PyNumber_Index(PyObject o); - // Parsed from bltinmodule.h @@ -13584,27 +12232,15 @@ or PyObject_FastCallDict() (both forms are supported), // Targeting ../_Py_GlobalMonitors.java -// Targeting ../_Py_CODEUNIT.java - - - - -/* These macros only remain defined for compatibility. */ -// #define _Py_OPCODE(word) ((word).op.code) -// #define _Py_OPARG(word) ((word).op.arg) - -@NoException public static native @ByVal _Py_CODEUNIT _py_make_codeunit(@Cast("uint8_t") byte opcode, @Cast("uint8_t") byte oparg); - -@NoException public static native void _py_set_opcode(_Py_CODEUNIT word, @Cast("uint8_t") byte opcode); - -// #define _Py_MAKE_CODEUNIT(opcode, oparg) _py_make_codeunit((opcode), (oparg)) -// #define _Py_SET_OPCODE(word, opcode) _py_set_opcode(&(word), (opcode)) // Targeting ../_PyCoCached.java // Targeting ../_PyCoLineInstrumentationData.java +// Targeting ../_PyExecutorArray.java + + // Targeting ../_PyCoMonitoringData.java @@ -13665,8 +12301,9 @@ or PyObject_FastCallDict() (both forms are supported), // 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 */ +// _PyExecutorArray *co_executors; /* executors from optimizer */ // _PyCoCached *_co_cached; /* cached co_* attributes */ -// uint64_t _co_instrumentation_version; /* current instrumentation version */ +// uintptr_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. \ @@ -13707,6 +12344,8 @@ or PyObject_FastCallDict() (both forms are supported), public static final int CO_FUTURE_GENERATOR_STOP = 0x800000; public static final int CO_FUTURE_ANNOTATIONS = 0x1000000; +public static final int CO_NO_MONITORING_EVENTS = 0x2000000; + /* This should be defined if a future statement modifies the syntax. For example, when a keyword is added. */ @@ -13720,10 +12359,9 @@ or PyObject_FastCallDict() (both forms are supported), @NoException public static native @Cast("Py_ssize_t") long PyCode_GetNumFree(PyCodeObject op); -@NoException public static native int PyCode_GetFirstFree(PyCodeObject op); +@NoException public static native int PyUnstable_Code_GetFirstFree(PyCodeObject op); -// #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)) +@NoException public static native @Deprecated int PyCode_GetFirstFree(PyCodeObject op); /* Unstable public interface */ @NoException public static native PyCodeObject PyUnstable_Code_New( @@ -13904,28 +12542,18 @@ use PyFrame_GetLineNumber() instead. */ public static final int PyCF_TYPE_COMMENTS = 0x1000; public static final int PyCF_ALLOW_TOP_LEVEL_AWAIT = 0x2000; public static final int PyCF_ALLOW_INCOMPLETE_INPUT = 0x4000; +public static final int PyCF_OPTIMIZED_AST = (0x8000 | PyCF_ONLY_AST); public static final int PyCF_COMPILE_MASK = (PyCF_ONLY_AST | PyCF_ALLOW_TOP_LEVEL_AWAIT | PyCF_TYPE_COMMENTS | PyCF_DONT_IMPLY_DEDENT | - PyCF_ALLOW_INCOMPLETE_INPUT); + PyCF_ALLOW_INCOMPLETE_INPUT | PyCF_OPTIMIZED_AST); // Targeting ../PyCompilerFlags.java // #define _PyCompilerFlags_INIT // (PyCompilerFlags){.cf_flags = 0, .cf_feature_version = PY_MINOR_VERSION} -// Targeting ../_PyCompilerSrcLocation.java - - - -// #define SRC_LOCATION_FROM_AST(n) -// (_PyCompilerSrcLocation){ -// .ineno = (n)->lineno, -// .end_lineno = (n)->end_lineno, -// .col_offset = (n)->col_offset, -// .end_col_offset = (n)->end_col_offset } -// Targeting ../PyFutureFeatures.java - +/* Future feature support */ public static final String FUTURE_NESTED_SCOPES = "nested_scopes"; public static final String FUTURE_GENERATORS = "generators"; @@ -14000,11 +12628,6 @@ use PyFrame_GetLineNumber() instead. */ @NoException public static native int PyRun_SimpleStringFlags(@Cast("const char*") BytePointer arg0, PyCompilerFlags arg1); @NoException public static native int PyRun_SimpleStringFlags(String arg0, PyCompilerFlags arg1); -@NoException public static native int _PyRun_SimpleFileObject( - @Cast("FILE*") Pointer fp, - PyObject filename, - int closeit, - PyCompilerFlags flags); @NoException public static native int PyRun_AnyFileExFlags( @Cast("FILE*") Pointer fp, @Cast("const char*") BytePointer filename, @@ -14015,11 +12638,6 @@ use PyFrame_GetLineNumber() instead. */ String filename, int closeit, PyCompilerFlags flags); -@NoException public static native int _PyRun_AnyFileObject( - @Cast("FILE*") Pointer fp, - PyObject filename, - int closeit, - PyCompilerFlags flags); @NoException public static native int PyRun_SimpleFileExFlags( @Cast("FILE*") Pointer fp, @Cast("const char*") BytePointer filename, @@ -14050,10 +12668,6 @@ use PyFrame_GetLineNumber() instead. */ @Cast("FILE*") Pointer fp, String filename, PyCompilerFlags flags); -@NoException public static native int _PyRun_InteractiveLoopObject( - @Cast("FILE*") Pointer fp, - PyObject filename, - PyCompilerFlags flags); @NoException public static native PyObject PyRun_StringFlags(@Cast("const char*") BytePointer arg0, int arg1, PyObject arg2, @@ -14105,27 +12719,6 @@ use PyFrame_GetLineNumber() instead. */ // #define Py_CompileString(str, p, s) Py_CompileStringExFlags((str), (p), (s), NULL, -1) // #define Py_CompileStringFlags(str, p, s, f) Py_CompileStringExFlags((str), (p), (s), (f), -1) - -@NoException public static native @Cast("const char*") BytePointer _Py_SourceAsString( - PyObject cmd, - @Cast("const char*") BytePointer funcname, - @Cast("const char*") BytePointer what, - PyCompilerFlags cf, - @Cast("PyObject**") PointerPointer cmd_copy); -@NoException public static native @Cast("const char*") BytePointer _Py_SourceAsString( - PyObject cmd, - @Cast("const char*") BytePointer funcname, - @Cast("const char*") BytePointer what, - PyCompilerFlags cf, - @ByPtrPtr PyObject cmd_copy); -@NoException public static native String _Py_SourceAsString( - PyObject cmd, - String funcname, - String what, - PyCompilerFlags cf, - @ByPtrPtr PyObject cmd_copy); - - /* A function flavor is also exported by libpython. It is required when libpython is accessed directly rather than using header files which defines macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to @@ -14174,11 +12767,9 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to // #define PyRun_FileFlags(fp, p, s, g, l, flags) // PyRun_FileExFlags((fp), (p), (s), (g), (l), 0, (flags)) - /* Stuff with no proper home (yet) */ @NoException public static native @Cast("char*") BytePointer PyOS_Readline(@Cast("FILE*") Pointer arg0, @Cast("FILE*") Pointer arg1, @Cast("const char*") BytePointer arg2); @NoException public static native @Cast("char*") ByteBuffer PyOS_Readline(@Cast("FILE*") Pointer arg0, @Cast("FILE*") Pointer arg1, String arg2); -public static native PyThreadState _PyOS_ReadlineTState(); public static native void _PyOS_ReadlineTState(PyThreadState setter); // Targeting ../PyOS_ReadlineFunctionPointer_Pointer_Pointer_BytePointer.java @@ -14225,17 +12816,15 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to /* In pathconfig.c */ @NoException public static native @Deprecated void Py_SetProgramName(@Cast("const wchar_t*") Pointer arg0); -@NoException public static native @Cast("wchar_t*") Pointer Py_GetProgramName(); +@NoException public static native @Cast("wchar_t*") @Deprecated Pointer Py_GetProgramName(); @NoException public static native @Deprecated void Py_SetPythonHome(@Cast("const wchar_t*") Pointer arg0); -@NoException public static native @Cast("wchar_t*") Pointer Py_GetPythonHome(); +@NoException public static native @Cast("wchar_t*") @Deprecated Pointer Py_GetPythonHome(); -@NoException public static native @Cast("wchar_t*") Pointer Py_GetProgramFullPath(); - -@NoException public static native @Cast("wchar_t*") Pointer Py_GetPrefix(); -@NoException public static native @Cast("wchar_t*") Pointer Py_GetExecPrefix(); -@NoException public static native @Cast("wchar_t*") Pointer Py_GetPath(); -@NoException public static native @Deprecated void Py_SetPath(@Cast("const wchar_t*") Pointer arg0); +@NoException public static native @Cast("wchar_t*") @Deprecated Pointer Py_GetProgramFullPath(); +@NoException public static native @Cast("wchar_t*") @Deprecated Pointer Py_GetPrefix(); +@NoException public static native @Cast("wchar_t*") @Deprecated Pointer Py_GetExecPrefix(); +@NoException public static native @Cast("wchar_t*") @Deprecated Pointer Py_GetPath(); // #ifdef MS_WINDOWS // #endif @@ -14255,6 +12844,10 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to @MemberGetter public static native @Cast("const unsigned long") long Py_Version(); // #endif +// #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030D0000 +@NoException public static native int Py_IsFinalizing(); +// #endif + // #ifndef Py_LIMITED_API // # define Py_CPYTHON_PYLIFECYCLE_H // # include "cpython/pylifecycle.h" @@ -14275,16 +12868,6 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to /* Py_FrozenMain is kept out of the Limited API until documented and present in all builds of Python */ -/* Only used by applications that embed the interpreter and need to - * override the standard encoding determination mechanism - */ -@NoException public static native @Deprecated int Py_SetStandardStreamEncoding( - @Cast("const char*") BytePointer encoding, - @Cast("const char*") BytePointer errors); -@NoException public static native @Deprecated int Py_SetStandardStreamEncoding( - String encoding, - String errors); - /* PEP 432 Multi-phase initialization API (Private while provisional!) */ @NoException public static native @ByVal PyStatus Py_PreInitialize( @@ -14314,13 +12897,13 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to @Cast("Py_ssize_t") long argc, @Cast("wchar_t**") @ByPtrPtr Pointer argv); -@NoException public static native int _Py_IsCoreInitialized(); - /* Initialization and finalization */ @NoException public static native @ByVal PyStatus Py_InitializeFromConfig( @Const PyConfig config); + +// Python 3.8 provisional API (PEP 587) @NoException public static native @ByVal PyStatus _Py_InitializeMain(); @NoException public static native int Py_RunMain(); @@ -14328,29 +12911,8 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to @NoException public static native void Py_ExitStatusException(@ByVal PyStatus err); -/* Restore signals that the interpreter has called SIG_IGN on to SIG_DFL. */ -@NoException public static native void _Py_RestoreSignals(); - @NoException public static native int Py_FdIsInteractive(@Cast("FILE*") Pointer arg0, @Cast("const char*") BytePointer arg1); @NoException public static native int Py_FdIsInteractive(@Cast("FILE*") Pointer arg0, String arg1); -@NoException public static native int _Py_FdIsInteractive(@Cast("FILE*") Pointer fp, PyObject filename); - -@NoException public static native @Deprecated void _Py_SetProgramFullPath(@Cast("const wchar_t*") Pointer arg0); - -@NoException public static native @Cast("const char*") BytePointer _Py_gitidentifier(); -@NoException public static native @Cast("const char*") BytePointer _Py_gitversion(); - -@NoException public static native int _Py_IsFinalizing(); -@NoException public static native int _Py_IsInterpreterFinalizing(PyInterpreterState interp); - -/* Random */ -@NoException public static native int _PyOS_URandom(Pointer buffer, @Cast("Py_ssize_t") long size); -@NoException public static native int _PyOS_URandomNonblock(Pointer buffer, @Cast("Py_ssize_t") long size); - -/* Legacy locale support */ -@NoException public static native int _Py_CoerceLegacyLocale(int warn); -@NoException public static native int _Py_LegacyLocaleDetected(int warn); -@NoException public static native @Cast("char*") BytePointer _Py_SetLocaleFromEnv(int category); /* --- PyInterpreterConfig ------------------------------------ */ @@ -14372,6 +12934,14 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to // .gil = PyInterpreterConfig_OWN_GIL, // } +// gh-117649: The free-threaded build does not currently support single-phase +// init extensions in subinterpreters. For now, we ensure that +// `check_multi_interp_extensions` is always `1`, even in the legacy config. +// #ifdef Py_GIL_DISABLED +// #else +public static final int _PyInterpreterConfig_LEGACY_CHECK_MULTI_INTERP_EXTENSIONS = 0; +// #endif + // #define _PyInterpreterConfig_LEGACY_INIT // { // .se_main_obmalloc = 1, @@ -14379,7 +12949,7 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to // .aow_exec = 1, // .aow_threads = 1, // .aow_daemon_threads = 1, -// .check_multi_interp_extensions = 0, +// .check_multi_interp_extensions = _PyInterpreterConfig_LEGACY_CHECK_MULTI_INTERP_EXTENSIONS, // .gil = PyInterpreterConfig_SHARED_GIL, // } @@ -14392,7 +12962,7 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to // Targeting ../atexit_datacallbackfunc.java -@NoException public static native int _Py_AtExit( +@NoException public static native int PyUnstable_AtExit( PyInterpreterState arg0, atexit_datacallbackfunc arg1, Pointer arg2); @@ -14488,28 +13058,6 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to int precision, int flags, int[] type); -// Targeting ../Innerfunc_BytePointer_long_Pointer.java - - -@NoException public static native PyObject _Py_string_to_number_with_underscores( - @Cast("const char*") BytePointer str, @Cast("Py_ssize_t") long len, @Cast("const char*") BytePointer what, PyObject obj, Pointer arg, - Innerfunc_BytePointer_long_Pointer innerfunc); -// Targeting ../Innerfunc_String_long_Pointer.java - - -@NoException public static native PyObject _Py_string_to_number_with_underscores( - String str, @Cast("Py_ssize_t") long len, String what, PyObject obj, Pointer arg, - Innerfunc_String_long_Pointer innerfunc); - -@NoException public static native double _Py_parse_inf_or_nan(@Cast("const char*") BytePointer p, @Cast("char**") PointerPointer endptr); -@NoException public static native double _Py_parse_inf_or_nan(@Cast("const char*") BytePointer p, @Cast("char**") @ByPtrPtr BytePointer endptr); -@NoException public static native double _Py_parse_inf_or_nan(String p, @Cast("char**") @ByPtrPtr ByteBuffer endptr); -@NoException public static native double _Py_parse_inf_or_nan(@Cast("const char*") BytePointer p, @Cast("char**") @ByPtrPtr byte[] endptr); -@NoException public static native double _Py_parse_inf_or_nan(String p, @Cast("char**") @ByPtrPtr BytePointer endptr); -@NoException public static native double _Py_parse_inf_or_nan(@Cast("const char*") BytePointer p, @Cast("char**") @ByPtrPtr ByteBuffer endptr); -@NoException public static native double _Py_parse_inf_or_nan(String p, @Cast("char**") @ByPtrPtr byte[] endptr); -// #endif - /* PyOS_double_to_string's "flags" parameter can be set to 0 or more of: */ public static final int Py_DTSF_SIGN = 0x01; /* always add the sign */ @@ -14558,6 +13106,41 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to // #ifndef Py_FILEUTILS_H // #define Py_FILEUTILS_H + +/******************************* + * stat() and fstat() fiddling * + *******************************/ + +// #ifdef HAVE_SYS_STAT_H +// # include // S_ISREG() +// #elif defined(HAVE_STAT_H) +// #endif + +// #ifndef S_IFMT + // VisualAge C/C++ Failed to Define MountType Field in sys/stat.h. +public static final int S_IFMT = 0170000; +// #endif +// #ifndef S_IFLNK + // Windows doesn't define S_IFLNK, but posixmodule.c maps + // IO_REPARSE_TAG_SYMLINK to S_IFLNK. +public static final int S_IFLNK = 0120000; +// #endif +// #ifndef S_ISREG +// # define S_ISREG(x) (((x) & S_IFMT) == S_IFREG) +// #endif +// #ifndef S_ISDIR +// # define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR) +// #endif +// #ifndef S_ISCHR +// # define S_ISCHR(x) (((x) & S_IFMT) == S_IFCHR) +// #endif +// #ifndef S_ISLNK +// # define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK) +// #endif + + +// Move this down here since some C++ #include's don't like to be included +// inside an extern "C". // #ifdef __cplusplus // #endif @@ -14619,12 +13202,58 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to // #endif /* !Py_PYFPE_H */ -// Parsed from tracemalloc.h +// Parsed from cpython/pyhash.h + +// #ifndef Py_CPYTHON_HASH_H +// # error "this header file must not be included directly" +// #endif + +/* Prime multiplier used in string and various other hashes. */ +public static final long PyHASH_MULTIPLIER = 1000003L; /* 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 SIZEOF_VOID_P >= 8 +public static final int PyHASH_BITS = 61; +// #else +// #endif + +public static native @MemberGetter long PyHASH_MODULUS(); +public static final long PyHASH_MODULUS = PyHASH_MODULUS(); +public static final int PyHASH_INF = 314159; +public static final long PyHASH_IMAG = PyHASH_MULTIPLIER; + +/* Aliases kept for backward compatibility with Python 3.12 */ +public static final long _PyHASH_MULTIPLIER = PyHASH_MULTIPLIER; +public static final int _PyHASH_BITS = PyHASH_BITS; +public static native @MemberGetter long _PyHASH_MODULUS(); +public static final long _PyHASH_MODULUS = _PyHASH_MODULUS(); +public static final int _PyHASH_INF = PyHASH_INF; +public static final long _PyHASH_IMAG = PyHASH_IMAG; + +/* Helpers for hash functions */ +@NoException public static native @Cast("Py_hash_t") long _Py_HashDouble(PyObject arg0, double arg1); + +// Kept for backward compatibility +// #define _Py_HashPointer Py_HashPointer +// Targeting ../PyHash_FuncDef.java + + +@NoException public static native PyHash_FuncDef PyHash_GetFuncDef(); + +@NoException public static native @Cast("Py_hash_t") long Py_HashPointer(@Const Pointer ptr); +@NoException public static native @Cast("Py_hash_t") long PyObject_GenericHash(PyObject arg0); + + +// Parsed from cpython/tracemalloc.h + +// #ifndef Py_LIMITED_API // #ifndef Py_TRACEMALLOC_H // #define Py_TRACEMALLOC_H -// #ifndef Py_LIMITED_API /* Track an allocated memory block in the tracemalloc module. Return 0 on success, return -1 on error (failed to allocate memory to store the trace). @@ -14645,54 +13274,8 @@ macros below. On Windows, for example, PyAPI_FUNC() uses dllexport to @Cast("unsigned int") int domain, @Cast("uintptr_t") long ptr); -/* Get the traceback where a memory block was allocated. - - Return a tuple of (filename: str, lineno: int) tuples. - - Return None if the tracemalloc module is disabled or if the memory block - is not tracked by tracemalloc. - - Raise an exception and return NULL on error. */ -@NoException public static native PyObject _PyTraceMalloc_GetTraceback( - @Cast("unsigned int") int domain, - @Cast("uintptr_t") long ptr); - -/* Return non-zero if tracemalloc is tracing */ -@NoException public static native int _PyTraceMalloc_IsTracing(); - -/* Clear the tracemalloc traces */ -@NoException public static native void _PyTraceMalloc_ClearTraces(); - -/* Clear the tracemalloc traces */ -@NoException public static native PyObject _PyTraceMalloc_GetTraces(); - -/* Clear tracemalloc traceback for an object */ -@NoException public static native PyObject _PyTraceMalloc_GetObjectTraceback(PyObject obj); - -/* Initialize tracemalloc */ -@NoException public static native int _PyTraceMalloc_Init(); - -/* Start tracemalloc */ -@NoException public static native int _PyTraceMalloc_Start(int max_nframe); - -/* Stop tracemalloc */ -@NoException public static native void _PyTraceMalloc_Stop(); - -/* Get the tracemalloc traceback limit */ -@NoException public static native int _PyTraceMalloc_GetTracebackLimit(); - -/* Get the memory usage of tracemalloc in bytes */ -@NoException public static native @Cast("size_t") long _PyTraceMalloc_GetMemory(); - -/* Get the current size and peak size of traced memory blocks as a 2-tuple */ -@NoException public static native PyObject _PyTraceMalloc_GetTracedMemory(); - -/* Set the peak size of traced memory blocks to the current size */ -@NoException public static native void _PyTraceMalloc_ResetPeak(); - -// #endif - -// #endif /* !Py_TRACEMALLOC_H */ +// #endif // !Py_TRACEMALLOC_H +// #endif // !Py_LIMITED_API // Parsed from datetime.h diff --git a/cpython/src/gen/java/org/bytedeco/cpython/xid_freefunc.java b/cpython/src/gen/java/org/bytedeco/cpython/xid_freefunc.java deleted file mode 100644 index 07e9ec3e26c..00000000000 --- a/cpython/src/gen/java/org/bytedeco/cpython/xid_freefunc.java +++ /dev/null @@ -1,21 +0,0 @@ -// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE - -package org.bytedeco.cpython; - -import java.nio.*; -import org.bytedeco.javacpp.*; -import org.bytedeco.javacpp.annotation.*; - -import static org.bytedeco.javacpp.presets.javacpp.*; - -import static org.bytedeco.cpython.global.python.*; - -@Properties(inherit = org.bytedeco.cpython.presets.python.class) -public class xid_freefunc extends FunctionPointer { - static { Loader.load(); } - /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ - public xid_freefunc(Pointer p) { super(p); } - protected xid_freefunc() { allocate(); } - private native void allocate(); - public native void call(Pointer arg0); -} diff --git a/cpython/src/main/java/org/bytedeco/cpython/helper/python.java b/cpython/src/main/java/org/bytedeco/cpython/helper/python.java index 7ca2abeebd1..7a157b23eae 100644 --- a/cpython/src/main/java/org/bytedeco/cpython/helper/python.java +++ b/cpython/src/main/java/org/bytedeco/cpython/helper/python.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2021 Samuel Audet + * Copyright (C) 2019-2024 Samuel Audet * * Licensed either under the Apache License, Version 2.0, or (at your option) * under the terms of the GNU General Public License as published by @@ -31,100 +31,50 @@ public class python extends org.bytedeco.cpython.presets.python { - public static String Py_GetPathString() { - Py_FrozenFlag(1); // prevent Python from printing useless warnings - Pointer s = org.bytedeco.cpython.global.python.Py_GetPath(); - if (!Pointer.isNull(s)) { - BytePointer p = Py_EncodeLocale(s, null); - String string = p.getString(); - PyMem_Free(p); - return string; - } else { - return null; - } - } - - public static void Py_SetPath(File... path) throws IOException { + /** Effectively returns {@code PyStatus_Exception(Py_InitializeFromConfig(config)) == 0} + * after setting the {@code home} and {@code pythonpath_env} values, for convenience. */ + public static boolean Py_Initialize(File... path) throws IOException { String[] strings = new String[path.length]; for (int i = 0; i < path.length; i++) { strings[i] = path[i].getCanonicalPath(); } - Py_SetPath(strings); + return Py_Initialize(strings); } - public static void Py_SetPath(String... path) throws IOException { - Py_FrozenFlag(1); // prevent Python from printing useless warnings - String separator = ""; - String string = ""; - for (String s : path) { - string += separator + s; - separator = File.pathSeparator; - } - Pointer p = Py_DecodeLocale(string, null); - org.bytedeco.cpython.global.python.Py_SetPath(p); + /** Effectively returns {@code PyStatus_Exception(Py_InitializeFromConfig(config)) == 0} + * after setting the {@code home} and {@code pythonpath_env} values, for convenience. */ + public static boolean Py_Initialize(String... path) throws IOException { + PyConfig config = new PyConfig(); + PyConfig_InitPythonConfig(config); + PointerPointer home = new PointerPointer(config.getPointer(BytePointer.class, config.offsetof("home"))); + Pointer p = Py_DecodeLocale(cachePackage().getCanonicalPath(), null); + PyStatus status = PyConfig_SetString(config, home, p); PyMem_RawFree(p); - } - - /** Effectively calls {@code Py_SetPath(path, Py_GetPath())}, for convenience. */ - public static void Py_AddPath(File... path) throws IOException { - String[] strings = new String[path.length]; - for (int i = 0; i < path.length; i++) { - strings[i] = path[i].getCanonicalPath(); + if (PyStatus_Exception(status) != 0) { + Py_ExitStatusException(status); + return false; } - Py_AddPath(strings); - } - /** Effectively calls {@code Py_SetPath(path, Py_GetPath())}, for convenience. */ - public static void Py_AddPath(String... path) throws IOException { - String s = Py_GetPathString(); - if (s != null) { - path = Arrays.copyOf(path, path.length + 1); - path[path.length - 1] = s; - } - Py_SetPath(path); - } - - public static void PySys_SetPath(File... path) throws IOException { - String[] strings = new String[path.length]; - for (int i = 0; i < path.length; i++) { - strings[i] = path[i].getCanonicalPath(); - } - PySys_SetPath(strings); - } - - public static void PySys_SetPath(String... path) throws IOException { + PointerPointer pythonpath_env = new PointerPointer(config.getPointer(BytePointer.class, config.offsetof("pythonpath_env"))); String separator = ""; String string = ""; for (String s : path) { string += separator + s; separator = File.pathSeparator; } - Pointer p = Py_DecodeLocale(string, null); - org.bytedeco.cpython.global.python.PySys_SetPath(p); + p = Py_DecodeLocale(string, null); + status = PyConfig_SetString(config, pythonpath_env, p); PyMem_RawFree(p); - } - - /** Effectively returns {@code Py_IsInitialized() != 0} after calling - * {@code Py_SetPythonHome(cachePackage()); Py_InitializeEx(0); PySys_SetPath(path)}, for convenience. */ - public static boolean Py_Initialize(File... path) throws IOException { - String[] strings = new String[path.length]; - for (int i = 0; i < path.length; i++) { - strings[i] = path[i].getCanonicalPath(); + if (PyStatus_Exception(status) != 0) { + Py_ExitStatusException(status); + return false; } - return Py_Initialize(strings); - } - /** Effectively returns {@code Py_IsInitialized() != 0} after calling - * {@code Py_SetPythonHome(cachePackage()); Py_InitializeEx(0); PySys_SetPath(path)}, for convenience. */ - public static boolean Py_Initialize(String... path) throws IOException { - Pointer p = Py_DecodeLocale(cachePackage().getCanonicalPath(), null); - Py_SetPythonHome(p); - PyMem_RawFree(p); - Py_InitializeEx(0); - if (Py_IsInitialized() != 0) { - PySys_SetPath(path); - return true; + status = Py_InitializeFromConfig(config); + if (PyStatus_Exception(status) != 0) { + Py_ExitStatusException(status); + return false; } - return false; + return true; } } diff --git a/cpython/src/main/java/org/bytedeco/cpython/presets/python.java b/cpython/src/main/java/org/bytedeco/cpython/presets/python.java index 54fcfdcccdb..b75a0cb9f94 100644 --- a/cpython/src/main/java/org/bytedeco/cpython/presets/python.java +++ b/cpython/src/main/java/org/bytedeco/cpython/presets/python.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2023 Samuel Audet + * Copyright (C) 2018-2024 Samuel Audet * * Licensed either under the Apache License, Version 2.0, or (at your option) * under the terms of the GNU General Public License as published by @@ -62,6 +62,10 @@ "pytypedefs.h", "pybuffer.h", "cpython/pymem.h", + "pystats.h", + "lock.h", + "monitoring.h", + "critical_section.h", "object.h", "cpython/object.h", @@ -162,7 +166,8 @@ "fileutils.h", "cpython/fileutils.h", "cpython/pyfpe.h", - "tracemalloc.h", + "cpython/pyhash.h", + "cpython/tracemalloc.h", "datetime.h", }, @@ -192,8 +197,9 @@ "cpython/pythonrun.h", "cpython/pylifecycle.h", "cpython/fileutils.h", + "cpython/pyhash.h", }, - link = "python3.12@.1.0!", + link = "python3.13@.1.0!", preload = {"ffi@.8", "ffi@.7", "ffi@.6", "ffi@.5", "libcrypto-1_1", "libssl-1_1"/*, "sqlite3", "tcl86t", "tk86t"*/}, resource = {"include", "lib", "libs", "bin", "share"} ), @@ -203,8 +209,8 @@ @Platform(value = "linux-x86", preloadpath = {"/usr/lib32/", "/usr/lib/"}), @Platform(value = "linux-x86_64", preloadpath = {"/usr/lib64/", "/usr/lib/"}), @Platform(value = "linux-ppc64", preloadpath = {"/usr/lib/powerpc64-linux-gnu/", "/usr/lib/powerpc64le-linux-gnu/"}), - @Platform(value = "macosx", link = "python3.12!"), - @Platform(value = "windows", link = "python312"), + @Platform(value = "macosx", link = "python3.13!"), + @Platform(value = "windows", link = "python313"), }, target = "org.bytedeco.cpython", global = "org.bytedeco.cpython.global.python", @@ -222,7 +228,7 @@ public static synchronized File cachePackage() throws IOException { return packageFile; } File pythonFile = Loader.cacheResource("/org/bytedeco/cpython/" + Loader.getPlatform()); - File configDir = new File(pythonFile, "lib/python3.12/"); + File configDir = new File(pythonFile, "lib/python3.13/"); if (configDir.exists()) { String pythonPath = pythonFile.getAbsolutePath(); Pattern pattern = Pattern.compile("'prefix': '(.*)'"); @@ -261,10 +267,10 @@ public static synchronized File cachePackage() throws IOException { return pythonFile; } - /** Returns {@code {f, new File(f, "site-packages"), new File(f, "python3.12"), new File(f, "python3.12/lib-dynload"), new File(f, "python3.12/site-packages")}} where {@code File f = new File(cachePackage(), "lib")}. */ + /** Returns {@code {f, new File(f, "site-packages"), new File(f, "python3.13"), new File(f, "python3.13/lib-dynload"), new File(f, "python3.13/site-packages")}} where {@code File f = new File(cachePackage(), "lib")}. */ public static File[] cachePackages() throws IOException { File f = new File(cachePackage(), "lib"); - return new File[] {f, new File(f, "site-packages"), new File(f, "python3.12"), new File(f, "python3.12/lib-dynload"), new File(f, "python3.12/site-packages")}; + return new File[] {f, new File(f, "site-packages"), new File(f, "python3.13"), new File(f, "python3.13/lib-dynload"), new File(f, "python3.13/site-packages")}; } public void map(InfoMap infoMap) { @@ -281,7 +287,7 @@ public void map(InfoMap infoMap) { "PyMem_Del", "PyMem_DEL", "PyDescr_COMMON", "PY_UNICODE_TYPE", "_PyObject_EXTRA_INIT", "PyObject_MALLOC", "PyObject_REALLOC", "PyObject_FREE", "PyObject_Del", "PyObject_DEL", "_PyTraceMalloc_Config_INIT", "_PyUnicode_AsStringAndSize", "_PyUnicode_AsString", - "PyLong_FromPid", "PyLong_AsPid", "PyLong_AS_LONG", + "PY_CXX_CONST", "PyLong_FromPid", "PyLong_AsPid", "PyLong_AS_LONG", "Py_False", "Py_True", "Py_RETURN_TRUE", "Py_RETURN_FALSE", "Py_RETURN_NAN", "PyObject_HEAD", "PyObject_VAR_HEAD", "Py_RETURN_NONE", "Py_RETURN_NOTIMPLEMENTED", "PyModuleDef_HEAD_INIT", "_Py_atomic_address", "__declspec", @@ -294,9 +300,11 @@ public void map(InfoMap infoMap) { "_PyCompilerFlags_INIT", "_PyInterpreterState_Get", "PyOS_strnicmp", "PyOS_stricmp", "Py_FrozenMain", "_PyObject_Vectorcall", "_PyObject_VectorcallMethod", "_PyObject_FastCallDict", "_PyVectorcall_Function", "_PyObject_CallOneArg", "_PyObject_CallMethodNoArgs", "_PyObject_CallMethodOneArg", "_PyObject_LookupSpecial", "_PyTZINFO_HEAD", - "_PyDateTime_TIMEHEAD", "_PyDateTime_DATETIMEHEAD", "PyDateTime_IMPORT", "PyDateTime_TimeZone_UTC").cppTypes().annotations()) + "_PyDateTime_TIMEHEAD", "_PyDateTime_DATETIMEHEAD", "PyDateTime_IMPORT", "PyDateTime_TimeZone_UTC", + "PyStructSequence_SET_ITEM", "PyStructSequence_GET_ITEM", "_PyThreadState_UncheckedGet", "_Py_HashPointer").cppTypes().annotations()) .put(new Info("PyAPI_DATA").cppText("#define PyAPI_DATA(RTYPE) RTYPE")) + .put(new Info("PyAPI_FUNC").cppText("#define PyAPI_FUNC(RTYPE) RTYPE").cppTypes()) .put(new Info("Py_DEPRECATED").cppText("#define Py_DEPRECATED() deprecated").cppTypes()) .put(new Info("deprecated").annotations("@Deprecated")) @@ -314,7 +322,11 @@ public void map(InfoMap infoMap) { "MS_WINDOWS", "defined(HAVE_CLOCK_GETTIME) || defined(HAVE_KQUEUE)", "X87_DOUBLE_ROUNDING", - "Py_DEBUG", "Py_TRACE_REFS", + "Py_DEBUG", "Py_GIL_DISABLED", "Py_STATS", "Py_TRACE_REFS", + "defined(Py_GIL_DISABLED) && !defined(Py_LIMITED_API)", + "!defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)", + "defined(Py_GIL_DISABLED) && defined(Py_REF_DEBUG)", + "defined(Py_GIL_DISABLED)", "defined(MS_WIN32) && !defined(HAVE_SNPRINTF)", "defined(MS_WINDOWS) && !defined(Py_LIMITED_API)", "!defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000", @@ -325,18 +337,20 @@ public void map(InfoMap infoMap) { "defined(Py_REF_DEBUG) && !(defined(Py_LIMITED_API) && Py_LIMITED_API+0 >= 0x030A0000)", "PY_SSIZE_T_CLEAN").cppTypes().define(false)) - .put(new Info("!defined(__INTEL_COMPILER)", "WITH_THREAD", "PY_NO_SHORT_FLOAT_REPR").cppTypes().define(true)) + .put(new Info("!defined(__INTEL_COMPILER)", "WITH_THREAD", "PY_NO_SHORT_FLOAT_REPR", + "!defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030d0000").cppTypes().define(true)) .put(new Info("COMPILER", "PY_LLONG_MIN", "PY_LLONG_MAX", "PY_ULLONG_MAX", "PY_TIMEOUT_MAX", "SIZEOF_PY_HASH_T", "SIZEOF_PY_UHASH_T", "PY_SSIZE_T_MAX", "PY_SSIZE_T_MIN", - "LONG_BIT", "PyLong_BASE", "PyLong_MASK", "Py_UNICODE_SIZE", - "PY_VECTORCALL_ARGUMENTS_OFFSET", "_Py_IMMORTAL_REFCNT").cppTypes("long long").translate(false)) + "LONG_BIT", "PyLong_BASE", "PyLong_MASK", "Py_UNICODE_SIZE", "PyTime_MIN", "PyTime_MAX", "PyHASH_MODULUS", + "_Py_IMMORTAL_REFCNT_LOCAL", "PY_VECTORCALL_ARGUMENTS_OFFSET", "_Py_IMMORTAL_REFCNT").cppTypes("long long").translate(false)) .put(new Info("Py_INFINITY").cppTypes("double").translate(false)) .put(new Info("Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED", "Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED", - "Py_MOD_PER_INTERPRETER_GIL_SUPPORTED").cppTypes("void*").translate(false)) + "Py_MOD_PER_INTERPRETER_GIL_SUPPORTED", + "Py_MOD_GIL_USED", "Py_MOD_GIL_NOT_USED").cppTypes("void*").translate(false)) .put(new Info("PyHash_FuncDef").purify()) @@ -355,7 +369,7 @@ public void map(InfoMap infoMap) { .put(new Info("_is").cast().pointerTypes("PyInterpreterState")) .put(new Info("_ts").cast().pointerTypes("PyThreadState")) - .put(new Info("PyThreadFrameGetter", "jmp_buf", "_PyInterpreterFrame", "_stack_chunk").cast().pointerTypes("Pointer")) + .put(new Info("PyThreadFrameGetter", "jmp_buf", "_PyInterpreterFrame", "_stack_chunk", "_PyExecutorObject").cast().pointerTypes("Pointer")) .put(new Info("_Py_memory_order", "PyThreadState::_preserve_36_ABI_1", "PyThreadState::_preserve_36_ABI_2", "_PyGC_generation0", "_PyBytes_InsertThousandsGroupingLocale", diff --git a/cpython/src/main/java/org/bytedeco/cpython/python.java b/cpython/src/main/java/org/bytedeco/cpython/python.java index c54ed582c1d..2934404c899 100644 --- a/cpython/src/main/java/org/bytedeco/cpython/python.java +++ b/cpython/src/main/java/org/bytedeco/cpython/python.java @@ -41,11 +41,11 @@ inherit = org.bytedeco.cpython.presets.python.class, value = { @Platform( - executable = "python3.12" + executable = "python3.13" ), @Platform( value = "macosx", - executable = "python3.12" + executable = "python3.13" ), @Platform( value = "windows", diff --git a/ffmpeg/README.md b/ffmpeg/README.md index 34e23a7f4e8..fe70bf736a8 100644 --- a/ffmpeg/README.md +++ b/ffmpeg/README.md @@ -9,7 +9,7 @@ Introduction ------------ This directory contains the JavaCPP Presets module for: - * FFmpeg 7.0.2 http://ffmpeg.org/ + * FFmpeg 7.1 http://ffmpeg.org/ Please refer to the parent README.md file for more detailed information about the JavaCPP Presets. @@ -46,14 +46,14 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic org.bytedeco ffmpeg-platform - 7.0.2-1.5.11-SNAPSHOT + 7.1-1.5.11-SNAPSHOT org.bytedeco ffmpeg-platform-gpl - 7.0.2-1.5.11-SNAPSHOT + 7.1-1.5.11-SNAPSHOT diff --git a/ffmpeg/cppbuild.sh b/ffmpeg/cppbuild.sh index e887616b619..5f0d725824f 100755 --- a/ffmpeg/cppbuild.sh +++ b/ffmpeg/cppbuild.sh @@ -33,22 +33,22 @@ SPEEX=speex-1.2.1 OPUS=opus-1.3.1 OPENCORE_AMR=opencore-amr-0.1.6 VO_AMRWBENC=vo-amrwbenc-0.1.3 -OPENSSL=openssl-3.3.1 +OPENSSL=openssl-3.3.2 OPENH264_VERSION=2.4.1 X264=x264-stable X265=3.4 VPX_VERSION=1.14.1 ALSA_VERSION=1.2.12 -FREETYPE_VERSION=2.13.2 +FREETYPE_VERSION=2.13.3 MFX_VERSION=1.35.1 NVCODEC_VERSION=12.2.72.0 XML2=libxml2-2.9.12 LIBSRT_VERSION=1.5.3 WEBP_VERSION=1.4.0 AOMAV1_VERSION=3.9.1 -SVTAV1_VERSION=2.1.2 +SVTAV1_VERSION=2.2.1 ZIMG_VERSION=3.0.5 -FFMPEG_VERSION=7.0.2 +FFMPEG_VERSION=7.1 download https://download.videolan.org/contrib/nasm/nasm-$NASM_VERSION.tar.gz nasm-$NASM_VERSION.tar.gz download http://zlib.net/$ZLIB.tar.gz $ZLIB.tar.gz download http://downloads.sourceforge.net/project/lame/lame/3.100/$LAME.tar.gz $LAME.tar.gz diff --git a/ffmpeg/ffmpeg.patch b/ffmpeg/ffmpeg.patch index cca626dac93..cd2831bf37b 100644 --- a/ffmpeg/ffmpeg.patch +++ b/ffmpeg/ffmpeg.patch @@ -1,16 +1,16 @@ -diff -ruN ffmpeg-7.0/configure ffmpeg-7.0-patch/configure ---- ffmpeg-7.0/configure 2024-04-05 08:22:59.000000000 +0900 -+++ ffmpeg-7.0-patch/configure 2024-04-20 00:59:06.473315424 +0900 -@@ -6823,7 +6823,7 @@ +diff -ruN ffmpeg-7.1/configure ffmpeg-7.1-patch/configure +--- ffmpeg-7.1/configure 2024-09-30 08:31:47.000000000 +0900 ++++ ffmpeg-7.1-patch/configure 2024-10-13 20:41:25.648732122 +0900 +@@ -6865,7 +6865,7 @@ enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; } enabled ladspa && require_headers "ladspa.h dlfcn.h" enabled lcms2 && require_pkg_config lcms2 "lcms2 >= 2.13" lcms2.h cmsCreateContext --enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_codec.h aom_codec_version +-enabled libaom && require_pkg_config libaom "aom >= 2.0.0" aom/aom_codec.h aom_codec_version +enabled libaom && require libaom aom/aom_codec.h aom_codec_version -laom enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new || { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } || die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; } -@@ -6851,7 +6851,7 @@ +@@ -6893,7 +6893,7 @@ enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs enabled fontconfig && enable libfontconfig enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit @@ -19,7 +19,7 @@ diff -ruN ffmpeg-7.0/configure ffmpeg-7.0-patch/configure enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info enabled libharfbuzz && require_pkg_config libharfbuzz harfbuzz hb.h hb_buffer_create enabled libglslang && { check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \ -@@ -6881,15 +6881,7 @@ +@@ -6925,15 +6925,7 @@ # pkg-config support. Instead, users should make sure that the build # can find the libraries and headers through other means. elif enabled libmfx; then @@ -36,7 +36,7 @@ diff -ruN ffmpeg-7.0/configure ffmpeg-7.0-patch/configure warn "libmfx is deprecated. Please run configure with --enable-libvpl to use libvpl instead." elif enabled libvpl; then # Consider pkg-config only. The name of libmfx is still passed to check_pkg_config function for --enable-libvpl option -@@ -6917,21 +6909,14 @@ +@@ -6962,21 +6954,14 @@ { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader || require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } || require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; } @@ -60,7 +60,7 @@ diff -ruN ffmpeg-7.0/configure ffmpeg-7.0-patch/configure enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 4.192.0" libplacebo/vulkan.h pl_vulkan_create enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new enabled libqrencode && require_pkg_config libqrencode libqrencode qrencode.h QRcode_encodeString -@@ -6949,9 +6934,9 @@ +@@ -6994,9 +6979,9 @@ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/sftp.h sftp_init @@ -73,7 +73,7 @@ diff -ruN ffmpeg-7.0/configure ffmpeg-7.0-patch/configure enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg -@@ -6971,19 +6956,15 @@ +@@ -7016,19 +7001,15 @@ enabled libvpx && { enabled libvpx_vp8_decoder && { @@ -93,9 +93,9 @@ diff -ruN ffmpeg-7.0/configure ffmpeg-7.0-patch/configure check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs" } if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then -@@ -6992,27 +6973,27 @@ - } +@@ -7038,27 +7019,27 @@ + enabled libvvenc && require_pkg_config libvvenc "libvvenc >= 1.6.1" "vvenc/vvenc.h" vvenc_get_version enabled libwebp && { - enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion - enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; } @@ -103,7 +103,7 @@ diff -ruN ffmpeg-7.0/configure ffmpeg-7.0-patch/configure + enabled libwebp_encoder && require libwebp webp/encode.h WebPGetEncoderVersion -lwebp -lsharpyuv + enabled libwebp_anim_encoder && require libwebp_anim_encoder webp/mux.h WebPAnimEncoderOptionsInit -lwebpmux -lwebp -lsharpyuv; } +enabled libx264 && require libx264 "stdint.h x264.h" x264_encoder_encode -lx264 $pthreads_extralibs && - require_cpp_condition libx264 x264.h "X264_BUILD >= 122" && { + require_cpp_condition libx264 x264.h "X264_BUILD >= 155" && { [ "$toolchain" != "msvc" ] || require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } && check_cpp_condition libx264_hdr10 x264.h "X264_BUILD >= 163" && @@ -114,7 +114,7 @@ diff -ruN ffmpeg-7.0/configure ffmpeg-7.0-patch/configure enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs" enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get enabled libxevd && require_pkg_config libxevd "xevd >= 0.4.1" "xevd.h" xevd_decode - enabled libxeve && require_pkg_config libxeve "xeve >= 0.4.3" "xeve.h" xeve_encode + enabled libxeve && require_pkg_config libxeve "xeve >= 0.5.1" "xeve.h" xeve_encode enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore -enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version +enabled libzimg && require libzimg zimg.h zimg_get_api_version -lzimg @@ -127,7 +127,7 @@ diff -ruN ffmpeg-7.0/configure ffmpeg-7.0-patch/configure enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init || check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init || check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto || -@@ -7051,15 +7032,13 @@ +@@ -7097,15 +7078,13 @@ die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } && enable omx enabled omx && require_headers OMX_Core.h diff --git a/ffmpeg/platform/gpl/pom.xml b/ffmpeg/platform/gpl/pom.xml index 50b72f789bb..78188a3b5e9 100644 --- a/ffmpeg/platform/gpl/pom.xml +++ b/ffmpeg/platform/gpl/pom.xml @@ -12,7 +12,7 @@ org.bytedeco ffmpeg-platform-gpl - 7.0.2-${project.parent.version} + 7.1-${project.parent.version} JavaCPP Presets Platform for FFmpeg (GPL enabled) diff --git a/ffmpeg/platform/pom.xml b/ffmpeg/platform/pom.xml index 50e1438d6d9..44441de2770 100644 --- a/ffmpeg/platform/pom.xml +++ b/ffmpeg/platform/pom.xml @@ -12,7 +12,7 @@ org.bytedeco ffmpeg-platform - 7.0.2-${project.parent.version} + 7.1-${project.parent.version} JavaCPP Presets Platform for FFmpeg diff --git a/ffmpeg/pom.xml b/ffmpeg/pom.xml index baff8459e75..af1e26b5980 100644 --- a/ffmpeg/pom.xml +++ b/ffmpeg/pom.xml @@ -11,7 +11,7 @@ org.bytedeco ffmpeg - 7.0.2-${project.parent.version} + 7.1-${project.parent.version} JavaCPP Presets for FFmpeg diff --git a/ffmpeg/samples/pom.xml b/ffmpeg/samples/pom.xml index 5fb5bf2c8fe..1eb7d454906 100644 --- a/ffmpeg/samples/pom.xml +++ b/ffmpeg/samples/pom.xml @@ -12,14 +12,14 @@ org.bytedeco ffmpeg-platform - 7.0.2-1.5.11-SNAPSHOT + 7.1-1.5.11-SNAPSHOT org.bytedeco ffmpeg-platform-gpl - 7.0.2-1.5.11-SNAPSHOT + 7.1-1.5.11-SNAPSHOT diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVCodec.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVCodec.java index 85d60aaffb1..36fcc944e7f 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVCodec.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVCodec.java @@ -57,14 +57,19 @@ public class AVCodec extends Pointer { public native int capabilities(); public native AVCodec capabilities(int setter); /** maximum value for lowres supported by the decoder */ public native @Cast("uint8_t") byte max_lowres(); public native AVCodec max_lowres(byte setter); - /** array of supported framerates, or NULL if any, array is terminated by {0,0} */ - public native @Const AVRational supported_framerates(); public native AVCodec supported_framerates(AVRational setter); - /** array of supported pixel formats, or NULL if unknown, array is terminated by -1 */ - public native @Cast("const AVPixelFormat*") IntPointer pix_fmts(); public native AVCodec pix_fmts(IntPointer setter); - /** array of supported audio samplerates, or NULL if unknown, array is terminated by 0 */ - public native @Const IntPointer supported_samplerates(); public native AVCodec supported_samplerates(IntPointer setter); - /** array of supported sample formats, or NULL if unknown, array is terminated by -1 */ - public native @Cast("const AVSampleFormat*") IntPointer sample_fmts(); public native AVCodec sample_fmts(IntPointer setter); + + /** + * Deprecated codec capabilities. + */ + /** @deprecated use avcodec_get_supported_config() */ + public native @Const @Deprecated AVRational supported_framerates(); public native AVCodec supported_framerates(AVRational setter); + /** @deprecated use avcodec_get_supported_config() */ + public native @Cast("const AVPixelFormat*") @Deprecated IntPointer pix_fmts(); public native AVCodec pix_fmts(IntPointer setter); + /** @deprecated use avcodec_get_supported_config() */ + public native @Const @Deprecated IntPointer supported_samplerates(); public native AVCodec supported_samplerates(IntPointer setter); + /** @deprecated use avcodec_get_supported_config() */ + public native @Cast("const AVSampleFormat*") @Deprecated IntPointer sample_fmts(); public native AVCodec sample_fmts(IntPointer setter); + /** AVClass for the private context */ public native @Const AVClass priv_class(); public native AVCodec priv_class(AVClass setter); /** array of recognized profiles, or NULL if unknown, array is terminated by {AV_PROFILE_UNKNOWN} */ @@ -84,6 +89,7 @@ public class AVCodec extends Pointer { /** * Array of supported channel layouts, terminated with a zeroed layout. + * @deprecated use avcodec_get_supported_config() */ - public native @Const AVChannelLayout ch_layouts(); public native AVCodec ch_layouts(AVChannelLayout setter); + public native @Const @Deprecated AVChannelLayout ch_layouts(); public native AVCodec ch_layouts(AVChannelLayout setter); } diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVCodecContext.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVCodecContext.java index d0c6ea0a692..241aca5dfa0 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVCodecContext.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVCodecContext.java @@ -803,6 +803,10 @@ public static class Get_format_AVCodecContext_IntPointer extends FunctionPointer * this callback and filled with the extra buffers if there are more * buffers than buf[] can hold. extended_buf will be freed in * av_frame_unref(). + * Decoders will generally initialize the whole buffer before it is output + * but it can in rare error conditions happen that uninitialized data is passed + * through. \important The buffers returned by get_buffer* should thus not contain sensitive + * data. * * If AV_CODEC_CAP_DR1 is not set then get_buffer2() must call * avcodec_default_get_buffer2() instead of providing buffers allocated by @@ -1179,6 +1183,7 @@ public static class Get_buffer2_AVCodecContext_AVFrame_int extends FunctionPoint public static final int FF_DCT_MMX = 3; public static final int FF_DCT_ALTIVEC = 5; public static final int FF_DCT_FAAN = 6; +public static final int FF_DCT_NEON = 7; /** * IDCT algorithm, see FF_IDCT_* below. @@ -1758,7 +1763,7 @@ public static class Get_encode_buffer_AVCodecContext_AVPacket_int extends Functi * - encoding: may be set by user before calling avcodec_open2() for * encoder configuration. Afterwards owned and freed by the * encoder. - * - decoding: unused + * - decoding: may be set by libavcodec in avcodec_open2(). */ public native AVFrameSideData decoded_side_data(int i); public native AVCodecContext decoded_side_data(int i, AVFrameSideData setter); public native @Cast("AVFrameSideData**") PointerPointer decoded_side_data(); public native AVCodecContext decoded_side_data(PointerPointer setter); diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVPacketSideData.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVPacketSideData.java index 4da46b9cac1..335d2d4308d 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVPacketSideData.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avcodec/AVPacketSideData.java @@ -14,6 +14,7 @@ import static org.bytedeco.ffmpeg.global.avcodec.*; //DEPRECATED +// #endif /** * This structure stores auxiliary information for decoding, presenting, or diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avfilter/AVFilter.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avfilter/AVFilter.java index b681b8bb6b0..c1dc2bfe7ca 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avfilter/AVFilter.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avfilter/AVFilter.java @@ -236,6 +236,29 @@ public static class Query_func_AVFilterContext extends FunctionPointer { public native int call(AVFilterContext arg0); } @Name("formats.query_func") public native Query_func_AVFilterContext formats_query_func(); public native AVFilter formats_query_func(Query_func_AVFilterContext setter); + + /** + * Same as query_func(), except this function writes the results into + * provided arrays. + * + * @param cfg_in array of input format configurations with as many + * members as the filters has inputs (NULL when there are + * no inputs); + * @param cfg_out array of output format configurations with as many + * members as the filters has outputs (NULL when there + * are no outputs); + */ + public static class Query_func2_AVFilterContext_PointerPointer_PointerPointer extends FunctionPointer { + static { Loader.load(); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public Query_func2_AVFilterContext_PointerPointer_PointerPointer(Pointer p) { super(p); } + protected Query_func2_AVFilterContext_PointerPointer_PointerPointer() { allocate(); } + private native void allocate(); + public native int call(@Const AVFilterContext arg0, + @Cast("AVFilterFormatsConfig**") PointerPointer cfg_in, + @Cast("AVFilterFormatsConfig**") PointerPointer cfg_out); + } + @Name("formats.query_func2") public native Query_func2_AVFilterContext_PointerPointer_PointerPointer formats_query_func2(); public native AVFilter formats_query_func2(Query_func2_AVFilterContext_PointerPointer_PointerPointer setter); /** * A pointer to an array of admissible pixel formats delimited * by AV_PIX_FMT_NONE. The generic code will use this list diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avfilter/AVFilterLink.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avfilter/AVFilterLink.java index df6f2b86b10..526272d22ce 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avfilter/AVFilterLink.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avfilter/AVFilterLink.java @@ -120,74 +120,4 @@ public class AVFilterLink extends Pointer { * Lists of supported formats / etc. supported by the output filter. */ public native @ByRef AVFilterFormatsConfig outcfg(); public native AVFilterLink outcfg(AVFilterFormatsConfig setter); - - /** - * Graph the filter belongs to. - */ - public native AVFilterGraph graph(); public native AVFilterLink graph(AVFilterGraph setter); - - /** - * Current timestamp of the link, as defined by the most recent - * frame(s), in link time_base units. - */ - public native @Cast("int64_t") long current_pts(); public native AVFilterLink current_pts(long setter); - - /** - * Current timestamp of the link, as defined by the most recent - * frame(s), in AV_TIME_BASE units. - */ - public native @Cast("int64_t") long current_pts_us(); public native AVFilterLink current_pts_us(long setter); - - /** - * Frame rate of the stream on the link, or 1/0 if unknown or variable; - * if left to 0/0, will be automatically copied from the first input - * of the source filter if it exists. - * - * Sources should set it to the best estimation of the real frame rate. - * If the source frame rate is unknown or variable, set this to 1/0. - * Filters should update it if necessary depending on their function. - * Sinks can use it to set a default output frame rate. - * It is similar to the r_frame_rate field in AVStream. - */ - public native @ByRef AVRational frame_rate(); public native AVFilterLink frame_rate(AVRational setter); - - /** - * Minimum number of samples to filter at once. If filter_frame() is - * called with fewer samples, it will accumulate them in fifo. - * This field and the related ones must not be changed after filtering - * has started. - * If 0, all related fields are ignored. - */ - public native int min_samples(); public native AVFilterLink min_samples(int setter); - - /** - * Maximum number of samples to filter at once. If filter_frame() is - * called with more samples, it will split them. - */ - public native int max_samples(); public native AVFilterLink max_samples(int setter); - - /** - * Number of past frames sent through the link. - */ - public native @Cast("int64_t") long frame_count_in(); public native AVFilterLink frame_count_in(long setter); - public native @Cast("int64_t") long frame_count_out(); public native AVFilterLink frame_count_out(long setter); - - /** - * Number of past samples sent through the link. - */ - public native @Cast("int64_t") long sample_count_in(); public native AVFilterLink sample_count_in(long setter); - public native @Cast("int64_t") long sample_count_out(); public native AVFilterLink sample_count_out(long setter); - - /** - * True if a frame is currently wanted on the output of this filter. - * Set when ff_request_frame() is called by the output, - * cleared when a frame is filtered. - */ - public native int frame_wanted_out(); public native AVFilterLink frame_wanted_out(int setter); - - /** - * For hwaccel pixel formats, this should be a reference to the - * AVHWFramesContext describing the frames. - */ - public native AVBufferRef hw_frames_ctx(); public native AVFilterLink hw_frames_ctx(AVBufferRef setter); } diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVFormatContext.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVFormatContext.java index 9bf8232a643..e05be3e40bb 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVFormatContext.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVFormatContext.java @@ -483,6 +483,8 @@ public class AVFormatContext extends Pointer { * Skip duration calcuation in estimate_timings_from_pts. * - encoding: unused * - decoding: set by user + * + * @see duration_probesize */ public native int skip_estimate_duration_from_pts(); public native AVFormatContext skip_estimate_duration_from_pts(int setter); @@ -702,4 +704,14 @@ public static class Io_close2_AVFormatContext_AVIOContext extends FunctionPointe public native int call(AVFormatContext s, AVIOContext pb); } public native Io_close2_AVFormatContext_AVIOContext io_close2(); public native AVFormatContext io_close2(Io_close2_AVFormatContext_AVIOContext setter); + + /** + * Maximum number of bytes read from input in order to determine stream durations + * when using estimate_timings_from_pts in avformat_find_stream_info(). + * Demuxing only, set by the caller before avformat_find_stream_info(). + * Can be set to 0 to let avformat choose using a heuristic. + * + * @see skip_estimate_duration_from_pts + */ + public native @Cast("int64_t") long duration_probesize(); public native AVFormatContext duration_probesize(long setter); } diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVStreamGroup.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVStreamGroup.java index 4fd019822f9..09191abfd8a 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVStreamGroup.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVStreamGroup.java @@ -69,6 +69,7 @@ public class AVStreamGroup extends Pointer { @Name("params.iamf_audio_element") public native AVIAMFAudioElement params_iamf_audio_element(); public native AVStreamGroup params_iamf_audio_element(AVIAMFAudioElement setter); @Name("params.iamf_mix_presentation") public native AVIAMFMixPresentation params_iamf_mix_presentation(); public native AVStreamGroup params_iamf_mix_presentation(AVIAMFMixPresentation setter); @Name("params.tile_grid") public native AVStreamGroupTileGrid params_tile_grid(); public native AVStreamGroup params_tile_grid(AVStreamGroupTileGrid setter); + @Name("params.lcevc") public native AVStreamGroupLCEVC params_lcevc(); public native AVStreamGroup params_lcevc(AVStreamGroupLCEVC setter); /** * Metadata that applies to the whole group. diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVStreamGroupLCEVC.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVStreamGroupLCEVC.java new file mode 100644 index 00000000000..e0226a61afb --- /dev/null +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avformat/AVStreamGroupLCEVC.java @@ -0,0 +1,60 @@ +// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.ffmpeg.avformat; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; +import org.bytedeco.ffmpeg.avutil.*; +import static org.bytedeco.ffmpeg.global.avutil.*; +import org.bytedeco.ffmpeg.swresample.*; +import static org.bytedeco.ffmpeg.global.swresample.*; +import org.bytedeco.ffmpeg.avcodec.*; +import static org.bytedeco.ffmpeg.global.avcodec.*; + +import static org.bytedeco.ffmpeg.global.avformat.*; + + +/** + * AVStreamGroupLCEVC is meant to define the relation between video streams + * and a data stream containing LCEVC enhancement layer NALUs. + * + * No more than one stream of \ref AVCodecParameters.codec_type "codec_type" + * AVMEDIA_TYPE_DATA shall be present, and it must be of + * \ref AVCodecParameters.codec_id "codec_id" AV_CODEC_ID_LCEVC. + */ +@Properties(inherit = org.bytedeco.ffmpeg.presets.avformat.class) +public class AVStreamGroupLCEVC extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public AVStreamGroupLCEVC() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public AVStreamGroupLCEVC(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public AVStreamGroupLCEVC(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public AVStreamGroupLCEVC position(long position) { + return (AVStreamGroupLCEVC)super.position(position); + } + @Override public AVStreamGroupLCEVC getPointer(long i) { + return new AVStreamGroupLCEVC((Pointer)this).offsetAddress(i); + } + + public native @Const AVClass av_class(); public native AVStreamGroupLCEVC av_class(AVClass setter); + + /** + * Index of the LCEVC data stream in AVStreamGroup. + */ + public native @Cast("unsigned int") int lcevc_index(); public native AVStreamGroupLCEVC lcevc_index(int setter); + /** + * Width of the final stream for presentation. + */ + public native int width(); public native AVStreamGroupLCEVC width(int setter); + /** + * Height of the final image for presentation. + */ + public native int height(); public native AVStreamGroupLCEVC height(int setter); +} diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVFrame.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVFrame.java index 9f6662b5afb..57b34a7bbdc 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVFrame.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVFrame.java @@ -38,8 +38,7 @@ * to the end with a minor bump. * * Fields can be accessed through AVOptions, the name string used, matches the - * C structure field name for fields accessible through AVOptions. The AVClass - * for AVFrame can be obtained from avcodec_get_frame_class() + * C structure field name for fields accessible through AVOptions. */ @Properties(inherit = org.bytedeco.ffmpeg.presets.avutil.class) public class AVFrame extends Pointer { diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVSideDataDescriptor.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVSideDataDescriptor.java new file mode 100644 index 00000000000..22e1e5268c9 --- /dev/null +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVSideDataDescriptor.java @@ -0,0 +1,45 @@ +// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE + +package org.bytedeco.ffmpeg.avutil; + +import java.nio.*; +import org.bytedeco.javacpp.*; +import org.bytedeco.javacpp.annotation.*; + +import static org.bytedeco.javacpp.presets.javacpp.*; + +import static org.bytedeco.ffmpeg.global.avutil.*; + + +/** + * This struct describes the properties of a side data type. Its instance + * corresponding to a given type can be obtained from av_frame_side_data_desc(). + */ +@Properties(inherit = org.bytedeco.ffmpeg.presets.avutil.class) +public class AVSideDataDescriptor extends Pointer { + static { Loader.load(); } + /** Default native constructor. */ + public AVSideDataDescriptor() { super((Pointer)null); allocate(); } + /** Native array allocator. Access with {@link Pointer#position(long)}. */ + public AVSideDataDescriptor(long size) { super((Pointer)null); allocateArray(size); } + /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */ + public AVSideDataDescriptor(Pointer p) { super(p); } + private native void allocate(); + private native void allocateArray(long size); + @Override public AVSideDataDescriptor position(long position) { + return (AVSideDataDescriptor)super.position(position); + } + @Override public AVSideDataDescriptor getPointer(long i) { + return new AVSideDataDescriptor((Pointer)this).offsetAddress(i); + } + + /** + * Human-readable side data description. + */ + public native @Cast("const char*") BytePointer name(); public native AVSideDataDescriptor name(BytePointer setter); + + /** + * Side data property flags, a combination of AVSideDataProps values. + */ + public native @Cast("unsigned") int props(); public native AVSideDataDescriptor props(int setter); +} diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVStereo3D.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVStereo3D.java index 93a72d30b86..190b25fe0c6 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVStereo3D.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/avutil/AVStereo3D.java @@ -50,4 +50,26 @@ public class AVStereo3D extends Pointer { * Determines which views are packed. */ public native @Cast("AVStereo3DView") int view(); public native AVStereo3D view(int setter); + + /** + * Which eye is the primary eye when rendering in 2D. + */ + public native @Cast("AVStereo3DPrimaryEye") int primary_eye(); public native AVStereo3D primary_eye(int setter); + + /** + * The distance between the centres of the lenses of the camera system, + * in micrometers. Zero if unset. + */ + public native @Cast("uint32_t") int baseline(); public native AVStereo3D baseline(int setter); + + /** + * Relative shift of the left and right images, which changes the zero parallax plane. + * Range is -1.0 to 1.0. Zero if unset. + */ + public native @ByRef AVRational horizontal_disparity_adjustment(); public native AVStereo3D horizontal_disparity_adjustment(AVRational setter); + + /** + * Horizontal field of view, in degrees. Zero if unset. + */ + public native @ByRef AVRational horizontal_field_of_view(); public native AVStereo3D horizontal_field_of_view(AVRational setter); } diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avcodec.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avcodec.java index dc1a55a6d23..5cb1ee3707b 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avcodec.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avcodec.java @@ -572,6 +572,7 @@ public class avcodec extends org.bytedeco.ffmpeg.presets.avcodec { AV_CODEC_ID_AC4 = 0x15000 + 103, AV_CODEC_ID_OSQ = 0x15000 + 104, AV_CODEC_ID_QOA = 0x15000 + 105, + AV_CODEC_ID_LC3 = 0x15000 + 106, /* subtitle codecs */ /** A dummy ID pointing at the start of subtitle codecs. */ @@ -621,6 +622,7 @@ public class avcodec extends org.bytedeco.ffmpeg.presets.avcodec { AV_CODEC_ID_TIMED_ID3 = 0x18000 + 9, AV_CODEC_ID_BIN_DATA = 0x18000 + 10, AV_CODEC_ID_SMPTE_2038 = 0x18000 + 11, + AV_CODEC_ID_LCEVC = 0x18000 + 12, /** codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it */ @@ -894,6 +896,7 @@ public class avcodec extends org.bytedeco.ffmpeg.presets.avcodec { public static final int AV_PROFILE_AAC_HE_V2 = 28; public static final int AV_PROFILE_AAC_LD = 22; public static final int AV_PROFILE_AAC_ELD = 38; +public static final int AV_PROFILE_AAC_USAC = 41; public static final int AV_PROFILE_MPEG2_AAC_LOW = 128; public static final int AV_PROFILE_MPEG2_AAC_HE = 131; @@ -980,6 +983,7 @@ public class avcodec extends org.bytedeco.ffmpeg.presets.avcodec { public static final int AV_PROFILE_HEVC_MAIN_10 = 2; public static final int AV_PROFILE_HEVC_MAIN_STILL_PICTURE = 3; public static final int AV_PROFILE_HEVC_REXT = 4; +public static final int AV_PROFILE_HEVC_MULTIVIEW_MAIN = 6; public static final int AV_PROFILE_HEVC_SCC = 9; public static final int AV_PROFILE_VVC_MAIN_10 = 1; @@ -1237,10 +1241,6 @@ public class avcodec extends org.bytedeco.ffmpeg.presets.avcodec { * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows: *

{@code
      * u32le param_flags
-     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
-     *     s32le channel_count
-     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
-     *     u64le channel_layout
      * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
      *     s32le sample_rate
      * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
@@ -1508,6 +1508,25 @@ public class avcodec extends org.bytedeco.ffmpeg.presets.avcodec {
     */
     AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT = 35,
 
+    /**
+     * The number of pixels to discard from the top/bottom/left/right border of the
+     * decoded frame to obtain the sub-rectangle intended for presentation.
+     *
+     * 
{@code
+     * u32le crop_top
+     * u32le crop_bottom
+     * u32le crop_left
+     * u32le crop_right
+     * }
+ */ + AV_PKT_DATA_FRAME_CROPPING = 36, + + /** + * Raw LCEVC payload data, as a uint8_t array, with NAL emulation + * bytes intact. + */ + AV_PKT_DATA_LCEVC = 37, + /** * The number of side data types. * This is not part of the public API/ABI in the sense that it may @@ -1516,8 +1535,9 @@ public class avcodec extends org.bytedeco.ffmpeg.presets.avcodec { * If its value becomes huge, some code using it * needs to be updated as it assumes it to be smaller than other limits. */ - AV_PKT_DATA_NB = 36; + AV_PKT_DATA_NB = 38; +// #if FF_API_QUALITY_FACTOR public static final int AV_PKT_DATA_QUALITY_FACTOR = AV_PKT_DATA_QUALITY_STATS; // Targeting ../avcodec/AVPacketSideData.java @@ -2912,6 +2932,12 @@ public class avcodec extends org.bytedeco.ffmpeg.presets.avcodec { */ public static final int AV_CODEC_EXPORT_DATA_FILM_GRAIN = (1 << 3); +/** + * Decoding only. + * Do not apply picture enhancement layers, export them instead. + */ +public static final int AV_CODEC_EXPORT_DATA_ENHANCEMENTS = (1 << 4); + /** * The decoder will keep a reference to the frame and may reuse it later. */ @@ -3483,6 +3509,55 @@ public class avcodec extends org.bytedeco.ffmpeg.presets.avcodec { @Cast("AVPixelFormat") int hw_pix_fmt, @ByPtrPtr AVBufferRef out_frames_ref); +/** enum AVCodecConfig */ +public static final int + /** AVPixelFormat, terminated by AV_PIX_FMT_NONE */ + AV_CODEC_CONFIG_PIX_FORMAT = 0, + /** AVRational, terminated by {0, 0} */ + AV_CODEC_CONFIG_FRAME_RATE = 1, + /** int, terminated by 0 */ + AV_CODEC_CONFIG_SAMPLE_RATE = 2, + /** AVSampleFormat, terminated by AV_SAMPLE_FMT_NONE */ + AV_CODEC_CONFIG_SAMPLE_FORMAT = 3, + /** AVChannelLayout, terminated by {0} */ + AV_CODEC_CONFIG_CHANNEL_LAYOUT = 4, + /** AVColorRange, terminated by AVCOL_RANGE_UNSPECIFIED */ + AV_CODEC_CONFIG_COLOR_RANGE = 5, + /** AVColorSpace, terminated by AVCOL_SPC_UNSPECIFIED */ + AV_CODEC_CONFIG_COLOR_SPACE = 6; + +/** + * Retrieve a list of all supported values for a given configuration type. + * + * @param avctx An optional context to use. Values such as + * {@code strict_std_compliance} may affect the result. If NULL, + * default values are used. + * @param codec The codec to query, or NULL to use avctx->codec. + * @param config The configuration to query. + * @param flags Currently unused; should be set to zero. + * @param out_configs On success, set to a list of configurations, terminated + * by a config-specific terminator, or NULL if all + * possible values are supported. + * @param out_num_configs On success, set to the number of elements in + *out_configs, excluding the terminator. Optional. + */ +@NoException public static native int avcodec_get_supported_config(@Const AVCodecContext avctx, + @Const AVCodec codec, @Cast("AVCodecConfig") int config, + @Cast("unsigned") int flags, @Cast("const void**") PointerPointer out_configs, + IntPointer out_num_configs); +@NoException public static native int avcodec_get_supported_config(@Const AVCodecContext avctx, + @Const AVCodec codec, @Cast("AVCodecConfig") int config, + @Cast("unsigned") int flags, @Cast("const void**") @ByPtrPtr Pointer out_configs, + IntPointer out_num_configs); +@NoException public static native int avcodec_get_supported_config(@Const AVCodecContext avctx, + @Const AVCodec codec, @Cast("AVCodecConfig") int config, + @Cast("unsigned") int flags, @Cast("const void**") @ByPtrPtr Pointer out_configs, + IntBuffer out_num_configs); +@NoException public static native int avcodec_get_supported_config(@Const AVCodecContext avctx, + @Const AVCodec codec, @Cast("AVCodecConfig") int config, + @Cast("unsigned") int flags, @Cast("const void**") @ByPtrPtr Pointer out_configs, + int[] out_num_configs); + /** @@ -4031,6 +4106,7 @@ public class avcodec extends org.bytedeco.ffmpeg.presets.avcodec { public static final boolean FF_API_AVCODEC_CLOSE = (LIBAVCODEC_VERSION_MAJOR < 62); public static final boolean FF_API_BUFFER_MIN_SIZE = (LIBAVCODEC_VERSION_MAJOR < 62); public static final boolean FF_API_VDPAU_ALLOC_GET_SET = (LIBAVCODEC_VERSION_MAJOR < 62); +public static final boolean FF_API_QUALITY_FACTOR = (LIBAVCODEC_VERSION_MAJOR < 62); // #endif /* AVCODEC_VERSION_MAJOR_H */ @@ -4068,7 +4144,7 @@ public class avcodec extends org.bytedeco.ffmpeg.presets.avcodec { // #include "version_major.h" -public static final int LIBAVCODEC_VERSION_MINOR = 3; +public static final int LIBAVCODEC_VERSION_MINOR = 19; public static final int LIBAVCODEC_VERSION_MICRO = 100; public static native @MemberGetter int LIBAVCODEC_VERSION_INT(); diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avdevice.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avdevice.java index 44e993a22ec..42a4b2777de 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avdevice.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avdevice.java @@ -547,7 +547,7 @@ public class avdevice extends org.bytedeco.ffmpeg.presets.avdevice { // #include "version_major.h" -public static final int LIBAVDEVICE_VERSION_MINOR = 1; +public static final int LIBAVDEVICE_VERSION_MINOR = 3; public static final int LIBAVDEVICE_VERSION_MICRO = 100; public static native @MemberGetter int LIBAVDEVICE_VERSION_INT(); diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avfilter.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avfilter.java index d4627093c45..14c8dc3e38f 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avfilter.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avfilter.java @@ -126,6 +126,9 @@ public class avfilter extends org.bytedeco.ffmpeg.presets.avfilter { * @return type of the pad_idx'th pad in pads */ @NoException public static native @Cast("AVMediaType") int avfilter_pad_get_type(@Const AVFilterPad pads, int pad_idx); +// Targeting ../avfilter/AVFilterFormatsConfig.java + + /** * The number of the filter inputs is not determined just by AVFilter.inputs. @@ -203,9 +206,6 @@ public class avfilter extends org.bytedeco.ffmpeg.presets.avfilter { // Targeting ../avfilter/AVFilterContext.java -// Targeting ../avfilter/AVFilterFormatsConfig.java - - // Targeting ../avfilter/AVFilterLink.java @@ -1241,7 +1241,7 @@ public class avfilter extends org.bytedeco.ffmpeg.presets.avfilter { // #include "version_major.h" -public static final int LIBAVFILTER_VERSION_MINOR = 1; +public static final int LIBAVFILTER_VERSION_MINOR = 4; public static final int LIBAVFILTER_VERSION_MICRO = 100; diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avformat.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avformat.java index 50021610993..800ef79c157 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avformat.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avformat.java @@ -1362,6 +1362,11 @@ public class avformat extends org.bytedeco.ffmpeg.presets.avformat { * The video stream contains still images. */ public static final int AV_DISPOSITION_STILL_IMAGE = (1 << 20); +/** + * The video stream contains multiple layers, e.g. stereoscopic views (cf. H.264 + * Annex G/H, or HEVC Annex F). + */ +public static final int AV_DISPOSITION_MULTILAYER = (1 << 21); /** * @return The AV_DISPOSITION_* flag corresponding to disp or a negative error @@ -1393,13 +1398,17 @@ public class avformat extends org.bytedeco.ffmpeg.presets.avformat { // Targeting ../avformat/AVStreamGroupTileGrid.java +// Targeting ../avformat/AVStreamGroupLCEVC.java + + /** enum AVStreamGroupParamsType */ public static final int AV_STREAM_GROUP_PARAMS_NONE = 0, AV_STREAM_GROUP_PARAMS_IAMF_AUDIO_ELEMENT = 1, AV_STREAM_GROUP_PARAMS_IAMF_MIX_PRESENTATION = 2, - AV_STREAM_GROUP_PARAMS_TILE_GRID = 3; + AV_STREAM_GROUP_PARAMS_TILE_GRID = 3, + AV_STREAM_GROUP_PARAMS_LCEVC = 4; // Targeting ../avformat/AVIAMFAudioElement.java @@ -2742,6 +2751,7 @@ network protocols (e.g. HLS), this can @NoException public static native int avformat_queue_attached_pictures(AVFormatContext s); +// #if FF_API_INTERNAL_TIMING /** enum AVTimebaseSource */ public static final int AVFMT_TBCF_AUTO = -1, @@ -2752,25 +2762,18 @@ network protocols (e.g. HLS), this can // #endif /** - * Transfer internal timing information from one stream to another. - * - * This function is useful when doing stream copy. - * - * @param ofmt target output format for ost - * @param ost output stream which needs timings copy and adjustments - * @param ist reference input stream to copy timings from - * @param copy_tb define from where the stream codec timebase needs to be imported + * @deprecated do not call this function */ -@NoException public static native int avformat_transfer_internal_stream_timing_info(@Const AVOutputFormat ofmt, +@NoException public static native @Deprecated int avformat_transfer_internal_stream_timing_info(@Const AVOutputFormat ofmt, AVStream ost, @Const AVStream ist, @Cast("AVTimebaseSource") int copy_tb); /** - * Get the internal codec timebase from a stream. - * - * @param st input stream to extract the timebase from + * @deprecated do not call this function */ -@NoException public static native @ByVal AVRational av_stream_get_codec_timebase(@Const AVStream st); +@NoException public static native @Deprecated @ByVal AVRational av_stream_get_codec_timebase(@Const AVStream st); +// #endif + /** * \} @@ -2830,6 +2833,7 @@ network protocols (e.g. HLS), this can public static final boolean FF_API_AVSTREAM_SIDE_DATA = (LIBAVFORMAT_VERSION_MAJOR < 62); public static final boolean FF_API_GET_DUR_ESTIMATE_METHOD = (LIBAVFORMAT_VERSION_MAJOR < 62); +public static final boolean FF_API_INTERNAL_TIMING = (LIBAVFORMAT_VERSION_MAJOR < 62); public static final int FF_API_R_FRAME_RATE = 1; @@ -2871,7 +2875,7 @@ network protocols (e.g. HLS), this can // #include "version_major.h" -public static final int LIBAVFORMAT_VERSION_MINOR = 1; +public static final int LIBAVFORMAT_VERSION_MINOR = 7; public static final int LIBAVFORMAT_VERSION_MICRO = 100; public static native @MemberGetter int LIBAVFORMAT_VERSION_INT(); diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avutil.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avutil.java index 55f5f91f272..2bdb1f7fce1 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avutil.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/avutil.java @@ -518,6 +518,8 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { public static final int AVERROR_HTTP_FORBIDDEN = AVERROR_HTTP_FORBIDDEN(); public static native @MemberGetter int AVERROR_HTTP_NOT_FOUND(); public static final int AVERROR_HTTP_NOT_FOUND = AVERROR_HTTP_NOT_FOUND(); +public static native @MemberGetter int AVERROR_HTTP_TOO_MANY_REQUESTS(); +public static final int AVERROR_HTTP_TOO_MANY_REQUESTS = AVERROR_HTTP_TOO_MANY_REQUESTS(); public static native @MemberGetter int AVERROR_HTTP_OTHER_4XX(); public static final int AVERROR_HTTP_OTHER_4XX = AVERROR_HTTP_OTHER_4XX(); public static native @MemberGetter int AVERROR_HTTP_SERVER_ERROR(); @@ -3288,8 +3290,14 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { AVCOL_SPC_CHROMA_DERIVED_CL = 13, /** ITU-R BT.2100-0, ICtCp */ AVCOL_SPC_ICTCP = 14, + /** SMPTE ST 2128, IPT-C2 */ + AVCOL_SPC_IPT_C2 = 15, + /** YCgCo-R, even addition of bits */ + AVCOL_SPC_YCGCO_RE = 16, + /** YCgCo-R, odd addition of bits */ + AVCOL_SPC_YCGCO_RO = 17, /** Not part of ABI */ - AVCOL_SPC_NB = 15; + AVCOL_SPC_NB = 18; /** * Visual content value range. @@ -3615,7 +3623,22 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { * applications which know this information in advance to speed up * encoding. */ - AV_FRAME_DATA_VIDEO_HINT = 27; + AV_FRAME_DATA_VIDEO_HINT = 27, + + /** + * Raw LCEVC payload data, as a uint8_t array, with NAL emulation + * bytes intact. + */ + AV_FRAME_DATA_LCEVC = 28, + + /** + * This side data must be associated with a video frame. + * The presence of this side data indicates that the video stream is + * composed of multiple views (e.g. stereoscopic 3D content, + * cf. H.264 Annex H or H.265 Annex G). + * The data is an int storing the view ID. + */ + AV_FRAME_DATA_VIEW_ID = 29; /** enum AVActiveFormatDescription */ public static final int @@ -3629,6 +3652,24 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { // Targeting ../avutil/AVFrameSideData.java + +/** enum AVSideDataProps */ +public static final int + /** + * The side data type can be used in stream-global structures. + * Side data types without this property are only meaningful on per-frame + * basis. + */ + AV_SIDE_DATA_PROP_GLOBAL = (1 << 0), + + /** + * Multiple instances of this side data type can be meaningfully present in + * a single side data array. + */ + AV_SIDE_DATA_PROP_MULTI = (1 << 1); +// Targeting ../avutil/AVSideDataDescriptor.java + + // Targeting ../avutil/AVRegionOfInterest.java @@ -3879,6 +3920,12 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { */ @NoException public static native @Cast("const char*") BytePointer av_frame_side_data_name(@Cast("AVFrameSideDataType") int type); +/** + * @return side data descriptor corresponding to a given side data type, NULL + * when not available. + */ +@NoException public static native @Const AVSideDataDescriptor av_frame_side_data_desc(@Cast("AVFrameSideDataType") int type); + /** * Free all side data entries and their contents, then zeroes out the * values which the pointers are pointing to. @@ -3892,7 +3939,15 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { @NoException public static native void av_frame_side_data_free(@Cast("AVFrameSideData***") @ByPtrPtr PointerPointer sd, IntBuffer nb_sd); @NoException public static native void av_frame_side_data_free(@Cast("AVFrameSideData***") @ByPtrPtr PointerPointer sd, int[] nb_sd); +/** + * Remove existing entries before adding new ones. + */ public static final int AV_FRAME_SIDE_DATA_FLAG_UNIQUE = (1 << 0); +/** + * Don't add a new entry if another of the same type exists. + * Applies only for side data types without the AV_SIDE_DATA_PROP_MULTI prop. + */ +public static final int AV_FRAME_SIDE_DATA_FLAG_REPLACE = (1 << 1); /** * Add new side data entry to an array. @@ -3905,10 +3960,12 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { * @param size size of the side data * @param flags Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. * - * @return newly added side data on success, NULL on error. In case of - * AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of matching - * AVFrameSideDataType will be removed before the addition is - * attempted. + * @return newly added side data on success, NULL on error. + * \note In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of + * matching AVFrameSideDataType will be removed before the addition + * is attempted. + * \note In case of AV_FRAME_SIDE_DATA_FLAG_REPLACE being set, if an + * entry of the same type already exists, it will be replaced instead. */ @NoException public static native AVFrameSideData av_frame_side_data_new(@Cast("AVFrameSideData***") @ByPtrPtr PointerPointer sd, IntPointer nb_sd, @Cast("AVFrameSideDataType") int type, @@ -3920,6 +3977,41 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { @Cast("AVFrameSideDataType") int type, @Cast("size_t") long size, @Cast("unsigned int") int flags); +/** + * Add a new side data entry to an array from an existing AVBufferRef. + * + * @param sd pointer to array of side data to which to add another entry, + * or to NULL in order to start a new array. + * @param nb_sd pointer to an integer containing the number of entries in + * the array. + * @param type type of the added side data + * @param buf Pointer to AVBufferRef to add to the array. On success, + * the function takes ownership of the AVBufferRef and *buf is + * set to NULL, unless AV_FRAME_SIDE_DATA_FLAG_NEW_REF is set + * in which case the ownership will remain with the caller. + * @param flags Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. + * + * @return newly added side data on success, NULL on error. + * \note In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of + * matching AVFrameSideDataType will be removed before the addition + * is attempted. + * \note In case of AV_FRAME_SIDE_DATA_FLAG_REPLACE being set, if an + * entry of the same type already exists, it will be replaced instead. + * + */ +@NoException public static native AVFrameSideData av_frame_side_data_add(@Cast("AVFrameSideData***") @ByPtrPtr PointerPointer sd, IntPointer nb_sd, + @Cast("AVFrameSideDataType") int type, + @Cast("AVBufferRef**") PointerPointer buf, @Cast("unsigned int") int flags); +@NoException public static native AVFrameSideData av_frame_side_data_add(@Cast("AVFrameSideData***") @ByPtrPtr PointerPointer sd, IntPointer nb_sd, + @Cast("AVFrameSideDataType") int type, + @ByPtrPtr AVBufferRef buf, @Cast("unsigned int") int flags); +@NoException public static native AVFrameSideData av_frame_side_data_add(@Cast("AVFrameSideData***") @ByPtrPtr PointerPointer sd, IntBuffer nb_sd, + @Cast("AVFrameSideDataType") int type, + @ByPtrPtr AVBufferRef buf, @Cast("unsigned int") int flags); +@NoException public static native AVFrameSideData av_frame_side_data_add(@Cast("AVFrameSideData***") @ByPtrPtr PointerPointer sd, int[] nb_sd, + @Cast("AVFrameSideDataType") int type, + @ByPtrPtr AVBufferRef buf, @Cast("unsigned int") int flags); + /** * Add a new side data entry to an array based on existing side data, taking * a reference towards the contained AVBufferRef. @@ -3932,10 +4024,12 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { * for the buffer. * @param flags Some combination of AV_FRAME_SIDE_DATA_FLAG_* flags, or 0. * - * @return negative error code on failure, >=0 on success. In case of - * AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of matching - * AVFrameSideDataType will be removed before the addition is - * attempted. + * @return negative error code on failure, >=0 on success. + * \note In case of AV_FRAME_SIDE_DATA_FLAG_UNIQUE being set, entries of + * matching AVFrameSideDataType will be removed before the addition + * is attempted. + * \note In case of AV_FRAME_SIDE_DATA_FLAG_REPLACE being set, if an + * entry of the same type already exists, it will be replaced instead. */ @NoException public static native int av_frame_side_data_clone(@Cast("AVFrameSideData***") @ByPtrPtr PointerPointer sd, IntPointer nb_sd, @Const AVFrameSideData src, @Cast("unsigned int") int flags); @@ -3974,6 +4068,15 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { int nb_sd, @Cast("AVFrameSideDataType") int type); +/** + * Remove and free all side data instances of the given type from an array. + */ +@NoException public static native void av_frame_side_data_remove(@Cast("AVFrameSideData***") @ByPtrPtr PointerPointer sd, IntPointer nb_sd, + @Cast("AVFrameSideDataType") int type); +@NoException public static native void av_frame_side_data_remove(@Cast("AVFrameSideData***") @ByPtrPtr PointerPointer sd, IntBuffer nb_sd, + @Cast("AVFrameSideDataType") int type); +@NoException public static native void av_frame_side_data_remove(@Cast("AVFrameSideData***") @ByPtrPtr PointerPointer sd, int[] nb_sd, + @Cast("AVFrameSideDataType") int type); /** * \} */ @@ -4394,6 +4497,14 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { AV_CHAN_BOTTOM_FRONT_CENTER = 38, AV_CHAN_BOTTOM_FRONT_LEFT = 39, AV_CHAN_BOTTOM_FRONT_RIGHT = 40, + /** +90 degrees, Lss, SiL */ + AV_CHAN_SIDE_SURROUND_LEFT = 41, + /** -90 degrees, Rss, SiR */ + AV_CHAN_SIDE_SURROUND_RIGHT = 42, + /** +110 degrees, Lvs, TpLS */ + AV_CHAN_TOP_SURROUND_LEFT = 43, + /** -110 degrees, Rvs, TpRS */ + AV_CHAN_TOP_SURROUND_RIGHT = 44, /** Channel is empty can be safely skipped. */ AV_CHAN_UNUSED = 0x200, @@ -4509,6 +4620,10 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { public static final long AV_CH_BOTTOM_FRONT_CENTER = (1L << AV_CHAN_BOTTOM_FRONT_CENTER ); public static final long AV_CH_BOTTOM_FRONT_LEFT = (1L << AV_CHAN_BOTTOM_FRONT_LEFT ); public static final long AV_CH_BOTTOM_FRONT_RIGHT = (1L << AV_CHAN_BOTTOM_FRONT_RIGHT ); +public static final long AV_CH_SIDE_SURROUND_LEFT = (1L << AV_CHAN_SIDE_SURROUND_LEFT ); +public static final long AV_CH_SIDE_SURROUND_RIGHT = (1L << AV_CHAN_SIDE_SURROUND_RIGHT ); +public static final long AV_CH_TOP_SURROUND_LEFT = (1L << AV_CHAN_TOP_SURROUND_LEFT ); +public static final long AV_CH_TOP_SURROUND_RIGHT = (1L << AV_CHAN_TOP_SURROUND_RIGHT ); /** * \} @@ -4938,6 +5053,16 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { */ @NoException public static native int av_channel_layout_compare(@Const AVChannelLayout chl, @Const AVChannelLayout chl1); +/** + * Return the order if the layout is n-th order standard-order ambisonic. + * The presence of optional extra non-diegetic channels at the end is not taken + * into account. + * + * @param channel_layout input channel layout + * @return the order of the layout, a negative error code otherwise. + */ +@NoException public static native int av_channel_layout_ambisonic_order(@Const AVChannelLayout channel_layout); + /** * The conversion must be lossless. */ @@ -5018,6 +5143,7 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { // #define AVUTIL_CPU_H // #include +// #include "version.h" public static final int AV_CPU_FLAG_FORCE = 0x80000000; /* force usage of selected flags (OR) */ @@ -5111,10 +5237,12 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { // RISC-V extensions /** I (full GPR bank) */ public static final int AV_CPU_FLAG_RVI = (1 << 0); +// #if FF_API_RISCV_FD_ZBA /** F (single precision FP) */ public static final int AV_CPU_FLAG_RVF = (1 << 1); /** D (double precision FP) */ public static final int AV_CPU_FLAG_RVD = (1 << 2); +// #endif /** Vectors of 8/16/32-bit int's */ public static final int AV_CPU_FLAG_RVV_I32 = (1 << 3); /** Vectors of float's */ @@ -5125,8 +5253,16 @@ public class avutil extends org.bytedeco.ffmpeg.presets.avutil { public static final int AV_CPU_FLAG_RVV_F64 = (1 << 6); /** Basic bit-manipulations */ public static final int AV_CPU_FLAG_RVB_BASIC = (1 << 7); +// #if FF_API_RISCV_FD_ZBA /** Address bit-manipulations */ public static final int AV_CPU_FLAG_RVB_ADDR = (1 << 8); +// #endif +/** Vector basic bit-manipulations */ +public static final int AV_CPU_FLAG_RV_ZVBB = (1 << 9); +/** Fast misaligned accesses */ +public static final int AV_CPU_FLAG_RV_MISALIGNED = (1 <<10); +/** B (bit manipulations) */ +public static final int AV_CPU_FLAG_RVB = (1 <<11); /** * Return the flags which specify extensions supported by the CPU. @@ -5504,6 +5640,16 @@ allocated with av_malloc() or another memory allocation function. */ * question is allowed to access the field. This allows us to extend the * semantics of those fields without breaking API compatibility. * + * \section avoptions_scope Scope of AVOptions + * + * AVOptions is designed to support any set of multimedia configuration options + * that can be defined at compile-time. Although it is mainly used to expose + * FFmpeg options, you are welcome to adapt it to your own use case. + * + * No single approach can ever fully solve the problem of configuration, + * but please submit a patch if you believe you have found a problem + * that is best solved by extending AVOptions. + * * \section avoptions_implement Implementing AVOptions * This section describes how to add AVOptions capabilities to a struct. * @@ -5681,30 +5827,100 @@ allocated with av_malloc() or another memory allocation function. */ * before the file is actually opened. */ +/** + * An option type determines: + * - for native access, the underlying C type of the field that an AVOption + * refers to; + * - for foreign access, the semantics of accessing the option through this API, + * e.g. which av_opt_get_*() and av_opt_set_*() functions can be called, or + * what format will av_opt_get()/av_opt_set() expect/produce. + */ /** enum AVOptionType */ public static final int + /** + * Underlying C type is unsigned int. + */ AV_OPT_TYPE_FLAGS = 1, + /** + * Underlying C type is int. + */ AV_OPT_TYPE_INT = 2, + /** + * Underlying C type is int64_t. + */ AV_OPT_TYPE_INT64 = 3, + /** + * Underlying C type is double. + */ AV_OPT_TYPE_DOUBLE = 4, + /** + * Underlying C type is float. + */ AV_OPT_TYPE_FLOAT = 5, + /** + * Underlying C type is a uint8_t* that is either NULL or points to a C + * string allocated with the av_malloc() family of functions. + */ AV_OPT_TYPE_STRING = 6, + /** + * Underlying C type is AVRational. + */ AV_OPT_TYPE_RATIONAL = 7, - /** offset must point to a pointer immediately followed by an int for the length */ + /** + * Underlying C type is a uint8_t* that is either NULL or points to an array + * allocated with the av_malloc() family of functions. The pointer is + * immediately followed by an int containing the array length in bytes. + */ AV_OPT_TYPE_BINARY = 8, + /** + * Underlying C type is AVDictionary*. + */ AV_OPT_TYPE_DICT = 9, + /** + * Underlying C type is uint64_t. + */ AV_OPT_TYPE_UINT64 = 10, + /** + * Special option type for declaring named constants. Does not correspond to + * an actual field in the object, offset must be 0. + */ AV_OPT_TYPE_CONST = 11, - /** offset must point to two consecutive integers */ + /** + * Underlying C type is two consecutive integers. + */ AV_OPT_TYPE_IMAGE_SIZE = 12, + /** + * Underlying C type is enum AVPixelFormat. + */ AV_OPT_TYPE_PIXEL_FMT = 13, + /** + * Underlying C type is enum AVSampleFormat. + */ AV_OPT_TYPE_SAMPLE_FMT = 14, - /** offset must point to AVRational */ + /** + * Underlying C type is AVRational. + */ AV_OPT_TYPE_VIDEO_RATE = 15, + /** + * Underlying C type is int64_t. + */ AV_OPT_TYPE_DURATION = 16, + /** + * Underlying C type is uint8_t[4]. + */ AV_OPT_TYPE_COLOR = 17, + /** + * Underlying C type is int. + */ AV_OPT_TYPE_BOOL = 18, + /** + * Underlying C type is AVChannelLayout. + */ AV_OPT_TYPE_CHLAYOUT = 19, + /** + * Underlying C type is unsigned int. + */ + AV_OPT_TYPE_UINT = 20, /** * May be combined with another regular option type to declare an array @@ -5845,6 +6061,12 @@ allocated with av_malloc() or another memory allocation function. */ */ public static final int AV_OPT_ALLOW_NULL = (1 << 2); +/** + * May be used with av_opt_set_array() to signal that new elements should + * replace the existing ones in the indicated range. + */ +public static final int AV_OPT_ARRAY_REPLACE = (1 << 3); + /** * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than * one component for certain option types. @@ -6161,6 +6383,10 @@ allocated with av_malloc() or another memory allocation function. */ @NoException public static native int av_opt_set_sample_fmt(Pointer obj, String name, @Cast("AVSampleFormat") int fmt, int search_flags); @NoException public static native int av_opt_set_video_rate(Pointer obj, @Cast("const char*") BytePointer name, @ByVal AVRational val, int search_flags); @NoException public static native int av_opt_set_video_rate(Pointer obj, String name, @ByVal AVRational val, int search_flags); +/** + * \note Any old chlayout present is discarded and replaced with a copy of the new one. The + * caller still owns layout and is responsible for uninitializing it. + */ @NoException public static native int av_opt_set_chlayout(Pointer obj, @Cast("const char*") BytePointer name, @Const AVChannelLayout layout, int search_flags); @NoException public static native int av_opt_set_chlayout(Pointer obj, String name, @Const AVChannelLayout layout, int search_flags); /** @@ -6186,6 +6412,59 @@ allocated with av_malloc() or another memory allocation function. */ // av_opt_set_bin(obj, name, (const uint8_t *)(val), // av_int_list_length(val, term) * sizeof(*(val)), flags)) +/** + * Add, replace, or remove elements for an array option. Which of these + * operations is performed depends on the values of val and search_flags. + * + * @param start_elem Index of the first array element to modify; must not be + * larger than array size as returned by + * av_opt_get_array_size(). + * @param nb_elems number of array elements to modify; when val is NULL, + * start_elem+nb_elems must not be larger than array size as + * returned by av_opt_get_array_size() + * + * @param val_type Option type corresponding to the type of val, ignored when val is + * NULL. + * + * The effect of this function will will be as if av_opt_setX() + * was called for each element, where X is specified by type. + * E.g. AV_OPT_TYPE_STRING corresponds to av_opt_set(). + * + * Typically this should be the same as the scalarized type of + * the AVOption being set, but certain conversions are also + * possible - the same as those done by the corresponding + * av_opt_set*() function. E.g. any option type can be set from + * a string, numeric types can be set from int64, double, or + * rational, etc. + * + * @param val Array with nb_elems elements or NULL. + * + * When NULL, nb_elems array elements starting at start_elem are + * removed from the array. Any array elements remaining at the end + * are shifted by nb_elems towards the first element in order to keep + * the array contiguous. + * + * Otherwise (val is non-NULL), the type of val must match the + * underlying C type as documented for val_type. + * + * When AV_OPT_ARRAY_REPLACE is not set in search_flags, the array is + * enlarged by nb_elems, and the contents of val are inserted at + * start_elem. Previously existing array elements from start_elem + * onwards (if present) are shifted by nb_elems away from the first + * element in order to make space for the new elements. + * + * When AV_OPT_ARRAY_REPLACE is set in search_flags, the contents + * of val replace existing array elements from start_elem to + * start_elem+nb_elems (if present). New array size is + * max(start_elem + nb_elems, old array size). + */ +@NoException public static native int av_opt_set_array(Pointer obj, @Cast("const char*") BytePointer name, int search_flags, + @Cast("unsigned int") int start_elem, @Cast("unsigned int") int nb_elems, + @Cast("AVOptionType") int val_type, @Const Pointer val); +@NoException public static native int av_opt_set_array(Pointer obj, String name, int search_flags, + @Cast("unsigned int") int start_elem, @Cast("unsigned int") int nb_elems, + @Cast("AVOptionType") int val_type, @Const Pointer val); + /** * \} * \} @@ -6257,6 +6536,10 @@ allocated with av_malloc() or another memory allocation function. */ @NoException public static native int av_opt_get_sample_fmt(Pointer obj, String name, int search_flags, @Cast("AVSampleFormat*") int[] out_fmt); @NoException public static native int av_opt_get_video_rate(Pointer obj, @Cast("const char*") BytePointer name, int search_flags, AVRational out_val); @NoException public static native int av_opt_get_video_rate(Pointer obj, String name, int search_flags, AVRational out_val); +/** + * @param layout [out] The returned layout is a copy of the actual value and must + * be freed with av_channel_layout_uninit() by the caller + */ @NoException public static native int av_opt_get_chlayout(Pointer obj, @Cast("const char*") BytePointer name, int search_flags, AVChannelLayout layout); @NoException public static native int av_opt_get_chlayout(Pointer obj, String name, int search_flags, AVChannelLayout layout); /** @@ -6266,6 +6549,59 @@ allocated with av_malloc() or another memory allocation function. */ @NoException public static native int av_opt_get_dict_val(Pointer obj, @Cast("const char*") BytePointer name, int search_flags, @Cast("AVDictionary**") PointerPointer out_val); @NoException public static native int av_opt_get_dict_val(Pointer obj, @Cast("const char*") BytePointer name, int search_flags, @ByPtrPtr AVDictionary out_val); @NoException public static native int av_opt_get_dict_val(Pointer obj, String name, int search_flags, @ByPtrPtr AVDictionary out_val); + +/** + * For an array-type option, get the number of elements in the array. + */ +@NoException public static native int av_opt_get_array_size(Pointer obj, @Cast("const char*") BytePointer name, int search_flags, + @Cast("unsigned int*") IntPointer out_val); +@NoException public static native int av_opt_get_array_size(Pointer obj, String name, int search_flags, + @Cast("unsigned int*") IntBuffer out_val); +@NoException public static native int av_opt_get_array_size(Pointer obj, @Cast("const char*") BytePointer name, int search_flags, + @Cast("unsigned int*") int[] out_val); +@NoException public static native int av_opt_get_array_size(Pointer obj, String name, int search_flags, + @Cast("unsigned int*") IntPointer out_val); +@NoException public static native int av_opt_get_array_size(Pointer obj, @Cast("const char*") BytePointer name, int search_flags, + @Cast("unsigned int*") IntBuffer out_val); +@NoException public static native int av_opt_get_array_size(Pointer obj, String name, int search_flags, + @Cast("unsigned int*") int[] out_val); + +/** + * For an array-type option, retrieve the values of one or more array elements. + * + * @param start_elem index of the first array element to retrieve + * @param nb_elems number of array elements to retrieve; start_elem+nb_elems + * must not be larger than array size as returned by + * av_opt_get_array_size() + * + * @param out_type Option type corresponding to the desired output. + * + * The array elements produced by this function will + * will be as if av_opt_getX() was called for each element, + * where X is specified by out_type. E.g. AV_OPT_TYPE_STRING + * corresponds to av_opt_get(). + * + * Typically this should be the same as the scalarized type of + * the AVOption being retrieved, but certain conversions are + * also possible - the same as those done by the corresponding + * av_opt_get*() function. E.g. any option type can be retrieved + * as a string, numeric types can be retrieved as int64, double, + * or rational, etc. + * + * @param out_val Array with nb_elems members into which the output will be + * written. The array type must match the underlying C type as + * documented for out_type, and be zeroed on entry to this + * function. + * + * For dynamically allocated types (strings, binary, dicts, + * etc.), the result is owned and freed by the caller. + */ +@NoException public static native int av_opt_get_array(Pointer obj, @Cast("const char*") BytePointer name, int search_flags, + @Cast("unsigned int") int start_elem, @Cast("unsigned int") int nb_elems, + @Cast("AVOptionType") int out_type, Pointer out_val); +@NoException public static native int av_opt_get_array(Pointer obj, String name, int search_flags, + @Cast("unsigned int") int start_elem, @Cast("unsigned int") int nb_elems, + @Cast("AVOptionType") int out_type, Pointer out_val); /** * \} */ @@ -6296,6 +6632,12 @@ allocated with av_malloc() or another memory allocation function. */ @NoException public static native int av_opt_eval_int(Pointer obj, @Const AVOption o, String val, IntPointer int_out); @NoException public static native int av_opt_eval_int(Pointer obj, @Const AVOption o, @Cast("const char*") BytePointer val, IntBuffer int_out); @NoException public static native int av_opt_eval_int(Pointer obj, @Const AVOption o, String val, int[] int_out); +@NoException public static native int av_opt_eval_uint(Pointer obj, @Const AVOption o, @Cast("const char*") BytePointer val, @Cast("unsigned*") IntPointer uint_out); +@NoException public static native int av_opt_eval_uint(Pointer obj, @Const AVOption o, String val, @Cast("unsigned*") IntBuffer uint_out); +@NoException public static native int av_opt_eval_uint(Pointer obj, @Const AVOption o, @Cast("const char*") BytePointer val, @Cast("unsigned*") int[] uint_out); +@NoException public static native int av_opt_eval_uint(Pointer obj, @Const AVOption o, String val, @Cast("unsigned*") IntPointer uint_out); +@NoException public static native int av_opt_eval_uint(Pointer obj, @Const AVOption o, @Cast("const char*") BytePointer val, @Cast("unsigned*") IntBuffer uint_out); +@NoException public static native int av_opt_eval_uint(Pointer obj, @Const AVOption o, String val, @Cast("unsigned*") int[] uint_out); @NoException public static native int av_opt_eval_int64(Pointer obj, @Const AVOption o, @Cast("const char*") BytePointer val, @Cast("int64_t*") LongPointer int64_out); @NoException public static native int av_opt_eval_int64(Pointer obj, @Const AVOption o, String val, @Cast("int64_t*") LongBuffer int64_out); @NoException public static native int av_opt_eval_int64(Pointer obj, @Const AVOption o, @Cast("const char*") BytePointer val, @Cast("int64_t*") long[] int64_out); @@ -6373,6 +6715,8 @@ allocated with av_malloc() or another memory allocation function. */ public static final int AV_OPT_SERIALIZE_SKIP_DEFAULTS = 0x00000001; /** Serialize options that exactly match opt_flags only. */ public static final int AV_OPT_SERIALIZE_OPT_FLAGS_EXACT = 0x00000002; +/** Serialize options in possible children of the given object. */ +public static final int AV_OPT_SERIALIZE_SEARCH_CHILDREN = 0x00000004; /** * Serialize object's options. @@ -7579,7 +7923,12 @@ allocated with av_malloc() or another memory allocation function. */ * ... * }
*/ - AV_STEREO3D_COLUMNS = 7; + AV_STEREO3D_COLUMNS = 7, + + /** + * Video is stereoscopic but the packing is unspecified. + */ + AV_STEREO3D_UNSPEC = 8; /** * List of possible view types. @@ -7599,7 +7948,32 @@ allocated with av_malloc() or another memory allocation function. */ /** * Frame contains only the right view. */ - AV_STEREO3D_VIEW_RIGHT = 2; + AV_STEREO3D_VIEW_RIGHT = 2, + + /** + * Content is unspecified. + */ + AV_STEREO3D_VIEW_UNSPEC = 3; + +/** + * List of possible primary eyes. + */ +/** enum AVStereo3DPrimaryEye */ +public static final int + /** + * Neither eye. + */ + AV_PRIMARY_EYE_NONE = 0, + + /** + * Left eye. + */ + AV_PRIMARY_EYE_LEFT = 1, + + /** + * Right eye + */ + AV_PRIMARY_EYE_RIGHT = 2; /** * Inverted views, Right/Bottom represents the left view. @@ -7617,6 +7991,14 @@ allocated with av_malloc() or another memory allocation function. */ */ @NoException public static native AVStereo3D av_stereo3d_alloc(); +/** + * Allocate an AVStereo3D structure and set its fields to default values. + * The resulting struct can be freed using av_freep(). + * + * @return An AVStereo3D filled with default values or NULL on failure. + */ +@NoException public static native AVStereo3D av_stereo3d_alloc_size(@Cast("size_t*") SizeTPointer size); + /** * Allocate a complete AVFrameSideData and add it to the frame. * @@ -7645,6 +8027,44 @@ allocated with av_malloc() or another memory allocation function. */ @NoException public static native int av_stereo3d_from_name(@Cast("const char*") BytePointer name); @NoException public static native int av_stereo3d_from_name(String name); +/** + * Provide a human-readable name of a given stereo3d view. + * + * @param type The input stereo3d view value. + * + * @return The name of the stereo3d view value, or "unknown". + */ +@NoException public static native @Cast("const char*") BytePointer av_stereo3d_view_name(@Cast("unsigned int") int view); + +/** + * Get the AVStereo3DView form a human-readable name. + * + * @param name The input string. + * + * @return The AVStereo3DView value, or -1 if not found. + */ +@NoException public static native int av_stereo3d_view_from_name(@Cast("const char*") BytePointer name); +@NoException public static native int av_stereo3d_view_from_name(String name); + +/** + * Provide a human-readable name of a given stereo3d primary eye. + * + * @param type The input stereo3d primary eye value. + * + * @return The name of the stereo3d primary eye value, or "unknown". + */ +@NoException public static native @Cast("const char*") BytePointer av_stereo3d_primary_eye_name(@Cast("unsigned int") int eye); + +/** + * Get the AVStereo3DPrimaryEye form a human-readable name. + * + * @param name The input string. + * + * @return The AVStereo3DPrimaryEye value, or -1 if not found. + */ +@NoException public static native int av_stereo3d_primary_eye_from_name(@Cast("const char*") BytePointer name); +@NoException public static native int av_stereo3d_primary_eye_from_name(String name); + /** * \} */ @@ -7657,7 +8077,7 @@ allocated with av_malloc() or another memory allocation function. */ /* Automatically generated by version.sh, do not manually edit! */ // #ifndef AVUTIL_FFVERSION_H // #define AVUTIL_FFVERSION_H -public static final String FFMPEG_VERSION = "7.0.2"; +public static final String FFMPEG_VERSION = "7.1"; // #endif /* AVUTIL_FFVERSION_H */ @@ -7722,10 +8142,6 @@ allocated with av_malloc() or another memory allocation function. */ // #define AVUTIL_FIFO_H // #include -// #include - -// #include "attributes.h" -// #include "version.h" // Targeting ../avutil/AVFifo.java @@ -10994,12 +11410,14 @@ allocated with av_malloc() or another memory allocation function. */ // #include "attributes.h" // #include "error.h" // #include "macros.h" -// #include "mem.h" +// #include "version.h" // #ifdef HAVE_AV_CONFIG_H // # include "config.h" // # include "intmath.h" // # include "internal.h" +// #else +// # include "mem.h" // #endif /* HAVE_AV_CONFIG_H */ //rounded division & shift @@ -11073,9 +11491,6 @@ allocated with av_malloc() or another memory allocation function. */ // #ifndef av_clip_uintp2 // # define av_clip_uintp2 av_clip_uintp2_c // #endif -// #ifndef av_mod_uintp2 -// # define av_mod_uintp2 av_mod_uintp2_c -// #endif // #ifndef av_sat_add32 // # define av_sat_add32 av_sat_add32_c // #endif @@ -11100,6 +11515,9 @@ allocated with av_malloc() or another memory allocation function. */ // #ifndef av_clipd // # define av_clipd av_clipd_c // #endif +// #ifndef av_zero_extend +// # define av_zero_extend av_zero_extend_c +// #endif // #ifndef av_popcount // # define av_popcount av_popcount_c // #endif @@ -11190,10 +11608,17 @@ allocated with av_malloc() or another memory allocation function. */ /** * Clear high bits from an unsigned integer starting with specific bit position * @param a value to clip - * @param p bit position to clip at + * @param p bit position to clip at. Must be between 0 and 31. * @return clipped value */ -@NoException public static native @Cast("unsigned") @Const int av_mod_uintp2_c(@Cast("unsigned") int a, @Cast("unsigned") int p); +@NoException public static native @Cast("unsigned") @Const int av_zero_extend_c(@Cast("unsigned") int a, @Cast("unsigned") int p); + +// #if FF_API_MOD_UINTP2 +// #ifndef av_mod_uintp2 +// # define av_mod_uintp2 av_mod_uintp2_c +// #endif +@NoException public static native @Cast("unsigned") @Deprecated @Const int av_mod_uintp2_c(@Cast("unsigned") int a, @Cast("unsigned") int p); +// #endif /** * Add two signed 32-bit values with saturation. @@ -11887,7 +12312,6 @@ allocated with av_malloc() or another memory allocation function. */ // #include // #include -// #include "version.h" // #include "attributes.h" /** @@ -12360,10 +12784,8 @@ allocated with av_malloc() or another memory allocation function. */ // #include "config.h" -// #if ARCH_ARM -// # include "arm/intreadwrite.h" -// #elif ARCH_AVR32 -// # include "avr32/intreadwrite.h" +// #if ARCH_AARCH64 +// # include "aarch64/intreadwrite.h" // #elif ARCH_MIPS // # include "mips/intreadwrite.h" // #elif ARCH_PPC @@ -12834,9 +13256,41 @@ allocated with av_malloc() or another memory allocation function. */ // #if AV_HAVE_BIGENDIAN // # define AV_RLA(s, p) av_bswap##s(AV_RN##s##A(p)) // # define AV_WLA(s, p, v) AV_WN##s##A(p, av_bswap##s(v)) +// # define AV_RBA(s, p) AV_RN##s##A(p) +// # define AV_WBA(s, p, v) AV_WN##s##A(p, v) // #else // # define AV_RLA(s, p) AV_RN##s##A(p) // # define AV_WLA(s, p, v) AV_WN##s##A(p, v) +// # define AV_RBA(s, p) av_bswap##s(AV_RN##s##A(p)) +// # define AV_WBA(s, p, v) AV_WN##s##A(p, av_bswap##s(v)) +// #endif + +// #ifndef AV_RL16A +// # define AV_RL16A(p) AV_RLA(16, p) +// #endif +// #ifndef AV_WL16A +// # define AV_WL16A(p, v) AV_WLA(16, p, v) +// #endif + +// #ifndef AV_RB16A +// # define AV_RB16A(p) AV_RBA(16, p) +// #endif +// #ifndef AV_WB16A +// # define AV_WB16A(p, v) AV_WBA(16, p, v) +// #endif + +// #ifndef AV_RL32A +// # define AV_RL32A(p) AV_RLA(32, p) +// #endif +// #ifndef AV_WL32A +// # define AV_WL32A(p, v) AV_WLA(32, p, v) +// #endif + +// #ifndef AV_RB32A +// # define AV_RB32A(p) AV_RBA(32, p) +// #endif +// #ifndef AV_WB32A +// # define AV_WB32A(p, v) AV_WBA(32, p, v) // #endif // #ifndef AV_RL64A @@ -12846,6 +13300,13 @@ allocated with av_malloc() or another memory allocation function. */ // # define AV_WL64A(p, v) AV_WLA(64, p, v) // #endif +// #ifndef AV_RB64A +// # define AV_RB64A(p) AV_RBA(64, p) +// #endif +// #ifndef AV_WB64A +// # define AV_WB64A(p, v) AV_WBA(64, p, v) +// #endif + /* * The AV_COPYxxU macros are suitable for copying data to/from unaligned * memory locations. @@ -12971,6 +13432,15 @@ allocated with av_malloc() or another memory allocation function. */ */ @NoException public static native AVMasteringDisplayMetadata av_mastering_display_metadata_alloc(); +/** + * Allocate an AVMasteringDisplayMetadata structure and set its fields to + * default values. The resulting struct can be freed using av_freep(). + * + * @return An AVMasteringDisplayMetadata filled with default values or NULL + * on failure. + */ +@NoException public static native AVMasteringDisplayMetadata av_mastering_display_metadata_alloc_size(@Cast("size_t*") SizeTPointer size); + /** * Allocate a complete AVMasteringDisplayMetadata and add it to the frame. * @@ -13576,7 +14046,23 @@ allocated with av_malloc() or another memory allocation function. */ * using equirectangular projection. The \ref bounding fields indicate * the position of the current video in a larger surface. */ - AV_SPHERICAL_EQUIRECTANGULAR_TILE = 2; + AV_SPHERICAL_EQUIRECTANGULAR_TILE = 2, + + /** + * Video frame displays as a 180 degree equirectangular projection. + */ + AV_SPHERICAL_HALF_EQUIRECTANGULAR = 3, + + /** + * Video frame displays on a flat, rectangular 2D surface. + */ + AV_SPHERICAL_RECTILINEAR = 4, + + /** + * Fisheye projection (Apple). + * See: https://developer.apple.com/documentation/coremedia/cmprojectiontype/fisheye + */ + AV_SPHERICAL_FISHEYE = 5; // Targeting ../avutil/AVSphericalMapping.java @@ -14454,7 +14940,7 @@ allocated with av_malloc() or another memory allocation function. */ */ public static final int LIBAVUTIL_VERSION_MAJOR = 59; -public static final int LIBAVUTIL_VERSION_MINOR = 8; +public static final int LIBAVUTIL_VERSION_MINOR = 39; public static final int LIBAVUTIL_VERSION_MICRO = 100; public static native @MemberGetter int LIBAVUTIL_VERSION_INT(); @@ -14487,6 +14973,9 @@ allocated with av_malloc() or another memory allocation function. */ public static final boolean FF_API_PALETTE_HAS_CHANGED = (LIBAVUTIL_VERSION_MAJOR < 60); public static final boolean FF_API_VULKAN_CONTIGUOUS_MEMORY = (LIBAVUTIL_VERSION_MAJOR < 60); public static final boolean FF_API_H274_FILM_GRAIN_VCS = (LIBAVUTIL_VERSION_MAJOR < 60); +public static final boolean FF_API_MOD_UINTP2 = (LIBAVUTIL_VERSION_MAJOR < 60); +public static final boolean FF_API_RISCV_FD_ZBA = (LIBAVUTIL_VERSION_MAJOR < 60); +public static final boolean FF_API_VULKAN_FIXED_QUEUES = (LIBAVUTIL_VERSION_MAJOR < 60); /** * \} diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/swresample.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/swresample.java index 49d2f1652f9..21d49e0db54 100644 --- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/swresample.java +++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/swresample.java @@ -68,8 +68,8 @@ public class swresample extends org.bytedeco.ffmpeg.presets.swresample { * matrix). This is using the swr_alloc() function. *
{@code
  * SwrContext *swr = swr_alloc();
- * av_opt_set_channel_layout(swr, "in_channel_layout",  AV_CH_LAYOUT_5POINT1, 0);
- * av_opt_set_channel_layout(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO,  0);
+ * av_opt_set_chlayout(swr, "in_chlayout", &(AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1, 0);
+ * av_opt_set_chlayout(swr, "out_chlayout", &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO, 0);
  * av_opt_set_int(swr, "in_sample_rate",     48000,                0);
  * av_opt_set_int(swr, "out_sample_rate",    44100,                0);
  * av_opt_set_sample_fmt(swr, "in_sample_fmt",  AV_SAMPLE_FMT_FLTP, 0);
@@ -702,7 +702,7 @@ public class swresample extends org.bytedeco.ffmpeg.presets.swresample {
 
 // #include "version_major.h"
 
-public static final int LIBSWRESAMPLE_VERSION_MINOR =   1;
+public static final int LIBSWRESAMPLE_VERSION_MINOR =   3;
 public static final int LIBSWRESAMPLE_VERSION_MICRO = 100;
 
 public static native @MemberGetter int LIBSWRESAMPLE_VERSION_INT();
diff --git a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/swscale.java b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/swscale.java
index fc6a932619e..b73c3409304 100644
--- a/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/swscale.java
+++ b/ffmpeg/src/gen/java/org/bytedeco/ffmpeg/global/swscale.java
@@ -101,11 +101,35 @@ public class swscale extends org.bytedeco.ffmpeg.presets.swscale {
 public static final int SWS_PRINT_INFO =              0x1000;
 
 //the following 3 flags are not completely implemented
-//internal chrominance subsampling info
+
+/**
+ * Perform full chroma upsampling when upscaling to RGB.
+ *
+ * For example, when converting 50x50 yuv420p to 100x100 rgba, setting this flag
+ * will scale the chroma plane from 25x25 to 100x100 (4:4:4), and then convert
+ * the 100x100 yuv444p image to rgba in the final output step.
+ *
+ * Without this flag, the chroma plane is instead scaled to 50x100 (4:2:2),
+ * with a single chroma sample being re-used for both of the horizontally
+ * adjacent RGBA output pixels.
+ */
 public static final int SWS_FULL_CHR_H_INT =    0x2000;
-//input subsampling info
+
+/**
+ * Perform full chroma interpolation when downscaling RGB sources.
+ *
+ * For example, when converting a 100x100 rgba source to 50x50 yuv444p, setting
+ * this flag will generate a 100x100 (4:4:4) chroma plane, which is then
+ * downscaled to the required 50x50.
+ *
+ * Without this flag, the chroma plane is instead generated at 50x100 (dropping
+ * every other pixel), before then being downscaled to the required 50x50
+ * resolution.
+ */
 public static final int SWS_FULL_CHR_H_INP =    0x4000;
+
 public static final int SWS_DIRECT_BGR =        0x8000;
+
 public static final int SWS_ACCURATE_RND =      0x40000;
 public static final int SWS_BITEXACT =          0x80000;
 public static final int SWS_ERROR_DIFFUSION =  0x800000;
@@ -563,7 +587,7 @@ public class swscale extends org.bytedeco.ffmpeg.presets.swscale {
 
 // #include "version_major.h"
 
-public static final int LIBSWSCALE_VERSION_MINOR =   1;
+public static final int LIBSWSCALE_VERSION_MINOR =   3;
 public static final int LIBSWSCALE_VERSION_MICRO = 100;
 
 public static native @MemberGetter int LIBSWSCALE_VERSION_INT();
diff --git a/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avcodec.java b/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avcodec.java
index 2d3fc01272c..bf4fad88a36 100644
--- a/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avcodec.java
+++ b/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avcodec.java
@@ -56,7 +56,7 @@ public void map(InfoMap infoMap) {
                              "FF_API_AYUV_CODECID", "FF_API_VT_OUTPUT_CALLBACK", "FF_API_AVCODEC_CHROMA_POS", "FF_API_VT_HWACCEL_CONTEXT",
                              "FF_API_AVCTX_FRAME_NUMBER", "FF_CODEC_CRYSTAL_HD", "FF_API_SLICE_OFFSET", "FF_API_SUBFRAMES", "FF_API_TICKS_PER_FRAME",
                              "FF_API_DROPCHANGED", "FF_API_AVFFT", "FF_API_FF_PROFILE_LEVEL", "FF_API_AVCODEC_CLOSE", "FF_API_BUFFER_MIN_SIZE",
-                             "FF_API_VDPAU_ALLOC_GET_SET").define().translate().cppTypes("bool"))
+                             "FF_API_VDPAU_ALLOC_GET_SET", "FF_API_QUALITY_FACTOR").define().translate().cppTypes("bool"))
                .put(new Info("AVCodecInternal", "AVCodecHWConfigInternal").cast().pointerTypes("Pointer"))
                .put(new Info("av_jni_get_android_app_ctx").annotations("@Platform(\"android\")").javaNames("av_jni_get_android_app_ctx"))
                .put(new Info("av_jni_set_android_app_ctx").annotations("@Platform(\"android\")").javaNames("av_jni_set_android_app_ctx"))
diff --git a/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avformat.java b/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avformat.java
index ff89413614a..6d5b829d826 100644
--- a/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avformat.java
+++ b/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avformat.java
@@ -49,7 +49,7 @@ public void map(InfoMap infoMap) {
                .put(new Info("FF_API_LAVF_PRIV_OPT", "FF_API_COMPUTE_PKT_FIELDS2", "FF_API_AVIOCONTEXT_WRITTEN",
                              "FF_HLS_TS_OPTIONS", "FF_HTTP_CACHE_REDIRECT_DEFAULT", "FF_API_GET_END_PTS", "FF_API_AVIODIRCONTEXT",
                              "FF_API_AVFORMAT_IO_CLOSE", "FF_API_AVIO_WRITE_NONCONST", "FF_API_LAVF_SHORTEST", "FF_API_ALLOW_FLUSH",
-                             "FF_API_AVSTREAM_SIDE_DATA", "FF_API_GET_DUR_ESTIMATE_METHOD").define().translate().cppTypes("bool"))
+                             "FF_API_AVSTREAM_SIDE_DATA", "FF_API_GET_DUR_ESTIMATE_METHOD", "FF_API_INTERNAL_TIMING").define().translate().cppTypes("bool"))
                .put(new Info("LIBAVFORMAT_VERSION_MAJOR <= 54", "FF_API_ALLOC_OUTPUT_CONTEXT", "FF_API_FORMAT_PARAMETERS",
                              "FF_API_READ_PACKET", "FF_API_CLOSE_INPUT_FILE", "FF_API_NEW_STREAM", "FF_API_SET_PTS_INFO",
                              "FF_API_AVSTREAM_CLASS").define(false).translate().cppTypes("bool"));
diff --git a/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avutil.java b/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avutil.java
index face2acdb77..a53dabbe0b8 100644
--- a/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avutil.java
+++ b/ffmpeg/src/main/java/org/bytedeco/ffmpeg/presets/avutil.java
@@ -82,13 +82,13 @@ public void map(InfoMap infoMap) {
                              "av_ceil_log2", "av_clip", "av_clip64", "av_clip_uint8", "av_clip_int8", "av_clip_uint16", "av_clip_int16",
                              "av_clipl_int32", "av_clip_intp2", "av_clip_uintp2", "av_mod_uintp2", "av_sat_add32", "av_sat_dadd32",
                              "av_sat_sub32", "av_sat_dsub32", "av_clipf", "av_clipd", "av_popcount", "av_popcount64", "av_parity",
-                             "av_sat_add64", "av_sat_sub64", "LIBAVUTIL_VERSION").cppTypes().translate())
+                             "av_sat_add64", "av_sat_sub64", "av_zero_extend", "LIBAVUTIL_VERSION").cppTypes().translate())
                .put(new Info("LIBAVUTIL_VERSION_INT", "LIBAVUTIL_IDENT").translate(false))
                .put(new Info("FF_API_D2STR", "FF_API_DECLARE_ALIGNED", "FF_API_COLORSPACE_NAME", "FF_API_AV_MALLOCZ_ARRAY", "FF_API_FIFO_PEEK2",
                              "FF_API_FIFO_OLD_API", "FF_API_XVMC", "FF_API_OLD_CHANNEL_LAYOUT", "FF_API_AV_FOPEN_UTF8", "FF_API_PKT_DURATION",
                              "FF_API_REORDERED_OPAQUE", "FF_API_FRAME_PICTURE_NUMBER", "FF_API_HDR_VIVID_THREE_SPLINE", "FF_API_FRAME_PKT",
                              "FF_API_INTERLACED_FRAME", "FF_API_FRAME_KEY", "FF_API_PALETTE_HAS_CHANGED", "FF_API_VULKAN_CONTIGUOUS_MEMORY",
-                             "FF_API_H274_FILM_GRAIN_VCS").define().translate().cppTypes("bool"))
+                             "FF_API_H274_FILM_GRAIN_VCS", "FF_API_MOD_UINTP2", "FF_API_RISCV_FD_ZBA", "FF_API_VULKAN_FIXED_QUEUES").define().translate().cppTypes("bool"))
                .put(new Info("av_const").annotations("@Const"))
                .put(new Info("FF_CONST_AVUTIL55").annotations())
                .put(new Info("av_malloc_attrib", "av_alloc_size", "av_always_inline", "av_warn_unused_result", "av_alias").cppTypes().annotations())
@@ -133,6 +133,10 @@ public void map(InfoMap infoMap) {
                              "AV_CH_BOTTOM_FRONT_CENTER",
                              "AV_CH_BOTTOM_FRONT_LEFT",
                              "AV_CH_BOTTOM_FRONT_RIGHT",
+                             "AV_CH_SIDE_SURROUND_LEFT",
+                             "AV_CH_SIDE_SURROUND_RIGHT",
+                             "AV_CH_TOP_SURROUND_LEFT",
+                             "AV_CH_TOP_SURROUND_RIGHT",
                              "AV_CH_LAYOUT_NATIVE",
                              "AV_CH_LAYOUT_MONO",
                              "AV_CH_LAYOUT_STEREO",
diff --git a/llvm/README.md b/llvm/README.md
index 48a2ad255fb..217e42a15e8 100644
--- a/llvm/README.md
+++ b/llvm/README.md
@@ -9,7 +9,7 @@ Introduction
 ------------
 This directory contains the JavaCPP Presets module for:
 
- * LLVM 18.1.8  http://llvm.org/
+ * LLVM 19.1.2  http://llvm.org/
 
 Please refer to the parent README.md file for more detailed information about the JavaCPP Presets.
 
@@ -50,7 +50,7 @@ We can use [Maven 3](http://maven.apache.org/) to download and install automatic
         
             org.bytedeco
             llvm-platform
-            18.1.8-1.5.11-SNAPSHOT
+            19.1.2-1.5.11-SNAPSHOT
         
     
     
diff --git a/llvm/cppbuild.sh b/llvm/cppbuild.sh
index b74cbcce7de..653c2e85473 100755
--- a/llvm/cppbuild.sh
+++ b/llvm/cppbuild.sh
@@ -7,7 +7,7 @@ if [[ -z "$PLATFORM" ]]; then
     exit
 fi
 
-LLVM_VERSION=18.1.8
+LLVM_VERSION=19.1.2
 download https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/llvm-project-$LLVM_VERSION.src.tar.xz llvm-project-$LLVM_VERSION.src.tar.xz
 
 mkdir -p $PLATFORM
diff --git a/llvm/platform/pom.xml b/llvm/platform/pom.xml
index c2f03b9b3e3..f43565e4d7e 100644
--- a/llvm/platform/pom.xml
+++ b/llvm/platform/pom.xml
@@ -12,7 +12,7 @@
 
   org.bytedeco
   llvm-platform
-  18.1.8-${project.parent.version}
+  19.1.2-${project.parent.version}
   JavaCPP Presets Platform for LLVM
 
   
diff --git a/llvm/pom.xml b/llvm/pom.xml
index 47a5faf469d..364f82456d3 100644
--- a/llvm/pom.xml
+++ b/llvm/pom.xml
@@ -11,7 +11,7 @@
 
   org.bytedeco
   llvm
-  18.1.8-${project.parent.version}
+  19.1.2-${project.parent.version}
   JavaCPP Presets for LLVM
 
   
diff --git a/llvm/samples/clang/pom.xml b/llvm/samples/clang/pom.xml
index 8ff44399d0c..9da5c0aec10 100644
--- a/llvm/samples/clang/pom.xml
+++ b/llvm/samples/clang/pom.xml
@@ -12,7 +12,7 @@
         
             org.bytedeco
             llvm-platform
-            18.1.8-1.5.11-SNAPSHOT
+            19.1.2-1.5.11-SNAPSHOT
         
     
     
diff --git a/llvm/samples/llvm/pom.xml b/llvm/samples/llvm/pom.xml
index ecd1ffbe79c..2785b5727e2 100644
--- a/llvm/samples/llvm/pom.xml
+++ b/llvm/samples/llvm/pom.xml
@@ -12,7 +12,7 @@
         
             org.bytedeco
             llvm-platform
-            18.1.8-1.5.11-SNAPSHOT
+            19.1.2-1.5.11-SNAPSHOT
         
         
             org.bytedeco
diff --git a/llvm/samples/polly/pom.xml b/llvm/samples/polly/pom.xml
index fa9e576a7eb..7cda0b2b0bc 100644
--- a/llvm/samples/polly/pom.xml
+++ b/llvm/samples/polly/pom.xml
@@ -13,7 +13,7 @@
         
             org.bytedeco
             llvm-platform
-            18.1.8-1.5.11-SNAPSHOT
+            19.1.2-1.5.11-SNAPSHOT
         
         
             org.bytedeco
diff --git a/llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMDbgRecordRef.java b/llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMDbgRecordRef.java
new file mode 100644
index 00000000000..8926974b1d5
--- /dev/null
+++ b/llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMDbgRecordRef.java
@@ -0,0 +1,23 @@
+// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE
+
+package org.bytedeco.llvm.LLVM;
+
+import java.nio.*;
+import org.bytedeco.javacpp.*;
+import org.bytedeco.javacpp.annotation.*;
+
+import static org.bytedeco.javacpp.presets.javacpp.*;
+
+import static org.bytedeco.llvm.global.LLVM.*;
+
+
+/**
+ * @see llvm::DbgRecord
+ */
+@Name("LLVMOpaqueDbgRecord") @Opaque @Properties(inherit = org.bytedeco.llvm.presets.LLVM.class)
+public class LLVMDbgRecordRef extends Pointer {
+    /** Empty constructor. Calls {@code super((Pointer)null)}. */
+    public LLVMDbgRecordRef() { super((Pointer)null); }
+    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
+    public LLVMDbgRecordRef(Pointer p) { super(p); }
+}
diff --git a/llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMOpaqueDbgRecord.java b/llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMOpaqueDbgRecord.java
new file mode 100644
index 00000000000..731db67f6b6
--- /dev/null
+++ b/llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMOpaqueDbgRecord.java
@@ -0,0 +1,23 @@
+// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE
+
+package org.bytedeco.llvm.LLVM;
+
+import java.nio.*;
+import org.bytedeco.javacpp.*;
+import org.bytedeco.javacpp.annotation.*;
+
+import static org.bytedeco.javacpp.presets.javacpp.*;
+
+import static org.bytedeco.llvm.global.LLVM.*;
+
+
+/**
+ * @see llvm::DbgRecord
+ */
+@Opaque @Properties(inherit = org.bytedeco.llvm.presets.LLVM.class)
+public class LLVMOpaqueDbgRecord extends Pointer {
+    /** Empty constructor. Calls {@code super((Pointer)null)}. */
+    public LLVMOpaqueDbgRecord() { super((Pointer)null); }
+    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
+    public LLVMOpaqueDbgRecord(Pointer p) { super(p); }
+}
diff --git a/llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMOrcCSymbolDependenceGroup.java b/llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMOrcCSymbolDependenceGroup.java
new file mode 100644
index 00000000000..0480ed8840d
--- /dev/null
+++ b/llvm/src/gen/java/org/bytedeco/llvm/LLVM/LLVMOrcCSymbolDependenceGroup.java
@@ -0,0 +1,38 @@
+// Targeted by JavaCPP version 1.5.11-SNAPSHOT: DO NOT EDIT THIS FILE
+
+package org.bytedeco.llvm.LLVM;
+
+import java.nio.*;
+import org.bytedeco.javacpp.*;
+import org.bytedeco.javacpp.annotation.*;
+
+import static org.bytedeco.javacpp.presets.javacpp.*;
+
+import static org.bytedeco.llvm.global.LLVM.*;
+
+
+/**
+ * A set of symbols that share dependencies.
+ */
+@Properties(inherit = org.bytedeco.llvm.presets.LLVM.class)
+public class LLVMOrcCSymbolDependenceGroup extends Pointer {
+    static { Loader.load(); }
+    /** Default native constructor. */
+    public LLVMOrcCSymbolDependenceGroup() { super((Pointer)null); allocate(); }
+    /** Native array allocator. Access with {@link Pointer#position(long)}. */
+    public LLVMOrcCSymbolDependenceGroup(long size) { super((Pointer)null); allocateArray(size); }
+    /** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
+    public LLVMOrcCSymbolDependenceGroup(Pointer p) { super(p); }
+    private native void allocate();
+    private native void allocateArray(long size);
+    @Override public LLVMOrcCSymbolDependenceGroup position(long position) {
+        return (LLVMOrcCSymbolDependenceGroup)super.position(position);
+    }
+    @Override public LLVMOrcCSymbolDependenceGroup getPointer(long i) {
+        return new LLVMOrcCSymbolDependenceGroup((Pointer)this).offsetAddress(i);
+    }
+
+  public native @ByRef LLVMOrcCSymbolsList Symbols(); public native LLVMOrcCSymbolDependenceGroup Symbols(LLVMOrcCSymbolsList setter);
+  public native @Cast("LLVMOrcCDependenceMapPairs") LLVMOrcCDependenceMapPair Dependencies(); public native LLVMOrcCSymbolDependenceGroup Dependencies(LLVMOrcCDependenceMapPair setter);
+  public native @Cast("size_t") long NumDependencies(); public native LLVMOrcCSymbolDependenceGroup NumDependencies(long setter);
+}
diff --git a/llvm/src/gen/java/org/bytedeco/llvm/global/LLVM.java b/llvm/src/gen/java/org/bytedeco/llvm/global/LLVM.java
index 56e9a1933c0..f480bbec2cc 100644
--- a/llvm/src/gen/java/org/bytedeco/llvm/global/LLVM.java
+++ b/llvm/src/gen/java/org/bytedeco/llvm/global/LLVM.java
@@ -184,6 +184,9 @@ public class LLVM extends org.bytedeco.llvm.presets.LLVM {
 // Targeting ../LLVM/LLVMBinaryRef.java
 
 
+// Targeting ../LLVM/LLVMDbgRecordRef.java
+
+
 
 /**
  * \}
@@ -612,7 +615,8 @@ public static native void LLVMParseCommandLineOptions(int argc, @Cast("const cha
 
   LLVMInstructionValueKind = 24,
   LLVMPoisonValueValueKind = 25,
-  LLVMConstantTargetNoneValueKind = 26;
+  LLVMConstantTargetNoneValueKind = 26,
+  LLVMConstantPtrAuthValueKind = 27;
 
 /** enum LLVMIntPredicate */
 public static final int
@@ -723,50 +727,56 @@ Release barrier (for fences and
 
 /** enum LLVMAtomicRMWBinOp */
 public static final int
-    /** Set the new value and return the one old */
-    LLVMAtomicRMWBinOpXchg = 0,
-    /** Add a value and return the old one */
-    LLVMAtomicRMWBinOpAdd = 1,
-    /** Subtract a value and return the old one */
-    LLVMAtomicRMWBinOpSub = 2,
-    /** And a value and return the old one */
-    LLVMAtomicRMWBinOpAnd = 3,
-    /** Not-And a value and return the old one */
-    LLVMAtomicRMWBinOpNand = 4,
-    /** OR a value and return the old one */
-    LLVMAtomicRMWBinOpOr = 5,
-    /** Xor a value and return the old one */
-    LLVMAtomicRMWBinOpXor = 6,
-    /** Sets the value if it's greater than the
-                             original using a signed comparison and return
-                             the old one */
-    LLVMAtomicRMWBinOpMax = 7,
-    /** Sets the value if it's Smaller than the
-                             original using a signed comparison and return
-                             the old one */
-    LLVMAtomicRMWBinOpMin = 8,
-    /** Sets the value if it's greater than the
-                             original using an unsigned comparison and return
-                             the old one */
-    LLVMAtomicRMWBinOpUMax = 9,
-    /** Sets the value if it's greater than the
-                              original using an unsigned comparison and return
-                              the old one */
-    LLVMAtomicRMWBinOpUMin = 10,
-    /** Add a floating point value and return the
-                              old one */
-    LLVMAtomicRMWBinOpFAdd = 11,
-    /** Subtract a floating point value and return the
+  /** Set the new value and return the one old */
+  LLVMAtomicRMWBinOpXchg = 0,
+  /** Add a value and return the old one */
+  LLVMAtomicRMWBinOpAdd = 1,
+  /** Subtract a value and return the old one */
+  LLVMAtomicRMWBinOpSub = 2,
+  /** And a value and return the old one */
+  LLVMAtomicRMWBinOpAnd = 3,
+  /** Not-And a value and return the old one */
+  LLVMAtomicRMWBinOpNand = 4,
+  /** OR a value and return the old one */
+  LLVMAtomicRMWBinOpOr = 5,
+  /** Xor a value and return the old one */
+  LLVMAtomicRMWBinOpXor = 6,
+  /** Sets the value if it's greater than the
+                            original using a signed comparison and return
+                            the old one */
+  LLVMAtomicRMWBinOpMax = 7,
+  /** Sets the value if it's Smaller than the
+                            original using a signed comparison and return
+                            the old one */
+  LLVMAtomicRMWBinOpMin = 8,
+  /** Sets the value if it's greater than the
+                           original using an unsigned comparison and return
+                           the old one */
+  LLVMAtomicRMWBinOpUMax = 9,
+  /** Sets the value if it's greater than the
+                            original using an unsigned comparison and return
+                            the old one */
+  LLVMAtomicRMWBinOpUMin = 10,
+  /** Add a floating point value and return the
                             old one */
-    LLVMAtomicRMWBinOpFSub = 12,
-    /** Sets the value if it's greater than the
-                             original using an floating point comparison and
-                             return the old one */
-    LLVMAtomicRMWBinOpFMax = 13,
-    /** Sets the value if it's smaller than the
-                             original using an floating point comparison and
-                             return the old one */
-    LLVMAtomicRMWBinOpFMin = 14;
+  LLVMAtomicRMWBinOpFAdd = 11,
+  /** Subtract a floating point value and return the
+                          old one */
+  LLVMAtomicRMWBinOpFSub = 12,
+  /** Sets the value if it's greater than the
+                           original using an floating point comparison and
+                           return the old one */
+  LLVMAtomicRMWBinOpFMax = 13,
+  /** Sets the value if it's smaller than the
+                           original using an floating point comparison and
+                           return the old one */
+  LLVMAtomicRMWBinOpFMin = 14,
+  /** Increments the value, wrapping back to zero
+                               when incremented above input value */
+  LLVMAtomicRMWBinOpUIncWrap = 15,
+  /** Decrements the value, wrapping back to
+                               the input value when decremented below zero */
+  LLVMAtomicRMWBinOpUDecWrap = 16;
 
 /** enum LLVMDiagnosticSeverity */
 public static final int
@@ -879,6 +889,19 @@ Release barrier (for fences and
  * See https://llvm.org/docs/LangRef.html#fast-math-flags
  */
 
+/** enum  */
+public static final int
+  LLVMGEPFlagInBounds = (1 << 0),
+  LLVMGEPFlagNUSW = (1 << 1),
+  LLVMGEPFlagNUW = (1 << 2);
+
+/**
+ * Flags that constrain the allowed wrap semantics of a getelementptr
+ * instruction.
+ *
+ * See https://llvm.org/docs/LangRef.html#getelementptr-instruction
+ */
+
 /**
  * \}
  */
@@ -1042,6 +1065,28 @@ public static native LLVMAttributeRef LLVMCreateTypeAttribute(LLVMContextRef C,
  */
 public static native LLVMTypeRef LLVMGetTypeAttributeValue(LLVMAttributeRef A);
 
+/**
+ * Create a ConstantRange attribute.
+ *
+ * LowerWords and UpperWords need to be NumBits divided by 64 rounded up
+ * elements long.
+ */
+public static native LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C,
+                                                  @Cast("unsigned") int KindID,
+                                                  @Cast("unsigned") int NumBits,
+                                                  @Cast("const uint64_t*") LongPointer LowerWords,
+                                                  @Cast("const uint64_t*") LongPointer UpperWords);
+public static native LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C,
+                                                  @Cast("unsigned") int KindID,
+                                                  @Cast("unsigned") int NumBits,
+                                                  @Cast("const uint64_t*") LongBuffer LowerWords,
+                                                  @Cast("const uint64_t*") LongBuffer UpperWords);
+public static native LLVMAttributeRef LLVMCreateConstantRangeAttribute(LLVMContextRef C,
+                                                  @Cast("unsigned") int KindID,
+                                                  @Cast("unsigned") int NumBits,
+                                                  @Cast("const uint64_t*") long[] LowerWords,
+                                                  @Cast("const uint64_t*") long[] UpperWords);
+
 /**
  * Create a string attribute.
  */
@@ -1128,6 +1173,24 @@ public static native LLVMModuleRef LLVMModuleCreateWithNameInContext(String Modu
  */
 public static native void LLVMDisposeModule(LLVMModuleRef M);
 
+/**
+ * Soon to be deprecated.
+ * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
+ *
+ * Returns true if the module is in the new debug info mode which uses
+ * non-instruction debug records instead of debug intrinsics for variable
+ * location tracking.
+ */
+public static native @Cast("LLVMBool") int LLVMIsNewDbgInfoFormat(LLVMModuleRef M);
+
+/**
+ * Soon to be deprecated.
+ * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes
+ *
+ * Convert module into desired debug info format.
+ */
+public static native void LLVMSetIsNewDbgInfoFormat(LLVMModuleRef M, @Cast("LLVMBool") int UseNewFormat);
+
 /**
  * Obtain the identifier of a module.
  *
@@ -2061,6 +2124,35 @@ public static native LLVMTypeRef LLVMScalableVectorType(LLVMTypeRef ElementType,
  */
 public static native @Cast("unsigned") int LLVMGetVectorSize(LLVMTypeRef VectorTy);
 
+/**
+ * Get the pointer value for the associated ConstantPtrAuth constant.
+ *
+ * @see llvm::ConstantPtrAuth::getPointer
+ */
+public static native LLVMValueRef LLVMGetConstantPtrAuthPointer(LLVMValueRef PtrAuth);
+
+/**
+ * Get the key value for the associated ConstantPtrAuth constant.
+ *
+ * @see llvm::ConstantPtrAuth::getKey
+ */
+public static native LLVMValueRef LLVMGetConstantPtrAuthKey(LLVMValueRef PtrAuth);
+
+/**
+ * Get the discriminator value for the associated ConstantPtrAuth constant.
+ *
+ * @see llvm::ConstantPtrAuth::getDiscriminator
+ */
+public static native LLVMValueRef LLVMGetConstantPtrAuthDiscriminator(LLVMValueRef PtrAuth);
+
+/**
+ * Get the address discriminator value for the associated ConstantPtrAuth
+ * constant.
+ *
+ * @see llvm::ConstantPtrAuth::getAddrDiscriminator
+ */
+public static native LLVMValueRef LLVMGetConstantPtrAuthAddrDiscriminator(LLVMValueRef PtrAuth);
+
 /**
  * \}
  */
@@ -2144,6 +2236,42 @@ public static native LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, St
                                        @Cast("unsigned*") int[] IntParams,
                                        @Cast("unsigned") int IntParamCount);
 
+/**
+ * Obtain the name for this target extension type.
+ *
+ * @see llvm::TargetExtType::getName()
+ */
+public static native @Cast("const char*") BytePointer LLVMGetTargetExtTypeName(LLVMTypeRef TargetExtTy);
+
+/**
+ * Obtain the number of type parameters for this target extension type.
+ *
+ * @see llvm::TargetExtType::getNumTypeParameters()
+ */
+public static native @Cast("unsigned") int LLVMGetTargetExtTypeNumTypeParams(LLVMTypeRef TargetExtTy);
+
+/**
+ * Get the type parameter at the given index for the target extension type.
+ *
+ * @see llvm::TargetExtType::getTypeParameter()
+ */
+public static native LLVMTypeRef LLVMGetTargetExtTypeTypeParam(LLVMTypeRef TargetExtTy,
+                                          @Cast("unsigned") int Idx);
+
+/**
+ * Obtain the number of int parameters for this target extension type.
+ *
+ * @see llvm::TargetExtType::getNumIntParameters()
+ */
+public static native @Cast("unsigned") int LLVMGetTargetExtTypeNumIntParams(LLVMTypeRef TargetExtTy);
+
+/**
+ * Get the int parameter at the given index for the target extension type.
+ *
+ * @see llvm::TargetExtType::getIntParameter()
+ */
+public static native @Cast("unsigned") int LLVMGetTargetExtTypeIntParam(LLVMTypeRef TargetExtTy, @Cast("unsigned") int Idx);
+
 /**
  * \}
  */
@@ -2173,6 +2301,10 @@ public static native LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, St
  * \{
  */
 
+// Currently, clang-format tries to format the LLVM_FOR_EACH_VALUE_SUBCLASS
+// macro in a progressively-indented fashion, which is not desired
+// clang-format off
+
 // #define LLVM_FOR_EACH_VALUE_SUBCLASS(macro)
 //   macro(Argument)
 //   macro(BasicBlock)
@@ -2192,6 +2324,7 @@ public static native LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, St
 //       macro(ConstantStruct)
 //       macro(ConstantTokenNone)
 //       macro(ConstantVector)
+//       macro(ConstantPtrAuth)
 //       macro(GlobalValue)
 //         macro(GlobalAlias)
 //         macro(GlobalObject)
@@ -2263,6 +2396,8 @@ public static native LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, St
 //       macro(AtomicRMWInst)
 //       macro(FenceInst)
 
+// clang-format on
+
 /**
  * \defgroup LLVMCCoreValueGeneral General APIs
  *
@@ -2317,6 +2452,14 @@ public static native LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, St
  */
 public static native @Cast("char*") BytePointer LLVMPrintValueToString(LLVMValueRef Val);
 
+/**
+ * Return a string representation of the DbgRecord. Use
+ * LLVMDisposeMessage to free the string.
+ *
+ * @see llvm::DbgRecord::print()
+ */
+public static native @Cast("char*") BytePointer LLVMPrintDbgRecordToString(LLVMDbgRecordRef Record);
+
 /**
  * Replace all uses of a value with another one.
  *
@@ -2370,6 +2513,7 @@ public static native LLVMTypeRef LLVMTargetExtTypeInContext(LLVMContextRef C, St
       public static native LLVMValueRef LLVMIsAConstantStruct(LLVMValueRef Val);
       public static native LLVMValueRef LLVMIsAConstantTokenNone(LLVMValueRef Val);
       public static native LLVMValueRef LLVMIsAConstantVector(LLVMValueRef Val);
+      public static native LLVMValueRef LLVMIsAConstantPtrAuth(LLVMValueRef Val);
       public static native LLVMValueRef LLVMIsAGlobalValue(LLVMValueRef Val);
         public static native LLVMValueRef LLVMIsAGlobalAlias(LLVMValueRef Val);
         public static native LLVMValueRef LLVMIsAGlobalObject(LLVMValueRef Val);
@@ -2737,6 +2881,8 @@ public static native LLVMValueRef LLVMConstRealOfStringAndSize(LLVMTypeRef RealT
 /**
  * Create a ConstantDataSequential and initialize it with a string.
  *
+ * @deprecated LLVMConstStringInContext is deprecated in favor of the API
+ * accurate LLVMConstStringInContext2
  * @see llvm::ConstantDataArray::getString()
  */
 public static native LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, @Cast("const char*") BytePointer Str,
@@ -2744,6 +2890,18 @@ public static native LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, @Ca
 public static native LLVMValueRef LLVMConstStringInContext(LLVMContextRef C, String Str,
                                       @Cast("unsigned") int Length, @Cast("LLVMBool") int DontNullTerminate);
 
+/**
+ * Create a ConstantDataSequential and initialize it with a string.
+ *
+ * @see llvm::ConstantDataArray::getString()
+ */
+public static native LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C, @Cast("const char*") BytePointer Str,
+                                       @Cast("size_t") long Length,
+                                       @Cast("LLVMBool") int DontNullTerminate);
+public static native LLVMValueRef LLVMConstStringInContext2(LLVMContextRef C, String Str,
+                                       @Cast("size_t") long Length,
+                                       @Cast("LLVMBool") int DontNullTerminate);
+
 /**
  * Create a ConstantDataSequential with string content in the global context.
  *
@@ -2856,6 +3014,14 @@ public static native LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy,
 public static native LLVMValueRef LLVMConstVector(@ByPtrPtr LLVMValueRef ScalarConstantVals, @Cast("unsigned") int Size);
 public static native LLVMValueRef LLVMConstVector(@Cast("LLVMValueRef*") PointerPointer ScalarConstantVals, @Cast("unsigned") int Size);
 
+/**
+ * Create a ConstantPtrAuth constant with the given values.
+ *
+ * @see llvm::ConstantPtrAuth::get()
+ */
+public static native LLVMValueRef LLVMConstantPtrAuth(LLVMValueRef Ptr, LLVMValueRef Key,
+                                 LLVMValueRef Disc, LLVMValueRef AddrDisc);
+
 /**
  * \}
  */
@@ -2874,7 +3040,7 @@ public static native LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy,
 public static native LLVMValueRef LLVMSizeOf(LLVMTypeRef Ty);
 public static native LLVMValueRef LLVMConstNeg(LLVMValueRef ConstantVal);
 public static native LLVMValueRef LLVMConstNSWNeg(LLVMValueRef ConstantVal);
-public static native LLVMValueRef LLVMConstNUWNeg(LLVMValueRef ConstantVal);
+
 public static native LLVMValueRef LLVMConstNot(LLVMValueRef ConstantVal);
 public static native LLVMValueRef LLVMConstAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
 public static native LLVMValueRef LLVMConstNSWAdd(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
@@ -2886,11 +3052,6 @@ public static native LLVMValueRef LLVMConstNamedStruct(LLVMTypeRef StructTy,
 public static native LLVMValueRef LLVMConstNSWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
 public static native LLVMValueRef LLVMConstNUWMul(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
 public static native LLVMValueRef LLVMConstXor(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-public static native LLVMValueRef LLVMConstICmp(@Cast("LLVMIntPredicate") int Predicate,
-                           LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-public static native LLVMValueRef LLVMConstFCmp(@Cast("LLVMRealPredicate") int Predicate,
-                           LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
-public static native LLVMValueRef LLVMConstShl(LLVMValueRef LHSConstant, LLVMValueRef RHSConstant);
 public static native LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal,
                            @ByPtrPtr LLVMValueRef ConstantIndices, @Cast("unsigned") int NumIndices);
 public static native LLVMValueRef LLVMConstGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal,
@@ -2901,6 +3062,22 @@ public static native LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValu
 public static native LLVMValueRef LLVMConstInBoundsGEP2(LLVMTypeRef Ty, LLVMValueRef ConstantVal,
                                    @Cast("LLVMValueRef*") PointerPointer ConstantIndices,
                                    @Cast("unsigned") int NumIndices);
+/**
+ * Creates a constant GetElementPtr expression. Similar to LLVMConstGEP2, but
+ * allows specifying the no-wrap flags.
+ *
+ * @see llvm::ConstantExpr::getGetElementPtr()
+ */
+public static native LLVMValueRef LLVMConstGEPWithNoWrapFlags(LLVMTypeRef Ty,
+                                         LLVMValueRef ConstantVal,
+                                         @ByPtrPtr LLVMValueRef ConstantIndices,
+                                         @Cast("unsigned") int NumIndices,
+                                         @Cast("LLVMGEPNoWrapFlags") int NoWrapFlags);
+public static native LLVMValueRef LLVMConstGEPWithNoWrapFlags(LLVMTypeRef Ty,
+                                         LLVMValueRef ConstantVal,
+                                         @Cast("LLVMValueRef*") PointerPointer ConstantIndices,
+                                         @Cast("unsigned") int NumIndices,
+                                         @Cast("LLVMGEPNoWrapFlags") int NoWrapFlags);
 public static native LLVMValueRef LLVMConstTrunc(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
 public static native LLVMValueRef LLVMConstPtrToInt(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
 public static native LLVMValueRef LLVMConstIntToPtr(LLVMValueRef ConstantVal, LLVMTypeRef ToType);
@@ -2920,6 +3097,16 @@ public static native LLVMValueRef LLVMConstShuffleVector(LLVMValueRef VectorACon
                                     LLVMValueRef MaskConstant);
 public static native LLVMValueRef LLVMBlockAddress(LLVMValueRef F, LLVMBasicBlockRef BB);
 
+/**
+ * Gets the function associated with a given BlockAddress constant value.
+ */
+public static native LLVMValueRef LLVMGetBlockAddressFunction(LLVMValueRef BlockAddr);
+
+/**
+ * Gets the basic block associated with a given BlockAddress constant value.
+ */
+public static native LLVMBasicBlockRef LLVMGetBlockAddressBasicBlock(LLVMValueRef BlockAddr);
+
 /** Deprecated: Use LLVMGetInlineAsm instead. */
 public static native LLVMValueRef LLVMConstInlineAsm(LLVMTypeRef Ty,
                                 @Cast("const char*") BytePointer AsmString, @Cast("const char*") BytePointer Constraints,
@@ -3330,6 +3517,44 @@ public static native String LLVMIntrinsicCopyOverloadedName2(LLVMModuleRef Mod,
 public static native void LLVMSetGC(LLVMValueRef Fn, @Cast("const char*") BytePointer Name);
 public static native void LLVMSetGC(LLVMValueRef Fn, String Name);
 
+/**
+ * Gets the prefix data associated with a function. Only valid on functions, and
+ * only if LLVMHasPrefixData returns true.
+ * See https://llvm.org/docs/LangRef.html#prefix-data
+ */
+public static native LLVMValueRef LLVMGetPrefixData(LLVMValueRef Fn);
+
+/**
+ * Check if a given function has prefix data. Only valid on functions.
+ * See https://llvm.org/docs/LangRef.html#prefix-data
+ */
+public static native @Cast("LLVMBool") int LLVMHasPrefixData(LLVMValueRef Fn);
+
+/**
+ * Sets the prefix data for the function. Only valid on functions.
+ * See https://llvm.org/docs/LangRef.html#prefix-data
+ */
+public static native void LLVMSetPrefixData(LLVMValueRef Fn, LLVMValueRef prefixData);
+
+/**
+ * Gets the prologue data associated with a function. Only valid on functions,
+ * and only if LLVMHasPrologueData returns true.
+ * See https://llvm.org/docs/LangRef.html#prologue-data
+ */
+public static native LLVMValueRef LLVMGetPrologueData(LLVMValueRef Fn);
+
+/**
+ * Check if a given function has prologue data. Only valid on functions.
+ * See https://llvm.org/docs/LangRef.html#prologue-data
+ */
+public static native @Cast("LLVMBool") int LLVMHasPrologueData(LLVMValueRef Fn);
+
+/**
+ * Sets the prologue data for the function. Only valid on functions.
+ * See https://llvm.org/docs/LangRef.html#prologue-data
+ */
+public static native void LLVMSetPrologueData(LLVMValueRef Fn, LLVMValueRef prologueData);
+
 /**
  * Add an attribute to a function.
  *
@@ -4090,8 +4315,7 @@ public static native LLVMValueMetadataEntry LLVMInstructionGetAllMetadataOtherTh
 /**
  * Obtain the predicate of an instruction.
  *
- * This is only valid for instructions that correspond to llvm::ICmpInst
- * or llvm::ConstantExpr whose opcode is llvm::Instruction::ICmp.
+ * This is only valid for instructions that correspond to llvm::ICmpInst.
  *
  * @see llvm::ICmpInst::getPredicate()
  */
@@ -4100,8 +4324,7 @@ public static native LLVMValueMetadataEntry LLVMInstructionGetAllMetadataOtherTh
 /**
  * Obtain the float predicate of an instruction.
  *
- * This is only valid for instructions that correspond to llvm::FCmpInst
- * or llvm::ConstantExpr whose opcode is llvm::Instruction::FCmp.
+ * This is only valid for instructions that correspond to llvm::FCmpInst.
  *
  * @see llvm::FCmpInst::getPredicate()
  */
@@ -4305,6 +4528,28 @@ public static native LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueR
  */
 public static native void LLVMSetUnwindDest(LLVMValueRef InvokeInst, LLVMBasicBlockRef B);
 
+/**
+ * Get the default destination of a CallBr instruction.
+ *
+ * @see llvm::CallBrInst::getDefaultDest()
+ */
+public static native LLVMBasicBlockRef LLVMGetCallBrDefaultDest(LLVMValueRef CallBr);
+
+/**
+ * Get the number of indirect destinations of a CallBr instruction.
+ *
+ * @see llvm::CallBrInst::getNumIndirectDests()
+ 

+ */ +public static native @Cast("unsigned") int LLVMGetCallBrNumIndirectDests(LLVMValueRef CallBr); + +/** + * Get the indirect destination of a CallBr instruction at the given index. + * + * @see llvm::CallBrInst::getIndirectDest() + */ +public static native LLVMBasicBlockRef LLVMGetCallBrIndirectDest(LLVMValueRef CallBr, @Cast("unsigned") int Idx); + /** * \} */ @@ -4421,6 +4666,20 @@ public static native LLVMOperandBundleRef LLVMGetOperandBundleAtIndex(LLVMValueR */ public static native LLVMTypeRef LLVMGetGEPSourceElementType(LLVMValueRef GEP); +/** + * Get the no-wrap related flags for the given GEP instruction. + * + * @see llvm::GetElementPtrInst::getNoWrapFlags + */ +public static native @Cast("LLVMGEPNoWrapFlags") int LLVMGEPGetNoWrapFlags(LLVMValueRef GEP); + +/** + * Set the no-wrap related flags for the given GEP instruction. + * + * @see llvm::GetElementPtrInst::setNoWrapFlags + */ +public static native void LLVMGEPSetNoWrapFlags(LLVMValueRef GEP, @Cast("LLVMGEPNoWrapFlags") int NoWrapFlags); + /** * \} */ @@ -4505,9 +4764,28 @@ public static native void LLVMAddIncoming(LLVMValueRef PhiNode, @Cast("LLVMValue public static native LLVMBuilderRef LLVMCreateBuilderInContext(LLVMContextRef C); public static native LLVMBuilderRef LLVMCreateBuilder(); +/** + * Set the builder position before Instr but after any attached debug records, + * or if Instr is null set the position to the end of Block. + */ public static native void LLVMPositionBuilder(LLVMBuilderRef Builder, LLVMBasicBlockRef Block, LLVMValueRef Instr); +/** + * Set the builder position before Instr and any attached debug records, + * or if Instr is null set the position to the end of Block. + */ +public static native void LLVMPositionBuilderBeforeDbgRecords(LLVMBuilderRef Builder, + LLVMBasicBlockRef Block, + LLVMValueRef Inst); +/** + * Set the builder position before Instr but after any attached debug records. + */ public static native void LLVMPositionBuilderBefore(LLVMBuilderRef Builder, LLVMValueRef Instr); +/** + * Set the builder position before Instr and any attached debug records. + */ +public static native void LLVMPositionBuilderBeforeInstrAndDbgRecords(LLVMBuilderRef Builder, + LLVMValueRef Instr); public static native void LLVMPositionBuilderAtEnd(LLVMBuilderRef Builder, LLVMBasicBlockRef Block); public static native LLVMBasicBlockRef LLVMGetInsertBlock(LLVMBuilderRef Builder); public static native void LLVMClearInsertionPosition(LLVMBuilderRef Builder); @@ -4597,6 +4875,18 @@ public static native LLVMValueRef LLVMBuildSwitch(LLVMBuilderRef arg0, LLVMValue LLVMBasicBlockRef Else, @Cast("unsigned") int NumCases); public static native LLVMValueRef LLVMBuildIndirectBr(LLVMBuilderRef B, LLVMValueRef Addr, @Cast("unsigned") int NumDests); +public static native LLVMValueRef LLVMBuildCallBr(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, + LLVMBasicBlockRef DefaultDest, + @ByPtrPtr LLVMBasicBlockRef IndirectDests, + @Cast("unsigned") int NumIndirectDests, @ByPtrPtr LLVMValueRef Args, + @Cast("unsigned") int NumArgs, @ByPtrPtr LLVMOperandBundleRef Bundles, + @Cast("unsigned") int NumBundles, @Cast("const char*") BytePointer Name); +public static native LLVMValueRef LLVMBuildCallBr(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Fn, + LLVMBasicBlockRef DefaultDest, + @Cast("LLVMBasicBlockRef*") PointerPointer IndirectDests, + @Cast("unsigned") int NumIndirectDests, @Cast("LLVMValueRef*") PointerPointer Args, + @Cast("unsigned") int NumArgs, @Cast("LLVMOperandBundleRef*") PointerPointer Bundles, + @Cast("unsigned") int NumBundles, String Name); public static native LLVMValueRef LLVMBuildInvoke2(LLVMBuilderRef arg0, LLVMTypeRef Ty, LLVMValueRef Fn, @ByPtrPtr LLVMValueRef Args, @Cast("unsigned") int NumArgs, LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch, @@ -4831,10 +5121,7 @@ public static native LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef @Cast("const char*") BytePointer Name); public static native LLVMValueRef LLVMBuildNSWNeg(LLVMBuilderRef B, LLVMValueRef V, String Name); -public static native LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, - @Cast("const char*") BytePointer Name); -public static native LLVMValueRef LLVMBuildNUWNeg(LLVMBuilderRef B, LLVMValueRef V, - String Name); + public static native LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef arg0, LLVMValueRef V, @Cast("const char*") BytePointer Name); public static native LLVMValueRef LLVMBuildFNeg(LLVMBuilderRef arg0, LLVMValueRef V, String Name); public static native LLVMValueRef LLVMBuildNot(LLVMBuilderRef arg0, LLVMValueRef V, @Cast("const char*") BytePointer Name); @@ -4956,6 +5243,22 @@ public static native LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTy public static native LLVMValueRef LLVMBuildInBoundsGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, @Cast("LLVMValueRef*") PointerPointer Indices, @Cast("unsigned") int NumIndices, String Name); +/** + * Creates a GetElementPtr instruction. Similar to LLVMBuildGEP2, but allows + * specifying the no-wrap flags. + * + * @see llvm::IRBuilder::CreateGEP() + */ +public static native LLVMValueRef LLVMBuildGEPWithNoWrapFlags(LLVMBuilderRef B, LLVMTypeRef Ty, + LLVMValueRef Pointer, + @ByPtrPtr LLVMValueRef Indices, + @Cast("unsigned") int NumIndices, @Cast("const char*") BytePointer Name, + @Cast("LLVMGEPNoWrapFlags") int NoWrapFlags); +public static native LLVMValueRef LLVMBuildGEPWithNoWrapFlags(LLVMBuilderRef B, LLVMTypeRef Ty, + LLVMValueRef Pointer, + @Cast("LLVMValueRef*") PointerPointer Indices, + @Cast("unsigned") int NumIndices, String Name, + @Cast("LLVMGEPNoWrapFlags") int NoWrapFlags); public static native LLVMValueRef LLVMBuildStructGEP2(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef Pointer, @Cast("unsigned") int Idx, @Cast("const char*") BytePointer Name); @@ -8318,11 +8621,24 @@ public static native LLVMMCJITMemoryManagerRef LLVMCreateSimpleMCJITMemoryManage LLVMDWARFSourceLanguageFortran18 = 43, LLVMDWARFSourceLanguageAda2005 = 44, LLVMDWARFSourceLanguageAda2012 = 45, - LLVMDWARFSourceLanguageMojo = 46, + LLVMDWARFSourceLanguageHIP = 46, + LLVMDWARFSourceLanguageAssembly = 47, + LLVMDWARFSourceLanguageC_sharp = 48, + LLVMDWARFSourceLanguageMojo = 49, + LLVMDWARFSourceLanguageGLSL = 50, + LLVMDWARFSourceLanguageGLSL_ES = 51, + LLVMDWARFSourceLanguageHLSL = 52, + LLVMDWARFSourceLanguageOpenCL_CPP = 53, + LLVMDWARFSourceLanguageCPP_for_OpenCL = 54, + LLVMDWARFSourceLanguageSYCL = 55, + LLVMDWARFSourceLanguageRuby = 56, + LLVMDWARFSourceLanguageMove = 57, + LLVMDWARFSourceLanguageHylo = 58, + // Vendor extensions: - LLVMDWARFSourceLanguageMips_Assembler = 47, - LLVMDWARFSourceLanguageGOOGLE_RenderScript = 48, - LLVMDWARFSourceLanguageBORLAND_Delphi = 49; + LLVMDWARFSourceLanguageMips_Assembler = 59, + LLVMDWARFSourceLanguageGOOGLE_RenderScript = 60, + LLVMDWARFSourceLanguageBORLAND_Delphi = 61; /** * The amount of debug information to emit. @@ -9584,66 +9900,84 @@ public static native LLVMMetadataRef LLVMDIBuilderCreateTempGlobalVariableFwdDec LLVMMetadataRef Decl, @Cast("uint32_t") int AlignInBits); /** - * Insert a new llvm.dbg.declare intrinsic call before the given instruction. + * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). + * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes + * + * The debug format can be switched later after inserting the records using + * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons. + * + * Insert a Declare DbgRecord before the given instruction. * @param Builder The DIBuilder. * @param Storage The storage of the variable to declare. * @param VarInfo The variable's debug info descriptor. * @param Expr A complex location expression for the variable. * @param DebugLoc Debug info location. - * @param Instr Instruction acting as a location for the new intrinsic. + * @param Instr Instruction acting as a location for the new record. */ -public static native LLVMValueRef LLVMDIBuilderInsertDeclareBefore( - LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, - LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr); +public static native LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordBefore( + LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, + LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr); /** - * Insert a new llvm.dbg.declare intrinsic call at the end of the given basic - * block. If the basic block has a terminator instruction, the intrinsic is - * inserted before that terminator instruction. + * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). + * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes + * + * The debug format can be switched later after inserting the records using + * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons. + * + * Insert a Declare DbgRecord at the end of the given basic block. If the basic + * block has a terminator instruction, the record is inserted before that + * terminator instruction. * @param Builder The DIBuilder. * @param Storage The storage of the variable to declare. * @param VarInfo The variable's debug info descriptor. * @param Expr A complex location expression for the variable. * @param DebugLoc Debug info location. - * @param Block Basic block acting as a location for the new intrinsic. + * @param Block Basic block acting as a location for the new record. */ -public static native LLVMValueRef LLVMDIBuilderInsertDeclareAtEnd( +public static native LLVMDbgRecordRef LLVMDIBuilderInsertDeclareRecordAtEnd( LLVMDIBuilderRef Builder, LLVMValueRef Storage, LLVMMetadataRef VarInfo, LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block); /** - * Insert a new llvm.dbg.value intrinsic call before the given instruction. + * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). + * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes + * + * The debug format can be switched later after inserting the records using + * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons. + * + * Insert a new debug record before the given instruction. * @param Builder The DIBuilder. * @param Val The value of the variable. * @param VarInfo The variable's debug info descriptor. * @param Expr A complex location expression for the variable. * @param DebugLoc Debug info location. - * @param Instr Instruction acting as a location for the new intrinsic. + * @param Instr Instruction acting as a location for the new record. */ -public static native LLVMValueRef LLVMDIBuilderInsertDbgValueBefore(LLVMDIBuilderRef Builder, - LLVMValueRef Val, - LLVMMetadataRef VarInfo, - LLVMMetadataRef Expr, - LLVMMetadataRef DebugLoc, - LLVMValueRef Instr); +public static native LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueRecordBefore( + LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, + LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMValueRef Instr); /** - * Insert a new llvm.dbg.value intrinsic call at the end of the given basic - * block. If the basic block has a terminator instruction, the intrinsic is - * inserted before that terminator instruction. + * Only use in "new debug format" (LLVMIsNewDbgInfoFormat() is true). + * See https://llvm.org/docs/RemoveDIsDebugInfo.html#c-api-changes + * + * The debug format can be switched later after inserting the records using + * LLVMSetIsNewDbgInfoFormat, if needed for legacy or transitionary reasons. + * + * Insert a new debug record at the end of the given basic block. If the + * basic block has a terminator instruction, the record is inserted before + * that terminator instruction. * @param Builder The DIBuilder. * @param Val The value of the variable. * @param VarInfo The variable's debug info descriptor. * @param Expr A complex location expression for the variable. * @param DebugLoc Debug info location. - * @param Block Basic block acting as a location for the new intrinsic. + * @param Block Basic block acting as a location for the new record. */ -public static native LLVMValueRef LLVMDIBuilderInsertDbgValueAtEnd(LLVMDIBuilderRef Builder, - LLVMValueRef Val, - LLVMMetadataRef VarInfo, - LLVMMetadataRef Expr, - LLVMMetadataRef DebugLoc, - LLVMBasicBlockRef Block); +public static native LLVMDbgRecordRef LLVMDIBuilderInsertDbgValueRecordAtEnd( + LLVMDIBuilderRef Builder, LLVMValueRef Val, LLVMMetadataRef VarInfo, + LLVMMetadataRef Expr, LLVMMetadataRef DebugLoc, LLVMBasicBlockRef Block); /** * Create a new descriptor for a local auto variable. @@ -9998,6 +10332,9 @@ public static native LLVMMetadataRef LLVMDIBuilderCreateParameterVariable( * Represents a list of (JITDylibRef, (LLVMOrcSymbolStringPoolEntryRef*, * size_t)) pairs that can be used to construct a SymbolDependenceMap. */ +// Targeting ../LLVM/LLVMOrcCSymbolDependenceGroup.java + + /** * Lookup kind. This can be used by definition generators when deciding whether @@ -10452,6 +10789,19 @@ public static native LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyReso * that all symbols covered by this MaterializationResponsibility instance * have been emitted. * + * This function takes ownership of the symbols in the Dependencies struct. + * This allows the following pattern... + * + * LLVMOrcSymbolStringPoolEntryRef Names[] = {...}; + * LLVMOrcCDependenceMapPair Dependence = {JD, {Names, sizeof(Names)}} + * LLVMOrcMaterializationResponsibilityAddDependencies(JD, Name, &Dependence, + * 1); + * + * ... without requiring cleanup of the elements of the Names array afterwards. + * + * The client is still responsible for deleting the Dependencies.Names arrays, + * and the Dependencies array itself. + * * This method will return an error if any symbols being resolved have been * moved to the error state due to the failure of a dependency. If this * method returns an error then clients should log it and call @@ -10461,7 +10811,8 @@ public static native LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyReso * LLVMErrorSuccess. */ public static native LLVMErrorRef LLVMOrcMaterializationResponsibilityNotifyEmitted( - LLVMOrcMaterializationResponsibilityRef MR); + LLVMOrcMaterializationResponsibilityRef MR, + LLVMOrcCSymbolDependenceGroup SymbolDepGroups, @Cast("size_t") long NumSymbolDepGroups); /** * Attempt to claim responsibility for new definitions. This method can be @@ -10518,38 +10869,6 @@ public static native LLVMErrorRef LLVMOrcMaterializationResponsibilityDelegate( @Cast("LLVMOrcSymbolStringPoolEntryRef*") PointerPointer Symbols, @Cast("size_t") long NumSymbols, @Cast("LLVMOrcMaterializationResponsibilityRef*") PointerPointer Result); -/** - * Adds dependencies to a symbol that the MaterializationResponsibility is - * responsible for. - * - * This function takes ownership of Dependencies struct. The Names - * array have been retained for this function. This allows the following - * pattern... - * - * LLVMOrcSymbolStringPoolEntryRef Names[] = {...}; - * LLVMOrcCDependenceMapPair Dependence = {JD, {Names, sizeof(Names)}} - * LLVMOrcMaterializationResponsibilityAddDependencies(JD, Name, &Dependence, - * 1); - * - * ... without requiring cleanup of the elements of the Names array afterwards. - * - * The client is still responsible for deleting the Dependencies.Names array - * itself. - */ -public static native void LLVMOrcMaterializationResponsibilityAddDependencies( - LLVMOrcMaterializationResponsibilityRef MR, - LLVMOrcSymbolStringPoolEntryRef Name, - @Cast("LLVMOrcCDependenceMapPairs") LLVMOrcCDependenceMapPair Dependencies, @Cast("size_t") long NumPairs); - -/** - * Adds dependencies to all symbols that the MaterializationResponsibility is - * responsible for. See LLVMOrcMaterializationResponsibilityAddDependencies for - * notes about memory responsibility. - */ -public static native void LLVMOrcMaterializationResponsibilityAddDependenciesForAll( - LLVMOrcMaterializationResponsibilityRef MR, - @Cast("LLVMOrcCDependenceMapPairs") LLVMOrcCDependenceMapPair Dependencies, @Cast("size_t") long NumPairs); - /** * Create a "bare" JITDylib. * diff --git a/llvm/src/gen/java/org/bytedeco/llvm/global/clang.java b/llvm/src/gen/java/org/bytedeco/llvm/global/clang.java index 8bd4fd9a2c1..3d1bc79e2d2 100644 --- a/llvm/src/gen/java/org/bytedeco/llvm/global/clang.java +++ b/llvm/src/gen/java/org/bytedeco/llvm/global/clang.java @@ -2825,8 +2825,9 @@ public static class CXTUResourceUsageKind { CXCursor_ObjCSelfExpr = 146, /** OpenMP 5.0 [2.1.5, Array Section]. + * OpenACC 3.3 [2.7.1, Data Specification for Data Clauses (Sub Arrays)] */ - CXCursor_OMPArraySectionExpr = 147, + CXCursor_ArraySectionExpr = 147, /** Represents an \available(...) check. */ @@ -2856,7 +2857,7 @@ public static class CXTUResourceUsageKind { CXCursor_ConceptSpecializationExpr = 153, /** - * Expression that references a C++20 concept. + * Expression that references a C++20 requires expression. */ CXCursor_RequiresExpr = 154, @@ -2866,7 +2867,12 @@ public static class CXTUResourceUsageKind { */ CXCursor_CXXParenListInitExpr = 155, - CXCursor_LastExpr = CXCursor_CXXParenListInitExpr, + /** + * Represents a C++26 pack indexing expression. + */ + CXCursor_PackIndexingExpr = 156, + + CXCursor_LastExpr = CXCursor_PackIndexingExpr, /* Statements */ CXCursor_FirstStmt = 200, @@ -3321,7 +3327,23 @@ public static class CXTUResourceUsageKind { */ CXCursor_OMPScopeDirective = 306, - CXCursor_LastStmt = CXCursor_OMPScopeDirective, + /** OpenMP reverse directive. + */ + CXCursor_OMPReverseDirective = 307, + + /** OpenMP interchange directive. + */ + CXCursor_OMPInterchangeDirective = 308, + + /** OpenACC Compute Construct. + */ + CXCursor_OpenACCComputeConstruct = 320, + + /** OpenACC Loop Construct. + */ + CXCursor_OpenACCLoopConstruct = 321, + + CXCursor_LastStmt = CXCursor_OpenACCLoopConstruct, /** * Cursor that represents the translation unit itself. @@ -4121,6 +4143,8 @@ public static native void clang_getOverriddenCursors(@ByVal CXCursor cursor, CXCallingConv_SwiftAsync = 17, CXCallingConv_AArch64SVEPCS = 18, CXCallingConv_M68kRTD = 19, + CXCallingConv_PreserveNone = 20, + CXCallingConv_RISCVVectorCall = 21, CXCallingConv_Invalid = 100, CXCallingConv_Unexposed = 200; @@ -4865,6 +4889,57 @@ public static native long clang_Cursor_getTemplateArgumentValue(@ByVal CXCursor CX_SC_Auto = 6, CX_SC_Register = 7; +/** + * Represents a specific kind of binary operator which can appear at a cursor. + */ +/** enum CX_BinaryOperatorKind */ +public static final int + CX_BO_Invalid = 0, + CX_BO_PtrMemD = 1, + CX_BO_PtrMemI = 2, + CX_BO_Mul = 3, + CX_BO_Div = 4, + CX_BO_Rem = 5, + CX_BO_Add = 6, + CX_BO_Sub = 7, + CX_BO_Shl = 8, + CX_BO_Shr = 9, + CX_BO_Cmp = 10, + CX_BO_LT = 11, + CX_BO_GT = 12, + CX_BO_LE = 13, + CX_BO_GE = 14, + CX_BO_EQ = 15, + CX_BO_NE = 16, + CX_BO_And = 17, + CX_BO_Xor = 18, + CX_BO_Or = 19, + CX_BO_LAnd = 20, + CX_BO_LOr = 21, + CX_BO_Assign = 22, + CX_BO_MulAssign = 23, + CX_BO_DivAssign = 24, + CX_BO_RemAssign = 25, + CX_BO_AddAssign = 26, + CX_BO_SubAssign = 27, + CX_BO_ShlAssign = 28, + CX_BO_ShrAssign = 29, + CX_BO_AndAssign = 30, + CX_BO_XorAssign = 31, + CX_BO_OrAssign = 32, + CX_BO_Comma = 33, + CX_BO_LAST = CX_BO_Comma; + +/** + * \brief Returns the operator code for the binary operator. + */ +public static native @Cast("CX_BinaryOperatorKind") int clang_Cursor_getBinaryOpcode(@ByVal CXCursor C); + +/** + * \brief Returns a string containing the spelling of the binary operator. + */ +public static native @ByVal CXString clang_Cursor_getBinaryOpcodeStr(@Cast("CX_BinaryOperatorKind") int Op); + /** * Returns the storage class for a function or variable declaration. * diff --git a/llvm/src/main/java/org/bytedeco/llvm/presets/LLVM.java b/llvm/src/main/java/org/bytedeco/llvm/presets/LLVM.java index 991df182651..050626ba280 100644 --- a/llvm/src/main/java/org/bytedeco/llvm/presets/LLVM.java +++ b/llvm/src/main/java/org/bytedeco/llvm/presets/LLVM.java @@ -38,7 +38,7 @@ "", "", /*"", "", "", "", "", "", "", "",*/ "", "", "", "", ""}, - compiler = "cpp17", link = {"LLVM@.18.1", "LTO@.18.1", "Remarks@.18.1"}, resource = {"include", "lib", "libexec", "share"}), + compiler = "cpp17", link = {"LLVM@.19.1", "LTO@.19.1", "Remarks@.19.1"}, resource = {"include", "lib", "libexec", "share"}), @Platform(value = "macosx", link = {"LLVM", "LTO", "Remarks"}), @Platform(value = "windows", link = {"Ws2_32", "LLVM", "LTO", "Remarks"})}) @NoException @@ -58,6 +58,7 @@ public static synchronized File cachePackage() throws IOException { public void map(InfoMap infoMap) { infoMap.put(new Info("LLVMOpaqueContext").pointerTypes("LLVMContextRef")) + .put(new Info("LLVMOpaqueDbgRecord").pointerTypes("LLVMDbgRecordRef")) .put(new Info("LLVMOpaqueModule").pointerTypes("LLVMModuleRef")) .put(new Info("LLVMOpaqueType").pointerTypes("LLVMTypeRef")) .put(new Info("LLVMOpaqueValue").pointerTypes("LLVMValueRef")) @@ -124,6 +125,7 @@ public void map(InfoMap infoMap) { .put(new Info("LLVMOpaquePassBuilderOptions").pointerTypes("LLVMPassBuilderOptionsRef")) .put(new Info("LLVMContextRef").valueTypes("LLVMContextRef").pointerTypes("@ByPtrPtr LLVMContextRef", "@Cast(\"LLVMContextRef*\") PointerPointer")) + .put(new Info("LLVMDbgRecordRef").valueTypes("LLVMDbgRecordRef").pointerTypes("@ByPtrPtr LLVMDbgRecordRef", "@Cast(\"LLVMDbgRecordRef*\") PointerPointer")) .put(new Info("LLVMModuleRef").valueTypes("LLVMModuleRef").pointerTypes("@ByPtrPtr LLVMModuleRef", "@Cast(\"LLVMModuleRef*\") PointerPointer")) .put(new Info("LLVMTypeRef").valueTypes("LLVMTypeRef").pointerTypes("@ByPtrPtr LLVMTypeRef", "@Cast(\"LLVMTypeRef*\") PointerPointer")) .put(new Info("LLVMValueRef").valueTypes("LLVMValueRef").pointerTypes("@ByPtrPtr LLVMValueRef", "@Cast(\"LLVMValueRef*\") PointerPointer")) diff --git a/llvm/src/main/java/org/bytedeco/llvm/presets/clang.java b/llvm/src/main/java/org/bytedeco/llvm/presets/clang.java index 3342f5ddb70..75fea34dffc 100644 --- a/llvm/src/main/java/org/bytedeco/llvm/presets/clang.java +++ b/llvm/src/main/java/org/bytedeco/llvm/presets/clang.java @@ -30,7 +30,7 @@ include = {"", "", "", "", "", "", "", "", "", ""}, - compiler = "cpp17", link = "clang@.18.1"), @Platform(value = "windows", link = "libclang") }) + compiler = "cpp17", link = "clang@.19.1"), @Platform(value = "windows", link = "libclang") }) @NoException public class clang implements InfoMapper { public void map(InfoMap infoMap) { diff --git a/llvm/src/main/java/org/bytedeco/llvm/program/clang.java b/llvm/src/main/java/org/bytedeco/llvm/program/clang.java index 74d3458f7ac..ca2a2b6f8b3 100644 --- a/llvm/src/main/java/org/bytedeco/llvm/program/clang.java +++ b/llvm/src/main/java/org/bytedeco/llvm/program/clang.java @@ -41,7 +41,7 @@ value = { @Platform( value = {"linux", "macosx", "windows"}, - preload = {"LLVM@.18.1", "clang-cpp@.18.1"}, + preload = {"LLVM@.19.1", "clang-cpp@.19.1"}, executable = { "clang", "clang-check", diff --git a/numpy/cppbuild.sh b/numpy/cppbuild.sh index 7fba132c02d..13b8b566367 100755 --- a/numpy/cppbuild.sh +++ b/numpy/cppbuild.sh @@ -62,15 +62,15 @@ echo "libraries = openblas" >> site.cfg echo "library_dirs = $OPENBLAS_PATH/lib/" >> site.cfg echo "include_dirs = $OPENBLAS_PATH/include/" >> site.cfg -if [[ -f "$CPYTHON_PATH/include/python3.12/Python.h" ]]; then +if [[ -f "$CPYTHON_PATH/include/python3.13/Python.h" ]]; then # setup.py won't pick up the right libgfortran.so without this export LD_LIBRARY_PATH="$OPENBLAS_PATH/lib/:$CPYTHON_PATH/lib/" - export PATH="$CPYTHON_PATH/lib/python3.12/bin/:$PATH" - export PYTHON_BIN_PATH="$CPYTHON_PATH/bin/python3.12" - export PYTHON_INCLUDE_PATH="$CPYTHON_PATH/include/python3.12/" - export PYTHON_LIB_PATH="$CPYTHON_PATH/lib/python3.12/" - export PYTHON_INSTALL_PATH="$INSTALL_PATH/lib/python3.12/site-packages/" - export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.12/site-packages/pip/_vendor/certifi/cacert.pem" + export PATH="$CPYTHON_PATH/lib/python3.13/bin/:$PATH" + export PYTHON_BIN_PATH="$CPYTHON_PATH/bin/python3.13" + export PYTHON_INCLUDE_PATH="$CPYTHON_PATH/include/python3.13/" + export PYTHON_LIB_PATH="$CPYTHON_PATH/lib/python3.13/" + export PYTHON_INSTALL_PATH="$INSTALL_PATH/lib/python3.13/site-packages/" + export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.13/site-packages/pip/_vendor/certifi/cacert.pem" chmod +x "$PYTHON_BIN_PATH" elif [[ -f "$CPYTHON_PATH/include/Python.h" ]]; then CPYTHON_PATH=$(cygpath $CPYTHON_PATH) @@ -88,17 +88,17 @@ mkdir -p "$PYTHON_INSTALL_PATH" TOOLS="setuptools==67.6.1 cython==3.0.10" if ! $PYTHON_BIN_PATH -m pip install --target=$PYTHON_LIB_PATH $TOOLS; then echo "extra_link_args = -lgfortran" >> site.cfg - chmod +x "$CPYTHON_HOST_PATH/bin/python3.12" + chmod +x "$CPYTHON_HOST_PATH/bin/python3.13" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CPYTHON_HOST_PATH/lib/:$CPYTHON_HOST_PATH" # crossenv 1.4 for python 3.11+ support. # See https://github.com/bytedeco/javacpp-presets/issues/1381 - "$CPYTHON_HOST_PATH/bin/python3.12" -m pip install --target="$CPYTHON_HOST_PATH/lib/python3.12/" crossenv==1.4 $TOOLS - "$CPYTHON_HOST_PATH/bin/python3.12" -m crossenv "$PYTHON_BIN_PATH" crossenv + "$CPYTHON_HOST_PATH/bin/python3.13" -m pip install --target="$CPYTHON_HOST_PATH/lib/python3.13/" crossenv==1.4 $TOOLS + "$CPYTHON_HOST_PATH/bin/python3.13" -m crossenv "$PYTHON_BIN_PATH" crossenv source crossenv/bin/activate cross-expose cython - chmod +x $CPYTHON_HOST_PATH/lib/python3.12/bin/* - export PATH="$CPYTHON_HOST_PATH/lib/python3.12/bin/:$PATH" + chmod +x $CPYTHON_HOST_PATH/lib/python3.13/bin/* + export PATH="$CPYTHON_HOST_PATH/lib/python3.13/bin/:$PATH" export PYTHON_BIN_PATH="python" fi diff --git a/numpy/platform/pom.xml b/numpy/platform/pom.xml index 959598de487..e1079a74ac5 100644 --- a/numpy/platform/pom.xml +++ b/numpy/platform/pom.xml @@ -28,7 +28,7 @@ org.bytedeco cpython-platform - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} ${project.groupId} diff --git a/numpy/pom.xml b/numpy/pom.xml index e68fb8f4c3d..25c7719821e 100644 --- a/numpy/pom.xml +++ b/numpy/pom.xml @@ -23,7 +23,7 @@ org.bytedeco cpython - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} org.bytedeco @@ -51,7 +51,7 @@ org.bytedeco cpython - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} org.bytedeco @@ -62,7 +62,7 @@ org.bytedeco cpython - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} ${javacpp.platform} @@ -80,7 +80,7 @@ ${basedir}/../cpython/src/main/resources/org/bytedeco/cpython/include/ ${basedir}/../cpython/target/classes/org/bytedeco/cpython/include/ ${basedir}/../cpython/cppbuild/${javacpp.platform}/include/ - ${basedir}/../cpython/cppbuild/${javacpp.platform}/include/python3.12/ + ${basedir}/../cpython/cppbuild/${javacpp.platform}/include/python3.13/ ${basedir}/cppbuild/${javacpp.platform}/python/numpy/_core/include/ ${basedir}/cppbuild/${javacpp.platform}/python/numpy/_core/include/numpy/ @@ -107,7 +107,7 @@ /org/bytedeco/openblas/${javacpp.platform}/include/ /org/bytedeco/cpython/include/ /org/bytedeco/cpython/${javacpp.platform}/include/ - /org/bytedeco/cpython/${javacpp.platform}/include/python3.12/ + /org/bytedeco/cpython/${javacpp.platform}/include/python3.13/ /${javacpp.platform.library.path}/ @@ -171,7 +171,7 @@ org.bytedeco cpython - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} ${os.name}-${os.arch} diff --git a/onnx/cppbuild.sh b/onnx/cppbuild.sh index f4a3cae134a..270aaba0b9a 100755 --- a/onnx/cppbuild.sh +++ b/onnx/cppbuild.sh @@ -53,13 +53,13 @@ fi CPYTHON_PATH="${CPYTHON_PATH//\\//}" -if [[ -f "$CPYTHON_PATH/include/python3.12/Python.h" ]]; then +if [[ -f "$CPYTHON_PATH/include/python3.13/Python.h" ]]; then export LD_LIBRARY_PATH="$CPYTHON_PATH/lib/" - export PYTHON_BIN_PATH="$CPYTHON_PATH/bin/python3.12" - export PYTHON_INCLUDE_PATH="$CPYTHON_PATH/include/python3.12/" - export PYTHON_LIB_PATH="$CPYTHON_PATH/lib/python3.12/" - export PYTHON_INSTALL_PATH="$INSTALL_PATH/lib/python3.12/site-packages/" - export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.12/site-packages/pip/_vendor/certifi/cacert.pem" + export PYTHON_BIN_PATH="$CPYTHON_PATH/bin/python3.13" + export PYTHON_INCLUDE_PATH="$CPYTHON_PATH/include/python3.13/" + export PYTHON_LIB_PATH="$CPYTHON_PATH/lib/python3.13/" + export PYTHON_INSTALL_PATH="$INSTALL_PATH/lib/python3.13/site-packages/" + export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.13/site-packages/pip/_vendor/certifi/cacert.pem" chmod +x "$PYTHON_BIN_PATH" elif [[ -f "$CPYTHON_PATH/include/Python.h" ]]; then CPYTHON_PATH=$(cygpath $CPYTHON_PATH) diff --git a/onnx/platform/pom.xml b/onnx/platform/pom.xml index 1714ddd5175..038339ff786 100644 --- a/onnx/platform/pom.xml +++ b/onnx/platform/pom.xml @@ -28,7 +28,7 @@ org.bytedeco cpython-platform - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} true diff --git a/onnx/pom.xml b/onnx/pom.xml index 90c85836986..91d50868d21 100644 --- a/onnx/pom.xml +++ b/onnx/pom.xml @@ -22,7 +22,7 @@ org.bytedeco cpython - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} true @@ -42,7 +42,7 @@ org.bytedeco cpython-platform - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} diff --git a/opencv/cppbuild.sh b/opencv/cppbuild.sh index 015f223cae7..cd9fdb5432e 100755 --- a/opencv/cppbuild.sh +++ b/opencv/cppbuild.sh @@ -45,13 +45,13 @@ export PYTHON3_EXECUTABLE= export PYTHON3_INCLUDE_DIR= export PYTHON3_LIBRARY= export PYTHON3_PACKAGES_PATH= -if [[ -f "$CPYTHON_PATH/include/python3.12/Python.h" ]]; then +if [[ -f "$CPYTHON_PATH/include/python3.13/Python.h" ]]; then export LD_LIBRARY_PATH="$OPENBLAS_PATH/lib/:$CPYTHON_PATH/lib/:$NUMPY_PATH/lib/:${LD_LIBRARY_PATH:-}" - export PYTHON3_EXECUTABLE="$CPYTHON_PATH/bin/python3.12" - export PYTHON3_INCLUDE_DIR="$CPYTHON_PATH/include/python3.12/" - export PYTHON3_LIBRARY="$CPYTHON_PATH/lib/python3.12/" - export PYTHON3_PACKAGES_PATH="$INSTALL_PATH/lib/python3.12/site-packages/" - export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.12/site-packages/pip/_vendor/certifi/cacert.pem" + export PYTHON3_EXECUTABLE="$CPYTHON_PATH/bin/python3.13" + export PYTHON3_INCLUDE_DIR="$CPYTHON_PATH/include/python3.13/" + export PYTHON3_LIBRARY="$CPYTHON_PATH/lib/python3.13/" + export PYTHON3_PACKAGES_PATH="$INSTALL_PATH/lib/python3.13/site-packages/" + export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.13/site-packages/pip/_vendor/certifi/cacert.pem" chmod +x "$PYTHON3_EXECUTABLE" elif [[ -f "$CPYTHON_PATH/include/Python.h" ]]; then CPYTHON_PATH=$(cygpath $CPYTHON_PATH) @@ -60,7 +60,7 @@ elif [[ -f "$CPYTHON_PATH/include/Python.h" ]]; then export PATH="$OPENBLAS_PATH:$CPYTHON_PATH:$NUMPY_PATH:$PATH" export PYTHON3_EXECUTABLE="$CPYTHON_PATH/bin/python.exe" export PYTHON3_INCLUDE_DIR="$CPYTHON_PATH/include/" - export PYTHON3_LIBRARY="$CPYTHON_PATH/libs/python312.lib" + export PYTHON3_LIBRARY="$CPYTHON_PATH/libs/python313.lib" export PYTHON3_PACKAGES_PATH="$INSTALL_PATH/lib/site-packages/" export SSL_CERT_FILE="$CPYTHON_PATH/lib/pip/_vendor/certifi/cacert.pem" fi @@ -116,9 +116,9 @@ sedinplace 's/PythonInterp "${min_version}"/PythonInterp/g' cmake/OpenCVDetectPy sedinplace 's/PythonLibs "${_version_major_minor}.${_version_patch}" EXACT/PythonLibs/g' cmake/OpenCVDetectPython.cmake sedinplace '/if(PYTHONINTERP_FOUND)/a\ if(" ${_python_version_major}" STREQUAL " 3")\ - set(PYTHON_VERSION_STRING "3.12")\ + set(PYTHON_VERSION_STRING "3.13")\ set(PYTHON_VERSION_MAJOR "3")\ - set(PYTHON_VERSION_MINOR "12")\ + set(PYTHON_VERSION_MINOR "13")\ endif()\ ' cmake/OpenCVDetectPython.cmake sedinplace '/execute_process/{N;N;N;d;}' cmake/OpenCVDetectPython.cmake diff --git a/platform/pom.xml b/platform/pom.xml index a2858f5cd45..db4f43e431b 100644 --- a/platform/pom.xml +++ b/platform/pom.xml @@ -92,7 +92,7 @@ org.bytedeco ffmpeg-platform - 7.0.2-${project.version} + 7.1-${project.version} @@ -212,7 +212,7 @@ org.bytedeco cpython-platform - 3.12.7-${project.version} + 3.13.0-${project.version} org.bytedeco @@ -232,7 +232,7 @@ org.bytedeco llvm-platform - 18.1.8-${project.version} + 19.1.2-${project.version} org.bytedeco diff --git a/pytorch/cppbuild.sh b/pytorch/cppbuild.sh index ee70d1d7c66..3512f84a4de 100755 --- a/pytorch/cppbuild.sh +++ b/pytorch/cppbuild.sh @@ -38,7 +38,7 @@ if [[ $PLATFORM == windows* ]]; then export PYTHON_BIN_PATH=$(which python.exe) fi -PYTORCH_VERSION=2.4.0 +PYTORCH_VERSION=2.4.1 export PYTORCH_BUILD_VERSION="$PYTORCH_VERSION" export PYTORCH_BUILD_NUMBER=1 @@ -104,14 +104,14 @@ OPENBLAS_PATH="${OPENBLAS_PATH//\\//}" NUMPY_PATH="${NUMPY_PATH//\\//}" CPYTHON_PATH="$CPYTHON_HOST_PATH" -if [[ -f "$CPYTHON_PATH/include/python3.12/Python.h" ]]; then +if [[ -f "$CPYTHON_PATH/include/python3.13/Python.h" ]]; then # setup.py won't pick up the right libgfortran.so without this export LD_LIBRARY_PATH="$OPENBLAS_PATH/lib/:$CPYTHON_PATH/lib/:$NUMPY_PATH/lib/" - export PYTHON_BIN_PATH="$CPYTHON_PATH/bin/python3.12" - export PYTHON_INCLUDE_PATH="$CPYTHON_PATH/include/python3.12/" - export PYTHON_LIB_PATH="$CPYTHON_PATH/lib/python3.12/" - export PYTHON_INSTALL_PATH="$INSTALL_PATH/lib/python3.12/site-packages/" - export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.12/site-packages/pip/_vendor/certifi/cacert.pem" + export PYTHON_BIN_PATH="$CPYTHON_PATH/bin/python3.13" + export PYTHON_INCLUDE_PATH="$CPYTHON_PATH/include/python3.13/" + export PYTHON_LIB_PATH="$CPYTHON_PATH/lib/python3.13/" + export PYTHON_INSTALL_PATH="$INSTALL_PATH/lib/python3.13/site-packages/" + export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.13/site-packages/pip/_vendor/certifi/cacert.pem" chmod +x "$PYTHON_BIN_PATH" elif [[ -f "$CPYTHON_PATH/include/Python.h" ]]; then CPYTHON_PATH=$(cygpath $CPYTHON_PATH) diff --git a/pytorch/pom.xml b/pytorch/pom.xml index 79e8b96d9ff..3b1a9856d95 100644 --- a/pytorch/pom.xml +++ b/pytorch/pom.xml @@ -62,7 +62,7 @@ org.bytedeco cpython - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} ${os.name}-${os.arch} diff --git a/scipy/cppbuild.sh b/scipy/cppbuild.sh index 2bcb90dc0c4..de81153f9d6 100755 --- a/scipy/cppbuild.sh +++ b/scipy/cppbuild.sh @@ -92,15 +92,15 @@ echo "libraries = openblas" >> site.cfg echo "library_dirs = $OPENBLAS_PATH/lib/" >> site.cfg echo "include_dirs = $OPENBLAS_PATH/include/" >> site.cfg -if [[ -f "$CPYTHON_PATH/include/python3.12/Python.h" ]]; then +if [[ -f "$CPYTHON_PATH/include/python3.13/Python.h" ]]; then # setup.py won't pick up the right libgfortran.so without this export LD_LIBRARY_PATH="$OPENBLAS_PATH/lib/:$CPYTHON_PATH/lib/:$NUMPY_PATH/lib/" - export PATH="$CPYTHON_PATH/lib/python3.12/bin/:$PATH" - export PYTHON_BIN_PATH="$CPYTHON_PATH/bin/python3.12" - export PYTHON_INCLUDE_PATH="$CPYTHON_PATH/include/python3.12/" - export PYTHON_LIB_PATH="$CPYTHON_PATH/lib/python3.12/" - export PYTHON_INSTALL_PATH="$INSTALL_PATH/lib/python3.12/site-packages/" - export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.12/site-packages/pip/_vendor/certifi/cacert.pem" + export PATH="$CPYTHON_PATH/lib/python3.13/bin/:$PATH" + export PYTHON_BIN_PATH="$CPYTHON_PATH/bin/python3.13" + export PYTHON_INCLUDE_PATH="$CPYTHON_PATH/include/python3.13/" + export PYTHON_LIB_PATH="$CPYTHON_PATH/lib/python3.13/" + export PYTHON_INSTALL_PATH="$INSTALL_PATH/lib/python3.13/site-packages/" + export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.13/site-packages/pip/_vendor/certifi/cacert.pem" chmod +x "$PYTHON_BIN_PATH" elif [[ -f "$CPYTHON_PATH/include/Python.h" ]]; then CPYTHON_PATH=$(cygpath $CPYTHON_PATH) @@ -122,28 +122,28 @@ export SCIPY_USE_PYTHRAN=0 TOOLS="setuptools==67.6.1 cython==3.0.10" if ! $PYTHON_BIN_PATH -m pip install --no-deps --target=$PYTHON_LIB_PATH $TOOLS; then echo "extra_link_args = -lgfortran" >> site.cfg - chmod +x "$CPYTHON_HOST_PATH/bin/python3.12" + chmod +x "$CPYTHON_HOST_PATH/bin/python3.13" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$CPYTHON_HOST_PATH/lib/:$CPYTHON_HOST_PATH" - "$CPYTHON_HOST_PATH/bin/python3.12" -m pip install --no-deps --target="$CPYTHON_HOST_PATH/lib/python3.12/" crossenv==1.4 numpy==2.1.2 $TOOLS - "$CPYTHON_HOST_PATH/bin/python3.12" -m crossenv "$PYTHON_BIN_PATH" crossenv - cp -a "$NUMPY_PATH/python/numpy" "$CPYTHON_HOST_PATH/lib/python3.12/" -# cp -a "$CPYTHON_HOST_PATH/lib/python3.12/include" "$PYTHON_LIB_PATH" + "$CPYTHON_HOST_PATH/bin/python3.13" -m pip install --no-deps --target="$CPYTHON_HOST_PATH/lib/python3.13/" crossenv==1.4 numpy==2.1.2 $TOOLS + "$CPYTHON_HOST_PATH/bin/python3.13" -m crossenv "$PYTHON_BIN_PATH" crossenv + cp -a "$NUMPY_PATH/python/numpy" "$CPYTHON_HOST_PATH/lib/python3.13/" +# cp -a "$CPYTHON_HOST_PATH/lib/python3.13/include" "$PYTHON_LIB_PATH" source crossenv/bin/activate cross-expose cython numpy pybind11 pythran - chmod +x $CPYTHON_HOST_PATH/lib/python3.12/bin/* - export PATH="$CPYTHON_HOST_PATH/lib/python3.12/bin/:$PATH" + chmod +x $CPYTHON_HOST_PATH/lib/python3.13/bin/* + export PATH="$CPYTHON_HOST_PATH/lib/python3.13/bin/:$PATH" export PYTHON_BIN_PATH="python" export NUMPY_MADVISE_HUGEPAGE=1 # For some reason, setup.py fails on Linux if the Python installation is not at its original prefix - PREFIX_HOST_PATH=$(sed -n 's/^prefix="\(.*\)"/\1/p' $CPYTHON_HOST_PATH/bin/python3.12-config) + PREFIX_HOST_PATH=$(sed -n 's/^prefix="\(.*\)"/\1/p' $CPYTHON_HOST_PATH/bin/python3.13-config) mkdir -p $PREFIX_HOST_PATH cp -a $CPYTHON_HOST_PATH/* $PREFIX_HOST_PATH fi if [[ $PLATFORM == linux* ]]; then # For some reason, setup.py fails on Linux if the Python installation is not at its original prefix - PREFIX_PATH=$(sed -n 's/^prefix="\(.*\)"/\1/p' $CPYTHON_PATH/bin/python3.12-config) + PREFIX_PATH=$(sed -n 's/^prefix="\(.*\)"/\1/p' $CPYTHON_PATH/bin/python3.13-config) mkdir -p $PREFIX_PATH cp -a $CPYTHON_PATH/* $PREFIX_PATH fi diff --git a/scipy/pom.xml b/scipy/pom.xml index eb8318852a7..e62252eceaf 100644 --- a/scipy/pom.xml +++ b/scipy/pom.xml @@ -52,7 +52,7 @@ org.bytedeco cpython - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} ${javacpp.platform} @@ -77,7 +77,7 @@ ${basedir}/../cpython/src/main/resources/org/bytedeco/cpython/include/ ${basedir}/../cpython/target/classes/org/bytedeco/cpython/include/ ${basedir}/../cpython/cppbuild/${javacpp.platform}/include/ - ${basedir}/../cpython/cppbuild/${javacpp.platform}/include/python3.12/ + ${basedir}/../cpython/cppbuild/${javacpp.platform}/include/python3.13/ ${basedir}/../numpy/src/main/resources/org/bytedeco/numpy/include/ ${basedir}/../numpy/target/classes/org/bytedeco/numpy/include/ ${basedir}/../numpy/cppbuild/${javacpp.platform}/python/numpy/_core/include/ @@ -108,7 +108,7 @@ /org/bytedeco/openblas/${javacpp.platform}/include/ /org/bytedeco/cpython/include/ /org/bytedeco/cpython/${javacpp.platform}/include/ - /org/bytedeco/cpython/${javacpp.platform}/include/python3.12/ + /org/bytedeco/cpython/${javacpp.platform}/include/python3.13/ /org/bytedeco/numpy/include/ /org/bytedeco/numpy/${javacpp.platform}/python/numpy/_core/include/ /org/bytedeco/numpy/${javacpp.platform}/python/numpy/_core/include/numpy/ @@ -177,7 +177,7 @@ org.bytedeco cpython - 3.12.7-${project.parent.version} + 3.13.0-${project.parent.version} ${os.name}-${os.arch} diff --git a/tvm/cppbuild.sh b/tvm/cppbuild.sh index 13946455123..6ca89c7722e 100755 --- a/tvm/cppbuild.sh +++ b/tvm/cppbuild.sh @@ -114,24 +114,24 @@ if [[ -f $f ]]; then chmod +x $LLVM_PATH/bin/llvm-config* fi if [[ -f "$LLVM_PATH/lib/libLLVM.dylib" ]]; then - ln -sf libLLVM.dylib $LLVM_PATH/lib/libLLVM-18.dylib + ln -sf libLLVM.dylib $LLVM_PATH/lib/libLLVM-19.dylib fi if [[ -f "$LLVM_PATH/lib/libLLVM.so" ]]; then - ln -sf libLLVM.so $LLVM_PATH/lib/libLLVM-18.so + ln -sf libLLVM.so $LLVM_PATH/lib/libLLVM-19.so fi if [[ -f "$LLVM_PATH/lib/LTO.lib" ]]; then ln -sf LTO.lib $LLVM_PATH/lib/LLVM.lib fi -if [[ -f "$CPYTHON_PATH/include/python3.12/Python.h" ]]; then +if [[ -f "$CPYTHON_PATH/include/python3.13/Python.h" ]]; then # setup.py won't pick up the right libgfortran.so without this export LD_LIBRARY_PATH="$OPENBLAS_PATH/lib/:$CPYTHON_PATH/lib/:$NUMPY_PATH/lib/:$SCIPY_PATH/lib/" - export PATH="$CPYTHON_PATH/lib/python3.12/bin/:$PATH" - export PYTHON_BIN_PATH="$CPYTHON_PATH/bin/python3.12" - export PYTHON_INCLUDE_PATH="$CPYTHON_PATH/include/python3.12/" - export PYTHON_LIB_PATH="$CPYTHON_PATH/lib/python3.12/" - export PYTHON_INSTALL_PATH="$INSTALL_PATH/lib/python3.12/site-packages/" - export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.12/site-packages/pip/_vendor/certifi/cacert.pem" + export PATH="$CPYTHON_PATH/lib/python3.13/bin/:$PATH" + export PYTHON_BIN_PATH="$CPYTHON_PATH/bin/python3.13" + export PYTHON_INCLUDE_PATH="$CPYTHON_PATH/include/python3.13/" + export PYTHON_LIB_PATH="$CPYTHON_PATH/lib/python3.13/" + export PYTHON_INSTALL_PATH="$INSTALL_PATH/lib/python3.13/site-packages/" + export SSL_CERT_FILE="$CPYTHON_PATH/lib/python3.13/site-packages/pip/_vendor/certifi/cacert.pem" chmod +x "$PYTHON_BIN_PATH" elif [[ -f "$CPYTHON_PATH/include/Python.h" ]]; then CPYTHON_PATH=$(cygpath $CPYTHON_PATH) diff --git a/tvm/platform/gpu/pom.xml b/tvm/platform/gpu/pom.xml index 599bcde2e91..179d21e76ba 100644 --- a/tvm/platform/gpu/pom.xml +++ b/tvm/platform/gpu/pom.xml @@ -29,7 +29,7 @@ org.bytedeco llvm-platform - 18.1.8-${project.parent.version} + 19.1.2-${project.parent.version} org.bytedeco diff --git a/tvm/platform/pom.xml b/tvm/platform/pom.xml index 3c993c7eaaa..6db8921277e 100644 --- a/tvm/platform/pom.xml +++ b/tvm/platform/pom.xml @@ -28,7 +28,7 @@ org.bytedeco llvm-platform - 18.1.8-${project.parent.version} + 19.1.2-${project.parent.version} org.bytedeco diff --git a/tvm/pom.xml b/tvm/pom.xml index af4ddbcfcf9..a3ce6a8bbb8 100644 --- a/tvm/pom.xml +++ b/tvm/pom.xml @@ -23,7 +23,7 @@ org.bytedeco llvm - 18.1.8-${project.parent.version} + 19.1.2-${project.parent.version} org.bytedeco @@ -61,7 +61,7 @@ org.bytedeco llvm-platform - 18.1.8-${project.parent.version} + 19.1.2-${project.parent.version} org.bytedeco @@ -101,7 +101,7 @@ ${basedir}/../cpython/src/main/resources/org/bytedeco/cpython/include/ ${basedir}/../cpython/target/classes/org/bytedeco/cpython/include/ ${basedir}/../cpython/cppbuild/${javacpp.platform}/include/ - ${basedir}/../cpython/cppbuild/${javacpp.platform}/include/python3.12/ + ${basedir}/../cpython/cppbuild/${javacpp.platform}/include/python3.13/ ${basedir}/../numpy/src/main/resources/org/bytedeco/numpy/include/ ${basedir}/../numpy/target/classes/org/bytedeco/numpy/include/ ${basedir}/../numpy/cppbuild/${javacpp.platform}/python/numpy/_core/include/ @@ -149,7 +149,7 @@ /org/bytedeco/openblas/${javacpp.platform}/include/ /org/bytedeco/cpython/include/ /org/bytedeco/cpython/${javacpp.platform}/include/ - /org/bytedeco/cpython/${javacpp.platform}/include/python3.12/ + /org/bytedeco/cpython/${javacpp.platform}/include/python3.13/ /org/bytedeco/numpy/include/ /org/bytedeco/numpy/${javacpp.platform}/python/numpy/_core/include/ /org/bytedeco/numpy/${javacpp.platform}/python/numpy/_core/include/numpy/