mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-24 14:23:52 +08:00
Expose out_is_redirected to rust
This commit is contained in:
parent
d02d0f3309
commit
7c37b681b2
|
@ -89,14 +89,21 @@ pub struct io_streams_t {
|
|||
streams: *mut builtins_ffi::io_streams_t,
|
||||
pub out: output_stream_t,
|
||||
pub err: output_stream_t,
|
||||
pub out_is_redirected: bool,
|
||||
}
|
||||
|
||||
impl io_streams_t {
|
||||
pub fn new(mut streams: Pin<&mut builtins_ffi::io_streams_t>) -> io_streams_t {
|
||||
let out = output_stream_t(streams.as_mut().get_out().unpin());
|
||||
let err = output_stream_t(streams.as_mut().get_err().unpin());
|
||||
let out_is_redirected = streams.as_mut().get_out_redirected();
|
||||
let streams = streams.unpin();
|
||||
io_streams_t { streams, out, err }
|
||||
io_streams_t {
|
||||
streams,
|
||||
out,
|
||||
err,
|
||||
out_is_redirected,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn ffi_pin(&mut self) -> Pin<&mut builtins_ffi::io_streams_t> {
|
||||
|
|
|
@ -25,6 +25,8 @@ include_cpp! {
|
|||
#include "fallback.h"
|
||||
#include "fds.h"
|
||||
#include "flog.h"
|
||||
#include "function.h"
|
||||
#include "highlight.h"
|
||||
#include "io.h"
|
||||
#include "parse_constants.h"
|
||||
#include "parser.h"
|
||||
|
@ -108,6 +110,8 @@ include_cpp! {
|
|||
generate!("function_get_annotated_definition")
|
||||
generate!("function_is_copy")
|
||||
generate!("function_exists")
|
||||
|
||||
generate!("colorize_shell")
|
||||
}
|
||||
|
||||
impl parser_t {
|
||||
|
|
Loading…
Reference in New Issue
Block a user