mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Add Stderr.line to cli-platform
This commit is contained in:
parent
d0656bf793
commit
762fa75511
3 changed files with 12 additions and 6 deletions
|
@ -113,7 +113,7 @@ unsafe fn call_the_closure(closure_data_ptr: *const u8) -> i64 {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn roc_fx_getLine() -> RocStr {
|
||||
pub extern "C" fn roc_fx_stdinLine() -> RocStr {
|
||||
use std::io::{self, BufRead};
|
||||
|
||||
let stdin = io::stdin();
|
||||
|
@ -123,11 +123,17 @@ pub extern "C" fn roc_fx_getLine() -> RocStr {
|
|||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn roc_fx_putLine(line: &RocStr) {
|
||||
pub extern "C" fn roc_fx_stdoutLine(line: &RocStr) {
|
||||
let string = line.as_str();
|
||||
println!("{}", string);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn roc_fx_stderrLine(line: &RocStr) {
|
||||
let string = line.as_str();
|
||||
eprintln!("{}", string);
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn roc_fx_sendRequest(roc_request: &glue::Request) -> glue::Response {
|
||||
let mut builder = reqwest::blocking::ClientBuilder::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue