From 1b6a04ca5504955c571d1c97504fb45ea0befee4 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 8 Jan 2024 01:21:28 +0400 Subject: Initial vendor packages Signed-off-by: Valentin Popov --- vendor/redox_syscall/src/scheme/generate.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 vendor/redox_syscall/src/scheme/generate.sh (limited to 'vendor/redox_syscall/src/scheme/generate.sh') diff --git a/vendor/redox_syscall/src/scheme/generate.sh b/vendor/redox_syscall/src/scheme/generate.sh new file mode 100755 index 0000000..be851f5 --- /dev/null +++ b/vendor/redox_syscall/src/scheme/generate.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash + +set -e + +echo "Generating SchemeMut from Scheme" +sed 's/trait Scheme/trait SchemeMut/' scheme.rs \ +| sed 's/\&self/\&mut self/g' \ +> scheme_mut.rs + +echo "Generating SchemeBlock from Scheme" +sed 's/trait Scheme/trait SchemeBlock/' scheme.rs \ +| sed 's/fn handle(\&self, packet: \&mut Packet)/fn handle(\&self, packet: \&Packet) -> Option/' \ +| sed 's/packet.a = Error::mux(res);/res.transpose().map(Error::mux)/' \ +| sed 's/\.map(|f| f\.bits())/\.map(|f| f.map(|f| f.bits()))/' \ +| sed 's/\.map(|o| o as usize)/.map(|o| o.map(|o| o as usize))/' \ +| sed 's/Ok(0)/Ok(Some(0))/g' \ +| sed 's/Result<\([^>]\+\)>/Result>/g' \ +| sed 's/convert_to_this_scheme/convert_to_this_scheme_block/g' \ +| sed 's/convert_in_scheme_handle/convert_in_scheme_handle_block/g' \ +> scheme_block.rs + +echo "Generating SchemeBlockMut from SchemeBlock" +sed 's/trait SchemeBlock/trait SchemeBlockMut/' scheme_block.rs \ +| sed 's/\&self/\&mut self/g' \ +> scheme_block_mut.rs -- cgit v1.2.3