diff --git a/LICENSE b/LICENSE index 8bb81d6b..364e9c53 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2025 blueloveTH +Copyright (c) 2026 blueloveTH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/amalgamate.py b/amalgamate.py index c4f18d5e..0026f5dd 100644 --- a/amalgamate.py +++ b/amalgamate.py @@ -11,7 +11,7 @@ ROOT = 'include/pocketpy' PUBLIC_HEADERS = ['config.h', 'export.h', 'vmath.h', 'pocketpy.h'] COPYRIGHT = '''/* - * Copyright (c) 2025 blueloveTH + * Copyright (c) 2026 blueloveTH * Distributed Under The MIT License * https://github.com/pocketpy/pocketpy */ diff --git a/docs/features/threading.md b/docs/features/threading.md index de12ebc5..069a4c23 100644 --- a/docs/features/threading.md +++ b/docs/features/threading.md @@ -1,6 +1,6 @@ --- icon: dot -title: Threading +title: Compute Threads --- pocketpy organizes its state by `VM` structure. diff --git a/docs/license.md b/docs/license.md index 509011c0..47deecbb 100644 --- a/docs/license.md +++ b/docs/license.md @@ -11,7 +11,7 @@ pkpy is licensed under the [MIT License](http://opensource.org/licenses/MIT). ``` MIT License -Copyright (c) 2025 blueloveTH +Copyright (c) 2026 blueloveTH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/plugins/flutter/pocketpy/lib/pocketpy_bindings_generated.dart b/plugins/flutter/pocketpy/lib/pocketpy_bindings_generated.dart index a3b7fc1a..59803413 100644 --- a/plugins/flutter/pocketpy/lib/pocketpy_bindings_generated.dart +++ b/plugins/flutter/pocketpy/lib/pocketpy_bindings_generated.dart @@ -357,6 +357,47 @@ class PocketpyBindings { late final _py_compile = _py_compilePtr.asFunction< bool Function(ffi.Pointer, ffi.Pointer, int, bool)>(); + /// Compile a `.py` file into a `.pyc` file. + bool py_compilefile( + ffi.Pointer src_path, + ffi.Pointer dst_path, + ) { + return _py_compilefile( + src_path, + dst_path, + ); + } + + late final _py_compilefilePtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function( + ffi.Pointer, ffi.Pointer)>>('py_compilefile'); + late final _py_compilefile = _py_compilefilePtr.asFunction< + bool Function(ffi.Pointer, ffi.Pointer)>(); + + /// Run a compiled code object. + bool py_execo( + ffi.Pointer data, + int size, + ffi.Pointer filename, + py_Ref module, + ) { + return _py_execo( + data, + size, + filename, + module, + ); + } + + late final _py_execoPtr = _lookup< + ffi.NativeFunction< + ffi.Bool Function(ffi.Pointer, ffi.Int, + ffi.Pointer, py_Ref)>>('py_execo'); + late final _py_execo = _py_execoPtr.asFunction< + bool Function( + ffi.Pointer, int, ffi.Pointer, py_Ref)>(); + /// Run a source string. /// @param source source string. /// @param filename filename (for error messages). @@ -960,38 +1001,6 @@ class PocketpyBindings { late final _py_bindmagic = _py_bindmagicPtr.asFunction(); - /// Bind a compile-time function via "decl-based" style. - void py_macrobind( - ffi.Pointer sig, - py_CFunction f, - ) { - return _py_macrobind( - sig, - f, - ); - } - - late final _py_macrobindPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, py_CFunction)>>('py_macrobind'); - late final _py_macrobind = _py_macrobindPtr - .asFunction, py_CFunction)>(); - - /// Get a compile-time function by name. - py_ItemRef py_macroget( - py_Name name, - ) { - return _py_macroget( - name, - ); - } - - late final _py_macrogetPtr = - _lookup>('py_macroget'); - late final _py_macroget = - _py_macrogetPtr.asFunction(); - /// Convert an `int` object in python to `int64_t`. int py_toint( py_Ref arg0, @@ -3946,10 +3955,12 @@ abstract class py_TraceEvent { /// A struct contains the callbacks of the VM. final class py_Callbacks extends ffi.Struct { - /// Used by `__import__` to load a source module. + /// Used by `__import__` to load a source or compiled module. external ffi.Pointer< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>> importfile; + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer path, ffi.Pointer data_size)>> + importfile; /// Called before `importfile` to lazy-import a C module. external ffi @@ -4035,13 +4046,13 @@ typedef py_CFunction = ffi.Pointer< /// A pointer that represents a python identifier. For fast name resolution. typedef py_Name = ffi.Pointer; -/// An item reference to a container object. It invalidates when the container is modified. -typedef py_ItemRef = ffi.Pointer; - /// A generic destructor function. typedef py_Dtor = ffi.Pointer)>>; +/// An item reference to a container object. It invalidates when the container is modified. +typedef py_ItemRef = ffi.Pointer; + /// A reference which has the same lifespan as the python object. typedef py_ObjectRef = ffi.Pointer;