From 49064888b96e6bb65e99ab551d0f7e8e16d1cf8c Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 27 Jun 2023 09:59:34 +0800 Subject: [PATCH] add echo struct --- bash-5.1/builtins_rust/echo/src/lib.rs | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/bash-5.1/builtins_rust/echo/src/lib.rs b/bash-5.1/builtins_rust/echo/src/lib.rs index e69de29b..7794985b 100644 --- a/bash-5.1/builtins_rust/echo/src/lib.rs +++ b/bash-5.1/builtins_rust/echo/src/lib.rs @@ -0,0 +1,34 @@ +extern crate libc; + +use libc::{c_char,c_int, strchr, putchar,clearerr,free,FILE, fprintf, c_void}; +use std::ffi::{CString,CStr,}; +use rcommon::{WordList, WordDesc, EX_USAGE, EXECUTION_SUCCESS, EXECUTION_FAILURE}; +// use std::io::{stdout, Write}; +use std::ptr::read_volatile; +use rhelp::r_builtin_help; + +//结构体 + +//枚举 + +//宏 +#[macro_export] +macro_rules! VALID_ECHO_OPTIONS { + () => { + CString::new("neE").unwrap().as_ptr() + }; +} + + +#[macro_export] +macro_rules! QUIT { + () => { + if read_volatile(&terminating_signal as *const i32) != 0{ + termsig_handler(read_volatile(&terminating_signal as *const i32)); + } + if interrupt_state != 0{ + throw_to_top_level(); + } + }; +} + -- Gitee