Implement NativeExtension pointer arguments

* Allows calling into native extensions directly with a pointer
* Makes it easier to implement some APIs more efficiently
* Appears with a "*" in the documentation for the argument.
* Implementing the pointer handling is entirely up to the implementation, although the extension API provides some hint.
* AudioStream has been implemented as an example, allowing to create NativeExtension based AudioStreams.
This commit is contained in:
reduz
2021-08-23 14:53:27 -03:00
parent 679b9be9d3
commit 44d62a9f4b
18 changed files with 370 additions and 25 deletions

View File

@ -1007,6 +1007,8 @@ def format_table(f, data, remove_empty_columns=False): # type: (TextIO, Iterabl
def make_type(klass, state): # type: (str, State) -> str
if klass.find("*") != -1: # Pointer, ignore
return klass
link_type = klass
if link_type.endswith("[]"): # Typed array, strip [] to link to contained type.
link_type = link_type[:-2]