diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-05-07 10:52:52 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-05-07 10:52:52 -0700 |
| commit | 01c46eef3a7e4fd5a96f364541c539746ae1ea3b (patch) | |
| tree | 447b4bf1086aae9a01844abcb9e55156d3007c26 /std/str.zig | |
| parent | 6f0f357ee43fc02ad2dc1eb44ab127c0d741282c (diff) | |
| download | zig-01c46eef3a7e4fd5a96f364541c539746ae1ea3b.tar.gz zig-01c46eef3a7e4fd5a96f364541c539746ae1ea3b.zip | |
std: separate str and cstr
Diffstat (limited to 'std/str.zig')
| -rw-r--r-- | std/str.zig | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/std/str.zig b/std/str.zig index 060921d199..529c8ae7a0 100644 --- a/std/str.zig +++ b/std/str.zig @@ -1,22 +1,5 @@ const assert = @import("index.zig").assert; -// fix https://github.com/andrewrk/zig/issues/140 -// and then make this able to run at compile time -#static_eval_enable(false) -pub fn len(ptr: &const u8) -> isize { - var count: isize = 0; - while (ptr[count] != 0; count += 1) {} - return count; -} - -pub fn from_c_const(str: &const u8) -> []const u8 { - return str[0...len(str)]; -} - -pub fn from_c(str: &u8) -> []u8 { - return str[0...len(str)]; -} - pub const eql = slice_eql(u8); pub fn slice_eql(T: type)(a: []const T, b: []const T) -> bool { |
