Skip to content

feat(#202): Add C/C++ Bindings Support - #318

Open
ioanstefan2020 wants to merge 6 commits into
xoriors:mainfrom
ioanstefan2020:feature/c-cpp-bindings
Open

feat(#202): Add C/C++ Bindings Support#318
ioanstefan2020 wants to merge 6 commits into
xoriors:mainfrom
ioanstefan2020:feature/c-cpp-bindings

Conversation

@ioanstefan2020

Copy link
Copy Markdown

Title: feat(#202): Add C/C++ Bindings Support

Description:
Implemented C bindings for the rencfs library to allow integration with C/C++ applications, addressing issue #202. This introduces a FFI (Foreign Function Interface) layer that exposes core filesystem operations.

Changes:

  • Added src/c_api.rs: Contains the FFI shim layer bridging sync C calls to async Rust tokio runtime.
  • Modified Cargo.toml: Added cdylib and staticlib crate types to generate .so and .a libraries.
  • Added rencfs.h: C header file defining the API.
  • Added examples/c_binding/main.cpp: A comprehensive demo application testing all implemented features.

Implemented Operations:

  • Core: Init, Free, Create File, Read, Write, Close.
  • Directory Ops: Mkdir, Rmdir, Rename, Unlink.
  • Listing: Directory iteration (opendir, readdir, closedir) using stateful iterators.
  • Auth: Change Password.

Fixes # (issue): 202

Type of change:
[ ] Bug fix
[x] New feature (non-breaking change which adds functionality)

Checklist:
[x] New and existing unit tests pass locally with my changes
[x] I have performed a self-review of my code
[x] My changes generate no new warnings (handled via FFI safety blocks)

Implements basic operations (init, create, read, write) exposing rencfs to C-compatible languages.
Implemented directory creation functionality exposed via FFI.
Implemented file deletion functionality exposed via FFI.
Completed the basic operations suite. Users can now securely change the filesystem password.
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.

1 participant