From 083fd72e6606be20c52debf2cce412327b70f877 Mon Sep 17 00:00:00 2001
From: Jeremy Soller <jackpot51@gmail.com>
Date: Sat, 3 Mar 2018 20:24:40 -0700
Subject: [PATCH] Reorganize

---
 Cargo.toml                               | 10 +++++-----
 {fcntl => src/fcntl}/Cargo.toml          |  4 ++--
 {stdlib => src/fcntl}/build.rs           |  4 ++--
 {fcntl => src/fcntl}/cbindgen.toml       |  0
 {fcntl => src/fcntl}/src/lib.rs          |  0
 {fcntl => src/fcntl}/src/linux.rs        |  0
 {fcntl => src/fcntl}/src/redox.rs        |  0
 {stdio => src/stdio}/Cargo.toml          |  4 ++--
 {fcntl => src/stdio}/build.rs            |  4 ++--
 {stdio => src/stdio}/cbindgen.toml       |  0
 {stdio => src/stdio}/src/lib.rs          |  0
 {stdio => src/stdio}/src/printf.rs       |  0
 {stdlib => src/stdlib}/Cargo.toml        |  6 +++---
 {string => src/stdlib}/build.rs          |  4 ++--
 {stdlib => src/stdlib}/cbindgen.toml     |  0
 {stdlib => src/stdlib}/src/lib.rs        |  0
 {string => src/string}/Cargo.toml        |  4 ++--
 {stdio => src/string}/build.rs           |  4 ++--
 {string => src/string}/cbindgen.toml     |  0
 {string => src/string}/src/lib.rs        |  0
 {aio => src/todo/aio}/lib.rs             |  0
 {ctype => src/todo/ctype}/lib.rs         |  0
 {grp => src/todo/grp}/lib.rs             |  0
 {mman => src/todo/mman}/lib.rs           |  0
 {pthread => src/todo/pthread}/lib.rs     |  0
 {semaphore => src/todo/semaphore}/lib.rs |  0
 {wchar => src/todo/wchar}/lib.rs         |  0
 {wctype => src/todo/wctype}/lib.rs       |  0
 {unistd => src/unistd}/Cargo.toml        |  4 ++--
 src/unistd/build.rs                      | 11 +++++++++++
 {unistd => src/unistd}/cbindgen.toml     |  0
 {unistd => src/unistd}/src/lib.rs        |  0
 unistd/build.rs                          | 11 -----------
 33 files changed, 35 insertions(+), 35 deletions(-)
 rename {fcntl => src/fcntl}/Cargo.toml (65%)
 rename {stdlib => src/fcntl}/build.rs (60%)
 rename {fcntl => src/fcntl}/cbindgen.toml (100%)
 rename {fcntl => src/fcntl}/src/lib.rs (100%)
 rename {fcntl => src/fcntl}/src/linux.rs (100%)
 rename {fcntl => src/fcntl}/src/redox.rs (100%)
 rename {stdio => src/stdio}/Cargo.toml (72%)
 rename {fcntl => src/stdio}/build.rs (60%)
 rename {stdio => src/stdio}/cbindgen.toml (100%)
 rename {stdio => src/stdio}/src/lib.rs (100%)
 rename {stdio => src/stdio}/src/printf.rs (100%)
 rename {stdlib => src/stdlib}/Cargo.toml (52%)
 rename {string => src/stdlib}/build.rs (60%)
 rename {stdlib => src/stdlib}/cbindgen.toml (100%)
 rename {stdlib => src/stdlib}/src/lib.rs (100%)
 rename {string => src/string}/Cargo.toml (65%)
 rename {stdio => src/string}/build.rs (60%)
 rename {string => src/string}/cbindgen.toml (100%)
 rename {string => src/string}/src/lib.rs (100%)
 rename {aio => src/todo/aio}/lib.rs (100%)
 rename {ctype => src/todo/ctype}/lib.rs (100%)
 rename {grp => src/todo/grp}/lib.rs (100%)
 rename {mman => src/todo/mman}/lib.rs (100%)
 rename {pthread => src/todo/pthread}/lib.rs (100%)
 rename {semaphore => src/todo/semaphore}/lib.rs (100%)
 rename {wchar => src/todo/wchar}/lib.rs (100%)
 rename {wctype => src/todo/wctype}/lib.rs (100%)
 rename {unistd => src/unistd}/Cargo.toml (65%)
 create mode 100644 src/unistd/build.rs
 rename {unistd => src/unistd}/cbindgen.toml (100%)
 rename {unistd => src/unistd}/src/lib.rs (100%)
 delete mode 100644 unistd/build.rs

