Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] - FSBV - Foreign struct by value for callbacks #351

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

theangelperalta
Copy link

@theangelperalta theangelperalta commented Dec 21, 2022

Implement foreign structure by value for callbacks using libffi 's Closure API. An issue raised by: #285

Launchpad Details: #LP1828643 - Ekaterina Vaartis - 2019-05-10T23:43:44.225888+00:00

@theangelperalta

This comment was marked as resolved.

@theangelperalta theangelperalta marked this pull request as ready for review January 7, 2023 17:58
@theangelperalta theangelperalta changed the title [Feature] - FSBV defcallback [Feature] - FSBV - Foreign struct by value for callbacks Jan 7, 2023
@theangelperalta theangelperalta changed the title [Feature] - FSBV - Foreign struct by value for callbacks [Feature] - #LP1828643 - FSBV - Foreign struct by value for callbacks Jan 7, 2023
@theangelperalta theangelperalta changed the title [Feature] - #LP1828643 - FSBV - Foreign struct by value for callbacks [Feature] - LP1828643 - Foreign struct by value for callbacks Jan 7, 2023
@theangelperalta theangelperalta changed the title [Feature] - LP1828643 - Foreign struct by value for callbacks [Feature] - FSBV - Foreign struct by value for callbacks Jan 7, 2023
@zacque0
Copy link

zacque0 commented Jun 6, 2023

Hi, I'm new to both CFFI and GitHub.

How can I help with this PR? Because I need this functionality to work. Currently, my use-case is writing a CFFI library with libclang.so, which has something like:

typedef struct {
  enum CXCursorKind kind;
  int xdata;
  const void *data[3];
} CXCursor;

typedef enum CXChildVisitResult (*CXCursorVisitor)(CXCursor cursor,
                                                   CXCursor parent,
                                                   CXClientData client_data);

CINDEX_LINKAGE unsigned clang_visitChildren(CXCursor parent,
                                            CXCursorVisitor visitor,
                                            CXClientData client_data);

As you can see, invoking clang_visitChildren requires a callback passing struct by value.

@theangelperalta
Copy link
Author

theangelperalta commented Jun 6, 2023

@zacque0, I don't believe this PR needs anymore work (yet I open it while ago, 6 months ago). However, I have yet to receive feedback from any of the maintainers.

@theangelperalta
Copy link
Author

Hey everyone, can I get some feedback on this PR? cc: @stassats, @sionescu, @attila-lendvai?

@attila-lendvai
Copy link
Member

sorry, but i'm not active in CL nowadays, so it would be quite some effort for me to test/review this.

@theangelperalta
Copy link
Author

sorry, but i'm not active in CL nowadays, so it would be quite some effort for me to test/review this.

@attila-lendvai, thanks for the quick response and honesty. It seems like @luismbo is the main maintainer of the project. I'll have to wait for feedback from him.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants