Skip to content

Support Globals #378

Closed
Closed
@TimWhiting

Description

@TimWhiting

I'm trying to create a dart wrapper to the Python C API, so that I can call python code from dart easily / pass objects back and forth.

I was using a different library to generate the ffi bindings, but am now trying to switch to this library. One issue that I have is that there are some global objects that are present in the dynamic / shared library / header files, but not in the generated bindings.

See for example the _Py_TrueStruct, and _Py_FalseStruct here

My current workaround and generated bindings are here. Essentially just adding another file and extensions on the generated class and reexporting everything. I'm not sure how many definitions I might be missing by just manually adding globals though.

As a side note there are a few macros that would be useful if they could be generated into functions. I know they couldn't be strongly typed, but since dart has a dynamic, it seems plausible, though probably fairly difficult since C macros are essentially copy / paste style macros, and might not necessarily be valid function definitions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions