Rename wasi_config_set_std[in|out|err].
This commit renames `wasi_config_set_std[in|out|err]` to `wasi_config_set_std[in|out|err]_file` so we can reserve the former for when the C API supports a stream abstraction.
This commit is contained in:
@@ -35,13 +35,13 @@ WASI_API_EXTERN void wasi_config_inherit_argv(wasi_config_t* config);
|
|||||||
WASI_API_EXTERN void wasi_config_set_env(wasi_config_t* config, int envc, const char* names[], const char* values[]);
|
WASI_API_EXTERN void wasi_config_set_env(wasi_config_t* config, int envc, const char* names[], const char* values[]);
|
||||||
WASI_API_EXTERN void wasi_config_inherit_env(wasi_config_t* config);
|
WASI_API_EXTERN void wasi_config_inherit_env(wasi_config_t* config);
|
||||||
|
|
||||||
WASI_API_EXTERN bool wasi_config_set_stdin(wasi_config_t* config, const char* path);
|
WASI_API_EXTERN bool wasi_config_set_stdin_file(wasi_config_t* config, const char* path);
|
||||||
WASI_API_EXTERN void wasi_config_inherit_stdin(wasi_config_t* config);
|
WASI_API_EXTERN void wasi_config_inherit_stdin(wasi_config_t* config);
|
||||||
|
|
||||||
WASI_API_EXTERN bool wasi_config_set_stdout(wasi_config_t* config, const char* path);
|
WASI_API_EXTERN bool wasi_config_set_stdout_file(wasi_config_t* config, const char* path);
|
||||||
WASI_API_EXTERN void wasi_config_inherit_stdout(wasi_config_t* config);
|
WASI_API_EXTERN void wasi_config_inherit_stdout(wasi_config_t* config);
|
||||||
|
|
||||||
WASI_API_EXTERN bool wasi_config_set_stderr(wasi_config_t* config, const char* path);
|
WASI_API_EXTERN bool wasi_config_set_stderr_file(wasi_config_t* config, const char* path);
|
||||||
WASI_API_EXTERN void wasi_config_inherit_stderr(wasi_config_t* config);
|
WASI_API_EXTERN void wasi_config_inherit_stderr(wasi_config_t* config);
|
||||||
|
|
||||||
WASI_API_EXTERN bool wasi_config_preopen_dir(wasi_config_t* config, const char* path, const char* guest_path);
|
WASI_API_EXTERN bool wasi_config_preopen_dir(wasi_config_t* config, const char* path, const char* guest_path);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ pub unsafe extern "C" fn wasi_config_inherit_env(config: *mut wasi_config_t) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn wasi_config_set_stdin(
|
pub unsafe extern "C" fn wasi_config_set_stdin_file(
|
||||||
config: *mut wasi_config_t,
|
config: *mut wasi_config_t,
|
||||||
path: *const c_char,
|
path: *const c_char,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
@@ -103,7 +103,7 @@ pub unsafe extern "C" fn wasi_config_inherit_stdin(config: *mut wasi_config_t) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn wasi_config_set_stdout(
|
pub unsafe extern "C" fn wasi_config_set_stdout_file(
|
||||||
config: *mut wasi_config_t,
|
config: *mut wasi_config_t,
|
||||||
path: *const c_char,
|
path: *const c_char,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
@@ -123,7 +123,7 @@ pub unsafe extern "C" fn wasi_config_inherit_stdout(config: *mut wasi_config_t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub unsafe extern "C" fn wasi_config_set_stderr(
|
pub unsafe extern "C" fn wasi_config_set_stderr_file(
|
||||||
config: *mut wasi_config_t,
|
config: *mut wasi_config_t,
|
||||||
path: *const c_char,
|
path: *const c_char,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
|
|||||||
@@ -854,7 +854,7 @@ namespace Wasmtime
|
|||||||
public static extern void wasi_config_inherit_env(WasiConfigHandle config);
|
public static extern void wasi_config_inherit_env(WasiConfigHandle config);
|
||||||
|
|
||||||
[DllImport(LibraryName)]
|
[DllImport(LibraryName)]
|
||||||
public static extern bool wasi_config_set_stdin(
|
public static extern bool wasi_config_set_stdin_file(
|
||||||
WasiConfigHandle config,
|
WasiConfigHandle config,
|
||||||
[MarshalAs(UnmanagedType.LPUTF8Str)] string path
|
[MarshalAs(UnmanagedType.LPUTF8Str)] string path
|
||||||
);
|
);
|
||||||
@@ -863,7 +863,7 @@ namespace Wasmtime
|
|||||||
public static extern void wasi_config_inherit_stdin(WasiConfigHandle config);
|
public static extern void wasi_config_inherit_stdin(WasiConfigHandle config);
|
||||||
|
|
||||||
[DllImport(LibraryName)]
|
[DllImport(LibraryName)]
|
||||||
public static extern bool wasi_config_set_stdout(
|
public static extern bool wasi_config_set_stdout_file(
|
||||||
WasiConfigHandle config,
|
WasiConfigHandle config,
|
||||||
[MarshalAs(UnmanagedType.LPUTF8Str)] string path
|
[MarshalAs(UnmanagedType.LPUTF8Str)] string path
|
||||||
);
|
);
|
||||||
@@ -872,7 +872,7 @@ namespace Wasmtime
|
|||||||
public static extern void wasi_config_inherit_stdout(WasiConfigHandle config);
|
public static extern void wasi_config_inherit_stdout(WasiConfigHandle config);
|
||||||
|
|
||||||
[DllImport(LibraryName)]
|
[DllImport(LibraryName)]
|
||||||
public static extern bool wasi_config_set_stderr(
|
public static extern bool wasi_config_set_stderr_file(
|
||||||
WasiConfigHandle config,
|
WasiConfigHandle config,
|
||||||
[MarshalAs(UnmanagedType.LPUTF8Str)] string path
|
[MarshalAs(UnmanagedType.LPUTF8Str)] string path
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ namespace Wasmtime
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(_standardInputPath))
|
if (!string.IsNullOrEmpty(_standardInputPath))
|
||||||
{
|
{
|
||||||
if (!Interop.wasi_config_set_stdin(config, _standardInputPath))
|
if (!Interop.wasi_config_set_stdin_file(config, _standardInputPath))
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException($"Failed to set stdin to file '{_standardInputPath}'.");
|
throw new InvalidOperationException($"Failed to set stdin to file '{_standardInputPath}'.");
|
||||||
}
|
}
|
||||||
@@ -359,7 +359,7 @@ namespace Wasmtime
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(_standardOutputPath))
|
if (!string.IsNullOrEmpty(_standardOutputPath))
|
||||||
{
|
{
|
||||||
if (!Interop.wasi_config_set_stdout(config, _standardOutputPath))
|
if (!Interop.wasi_config_set_stdout_file(config, _standardOutputPath))
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException($"Failed to set stdout to file '{_standardOutputPath}'.");
|
throw new InvalidOperationException($"Failed to set stdout to file '{_standardOutputPath}'.");
|
||||||
}
|
}
|
||||||
@@ -376,7 +376,7 @@ namespace Wasmtime
|
|||||||
|
|
||||||
if (!string.IsNullOrEmpty(_standardErrorPath))
|
if (!string.IsNullOrEmpty(_standardErrorPath))
|
||||||
{
|
{
|
||||||
if (!Interop.wasi_config_set_stderr(config, _standardErrorPath))
|
if (!Interop.wasi_config_set_stderr_file(config, _standardErrorPath))
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException($"Failed to set stderr to file '{_standardErrorPath}'.");
|
throw new InvalidOperationException($"Failed to set stderr to file '{_standardErrorPath}'.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user