diff --git a/Cargo.toml b/Cargo.toml
index 40f07230..e84ea2cf 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,11 +13,11 @@ members = ["crt0"]
 [dependencies]
 compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-builtins.git", default-features = false, features = ["mem"] }
 platform = { path = "platform" }
-fcntl = { path = "fcntl" }
-stdio = { path = "stdio" }
-stdlib = { path = "stdlib" }
-string = { path = "string" }
-unistd = { path = "unistd" }
+fcntl = { path = "src/fcntl" }
+stdio = { path = "src/stdio" }
+stdlib = { path = "src/stdlib" }
+string = { path = "src/string" }
+unistd = { path = "src/unistd" }
 
 [profile.dev]
 panic = "abort"
diff --git a/fcntl/Cargo.toml b/src/fcntl/Cargo.toml
similarity index 65%
rename from fcntl/Cargo.toml
rename to src/fcntl/Cargo.toml
index fbf73b66..9eb0cb9a 100644
--- a/fcntl/Cargo.toml
+++ b/src/fcntl/Cargo.toml
@@ -5,7 +5,7 @@ authors = ["Jeremy Soller <jackpot51@gmail.com>"]
 build = "build.rs"
 
 [build-dependencies]
-cbindgen = { path = "../cbindgen" }
+cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../platform" }
+platform = { path = "../../platform" }
diff --git a/stdlib/build.rs b/src/fcntl/build.rs
similarity index 60%
rename from stdlib/build.rs
rename to src/fcntl/build.rs
index 0a0b7570..b5f6c10b 100644
--- a/stdlib/build.rs
+++ b/src/fcntl/build.rs
@@ -4,8 +4,8 @@ use std::{env, fs};
 
 fn main() {
     let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
-    fs::create_dir_all("../target/include").expect("failed to create include directory");
+    fs::create_dir_all("../../target/include").expect("failed to create include directory");
     cbindgen::generate(crate_dir)
       .expect("failed to generate bindings")
-      .write_to_file("../target/include/stdlib.h");
+      .write_to_file("../../target/include/fcntl.h");
 }
diff --git a/fcntl/cbindgen.toml b/src/fcntl/cbindgen.toml
similarity index 100%
rename from fcntl/cbindgen.toml
rename to src/fcntl/cbindgen.toml
diff --git a/fcntl/src/lib.rs b/src/fcntl/src/lib.rs
similarity index 100%
rename from fcntl/src/lib.rs
rename to src/fcntl/src/lib.rs
diff --git a/fcntl/src/linux.rs b/src/fcntl/src/linux.rs
similarity index 100%
rename from fcntl/src/linux.rs
rename to src/fcntl/src/linux.rs
diff --git a/fcntl/src/redox.rs b/src/fcntl/src/redox.rs
similarity index 100%
rename from fcntl/src/redox.rs
rename to src/fcntl/src/redox.rs
diff --git a/stdio/Cargo.toml b/src/stdio/Cargo.toml
similarity index 72%
rename from stdio/Cargo.toml
rename to src/stdio/Cargo.toml
index 79147417..78c082e1 100644
--- a/stdio/Cargo.toml
+++ b/src/stdio/Cargo.toml
@@ -5,8 +5,8 @@ authors = ["Jeremy Soller <jackpot51@gmail.com>"]
 build = "build.rs"
 
 [build-dependencies]
-cbindgen = { path = "../cbindgen" }
+cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../platform" }
+platform = { path = "../../platform" }
 va_list = { version = "0.1", features = ["no_std"] }
