authorgravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-14 02:09:08 -08:00
committergravatar for hello@nektro.netMeghan <hello@nektro.net> 2020-11-14 02:09:08 -08:00
log099cd5c67482bf339740212a457a053a98a96944
treeb28a2ea2eb65c7e5267688090729f497620d407c
parent6857d71ebabe15e9a6883f310860315f6afc615a

zig: add util/ascii


1 files changed, 46 insertions(+), 0 deletions(-)

src/util/ascii.zig created+46
...@@ -0,0 +1,46 @@
1const std = @import("std");
2const gpa = std.heap.c_allocator;
3
4const u = @import("index.zig");
5
6//
7//
8
9pub const ascii = enum(u8) {
10 NUL,
11 SOH,
12 STX,
13 ETX,
14 EOT,
15 ENQ,
16 ACK,
17 BEL,
18 BS,
19 TAB,
20 LF,
21 VT,
22 FF,
23 CR,
24 SO,
25 SI,
26 DLE,
27 DC1,
28 DC2,
29 DC3,
30 DC4,
31 NAK,
32 SYN,
33 ETB,
34 CAN,
35 EM,
36 SUB,
37 ESC,
38 FS,
39 GS,
40 RS,
41 US,
42
43 pub fn s(self: ascii) []const u8 {
44 return &[_]u8{@enumToInt(self)};
45 }
46};