Export eXdupe as C library
Exporting eXdupe as a C library would be very useful. There would also be negligible performance overhead for it being used in another language (literally almost all languages today support the C ABI) using the C ABI.
Right now calling it from a program not written in a shell derivative, you have to wrap it a bunch and do a bunch of complex stuff for no reason.
That has actually been on the todo list for a while because it would also allow to easily create graphical user interfaces.
The idea is to layer it in three layers: deduplication library, archiver-library and a very thin command line interface.
Just let me know if you have any input since I'll probably start working on that as the next thing.
yeah that sounds good, not much else to add. i also have another request: for the eXdupe binary, rather than maintaing it seperately just build it as a wrapper for the eXdupe c lib
I don't think I understand what you mean - can you elaborate it?
What thought was having three layers:
- deduplication library: Basically just the current libexdupe.cpp which is not aware of files - its interface is just streams of data.
- eXdupe "application library" Takes paths of files, directories, flags, settings, etc as C parameters. Maybe a callback for progress (bytes compressed, compressed size as uint64_t).
- Thin command line wrapper - just turns command line into C types, prints status, translates C enum to error messages.
Maybe the wrapper in 3) could also offer a scripting-friendly mode. I.e. one that has a more fixed-format somehow.
yeah that sounds fine. rereading what i said id get why you were confused. sorry. but yeah this plan is fine