diff --git a/fcntl/build.rs b/src/stdio/build.rs
similarity index 60%
rename from fcntl/build.rs
rename to src/stdio/build.rs
index b04c12cd..dc48bf16 100644
--- a/fcntl/build.rs
+++ b/src/stdio/build.rs
@@ -4,8 +4,8 @@ use std::{env, fs};
 
 fn main() {
     let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
-    fs::create_dir_all("../target/include").expect("failed to create include directory");
+    fs::create_dir_all("../../target/include").expect("failed to create include directory");
     cbindgen::generate(crate_dir)
       .expect("failed to generate bindings")
-      .write_to_file("../target/include/fcntl.h");
+      .write_to_file("../../target/include/stdio.h");
 }
diff --git a/stdio/cbindgen.toml b/src/stdio/cbindgen.toml
similarity index 100%
rename from stdio/cbindgen.toml
rename to src/stdio/cbindgen.toml
diff --git a/stdio/src/lib.rs b/src/stdio/src/lib.rs
similarity index 100%
rename from stdio/src/lib.rs
rename to src/stdio/src/lib.rs
diff --git a/stdio/src/printf.rs b/src/stdio/src/printf.rs
similarity index 100%
rename from stdio/src/printf.rs
rename to src/stdio/src/printf.rs
diff --git a/stdlib/Cargo.toml b/src/stdlib/Cargo.toml
similarity index 52%
rename from stdlib/Cargo.toml
rename to src/stdlib/Cargo.toml
index 7becd734..ed0dce3f 100644
--- a/stdlib/Cargo.toml
+++ b/src/stdlib/Cargo.toml
@@ -5,8 +5,8 @@ authors = ["Jeremy Soller <jackpot51@gmail.com>"]
 build = "build.rs"
 
 [build-dependencies]
-cbindgen = { path = "../cbindgen" }
+cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../platform" }
-ralloc = { path = "../ralloc", default-features = false }
+platform = { path = "../../platform" }
+ralloc = { path = "../../ralloc", default-features = false }
diff --git a/string/build.rs b/src/stdlib/build.rs
similarity index 60%
rename from string/build.rs
rename to src/stdlib/build.rs
index 1aca9f78..7a6ca43d 100644
--- a/string/build.rs
+++ b/src/stdlib/build.rs
@@ -4,8 +4,8 @@ use std::{env, fs};
 
 fn main() {
     let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
-    fs::create_dir_all("../target/include").expect("failed to create include directory");
+    fs::create_dir_all("../../target/include").expect("failed to create include directory");
     cbindgen::generate(crate_dir)
       .expect("failed to generate bindings")
-      .write_to_file("../target/include/string.h");
+      .write_to_file("../../target/include/stdlib.h");
 }
diff --git a/stdlib/cbindgen.toml b/src/stdlib/cbindgen.toml
similarity index 100%
rename from stdlib/cbindgen.toml
rename to src/stdlib/cbindgen.toml
diff --git a/stdlib/src/lib.rs b/src/stdlib/src/lib.rs
similarity index 100%
rename from stdlib/src/lib.rs
rename to src/stdlib/src/lib.rs
diff --git a/string/Cargo.toml b/src/string/Cargo.toml
similarity index 65%
rename from string/Cargo.toml
rename to src/string/Cargo.toml
index 2e110e97..9c58c499 100644
--- a/string/Cargo.toml
+++ b/src/string/Cargo.toml
@@ -5,7 +5,7 @@ authors = ["Jeremy Soller <jackpot51@gmail.com>"]
 build = "build.rs"
 
 [build-dependencies]
-cbindgen = { path = "../cbindgen" }
+cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../platform" }
+platform = { path = "../../platform" }
diff --git a/stdio/build.rs b/src/string/build.rs
similarity index 60%
rename from stdio/build.rs
rename to src/string/build.rs
index f79b6f43..8cfc6ee6 100644
--- a/stdio/build.rs
+++ b/src/string/build.rs
@@ -4,8 +4,8 @@ use std::{env, fs};
 
 fn main() {
     let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
-    fs::create_dir_all("../target/include").expect("failed to create include directory");
+    fs::create_dir_all("../../target/include").expect("failed to create include directory");
     cbindgen::generate(crate_dir)
       .expect("failed to generate bindings")
-      .write_to_file("../target/include/stdio.h");
+      .write_to_file("../../target/include/string.h");
 }
diff --git a/string/cbindgen.toml b/src/string/cbindgen.toml
similarity index 100%
rename from string/cbindgen.toml
rename to src/string/cbindgen.toml
diff --git a/string/src/lib.rs b/src/string/src/lib.rs
similarity index 100%
rename from string/src/lib.rs
rename to src/string/src/lib.rs
diff --git a/aio/lib.rs b/src/todo/aio/lib.rs
similarity index 100%
rename from aio/lib.rs
rename to src/todo/aio/lib.rs
diff --git a/ctype/lib.rs b/src/todo/ctype/lib.rs
similarity index 100%
rename from ctype/lib.rs
rename to src/todo/ctype/lib.rs
diff --git a/grp/lib.rs b/src/todo/grp/lib.rs
similarity index 100%
rename from grp/lib.rs
rename to src/todo/grp/lib.rs
diff --git a/mman/lib.rs b/src/todo/mman/lib.rs
similarity index 100%
rename from mman/lib.rs
rename to src/todo/mman/lib.rs
diff --git a/pthread/lib.rs b/src/todo/pthread/lib.rs
similarity index 100%
rename from pthread/lib.rs
rename to src/todo/pthread/lib.rs
diff --git a/semaphore/lib.rs b/src/todo/semaphore/lib.rs
similarity index 100%
rename from semaphore/lib.rs
rename to src/todo/semaphore/lib.rs
diff --git a/wchar/lib.rs b/src/todo/wchar/lib.rs
similarity index 100%
rename from wchar/lib.rs
rename to src/todo/wchar/lib.rs
diff --git a/wctype/lib.rs b/src/todo/wctype/lib.rs
similarity index 100%
rename from wctype/lib.rs
rename to src/todo/wctype/lib.rs
diff --git a/unistd/Cargo.toml b/src/unistd/Cargo.toml
similarity index 65%
rename from unistd/Cargo.toml
rename to src/unistd/Cargo.toml
index 1a3bb22f..e678f3a9 100644
--- a/unistd/Cargo.toml
+++ b/src/unistd/Cargo.toml
@@ -5,7 +5,7 @@ authors = ["Jeremy Soller <jackpot51@gmail.com>"]
 build = "build.rs"
 
 [build-dependencies]
-cbindgen = { path = "../cbindgen" }
+cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../platform" }
+platform = { path = "../../platform" }
diff --git a/src/unistd/build.rs b/src/unistd/build.rs
new file mode 100644
index 00000000..73e152d8
--- /dev/null
+++ b/src/unistd/build.rs
@@ -0,0 +1,11 @@
+extern crate cbindgen;
+
+use std::{env, fs};
+
+fn main() {
+    let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
+    fs::create_dir_all("../../target/include").expect("failed to create include directory");
+    cbindgen::generate(crate_dir)
+      .expect("failed to generate bindings")
+      .write_to_file("../../target/include/unistd.h");
+}
diff --git a/unistd/cbindgen.toml b/src/unistd/cbindgen.toml
similarity index 100%
rename from unistd/cbindgen.toml
rename to src/unistd/cbindgen.toml
diff --git a/unistd/src/lib.rs b/src/unistd/src/lib.rs
similarity index 100%
rename from unistd/src/lib.rs
rename to src/unistd/src/lib.rs
diff --git a/unistd/build.rs b/unistd/build.rs
deleted file mode 100644
index c1285366..00000000
--- a/unistd/build.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-extern crate cbindgen;
-
-use std::{env, fs};
-
-fn main() {
-    let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");
-    fs::create_dir_all("../target/include").expect("failed to create include directory");
-    cbindgen::generate(crate_dir)
-      .expect("failed to generate bindings")
-      .write_to_file("../target/include/unistd.h");
-}
-- 
GitLab