diff options
Diffstat (limited to 'src/api/schema.zig')
-rw-r--r-- | src/api/schema.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/api/schema.zig b/src/api/schema.zig index b6f1a47f0..d32b8fb23 100644 --- a/src/api/schema.zig +++ b/src/api/schema.zig @@ -200,6 +200,9 @@ pub const Api = struct { /// platform platform: ?Platform = null, + /// watch + watch: ?bool = null, + pub fn decode(allocator: *std.mem.Allocator, reader: anytype) anyerror!TransformOptions { var obj = std.mem.zeroes(TransformOptions); try update(&obj, allocator, reader); @@ -374,6 +377,9 @@ pub const Api = struct { 17 => { result.platform = try reader.readEnum(Platform, .Little); }, + 18 => { + result.watch = (try reader.readByte()) == @as(u8, 1); + }, else => { return error.InvalidMessage; }, @@ -534,6 +540,11 @@ pub const Api = struct { try writer.writeByte(17); try writer.writeIntNative(@TypeOf(@enumToInt(result.platform orelse unreachable)), @enumToInt(result.platform orelse unreachable)); } + + if (result.watch) |watch| { + try writer.writeByte(18); + try writer.writeByte(@boolToInt(watch)); + } try writer.writeByte(0); return; } |