pytron-kit 0.3.12__py3-none-macosx_11_0_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pytron/__init__.py +112 -0
- pytron/application.py +562 -0
- pytron/apputils/__init__.py +0 -0
- pytron/apputils/chrome_ipc.py +203 -0
- pytron/apputils/codegen.py +261 -0
- pytron/apputils/config.py +303 -0
- pytron/apputils/deadmansswitch.py +47 -0
- pytron/apputils/extras.py +76 -0
- pytron/apputils/native.py +148 -0
- pytron/apputils/shell.py +73 -0
- pytron/apputils/windows.py +286 -0
- pytron/cli.py +384 -0
- pytron/commands/__init__.py +0 -0
- pytron/commands/android.py +28 -0
- pytron/commands/build.py +26 -0
- pytron/commands/doctor.py +221 -0
- pytron/commands/engine.py +23 -0
- pytron/commands/frontend.py +60 -0
- pytron/commands/harvest.py +112 -0
- pytron/commands/helpers.py +239 -0
- pytron/commands/info.py +50 -0
- pytron/commands/init.py +521 -0
- pytron/commands/install.py +294 -0
- pytron/commands/login.py +130 -0
- pytron/commands/package.py +228 -0
- pytron/commands/plugin.py +442 -0
- pytron/commands/run.py +312 -0
- pytron/commands/scan.py +210 -0
- pytron/commands/show.py +23 -0
- pytron/commands/uninstall.py +150 -0
- pytron/commands/utils.py +42 -0
- pytron/commands/workflow.py +95 -0
- pytron/console.py +133 -0
- pytron/core.py +18 -0
- pytron/dependencies/WebView2Loader.dll +0 -0
- pytron/dependencies/__init__.py +1 -0
- pytron/dependencies/pytron_native.so +0 -0
- pytron/engines/chrome/adapter.py +445 -0
- pytron/engines/chrome/engine.py +576 -0
- pytron/engines/chrome/forge.py +147 -0
- pytron/engines/chrome/shell/package.json +8 -0
- pytron/engines/chrome/shell/preload.js +12 -0
- pytron/engines/chrome/shell/shell.js +534 -0
- pytron/exceptions.py +36 -0
- pytron/inspector.py +201 -0
- pytron/inspector_ui.py +512 -0
- pytron/installer/Installation.nsi +236 -0
- pytron/installer/header.bmp +0 -0
- pytron/installer/pytron.ico +0 -0
- pytron/installer/sidebar.bmp +0 -0
- pytron/llms.md +98 -0
- pytron/manifests/README.md +29 -0
- pytron/manifests/windows-utf8.manifest +44 -0
- pytron/menu.py +128 -0
- pytron/nsis-setup.exe +0 -0
- pytron/pack/__init__.py +0 -0
- pytron/pack/assets.py +131 -0
- pytron/pack/compilers.py +289 -0
- pytron/pack/crystal.py +297 -0
- pytron/pack/graph.py +377 -0
- pytron/pack/inference.py +157 -0
- pytron/pack/installers.py +402 -0
- pytron/pack/introspect.py +357 -0
- pytron/pack/metadata.py +213 -0
- pytron/pack/modules.py +618 -0
- pytron/pack/nuitka.py +108 -0
- pytron/pack/pipeline.py +107 -0
- pytron/pack/pyinstaller.py +176 -0
- pytron/pack/rust_engine.py +273 -0
- pytron/pack/secure.py +309 -0
- pytron/pack/secure_loader/bin/pytron_rust_bootloader +0 -0
- pytron/pack/secure_loader/icon.ico +0 -0
- pytron/pack/utils.py +110 -0
- pytron/pack/virtual_root.py +124 -0
- pytron/platforms/__init__.py +0 -0
- pytron/platforms/android/__init__.py +3 -0
- pytron/platforms/android/android.py +103 -0
- pytron/platforms/android/builder.py +736 -0
- pytron/platforms/android/ops/build.py +79 -0
- pytron/platforms/android/ops/init.py +63 -0
- pytron/platforms/android/ops/run.py +79 -0
- pytron/platforms/android/ops/sync.py +770 -0
- pytron/platforms/android/ops/utils.py +8 -0
- pytron/platforms/android/shell/README.md +30 -0
- pytron/platforms/android/shell/app/build.gradle +64 -0
- pytron/platforms/android/shell/app/src/main/AndroidManifest.xml +29 -0
- pytron/platforms/android/shell/app/src/main/assets/python/main.py +86 -0
- pytron/platforms/android/shell/app/src/main/assets/python/python314.zip +0 -0
- pytron/platforms/android/shell/app/src/main/cpp/CMakeLists.txt +25 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/Python.h +155 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/abstract.h +915 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/audit.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bltinmodule.h +14 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/boolobject.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bytearrayobject.h +44 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/bytesobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/ceval.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/codecs.h +176 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/compile.h +22 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/complexobject.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/abstract.h +104 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/audit.h +8 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytearrayobject.h +38 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/bytesobject.h +42 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/cellobject.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/ceval.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/classobject.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/code.h +340 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/compile.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/complexobject.h +33 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/context.h +107 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/critical_section.h +154 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/descrobject.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/dictobject.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileobject.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/fileutils.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/floatobject.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/frameobject.h +35 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/funcobject.h +185 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/genobject.h +56 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/import.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/initconfig.h +334 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/listobject.h +53 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/lock.h +74 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longintrepr.h +184 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/longobject.h +89 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/memoryobject.h +50 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/methodobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/modsupport.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/monitoring.h +269 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/object.h +493 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/objimpl.h +104 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/odictobject.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/picklebufobject.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pthread_stubs.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic.h +614 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_gcc.h +615 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_msc.h +1197 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyatomic_std.h +1112 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyctype.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pydebug.h +38 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyerrors.h +132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyfpe.h +15 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyframe.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pyhash.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pylifecycle.h +89 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pymem.h +84 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystate.h +275 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pystats.h +194 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythonrun.h +96 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pythread.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/pytime.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/setobject.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/traceback.h +13 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tracemalloc.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/tupleobject.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/unicodeobject.h +773 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/warnings.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/cpython/weakrefobject.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/critical_section.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/datetime.h +267 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/descrobject.h +100 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/dictobject.h +108 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/dynamic_annotations.h +499 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/enumobject.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/errcode.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/exports.h +105 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/fileobject.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/fileutils.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/floatobject.h +54 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/frameobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/genericaliasobject.h +14 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/import.h +103 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/atomic.h +392 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/internal.h +969 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/prim.h +329 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/track.h +147 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc/types.h +721 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/mimalloc/mimalloc.h +565 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_abstract.h +61 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_asdl.h +112 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast.h +945 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ast_state.h +271 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_atexit.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_audit.h +35 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_backoff.h +133 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bitutils.h +186 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_blocks_output_buffer.h +321 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_brc.h +73 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytes_methods.h +82 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_bytesobject.h +149 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_c_array.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_call.h +206 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_capsule.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_cell.h +75 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval.h +390 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ceval_state.h +48 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_code.h +671 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_codecs.h +76 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_compile.h +230 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_complexobject.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_condvar.h +93 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_context.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_critical_section.h +237 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp.h +406 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_crossinterp_data_registry.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_debug_offsets.h +379 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_descrobject.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict.h +410 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dict_state.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_dtoa.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_signal.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_emscripten_trampoline.h +70 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_exceptions.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_faulthandler.h +100 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils.h +320 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_fileutils_windows.h +98 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_floatobject.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_flowgraph.h +47 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_format.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_frame.h +61 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist.h +111 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_freelist_state.h +70 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_function.h +53 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gc.h +378 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_genobject.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_getopt.h +22 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_gil.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_objects_fini_generated.h +1592 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_global_strings.h +854 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hamt.h +113 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_hashtable.h +150 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_import.h +141 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_importdl.h +139 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_index_pool.h +36 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_initconfig.h +197 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruction_sequence.h +83 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_instruments.h +127 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp.h +109 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interp_structs.h +977 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe.h +401 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpframe_structs.h +95 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_interpolation.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_intrinsics.h +51 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_jit.h +29 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_list.h +81 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_llist.h +106 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_lock.h +236 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_long.h +319 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_magic_number.h +305 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_memoryobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_mimalloc.h +69 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_modsupport.h +99 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_moduleobject.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_namespace.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object.h +1029 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_alloc.h +71 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_deferred.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_stack.h +95 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_object_state.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc.h +702 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_obmalloc_init.h +66 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_metadata.h +2117 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_opcode_utils.h +90 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_optimizer.h +318 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parking_lot.h +97 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_parser.h +78 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pathconfig.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyarena.h +68 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyatomic_ft_wrappers.h +174 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pybuffer.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyerrors.h +213 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pyhash.h +91 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pylifecycle.h +136 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymath.h +205 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pymem_init.h +103 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystate.h +339 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pystats.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythonrun.h +68 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_pythread.h +172 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_qsbr.h +172 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_range.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime.h +63 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init.h +239 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_init_generated.h +1589 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_runtime_structs.h +310 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_semaphore.h +67 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_setobject.h +41 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_signal.h +108 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sliceobject.h +20 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stackref.h +791 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_stats.h +97 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_strhex.h +39 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structs.h +88 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_structseq.h +40 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_symtable.h +201 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_sysmodule.h +32 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_template.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_time.h +334 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_token.h +110 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_traceback.h +111 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tracemalloc.h +164 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tstate.h +88 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_tuple.h +75 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typedefs.h +18 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typeobject.h +155 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_typevarobject.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_ucnhash.h +36 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject.h +308 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unicodeobject_generated.h +3132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_unionobject.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uniqueid.h +57 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_ids.h +335 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_uop_metadata.h +1204 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_warnings.h +21 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_weakref.h +133 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/intrcheck.h +23 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/iterobject.h +24 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/listobject.h +55 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/lock.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/longobject.h +178 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/marshal.h +31 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/memoryobject.h +34 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/methodobject.h +146 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/modsupport.h +146 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/moduleobject.h +122 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/monitoring.h +18 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/object.h +828 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/objimpl.h +211 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/opcode.h +43 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/opcode_ids.h +259 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/osdefs.h +57 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/osmodule.h +17 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/patchlevel.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/py_curses.h +117 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyatomic.h +16 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pybuffer.h +145 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pycapsule.h +58 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyconfig.h +2088 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pydtrace.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyerrors.h +335 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyexpat.h +62 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyframe.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyhash.h +59 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pylifecycle.h +80 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymacconfig.h +91 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymacro.h +243 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymath.h +65 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pymem.h +110 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pyport.h +710 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystate.h +132 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystats.h +28 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystrcmp.h +23 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pystrtod.h +37 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pythonrun.h +42 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pythread.h +131 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/pytypedefs.h +30 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/rangeobject.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/refcount.h +555 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/setobject.h +49 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/sliceobject.h +69 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/structmember.h +56 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/structseq.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/sysmodule.h +27 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/traceback.h +26 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/tupleobject.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/typeslots.h +96 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/unicodeobject.h +1029 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/warnings.h +45 -0
- pytron/platforms/android/shell/app/src/main/cpp/include/weakrefobject.h +46 -0
- pytron/platforms/android/shell/app/src/main/cpp/pytron_bridge.cpp +224 -0
- pytron/platforms/android/shell/app/src/main/java/com/pytron/shell/MainActivity.kt +208 -0
- pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- pytron/platforms/android/shell/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- pytron/platforms/android/shell/build.gradle +11 -0
- pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.jar +0 -0
- pytron/platforms/android/shell/gradle/wrapper/gradle-wrapper.properties +5 -0
- pytron/platforms/android/shell/gradle.properties +2 -0
- pytron/platforms/android/shell/gradlew.bat +85 -0
- pytron/platforms/android/shell/settings.gradle +16 -0
- pytron/platforms/darwin.py +82 -0
- pytron/platforms/darwin_ops/libs.py +31 -0
- pytron/platforms/darwin_ops/system.py +182 -0
- pytron/platforms/darwin_ops/utils.py +85 -0
- pytron/platforms/darwin_ops/webview.py +5 -0
- pytron/platforms/darwin_ops/window.py +102 -0
- pytron/platforms/interface.py +152 -0
- pytron/platforms/linux.py +82 -0
- pytron/platforms/linux_ops/libs.py +49 -0
- pytron/platforms/linux_ops/system.py +316 -0
- pytron/platforms/linux_ops/utils.py +19 -0
- pytron/platforms/linux_ops/webview.py +5 -0
- pytron/platforms/linux_ops/window.py +115 -0
- pytron/platforms/windows.py +136 -0
- pytron/platforms/windows_ops/__init__.py +0 -0
- pytron/platforms/windows_ops/constants.py +126 -0
- pytron/platforms/windows_ops/system.py +518 -0
- pytron/platforms/windows_ops/utils.py +3 -0
- pytron/platforms/windows_ops/webview.py +5 -0
- pytron/platforms/windows_ops/window.py +361 -0
- pytron/plugin.py +467 -0
- pytron/rcedit-x64.exe +0 -0
- pytron/router.py +146 -0
- pytron/serializer.py +240 -0
- pytron/shortcuts.py +279 -0
- pytron/state.py +76 -0
- pytron/tray.py +399 -0
- pytron/updater.py +181 -0
- pytron/utf8_hook.py +112 -0
- pytron/utils.py +44 -0
- pytron/webview.py +722 -0
- pytron_kit-0.3.12.dist-info/METADATA +131 -0
- pytron_kit-0.3.12.dist-info/RECORD +419 -0
- pytron_kit-0.3.12.dist-info/WHEEL +5 -0
- pytron_kit-0.3.12.dist-info/entry_points.txt +2 -0
- pytron_kit-0.3.12.dist-info/licenses/LICENSE +201 -0
- pytron_kit-0.3.12.dist-info/top_level.txt +1 -0
pytron/platforms/android/shell/app/src/main/cpp/include/internal/pycore_blocks_output_buffer.h
ADDED
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/*
|
|
2
|
+
_BlocksOutputBuffer is used to maintain an output buffer
|
|
3
|
+
that has unpredictable size. Suitable for compression/decompression
|
|
4
|
+
API (bz2/lzma/zlib) that has stream->next_out and stream->avail_out:
|
|
5
|
+
|
|
6
|
+
stream->next_out: point to the next output position.
|
|
7
|
+
stream->avail_out: the number of available bytes left in the buffer.
|
|
8
|
+
|
|
9
|
+
It maintains a list of bytes object, so there is no overhead of resizing
|
|
10
|
+
the buffer.
|
|
11
|
+
|
|
12
|
+
Usage:
|
|
13
|
+
|
|
14
|
+
1, Initialize the struct instance like this:
|
|
15
|
+
_BlocksOutputBuffer buffer = {.list = NULL};
|
|
16
|
+
Set .list to NULL for _BlocksOutputBuffer_OnError()
|
|
17
|
+
|
|
18
|
+
2, Initialize the buffer use one of these functions:
|
|
19
|
+
_BlocksOutputBuffer_InitAndGrow()
|
|
20
|
+
_BlocksOutputBuffer_InitWithSize()
|
|
21
|
+
|
|
22
|
+
3, If (avail_out == 0), grow the buffer:
|
|
23
|
+
_BlocksOutputBuffer_Grow()
|
|
24
|
+
|
|
25
|
+
4, Get the current outputted data size:
|
|
26
|
+
_BlocksOutputBuffer_GetDataSize()
|
|
27
|
+
|
|
28
|
+
5, Finish the buffer, and return a bytes object:
|
|
29
|
+
_BlocksOutputBuffer_Finish()
|
|
30
|
+
|
|
31
|
+
6, Clean up the buffer when an error occurred:
|
|
32
|
+
_BlocksOutputBuffer_OnError()
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
#ifndef Py_INTERNAL_BLOCKS_OUTPUT_BUFFER_H
|
|
36
|
+
#define Py_INTERNAL_BLOCKS_OUTPUT_BUFFER_H
|
|
37
|
+
#ifdef __cplusplus
|
|
38
|
+
extern "C" {
|
|
39
|
+
#endif
|
|
40
|
+
|
|
41
|
+
#include "Python.h"
|
|
42
|
+
|
|
43
|
+
#ifndef Py_BUILD_CORE
|
|
44
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
45
|
+
#endif
|
|
46
|
+
|
|
47
|
+
typedef struct {
|
|
48
|
+
// List of bytes objects
|
|
49
|
+
PyObject *list;
|
|
50
|
+
// Number of whole allocated size
|
|
51
|
+
Py_ssize_t allocated;
|
|
52
|
+
// Max length of the buffer, negative number means unlimited length.
|
|
53
|
+
Py_ssize_t max_length;
|
|
54
|
+
} _BlocksOutputBuffer;
|
|
55
|
+
|
|
56
|
+
static const char unable_allocate_msg[] = "Unable to allocate output buffer.";
|
|
57
|
+
|
|
58
|
+
/* In 32-bit build, the max block size should <= INT32_MAX. */
|
|
59
|
+
#define OUTPUT_BUFFER_MAX_BLOCK_SIZE (256*1024*1024)
|
|
60
|
+
|
|
61
|
+
/* Block size sequence */
|
|
62
|
+
#define KB (1024)
|
|
63
|
+
#define MB (1024*1024)
|
|
64
|
+
static const Py_ssize_t BUFFER_BLOCK_SIZE[] =
|
|
65
|
+
{ 32*KB, 64*KB, 256*KB, 1*MB, 4*MB, 8*MB, 16*MB, 16*MB,
|
|
66
|
+
32*MB, 32*MB, 32*MB, 32*MB, 64*MB, 64*MB, 128*MB, 128*MB,
|
|
67
|
+
OUTPUT_BUFFER_MAX_BLOCK_SIZE };
|
|
68
|
+
#undef KB
|
|
69
|
+
#undef MB
|
|
70
|
+
|
|
71
|
+
/* According to the block sizes defined by BUFFER_BLOCK_SIZE, the whole
|
|
72
|
+
allocated size growth step is:
|
|
73
|
+
1 32 KB +32 KB
|
|
74
|
+
2 96 KB +64 KB
|
|
75
|
+
3 352 KB +256 KB
|
|
76
|
+
4 1.34 MB +1 MB
|
|
77
|
+
5 5.34 MB +4 MB
|
|
78
|
+
6 13.34 MB +8 MB
|
|
79
|
+
7 29.34 MB +16 MB
|
|
80
|
+
8 45.34 MB +16 MB
|
|
81
|
+
9 77.34 MB +32 MB
|
|
82
|
+
10 109.34 MB +32 MB
|
|
83
|
+
11 141.34 MB +32 MB
|
|
84
|
+
12 173.34 MB +32 MB
|
|
85
|
+
13 237.34 MB +64 MB
|
|
86
|
+
14 301.34 MB +64 MB
|
|
87
|
+
15 429.34 MB +128 MB
|
|
88
|
+
16 557.34 MB +128 MB
|
|
89
|
+
17 813.34 MB +256 MB
|
|
90
|
+
18 1069.34 MB +256 MB
|
|
91
|
+
19 1325.34 MB +256 MB
|
|
92
|
+
20 1581.34 MB +256 MB
|
|
93
|
+
21 1837.34 MB +256 MB
|
|
94
|
+
22 2093.34 MB +256 MB
|
|
95
|
+
...
|
|
96
|
+
*/
|
|
97
|
+
|
|
98
|
+
/* Initialize the buffer, and grow the buffer.
|
|
99
|
+
|
|
100
|
+
max_length: Max length of the buffer, -1 for unlimited length.
|
|
101
|
+
|
|
102
|
+
On success, return allocated size (>=0)
|
|
103
|
+
On failure, return -1
|
|
104
|
+
*/
|
|
105
|
+
static inline Py_ssize_t
|
|
106
|
+
_BlocksOutputBuffer_InitAndGrow(_BlocksOutputBuffer *buffer,
|
|
107
|
+
const Py_ssize_t max_length,
|
|
108
|
+
void **next_out)
|
|
109
|
+
{
|
|
110
|
+
PyObject *b;
|
|
111
|
+
Py_ssize_t block_size;
|
|
112
|
+
|
|
113
|
+
// ensure .list was set to NULL
|
|
114
|
+
assert(buffer->list == NULL);
|
|
115
|
+
|
|
116
|
+
// get block size
|
|
117
|
+
if (0 <= max_length && max_length < BUFFER_BLOCK_SIZE[0]) {
|
|
118
|
+
block_size = max_length;
|
|
119
|
+
} else {
|
|
120
|
+
block_size = BUFFER_BLOCK_SIZE[0];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// the first block
|
|
124
|
+
b = PyBytes_FromStringAndSize(NULL, block_size);
|
|
125
|
+
if (b == NULL) {
|
|
126
|
+
return -1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// create the list
|
|
130
|
+
buffer->list = PyList_New(1);
|
|
131
|
+
if (buffer->list == NULL) {
|
|
132
|
+
Py_DECREF(b);
|
|
133
|
+
return -1;
|
|
134
|
+
}
|
|
135
|
+
PyList_SET_ITEM(buffer->list, 0, b);
|
|
136
|
+
|
|
137
|
+
// set variables
|
|
138
|
+
buffer->allocated = block_size;
|
|
139
|
+
buffer->max_length = max_length;
|
|
140
|
+
|
|
141
|
+
*next_out = PyBytes_AS_STRING(b);
|
|
142
|
+
return block_size;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/* Initialize the buffer, with an initial size.
|
|
146
|
+
|
|
147
|
+
Check block size limit in the outer wrapper function. For example, some libs
|
|
148
|
+
accept UINT32_MAX as the maximum block size, then init_size should <= it.
|
|
149
|
+
|
|
150
|
+
On success, return allocated size (>=0)
|
|
151
|
+
On failure, return -1
|
|
152
|
+
*/
|
|
153
|
+
static inline Py_ssize_t
|
|
154
|
+
_BlocksOutputBuffer_InitWithSize(_BlocksOutputBuffer *buffer,
|
|
155
|
+
const Py_ssize_t init_size,
|
|
156
|
+
void **next_out)
|
|
157
|
+
{
|
|
158
|
+
PyObject *b;
|
|
159
|
+
|
|
160
|
+
// ensure .list was set to NULL
|
|
161
|
+
assert(buffer->list == NULL);
|
|
162
|
+
|
|
163
|
+
// the first block
|
|
164
|
+
b = PyBytes_FromStringAndSize(NULL, init_size);
|
|
165
|
+
if (b == NULL) {
|
|
166
|
+
PyErr_SetString(PyExc_MemoryError, unable_allocate_msg);
|
|
167
|
+
return -1;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// create the list
|
|
171
|
+
buffer->list = PyList_New(1);
|
|
172
|
+
if (buffer->list == NULL) {
|
|
173
|
+
Py_DECREF(b);
|
|
174
|
+
return -1;
|
|
175
|
+
}
|
|
176
|
+
PyList_SET_ITEM(buffer->list, 0, b);
|
|
177
|
+
|
|
178
|
+
// set variables
|
|
179
|
+
buffer->allocated = init_size;
|
|
180
|
+
buffer->max_length = -1;
|
|
181
|
+
|
|
182
|
+
*next_out = PyBytes_AS_STRING(b);
|
|
183
|
+
return init_size;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Grow the buffer. The avail_out must be 0, please check it before calling.
|
|
187
|
+
|
|
188
|
+
On success, return allocated size (>=0)
|
|
189
|
+
On failure, return -1
|
|
190
|
+
*/
|
|
191
|
+
static inline Py_ssize_t
|
|
192
|
+
_BlocksOutputBuffer_Grow(_BlocksOutputBuffer *buffer,
|
|
193
|
+
void **next_out,
|
|
194
|
+
const Py_ssize_t avail_out)
|
|
195
|
+
{
|
|
196
|
+
PyObject *b;
|
|
197
|
+
const Py_ssize_t list_len = Py_SIZE(buffer->list);
|
|
198
|
+
Py_ssize_t block_size;
|
|
199
|
+
|
|
200
|
+
// ensure no gaps in the data
|
|
201
|
+
if (avail_out != 0) {
|
|
202
|
+
PyErr_SetString(PyExc_SystemError,
|
|
203
|
+
"avail_out is non-zero in _BlocksOutputBuffer_Grow().");
|
|
204
|
+
return -1;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// get block size
|
|
208
|
+
if (list_len < (Py_ssize_t) Py_ARRAY_LENGTH(BUFFER_BLOCK_SIZE)) {
|
|
209
|
+
block_size = BUFFER_BLOCK_SIZE[list_len];
|
|
210
|
+
} else {
|
|
211
|
+
block_size = BUFFER_BLOCK_SIZE[Py_ARRAY_LENGTH(BUFFER_BLOCK_SIZE) - 1];
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// check max_length
|
|
215
|
+
if (buffer->max_length >= 0) {
|
|
216
|
+
// if (rest == 0), should not grow the buffer.
|
|
217
|
+
Py_ssize_t rest = buffer->max_length - buffer->allocated;
|
|
218
|
+
assert(rest > 0);
|
|
219
|
+
|
|
220
|
+
// block_size of the last block
|
|
221
|
+
if (block_size > rest) {
|
|
222
|
+
block_size = rest;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// check buffer->allocated overflow
|
|
227
|
+
if (block_size > PY_SSIZE_T_MAX - buffer->allocated) {
|
|
228
|
+
PyErr_SetString(PyExc_MemoryError, unable_allocate_msg);
|
|
229
|
+
return -1;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// create the block
|
|
233
|
+
b = PyBytes_FromStringAndSize(NULL, block_size);
|
|
234
|
+
if (b == NULL) {
|
|
235
|
+
PyErr_SetString(PyExc_MemoryError, unable_allocate_msg);
|
|
236
|
+
return -1;
|
|
237
|
+
}
|
|
238
|
+
if (PyList_Append(buffer->list, b) < 0) {
|
|
239
|
+
Py_DECREF(b);
|
|
240
|
+
return -1;
|
|
241
|
+
}
|
|
242
|
+
Py_DECREF(b);
|
|
243
|
+
|
|
244
|
+
// set variables
|
|
245
|
+
buffer->allocated += block_size;
|
|
246
|
+
|
|
247
|
+
*next_out = PyBytes_AS_STRING(b);
|
|
248
|
+
return block_size;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* Return the current outputted data size. */
|
|
252
|
+
static inline Py_ssize_t
|
|
253
|
+
_BlocksOutputBuffer_GetDataSize(_BlocksOutputBuffer *buffer,
|
|
254
|
+
const Py_ssize_t avail_out)
|
|
255
|
+
{
|
|
256
|
+
return buffer->allocated - avail_out;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/* Finish the buffer.
|
|
260
|
+
|
|
261
|
+
Return a bytes object on success
|
|
262
|
+
Return NULL on failure
|
|
263
|
+
*/
|
|
264
|
+
static inline PyObject *
|
|
265
|
+
_BlocksOutputBuffer_Finish(_BlocksOutputBuffer *buffer,
|
|
266
|
+
const Py_ssize_t avail_out)
|
|
267
|
+
{
|
|
268
|
+
PyObject *result, *block;
|
|
269
|
+
const Py_ssize_t list_len = Py_SIZE(buffer->list);
|
|
270
|
+
|
|
271
|
+
// fast path for single block
|
|
272
|
+
if ((list_len == 1 && avail_out == 0) ||
|
|
273
|
+
(list_len == 2 && Py_SIZE(PyList_GET_ITEM(buffer->list, 1)) == avail_out))
|
|
274
|
+
{
|
|
275
|
+
block = PyList_GET_ITEM(buffer->list, 0);
|
|
276
|
+
Py_INCREF(block);
|
|
277
|
+
|
|
278
|
+
Py_CLEAR(buffer->list);
|
|
279
|
+
return block;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
// final bytes object
|
|
283
|
+
result = PyBytes_FromStringAndSize(NULL, buffer->allocated - avail_out);
|
|
284
|
+
if (result == NULL) {
|
|
285
|
+
PyErr_SetString(PyExc_MemoryError, unable_allocate_msg);
|
|
286
|
+
return NULL;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
// memory copy
|
|
290
|
+
if (list_len > 0) {
|
|
291
|
+
char *posi = PyBytes_AS_STRING(result);
|
|
292
|
+
|
|
293
|
+
// blocks except the last one
|
|
294
|
+
Py_ssize_t i = 0;
|
|
295
|
+
for (; i < list_len-1; i++) {
|
|
296
|
+
block = PyList_GET_ITEM(buffer->list, i);
|
|
297
|
+
memcpy(posi, PyBytes_AS_STRING(block), Py_SIZE(block));
|
|
298
|
+
posi += Py_SIZE(block);
|
|
299
|
+
}
|
|
300
|
+
// the last block
|
|
301
|
+
block = PyList_GET_ITEM(buffer->list, i);
|
|
302
|
+
memcpy(posi, PyBytes_AS_STRING(block), Py_SIZE(block) - avail_out);
|
|
303
|
+
} else {
|
|
304
|
+
assert(Py_SIZE(result) == 0);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
Py_CLEAR(buffer->list);
|
|
308
|
+
return result;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
/* Clean up the buffer when an error occurred. */
|
|
312
|
+
static inline void
|
|
313
|
+
_BlocksOutputBuffer_OnError(_BlocksOutputBuffer *buffer)
|
|
314
|
+
{
|
|
315
|
+
Py_CLEAR(buffer->list);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
#ifdef __cplusplus
|
|
319
|
+
}
|
|
320
|
+
#endif
|
|
321
|
+
#endif /* Py_INTERNAL_BLOCKS_OUTPUT_BUFFER_H */
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#ifndef Py_INTERNAL_BRC_H
|
|
2
|
+
#define Py_INTERNAL_BRC_H
|
|
3
|
+
|
|
4
|
+
#include <stdint.h>
|
|
5
|
+
#include "pycore_llist.h" // struct llist_node
|
|
6
|
+
#include "pycore_object_stack.h" // _PyObjectStack
|
|
7
|
+
|
|
8
|
+
#ifdef __cplusplus
|
|
9
|
+
extern "C" {
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
#ifndef Py_BUILD_CORE
|
|
13
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
14
|
+
#endif
|
|
15
|
+
|
|
16
|
+
#ifdef Py_GIL_DISABLED
|
|
17
|
+
|
|
18
|
+
// Prime number to avoid correlations with memory addresses.
|
|
19
|
+
#define _Py_BRC_NUM_BUCKETS 257
|
|
20
|
+
|
|
21
|
+
// Hash table bucket
|
|
22
|
+
struct _brc_bucket {
|
|
23
|
+
// Mutex protects both the bucket and thread state queues in this bucket.
|
|
24
|
+
PyMutex mutex;
|
|
25
|
+
|
|
26
|
+
// Linked list of _PyThreadStateImpl objects hashed to this bucket.
|
|
27
|
+
struct llist_node root;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// Per-interpreter biased reference counting state
|
|
31
|
+
struct _brc_state {
|
|
32
|
+
// Hash table of thread states by thread-id. Thread states within a bucket
|
|
33
|
+
// are chained using a doubly-linked list.
|
|
34
|
+
struct _brc_bucket table[_Py_BRC_NUM_BUCKETS];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Per-thread biased reference counting state
|
|
38
|
+
struct _brc_thread_state {
|
|
39
|
+
// Linked-list of thread states per hash bucket
|
|
40
|
+
struct llist_node bucket_node;
|
|
41
|
+
|
|
42
|
+
// Thread-id as determined by _PyThread_Id()
|
|
43
|
+
uintptr_t tid;
|
|
44
|
+
|
|
45
|
+
// Objects with refcounts to be merged (protected by bucket mutex)
|
|
46
|
+
_PyObjectStack objects_to_merge;
|
|
47
|
+
|
|
48
|
+
// Local stack of objects to be merged (not accessed by other threads)
|
|
49
|
+
_PyObjectStack local_objects_to_merge;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// Initialize/finalize the per-thread biased reference counting state
|
|
53
|
+
void _Py_brc_init_thread(PyThreadState *tstate);
|
|
54
|
+
void _Py_brc_remove_thread(PyThreadState *tstate);
|
|
55
|
+
|
|
56
|
+
// Initialize per-interpreter state
|
|
57
|
+
void _Py_brc_init_state(PyInterpreterState *interp);
|
|
58
|
+
|
|
59
|
+
void _Py_brc_after_fork(PyInterpreterState *interp);
|
|
60
|
+
|
|
61
|
+
// Enqueues an object to be merged by it's owning thread (tid). This
|
|
62
|
+
// steals a reference to the object.
|
|
63
|
+
void _Py_brc_queue_object(PyObject *ob);
|
|
64
|
+
|
|
65
|
+
// Merge the refcounts of queued objects for the current thread.
|
|
66
|
+
void _Py_brc_merge_refcounts(PyThreadState *tstate);
|
|
67
|
+
|
|
68
|
+
#endif /* Py_GIL_DISABLED */
|
|
69
|
+
|
|
70
|
+
#ifdef __cplusplus
|
|
71
|
+
}
|
|
72
|
+
#endif
|
|
73
|
+
#endif /* !Py_INTERNAL_BRC_H */
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
#ifndef Py_LIMITED_API
|
|
2
|
+
#ifndef Py_BYTES_CTYPE_H
|
|
3
|
+
#define Py_BYTES_CTYPE_H
|
|
4
|
+
|
|
5
|
+
#ifndef Py_BUILD_CORE
|
|
6
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
7
|
+
#endif
|
|
8
|
+
|
|
9
|
+
/*
|
|
10
|
+
* The internal implementation behind PyBytes (bytes) and PyByteArray (bytearray)
|
|
11
|
+
* methods of the given names, they operate on ASCII byte strings.
|
|
12
|
+
*/
|
|
13
|
+
extern PyObject* _Py_bytes_isspace(const char *cptr, Py_ssize_t len);
|
|
14
|
+
extern PyObject* _Py_bytes_isalpha(const char *cptr, Py_ssize_t len);
|
|
15
|
+
extern PyObject* _Py_bytes_isalnum(const char *cptr, Py_ssize_t len);
|
|
16
|
+
extern PyObject* _Py_bytes_isascii(const char *cptr, Py_ssize_t len);
|
|
17
|
+
extern PyObject* _Py_bytes_isdigit(const char *cptr, Py_ssize_t len);
|
|
18
|
+
extern PyObject* _Py_bytes_islower(const char *cptr, Py_ssize_t len);
|
|
19
|
+
extern PyObject* _Py_bytes_isupper(const char *cptr, Py_ssize_t len);
|
|
20
|
+
extern PyObject* _Py_bytes_istitle(const char *cptr, Py_ssize_t len);
|
|
21
|
+
|
|
22
|
+
/* These store their len sized answer in the given preallocated *result arg. */
|
|
23
|
+
extern void _Py_bytes_lower(char *result, const char *cptr, Py_ssize_t len);
|
|
24
|
+
extern void _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len);
|
|
25
|
+
extern void _Py_bytes_title(char *result, const char *s, Py_ssize_t len);
|
|
26
|
+
extern void _Py_bytes_capitalize(char *result, const char *s, Py_ssize_t len);
|
|
27
|
+
extern void _Py_bytes_swapcase(char *result, const char *s, Py_ssize_t len);
|
|
28
|
+
|
|
29
|
+
extern PyObject *_Py_bytes_find(const char *str, Py_ssize_t len, PyObject *sub,
|
|
30
|
+
Py_ssize_t start, Py_ssize_t end);
|
|
31
|
+
extern PyObject *_Py_bytes_index(const char *str, Py_ssize_t len, PyObject *sub,
|
|
32
|
+
Py_ssize_t start, Py_ssize_t end);
|
|
33
|
+
extern PyObject *_Py_bytes_rfind(const char *str, Py_ssize_t len, PyObject *sub,
|
|
34
|
+
Py_ssize_t start, Py_ssize_t end);
|
|
35
|
+
extern PyObject *_Py_bytes_rindex(const char *str, Py_ssize_t len, PyObject *sub,
|
|
36
|
+
Py_ssize_t start, Py_ssize_t end);
|
|
37
|
+
extern PyObject *_Py_bytes_count(const char *str, Py_ssize_t len, PyObject *sub,
|
|
38
|
+
Py_ssize_t start, Py_ssize_t end);
|
|
39
|
+
extern int _Py_bytes_contains(const char *str, Py_ssize_t len, PyObject *arg);
|
|
40
|
+
extern PyObject *_Py_bytes_startswith(const char *str, Py_ssize_t len,
|
|
41
|
+
PyObject *subobj, Py_ssize_t start,
|
|
42
|
+
Py_ssize_t end);
|
|
43
|
+
extern PyObject *_Py_bytes_endswith(const char *str, Py_ssize_t len,
|
|
44
|
+
PyObject *subobj, Py_ssize_t start,
|
|
45
|
+
Py_ssize_t end);
|
|
46
|
+
|
|
47
|
+
/* The maketrans() static method. */
|
|
48
|
+
extern PyObject* _Py_bytes_maketrans(Py_buffer *frm, Py_buffer *to);
|
|
49
|
+
|
|
50
|
+
/* Shared __doc__ strings. */
|
|
51
|
+
extern const char _Py_isspace__doc__[];
|
|
52
|
+
extern const char _Py_isalpha__doc__[];
|
|
53
|
+
extern const char _Py_isalnum__doc__[];
|
|
54
|
+
extern const char _Py_isascii__doc__[];
|
|
55
|
+
extern const char _Py_isdigit__doc__[];
|
|
56
|
+
extern const char _Py_islower__doc__[];
|
|
57
|
+
extern const char _Py_isupper__doc__[];
|
|
58
|
+
extern const char _Py_istitle__doc__[];
|
|
59
|
+
extern const char _Py_lower__doc__[];
|
|
60
|
+
extern const char _Py_upper__doc__[];
|
|
61
|
+
extern const char _Py_title__doc__[];
|
|
62
|
+
extern const char _Py_capitalize__doc__[];
|
|
63
|
+
extern const char _Py_swapcase__doc__[];
|
|
64
|
+
extern const char _Py_count__doc__[];
|
|
65
|
+
extern const char _Py_find__doc__[];
|
|
66
|
+
extern const char _Py_index__doc__[];
|
|
67
|
+
extern const char _Py_rfind__doc__[];
|
|
68
|
+
extern const char _Py_rindex__doc__[];
|
|
69
|
+
extern const char _Py_startswith__doc__[];
|
|
70
|
+
extern const char _Py_endswith__doc__[];
|
|
71
|
+
extern const char _Py_maketrans__doc__[];
|
|
72
|
+
extern const char _Py_expandtabs__doc__[];
|
|
73
|
+
extern const char _Py_ljust__doc__[];
|
|
74
|
+
extern const char _Py_rjust__doc__[];
|
|
75
|
+
extern const char _Py_center__doc__[];
|
|
76
|
+
extern const char _Py_zfill__doc__[];
|
|
77
|
+
|
|
78
|
+
/* this is needed because some docs are shared from the .o, not static */
|
|
79
|
+
#define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str)
|
|
80
|
+
|
|
81
|
+
#endif /* !Py_BYTES_CTYPE_H */
|
|
82
|
+
#endif /* !Py_LIMITED_API */
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#ifndef Py_INTERNAL_BYTESOBJECT_H
|
|
2
|
+
#define Py_INTERNAL_BYTESOBJECT_H
|
|
3
|
+
#ifdef __cplusplus
|
|
4
|
+
extern "C" {
|
|
5
|
+
#endif
|
|
6
|
+
|
|
7
|
+
#ifndef Py_BUILD_CORE
|
|
8
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
extern PyObject* _PyBytes_FormatEx(
|
|
12
|
+
const char *format,
|
|
13
|
+
Py_ssize_t format_len,
|
|
14
|
+
PyObject *args,
|
|
15
|
+
int use_bytearray);
|
|
16
|
+
|
|
17
|
+
extern PyObject* _PyBytes_FromHex(
|
|
18
|
+
PyObject *string,
|
|
19
|
+
int use_bytearray);
|
|
20
|
+
|
|
21
|
+
// Helper for PyBytes_DecodeEscape that detects invalid escape chars.
|
|
22
|
+
// Export for test_peg_generator.
|
|
23
|
+
PyAPI_FUNC(PyObject*) _PyBytes_DecodeEscape2(const char *, Py_ssize_t,
|
|
24
|
+
const char *,
|
|
25
|
+
int *, const char **);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
// Substring Search.
|
|
29
|
+
//
|
|
30
|
+
// Returns the index of the first occurrence of
|
|
31
|
+
// a substring ("needle") in a larger text ("haystack").
|
|
32
|
+
// If the needle is not found, return -1.
|
|
33
|
+
// If the needle is found, add offset to the index.
|
|
34
|
+
//
|
|
35
|
+
// Export for 'mmap' shared extension.
|
|
36
|
+
PyAPI_FUNC(Py_ssize_t)
|
|
37
|
+
_PyBytes_Find(const char *haystack, Py_ssize_t len_haystack,
|
|
38
|
+
const char *needle, Py_ssize_t len_needle,
|
|
39
|
+
Py_ssize_t offset);
|
|
40
|
+
|
|
41
|
+
// Same as above, but search right-to-left.
|
|
42
|
+
// Export for 'mmap' shared extension.
|
|
43
|
+
PyAPI_FUNC(Py_ssize_t)
|
|
44
|
+
_PyBytes_ReverseFind(const char *haystack, Py_ssize_t len_haystack,
|
|
45
|
+
const char *needle, Py_ssize_t len_needle,
|
|
46
|
+
Py_ssize_t offset);
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
// Helper function to implement the repeat and inplace repeat methods on a
|
|
50
|
+
// buffer.
|
|
51
|
+
//
|
|
52
|
+
// len_dest is assumed to be an integer multiple of len_src.
|
|
53
|
+
// If src equals dest, then assume the operation is inplace.
|
|
54
|
+
//
|
|
55
|
+
// This method repeately doubles the number of bytes copied to reduce
|
|
56
|
+
// the number of invocations of memcpy.
|
|
57
|
+
//
|
|
58
|
+
// Export for 'array' shared extension.
|
|
59
|
+
PyAPI_FUNC(void)
|
|
60
|
+
_PyBytes_Repeat(char* dest, Py_ssize_t len_dest,
|
|
61
|
+
const char* src, Py_ssize_t len_src);
|
|
62
|
+
|
|
63
|
+
/* --- _PyBytesWriter ----------------------------------------------------- */
|
|
64
|
+
|
|
65
|
+
/* The _PyBytesWriter structure is big: it contains an embedded "stack buffer".
|
|
66
|
+
A _PyBytesWriter variable must be declared at the end of variables in a
|
|
67
|
+
function to optimize the memory allocation on the stack. */
|
|
68
|
+
typedef struct {
|
|
69
|
+
/* bytes, bytearray or NULL (when the small buffer is used) */
|
|
70
|
+
PyObject *buffer;
|
|
71
|
+
|
|
72
|
+
/* Number of allocated size. */
|
|
73
|
+
Py_ssize_t allocated;
|
|
74
|
+
|
|
75
|
+
/* Minimum number of allocated bytes,
|
|
76
|
+
incremented by _PyBytesWriter_Prepare() */
|
|
77
|
+
Py_ssize_t min_size;
|
|
78
|
+
|
|
79
|
+
/* If non-zero, use a bytearray instead of a bytes object for buffer. */
|
|
80
|
+
int use_bytearray;
|
|
81
|
+
|
|
82
|
+
/* If non-zero, overallocate the buffer (default: 0).
|
|
83
|
+
This flag must be zero if use_bytearray is non-zero. */
|
|
84
|
+
int overallocate;
|
|
85
|
+
|
|
86
|
+
/* Stack buffer */
|
|
87
|
+
int use_small_buffer;
|
|
88
|
+
char small_buffer[512];
|
|
89
|
+
} _PyBytesWriter;
|
|
90
|
+
|
|
91
|
+
/* Initialize a bytes writer
|
|
92
|
+
|
|
93
|
+
By default, the overallocation is disabled. Set the overallocate attribute
|
|
94
|
+
to control the allocation of the buffer.
|
|
95
|
+
|
|
96
|
+
Export _PyBytesWriter API for '_pickle' shared extension. */
|
|
97
|
+
PyAPI_FUNC(void) _PyBytesWriter_Init(_PyBytesWriter *writer);
|
|
98
|
+
|
|
99
|
+
/* Get the buffer content and reset the writer.
|
|
100
|
+
Return a bytes object, or a bytearray object if use_bytearray is non-zero.
|
|
101
|
+
Raise an exception and return NULL on error. */
|
|
102
|
+
PyAPI_FUNC(PyObject *) _PyBytesWriter_Finish(_PyBytesWriter *writer,
|
|
103
|
+
void *str);
|
|
104
|
+
|
|
105
|
+
/* Deallocate memory of a writer (clear its internal buffer). */
|
|
106
|
+
PyAPI_FUNC(void) _PyBytesWriter_Dealloc(_PyBytesWriter *writer);
|
|
107
|
+
|
|
108
|
+
/* Allocate the buffer to write size bytes.
|
|
109
|
+
Return the pointer to the beginning of buffer data.
|
|
110
|
+
Raise an exception and return NULL on error. */
|
|
111
|
+
PyAPI_FUNC(void*) _PyBytesWriter_Alloc(_PyBytesWriter *writer,
|
|
112
|
+
Py_ssize_t size);
|
|
113
|
+
|
|
114
|
+
/* Ensure that the buffer is large enough to write *size* bytes.
|
|
115
|
+
Add size to the writer minimum size (min_size attribute).
|
|
116
|
+
|
|
117
|
+
str is the current pointer inside the buffer.
|
|
118
|
+
Return the updated current pointer inside the buffer.
|
|
119
|
+
Raise an exception and return NULL on error. */
|
|
120
|
+
PyAPI_FUNC(void*) _PyBytesWriter_Prepare(_PyBytesWriter *writer,
|
|
121
|
+
void *str,
|
|
122
|
+
Py_ssize_t size);
|
|
123
|
+
|
|
124
|
+
/* Resize the buffer to make it larger.
|
|
125
|
+
The new buffer may be larger than size bytes because of overallocation.
|
|
126
|
+
Return the updated current pointer inside the buffer.
|
|
127
|
+
Raise an exception and return NULL on error.
|
|
128
|
+
|
|
129
|
+
Note: size must be greater than the number of allocated bytes in the writer.
|
|
130
|
+
|
|
131
|
+
This function doesn't use the writer minimum size (min_size attribute).
|
|
132
|
+
|
|
133
|
+
See also _PyBytesWriter_Prepare().
|
|
134
|
+
*/
|
|
135
|
+
PyAPI_FUNC(void*) _PyBytesWriter_Resize(_PyBytesWriter *writer,
|
|
136
|
+
void *str,
|
|
137
|
+
Py_ssize_t size);
|
|
138
|
+
|
|
139
|
+
/* Write bytes.
|
|
140
|
+
Raise an exception and return NULL on error. */
|
|
141
|
+
PyAPI_FUNC(void*) _PyBytesWriter_WriteBytes(_PyBytesWriter *writer,
|
|
142
|
+
void *str,
|
|
143
|
+
const void *bytes,
|
|
144
|
+
Py_ssize_t size);
|
|
145
|
+
|
|
146
|
+
#ifdef __cplusplus
|
|
147
|
+
}
|
|
148
|
+
#endif
|
|
149
|
+
#endif /* !Py_INTERNAL_BYTESOBJECT_H */
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#ifndef Py_INTERNAL_C_ARRAY_H
|
|
2
|
+
#define Py_INTERNAL_C_ARRAY_H
|
|
3
|
+
|
|
4
|
+
#ifdef __cplusplus
|
|
5
|
+
extern "C" {
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
#ifndef Py_BUILD_CORE
|
|
9
|
+
# error "this header requires Py_BUILD_CORE define"
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
/* Utility for a number of growing arrays */
|
|
14
|
+
|
|
15
|
+
typedef struct {
|
|
16
|
+
void *array; /* pointer to the array */
|
|
17
|
+
int allocated_entries; /* pointer to the capacity of the array */
|
|
18
|
+
size_t item_size; /* size of each element */
|
|
19
|
+
int initial_num_entries; /* initial allocation size */
|
|
20
|
+
} _Py_c_array_t;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
int _Py_CArray_Init(_Py_c_array_t* array, int item_size, int initial_num_entries);
|
|
24
|
+
void _Py_CArray_Fini(_Py_c_array_t* array);
|
|
25
|
+
|
|
26
|
+
/* If idx is out of bounds:
|
|
27
|
+
* If arr->array is NULL, allocate arr->initial_num_entries slots.
|
|
28
|
+
* Otherwise, double its size.
|
|
29
|
+
*
|
|
30
|
+
* Return 0 if successful and -1 (with exception set) otherwise.
|
|
31
|
+
*/
|
|
32
|
+
int _Py_CArray_EnsureCapacity(_Py_c_array_t *c_array, int idx);
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
#ifdef __cplusplus
|
|
36
|
+
}
|
|
37
|
+
#endif
|
|
38
|
+
|
|
39
|
+
#endif /* !Py_INTERNAL_C_ARRAY_H */
|