mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
$exec may now provide a stdin parameter. Deprecated path.append, path.tappend, getcwd, tgetcwd, path.absolute, ls. Deprecated env::get_config_dir, replaced by env::new_get_config_dir. Added path.has_extension, path.new_append, path.temp_append, new_cwd, temp_cwd, path.new_absolute, new_ls, temp_ls. Added dstring.replace Updated win escapes for exec.
This commit is contained in:
@@ -83,10 +83,15 @@ fn String! get_home_dir(Allocator using = allocator::heap())
|
||||
return get_var(home, using);
|
||||
}
|
||||
|
||||
fn Path! get_config_dir(Allocator allocator = allocator::heap()) @deprecated("use new_get_config_dir()")
|
||||
{
|
||||
return new_get_config_dir(allocator) @inline;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the current user's config directory.
|
||||
**/
|
||||
fn Path! get_config_dir(Allocator allocator = allocator::heap())
|
||||
fn Path! new_get_config_dir(Allocator allocator = allocator::heap())
|
||||
{
|
||||
@pool(allocator)
|
||||
{
|
||||
@@ -100,7 +105,7 @@ fn Path! get_config_dir(Allocator allocator = allocator::heap())
|
||||
String s = get_var_temp("XDG_CONFIG_HOME") ?? get_var_temp("HOME")!;
|
||||
const DIR = ".config";
|
||||
$endif
|
||||
return path::temp_new(s).append(DIR, .allocator = allocator);
|
||||
return path::temp_new(s).new_append(DIR, .allocator = allocator);
|
||||
$endif
|
||||
};
|
||||
}
|
||||
@@ -126,11 +131,16 @@ fn bool clear_var(String name)
|
||||
};
|
||||
}
|
||||
|
||||
fn String! executable_path(Allocator allocator = allocator::heap())
|
||||
fn String! executable_path(Allocator allocator = allocator::heap()) @deprecated("use new_executable_path()")
|
||||
{
|
||||
return new_executable_path(allocator) @inline;
|
||||
}
|
||||
|
||||
fn String! new_executable_path(Allocator allocator = allocator::heap())
|
||||
{
|
||||
$if env::DARWIN:
|
||||
return darwin::executable_path(allocator);
|
||||
$else
|
||||
return "<Unsupported>";
|
||||
return SearchResult.MISSING?;
|
||||
$endif
|
||||
}
|
||||
@@ -80,7 +80,7 @@ fn uptr! load_address() @local
|
||||
{
|
||||
Darwin_segment_command_64* cmd = darwin::getsegbyname("__TEXT");
|
||||
if (!cmd) return BacktraceFault.SEGMENT_NOT_FOUND?;
|
||||
String path = env::executable_path(allocator::temp()) ?? BacktraceFault.EXECUTABLE_PATH_NOT_FOUND?!;
|
||||
String path = env::new_executable_path(allocator::temp()) ?? BacktraceFault.EXECUTABLE_PATH_NOT_FOUND?!;
|
||||
uint dyld_count = darwin::_dyld_image_count();
|
||||
for (uint i = 0; i < dyld_count; i++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user