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

Add C bindings for the libf3d #1307

Open
mwestphal opened this issue Mar 9, 2024 · 4 comments
Open

Add C bindings for the libf3d #1307

mwestphal opened this issue Mar 9, 2024 · 4 comments
Assignees
Labels
help wanted Please help with this issue! source:libf3d type:enhancement New feature or request
Milestone

Comments

@mwestphal
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Currently, the libf3d has a C++11 API and provides bindings in python and javascript (experimental).

Providing C bindings would open libf3d usage to many other languages, especially Julia and Rust.

Let's see if there is an interest for this. If you have interest, please do not hesitate to comment on this issue.

@kidharb
Copy link
Sponsor Contributor

kidharb commented Mar 16, 2024

@mwestphal please assign this to me

@Meakk
Copy link
Contributor

Meakk commented Mar 16, 2024

Here's my opinion on this topic:

  • Functions of the form instance.function(arg1, arg2) should look like function(instance, arg1, arg2)
  • Return references should become argument pointers
  • Returned std::vector should become int* size and T* ptr arguments

We should add the bindings directly in the public headers where it's appropriate, it should look like:

#ifdef __cplusplus

/* C++ class definition here*/

extern "C" {
#endif

/* C bindings definition here*/

#ifdef __cplusplus
}
#endif

@mwestphal mwestphal added type:enhancement New feature or request source:libf3d help wanted Please help with this issue! labels Mar 22, 2024
@parkerstafford
Copy link
Sponsor

parkerstafford commented Mar 31, 2024

I'll work on this!

@mwestphal
Copy link
Contributor Author

Need any help @parkerstafford ? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Please help with this issue! source:libf3d type:enhancement New feature or request
Projects
Status: In progress
Development

No branches or pull requests

4 participants