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

C binding for libdar? #55

Open
piperun opened this issue Nov 3, 2023 · 7 comments
Open

C binding for libdar? #55

piperun opened this issue Nov 3, 2023 · 7 comments
Assignees
Labels
enhancement behavor/feature enhancement

Comments

@piperun
Copy link

piperun commented Nov 3, 2023

I've been eying this project for some time and been wanting to use it in Rust/Dart, unfortunately there's no C binding to more easily dig your teeth into.
I noticed there is a python binding to my surprise but not C.

@Edrusb
Copy link
Owner

Edrusb commented Nov 3, 2023

correct, libdar is written in C++ and makes a big use of classes and objects. Though, one could argue that using an object is almost equivalent as adding a first argument (a pointer to the data-structure of the object, which can be an opaque one from API user point of view) to any method the class provides be converted to a C function...

If you are willing to set this up, let me know, I can guide you from the starting point (which code/branch to use from git) which part to focus on, up to what automatic/systematic naming could worth considering... Unfortunately, I have not free/personal time left for to do that alone, this is why I cannot add it to my todo list.

@Edrusb Edrusb self-assigned this Nov 3, 2023
@Edrusb Edrusb added the enhancement behavor/feature enhancement label Nov 3, 2023
@piperun
Copy link
Author

piperun commented Nov 4, 2023

Thank you for the reply!
I will admit I'm not very well versed enough in C to form a proper C bindings, as I plan on investing time in learning rust in the near future that might be an option instead?

@Edrusb
Copy link
Owner

Edrusb commented Nov 4, 2023

Searching Internet, it seems complicated to call C++ routines from rust due to C++ name mangling... it is advised to pass through C, which is probably the reason why you were looking for C API to libdar...

The path seems less complicated to reach python code from Rust, though this may not be totally straight forward... but libdar provides a python API as you know...

my 2 cents...

@piperun
Copy link
Author

piperun commented Nov 4, 2023

That is fair enough, I did find 2 projects that seem to have C bindings for libdar, but they are very old/incomplete:
https://sourceforge.net/projects/darbinding/
And this is the binding DarGUI uses:
https://sourceforge.net/p/dargui/code/HEAD/tree/libdargui/

@Edrusb
Copy link
Owner

Edrusb commented Nov 4, 2023

I'm sorry, I'd like to have more time to work on dar/libdar but I still have to pay my bills... and dar/libdar will stay free. So there are priorities and choices to take to match my available free time. C binding is not very demanded and while it does not seems very risky nor very complex to address (well, seen from far away...) it requires an important investment in time... something I have not for now... being busy some free software project...

@piperun
Copy link
Author

piperun commented Nov 5, 2023

I'm not sure I follow, I only stated I found these.
It was more of a look what I found rather than some demand, do apologize if it came out as such.

@Edrusb
Copy link
Owner

Edrusb commented Nov 5, 2023

This was unclear on my side what to do with these projects. Thanks for this feedback and no worries at all!

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

No branches or pull requests

2 participants