-
Notifications
You must be signed in to change notification settings - Fork 428
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
[FEAT] Port all the common_*
files, teletext and networking portions of libccx
to rust
#1495
[FEAT] Port all the common_*
files, teletext and networking portions of libccx
to rust
#1495
Conversation
3ddd353
to
9db7b1c
Compare
utility.c
to rustcommon_*
files and teletext portions of libccx
to rust
common_*
files and teletext portions of libccx
to rustcommon_*
files, teletext and networking portions of libccx
to rust
common_*
files, teletext and networking portions of libccx
to rustcommon_*
files, teletext and networking portions of libccx
to rust
16bd519
to
3c1d56b
Compare
e5d7aff
to
ff06589
Compare
@PunitLodha Can you review this PR? |
Could you make each commit a separate PR? If you can't, that means each change is not correctly isolated from the rest. We need each commit to be self-contained (at least don't break anything) and be reversible by itself - we don't want to merge a huge PR with lots of commits that must exist together. (we're still paying for playing fast-and-loose in the past) |
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Your PR breaks these cases:
Check the result page for more info. |
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Your PR breaks these cases:
Check the result page for more info. |
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
This PR aims to port most of the functions in files
common_*
,teletext.h
,telxcc.c
,networking.c
and certain parts ofutility.c
(such as logging) to rust. Certain parts of the codebase is left blank if they are dependant on some code which this PR has not aimed to convert. Such parts will have to be revisited once their dependencies are also converted to rust.I have placed the new rust code inside a new crate named as
lib_ccxr
, which is a normal rust library crate. This was because a static library crate does not allow doctests. This would also help in seperating ffi code to idiomatic Rust code. Since the Rust approach and C approach to solve a problem are very different, there are 3 layers of indirection I have used for porting:1. The C-FFI layer
This layers will have function names same as defined in C but with the prefix of
ccxr_
. These functions will handle the conversion between C-native types and Rust-native types and then pass it on to the C-like Rust layer. These are the functions defined in theccx_rust
crate underlibccxr_exports
module.2. The C-like Rust layer
This layer will have function names same as defined in C but work with Rust-native types. The code written using these functions would still be procedural but in Rust, hence the name C-like Rust. The entire task of these functions will be to translate the procedural code to idiomatic Rust code. These are the functions defined in the
c_functions.rs
file in appropriate modules inside thelib_ccxr
crate.3. The Idiomatic Rust layer
This layer will be the code written as one is supposed to write in idiomatic Rust. It will have complete documentation and tests. This code will will be situated in the
lib_ccxr
crate.