mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 14:43:28 +00:00
add nullable ada url functions
not fully sure how we should implement those; I believe we should move forward with nullable functions and put null-check logic outside of the wrappers
This commit is contained in:
8
vendor/ada/root.zig
vendored
8
vendor/ada/root.zig
vendored
@@ -63,6 +63,10 @@ pub inline fn getOrigin(url: URL) []const u8 {
|
||||
return origin.data[0..origin.length];
|
||||
}
|
||||
|
||||
pub inline fn getOriginNullable(url: URL) OwnedString {
|
||||
return c.ada_get_origin(url);
|
||||
}
|
||||
|
||||
pub inline fn getHrefNullable(url: URL) String {
|
||||
return c.ada_get_href(url);
|
||||
}
|
||||
@@ -79,6 +83,10 @@ pub inline fn getPassword(url: URL) []const u8 {
|
||||
return password.data[0..password.length];
|
||||
}
|
||||
|
||||
pub inline fn getPortNullable(url: URL) String {
|
||||
return c.ada_get_port(url);
|
||||
}
|
||||
|
||||
pub inline fn getPort(url: URL) []const u8 {
|
||||
if (!c.ada_has_port(url)) {
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user