From 9bfadd77d95a80f40c81f33bfb1340d88902dfbf Mon Sep 17 00:00:00 2001 From: Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> Date: Sat, 30 Sep 2023 23:03:43 +0200 Subject: [PATCH] docs --- README.md | 25 ++++++++++++++ example-user/Cargo.lock | 72 ---------------------------------------- example-user/Cargo.toml | 18 ---------- example-user/src/main.rs | 17 ---------- test.sh | 3 -- 5 files changed, 25 insertions(+), 110 deletions(-) create mode 100644 README.md delete mode 100644 example-user/Cargo.lock delete mode 100644 example-user/Cargo.toml delete mode 100644 example-user/src/main.rs delete mode 100755 test.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..9a82a5e --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# libuwuc + +A libc implementation written in Rust. + +## Layout + +libuwuc consists of two crates, `libuwuc` and `rawc`. `libuwuc` is a normal Rust library +and can be unit tested. It contains all the logic. `rawc` is a wrapper that declares all +the symbols and is compiled to a staticlib/cdylib and then linked into your favourite C programs. + +## How to build and test + +You can build libuwuc using `cargo build`. Then, use `./uwuc-gcc` to build C programs. + +`cargo test -p libuwuc` runs unit tests for the `libuwuc` crate. `./test_c.sh` runs +the bespoke integration test suite with tests written in C. + +## Why + +yes!!! + +## Platform Support + +`libuwuc` supports anything that supports the Linux system call ABI but is only tested on actual Linux. +Currently, it only supports x86-64, though that may change in the future. diff --git a/example-user/Cargo.lock b/example-user/Cargo.lock deleted file mode 100644 index b039314..0000000 --- a/example-user/Cargo.lock +++ /dev/null @@ -1,72 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "example-user" -version = "0.1.0" -dependencies = [ - "libuwuc", - "rawc", -] - -[[package]] -name = "libuwuc" -version = "0.1.0" -dependencies = [ - "cfg-if", - "linked_list_allocator", -] - -[[package]] -name = "linked_list_allocator" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afa463f5405ee81cdb9cc2baf37e08ec7e4c8209442b5d72c04cfb2cd6e6286" -dependencies = [ - "spinning_top", -] - -[[package]] -name = "lock_api" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "rawc" -version = "0.1.0" -dependencies = [ - "libuwuc", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "spinning_top" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9eb1a2f4c41445a3a0ff9abc5221c5fcd28e1f13cd7c0397706f9ac938ddb0" -dependencies = [ - "lock_api", -] diff --git a/example-user/Cargo.toml b/example-user/Cargo.toml deleted file mode 100644 index 10dd892..0000000 --- a/example-user/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[workspace] - -[package] -name = "example-user" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[profile.dev] -panic = "abort" - -[profile.release] -panic = "abort" - -[dependencies] -rawc = { path = "../rawc" } -libuwuc = { path = "../libuwuc" } \ No newline at end of file diff --git a/example-user/src/main.rs b/example-user/src/main.rs deleted file mode 100644 index a1209d6..0000000 --- a/example-user/src/main.rs +++ /dev/null @@ -1,17 +0,0 @@ -#![feature(panic_info_message)] -#![cfg_attr(not(test), no_std)] -#![no_main] - -use core::ffi::c_char; - -use libuwuc::println; - -extern crate rawc; - -#[no_mangle] -extern "C" fn main(_argc: i32, _argv: *const *const c_char) -> i32 { - println!("Hello, world!"); - let pwd = libuwuc::env::getenv(libuwuc::cstr!("PWD")); - println!("PWD={pwd:?}"); - 0 -} diff --git a/test.sh b/test.sh deleted file mode 100755 index 8ab49fe..0000000 --- a/test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -cargo run --manifest-path example-user/Cargo.toml