Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/basic_cli/cmd.sp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/// Run a command and capture its stdout as a string.
/// Returns the full stdout output on success.
foreign fn process_run(cmd: String, args: List[String]) -> String ! ExecError uses [Spawn]
pub foreign fn process_run(cmd: Str, args: List[Str]) -> Str ! ExecError uses [Spawn]

/// Run a command and return its exit code.
foreign fn process_run_status(cmd: String, args: List[String]) -> Int ! ExecError uses [Spawn]
pub foreign fn process_run_status(cmd: Str, args: List[Str]) -> Int ! ExecError uses [Spawn]
4 changes: 2 additions & 2 deletions src/basic_cli/dir.sp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// basic-cli platform — Directory operations

/// List entries in a directory, returning their names.
foreign fn dir_list(path: String) -> List[String] ! IoError uses [FileRead]
pub foreign fn dir_list(path: Str) -> List[Str] ! IoError uses [FileRead]

/// Create a directory (and any missing parents).
foreign fn dir_mkdir(path: String) -> Unit ! IoError uses [FileWrite]
pub foreign fn dir_mkdir(path: Str) -> () ! IoError uses [FileWrite]
4 changes: 2 additions & 2 deletions src/basic_cli/env.sp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// basic-cli platform — Environment variable access

/// Get the value of an environment variable, or None if not set.
foreign fn env_get(key: String) -> Option[String] uses [Env]
pub foreign fn env_get(key: Str) -> Option[Str] uses [Env]

/// Set an environment variable.
foreign fn env_set(key: String, value: String) -> Unit uses [Env]
pub foreign fn env_set(key: Str, value: Str) -> () uses [Env]
8 changes: 4 additions & 4 deletions src/basic_cli/file.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
/// Provides capability-gated file read and write operations.

/// Read the entire contents of a file as a string.
foreign fn file_read(path: String) -> String ! IoError uses [FileRead]
pub foreign fn file_read(path: Str) -> Str ! IoError uses [FileRead]

/// Write content to a file, creating or overwriting it.
foreign fn file_write(path: String, content: String) -> Unit ! IoError uses [FileWrite]
pub foreign fn file_write(path: Str, content: Str) -> () ! IoError uses [FileWrite]

/// Check whether a file or directory exists at the given path.
foreign fn file_exists(path: String) -> Bool uses [FileRead]
pub foreign fn file_exists(path: Str) -> Bool uses [FileRead]

/// Get file metadata (size, modified time, etc.) as a string representation.
foreign fn file_stat(path: String) -> String ! IoError uses [FileRead]
pub foreign fn file_stat(path: Str) -> Str ! IoError uses [FileRead]
2 changes: 1 addition & 1 deletion src/basic_cli/stdin.sp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// basic-cli platform — Standard input operations

/// Read a line from stdin (blocks until newline).
foreign fn read_line() -> String uses [Console]
pub foreign fn read_line() -> Str ! IoError uses [Console]
8 changes: 4 additions & 4 deletions src/basic_cli/stdout.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
/// Provides capability-gated access to stdout/stderr.

/// Print a string to stdout without trailing newline.
foreign fn print(s: String) -> Unit uses [Console]
pub foreign fn print(s: Str) -> () ! IoError uses [Console]

/// Print a string to stdout with trailing newline.
foreign fn println(s: String) -> Unit uses [Console]
pub foreign fn println(s: Str) -> () uses [Console]

/// Print a formatted string to stderr.
foreign fn eprint(s: String) -> Unit uses [Console]
pub foreign fn eprint(s: Str) -> () ! IoError uses [Console]

/// Print a formatted string to stderr with trailing newline.
foreign fn eprintln(s: String) -> Unit uses [Console]
pub foreign fn eprintln(s: Str) -> () uses [Console]
Loading