Switch to <* *> docs. Fix issue with dynamically loaded C3 libs with other C3 code.

This commit is contained in:
Christoffer Lerno
2024-10-12 17:55:05 +02:00
committed by Christoffer Lerno
parent 9f6a4eb300
commit 31cd839063
119 changed files with 3271 additions and 3277 deletions

View File

@@ -4,11 +4,11 @@
module std::os::env;
import std::io::path, libc, std::os;
/**
* @param [in] name
* @require name.len > 0
* @return! SearchResult.MISSING
**/
<*
@param [in] name
@require name.len > 0
@return! SearchResult.MISSING
*>
fn String! get_var(String name, Allocator allocator = allocator::heap())
{
@pool(allocator)
@@ -41,11 +41,11 @@ fn String! get_var_temp(String name)
return get_var(name, allocator::temp());
}
/**
* @param [in] name
* @param [in] value
* @require name.len > 0
**/
<*
@param [in] name
@param [in] value
@require name.len > 0
*>
fn bool set_var(String name, String value, bool overwrite = true)
{
@pool()
@@ -69,9 +69,9 @@ fn bool set_var(String name, String value, bool overwrite = true)
}
/**
* Returns the current user's home directory.
**/
<*
Returns the current user's home directory.
*>
fn String! get_home_dir(Allocator using = allocator::heap())
{
String home;
@@ -88,9 +88,9 @@ fn Path! get_config_dir(Allocator allocator = allocator::heap()) @deprecated("us
return new_get_config_dir(allocator) @inline;
}
/**
* Returns the current user's config directory.
**/
<*
Returns the current user's config directory.
*>
fn Path! new_get_config_dir(Allocator allocator = allocator::heap())
{
@pool(allocator)
@@ -111,10 +111,10 @@ fn Path! new_get_config_dir(Allocator allocator = allocator::heap())
}
/**
* @param [in] name
* @require name.len > 0
**/
<*
@param [in] name
@require name.len > 0
*>
fn bool clear_var(String name)
{
@pool()

View File

@@ -114,9 +114,9 @@ fn WString convert_command_line_win32(String[] command_line) @inline @if(env::WI
return str.str_view().to_temp_wstring()!!;
}
/**
* @require !environment || !options.inherit_environment
**/
<*
@require !environment || !options.inherit_environment
*>
fn SubProcess! create(String[] command_line, SubProcessOptions options = {}, String[] environment = {}) @if(env::WIN32)
{
void* rd, wr;
@@ -241,9 +241,9 @@ fn SubProcess! create(String[] command_line, SubProcessOptions options = {}, Str
};
}
/**
* @require command_line.len > 0
**/
<*
@require command_line.len > 0
*>
fn ZString* tcopy_command_line(String[] command_line) @local @inline @if(env::POSIX)
{
ZString* copy = mem::temp_alloc_array(ZString, command_line.len + 1);
@@ -276,9 +276,9 @@ fn String! execute_stdout_to_buffer(char[] buffer, String[] command_line, SubPro
return (String)buffer[:len - 1];
}
/**
* @require !environment || !options.inherit_environment
**/
<*
@require !environment || !options.inherit_environment
*>
fn SubProcess! create(String[] command_line, SubProcessOptions options = {}, String[] environment = {}) @if(env::POSIX)
{
CInt[2] stdinfd;
@@ -405,9 +405,9 @@ fn void! SubProcess.terminate(&self)
$endif
}
/**
* @require size <= Win32_DWORD.max
**/
<*
@require size <= Win32_DWORD.max
*>
fn usz! read_from_file_win32(CFile file, Win32_HANDLE event_handle, char* buffer, usz size) @if(env::WIN32) @local
{
CInt fd = libc::fileno(file);