Last active
April 16, 2019 13:41
-
-
Save bketelsen/ad78123b34b08cb740a9e285bf783e19 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const cstring = packed struct { | |
ptr: [*c]u8, | |
len: usize, | |
fn init(slice: []const u8) cstring { | |
return cstring{ | |
.ptr = slice.ptr, | |
.len = slice.len | |
}; | |
} | |
}; | |
export fn hello() cstring { | |
var h = "<div>Hello Brian</div>"; | |
return cstring.init(h); | |
} |
Author
bketelsen
commented
Apr 16, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment