this repo has no description
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

update to zig 0.14.0

+61 -40
+1 -1
README.md
··· 18 18 ### Zig Build System 19 19 20 20 `comlink` is written in zig and can be installed using the zig build system, 21 - version 0.13.0. 21 + version 0.14.0. 22 22 23 23 ```sh 24 24 git clone https://github.com/rockorager/comlink
+12 -11
build.zig.zon
··· 1 1 .{ 2 - .name = "comlink", 2 + .name = .comlink, 3 + .fingerprint = 0xa8dac1987074e6a3, 3 4 .version = "0.0.0", 4 5 .dependencies = .{ 5 6 .ziglua = .{ 6 - .url = "git+https://github.com/natecraddock/ziglua?ref=main#d853aa9450ae568a39ea02d7082e85bafc33f735", 7 - .hash = "1220affeb3fe37ef09411b5a213b5fdf9bb6568e9913bade204694648983a8b2776d", 7 + .url = "git+https://github.com/natecraddock/ziglua#00a3c39c587b1b853748c05b5f5c1dc68f5f3683", 8 + .hash = "ziglua-0.1.0-AAAAAMDKBADubTbfjHhHI0_1IS63_IV9KEsNLsy0fLm6", 8 9 }, 9 10 .vaxis = .{ 10 - .url = "git+https://github.com/rockorager/libvaxis#b6043f4497cea176acaea5574ff7011383f1c706", 11 - .hash = "1220d1ad3e0cd20b4a7c0810aec229a1af0a95c80bcdb4acbe69d04db4e5c0f403d3", 11 + .url = "git+https://github.com/rockorager/libvaxis#49fcd338121e6e750c3093807fae3539232066e0", 12 + .hash = "vaxis-0.1.0-BWNV_OHxCAAQonfy3m999V2NDOd5HFEXuDrdQu1J0keS", 12 13 }, 13 14 .zeit = .{ 14 - .url = "git+https://github.com/rockorager/zeit?ref=main#d943bc4bfe9e18490460dfdd64f48e997065eba8", 15 - .hash = "1220a021c15abe512e13fcf4615ee43f17ed09da80d49a0710116702666a7a04a6dd", 15 + .url = "git+https://github.com/rockorager/zeit#44bebf856693332b168d8ba2c45b9d1ec15511de", 16 + .hash = "zeit-0.0.0-5I6bk_pZAgB03N1p1GmVOZ--gOFwwQSRKj1UXb5tnaKS", 16 17 }, 17 18 .tls = .{ 18 - .url = "git+https://github.com/ianic/tls.zig#36ae29b0e51fae564222767ffd5d7f60f9a8dd0b", 19 - .hash = "1220319a215975c0ac3d251b334bfb915765adf21f7e64904028b1ec5ebcf00ea3cd", 19 + .url = "git+https://github.com/ianic/tls.zig#61bb43320a556363576becacd34f5bce36f8ef8d", 20 + .hash = "tls-0.1.0-ER2e0g70BABeDPnhrdr_joLOb_GSEYLSXe9EezhPG1Qg", 20 21 }, 21 22 .zzdoc = .{ 22 - .url = "git+https://github.com/rockorager/zzdoc?ref=main#c36a0e7557197e97d16bb2d52a4ea132c830add6", 23 - .hash = "1220b7f4bf11d7cbf1077a84fbb1a2d342c63769590898f1ae17a4305f24a1246f63", 23 + .url = "git+https://github.com/rockorager/zzdoc#57e86eb4e621bc4a96fbe0dd89ad0986db6d0483", 24 + .hash = "zzdoc-0.0.0-tzT1PuPZAACr1jIJxjTrdOsLbfXS6idWFGfTq0gwxJiv", 24 25 }, 25 26 }, 26 27 .paths = .{""},
+1 -1
src/app.zig
··· 130 130 .yellow = null, 131 131 }; 132 132 133 - self.lua = try Lua.init(&self.alloc); 133 + self.lua = try Lua.init(self.alloc); 134 134 self.write_thread = try std.Thread.spawn(.{}, writeLoop, .{ self.alloc, &self.write_queue }); 135 135 136 136 try lua.init(self);
+5 -5
src/comlink.zig
··· 30 30 } 31 31 32 32 return @Type(.{ 33 - .Enum = .{ 33 + .@"enum" = .{ 34 34 .decls = &.{}, 35 35 .tag_type = u16, 36 36 .fields = &fields, ··· 44 44 inline for (fields) |f| { 45 45 if (std.mem.eql(u8, field, f.name)) { 46 46 switch (@typeInfo(f.type)) { 47 - .Bool => return .boolean, 48 - .Int, .ComptimeInt => return .number, 49 - .Pointer => |ptr_info| { 47 + .bool => return .boolean, 48 + .int, .comptime_int => return .number, 49 + .pointer => |ptr_info| { 50 50 switch (ptr_info.size) { 51 - .Slice => { 51 + .slice => { 52 52 if (ptr_info.child == u8) return .string; 53 53 }, 54 54 else => {},
+6 -6
src/completer.zig
··· 24 24 buf: [irc.maximum_message_size]u8 = undefined, 25 25 kind: Kind = .nick, 26 26 list_view: vxfw.ListView, 27 - selected: bool, 27 + has_selection: bool, 28 28 29 29 pub fn init(gpa: std.mem.Allocator) Completer { 30 30 return .{ ··· 33 33 .word = "", 34 34 .widest = null, 35 35 .list_view = undefined, 36 - .selected = false, 36 + .has_selection = false, 37 37 }; 38 38 } 39 39 ··· 59 59 self.options.clearAndFree(); 60 60 self.widest = null; 61 61 self.kind = .nick; 62 - self.selected = false; 62 + self.has_selection = false; 63 63 64 64 if (self.word.len > 0 and self.word[0] == '/') { 65 65 self.kind = .command; ··· 80 80 /// item 81 81 pub fn next(self: *Completer, ctx: *vxfw.EventContext) []const u8 { 82 82 if (self.options.items.len == 0) return ""; 83 - if (self.selected) { 83 + if (self.has_selection) { 84 84 self.list_view.prevItem(ctx); 85 85 } 86 - self.selected = true; 86 + self.has_selection = true; 87 87 return self.replacementText(); 88 88 } 89 89 90 90 pub fn prev(self: *Completer, ctx: *vxfw.EventContext) []const u8 { 91 91 if (self.options.items.len == 0) return ""; 92 92 self.list_view.nextItem(ctx); 93 - self.selected = true; 93 + self.has_selection = true; 94 94 return self.replacementText(); 95 95 } 96 96
+9 -9
src/irc.zig
··· 1299 1299 if (!std.mem.eql(u8, a_sender, b_sender)) return true; 1300 1300 1301 1301 if (a_instant != null and b_instant != null) { 1302 - const a_ts = a_instant.?.timestamp_ns; 1303 - const b_ts = b_instant.?.timestamp_ns; 1302 + const a_ts = a_instant.?.timestamp; 1303 + const b_ts = b_instant.?.timestamp; 1304 1304 const delta: i64 = @intCast(a_ts - b_ts); 1305 1305 return @abs(delta) > (5 * std.time.ns_per_min); 1306 1306 } ··· 2387 2387 2388 2388 pub fn del(self: *Client, cap: []const u8) void { 2389 2389 const info = @typeInfo(Capabilities); 2390 - assert(info == .Struct); 2390 + assert(info == .@"struct"); 2391 2391 2392 - inline for (info.Struct.fields) |field| { 2392 + inline for (info.@"struct".fields) |field| { 2393 2393 if (std.mem.eql(u8, field.name, cap)) { 2394 2394 @field(self.caps, field.name) = false; 2395 2395 return; ··· 2399 2399 2400 2400 pub fn ack(self: *Client, cap: []const u8) void { 2401 2401 const info = @typeInfo(Capabilities); 2402 - assert(info == .Struct); 2402 + assert(info == .@"struct"); 2403 2403 2404 - inline for (info.Struct.fields) |field| { 2404 + inline for (info.@"struct".fields) |field| { 2405 2405 if (std.mem.eql(u8, field.name, cap)) { 2406 2406 @field(self.caps, field.name) = true; 2407 2407 return; ··· 2507 2507 self.stream = try std.net.tcpConnectToHost(self.alloc, self.config.server, port); 2508 2508 self.client = try tls.client(self.stream, .{ 2509 2509 .host = self.config.server, 2510 - .root_ca = self.app.bundle, 2510 + .root_ca = .{ .bundle = self.app.bundle }, 2511 2511 }); 2512 2512 } else { 2513 2513 const port: u16 = self.config.port orelse 6667; ··· 2520 2520 2521 2521 pub fn configureKeepalive(self: *Client, seconds: i32) !void { 2522 2522 const timeout = std.mem.toBytes(std.posix.timeval{ 2523 - .tv_sec = seconds, 2524 - .tv_usec = 0, 2523 + .sec = seconds, 2524 + .usec = 0, 2525 2525 }); 2526 2526 2527 2527 try std.posix.setsockopt(
+25 -5
src/lua.zig
··· 79 79 .luajit, .lua51 => lua.loadFile(path) catch return error.LuaError, 80 80 else => lua.loadFile(path, .binary_text) catch return error.LuaError, 81 81 } 82 - lua.protectedCall(0, ziglua.mult_return, 0) catch return error.LuaError; 82 + lua.protectedCall(.{ 83 + .args = 0, 84 + .results = ziglua.mult_return, 85 + .msg_handler = 0, 86 + }) catch return error.LuaError; 83 87 } 84 88 85 89 /// retrieves the *App lightuserdata from the registry index ··· 112 116 .function => { 113 117 // Push the table to the top since it is our argument to the function 114 118 lua.pushValue(1); // [table, function, table] 115 - lua.protectedCall(1, 0, 0) catch return error.LuaError; // [table] 119 + lua.protectedCall(.{ 120 + .args = 1, 121 + .results = 0, 122 + .msg_handler = 0, 123 + }) catch return error.LuaError; // [table] 116 124 // clear the stack 117 125 lua.pop(1); // [] 118 126 }, ··· 130 138 _ = lua.pushString(channel); // [function,string] 131 139 _ = lua.pushString(sender); // [function,string,string] 132 140 _ = lua.pushString(msg); // [function,string,string,string] 133 - lua.protectedCall(3, 0, 0) catch return error.LuaError; 141 + lua.protectedCall(.{ 142 + .args = 3, 143 + .results = 0, 144 + .msg_handler = 0, 145 + }) catch return error.LuaError; // [function,string,string,string] 134 146 }, 135 147 else => {}, 136 148 } ··· 139 151 pub fn execFn(lua: *Lua, func: i32) !void { 140 152 const lua_type = lua.rawGetIndex(registry_index, func); // [function] 141 153 switch (lua_type) { 142 - .function => lua.protectedCall(0, 0, 0) catch return error.LuaError, 154 + .function => lua.protectedCall(.{ 155 + .args = 0, 156 + .results = 0, 157 + .msg_handler = 0, 158 + }) catch return error.LuaError, 143 159 else => lua.raiseErrorStr("not a function", .{}), 144 160 } 145 161 } ··· 150 166 _ = lua.pushString(cmdline); // [function, string] 151 167 152 168 switch (lua_type) { 153 - .function => lua.protectedCall(1, 0, 0) catch |err| { 169 + .function => lua.protectedCall(.{ 170 + .args = 0, 171 + .results = 0, 172 + .msg_handler = 0, 173 + }) catch |err| { 154 174 const msg = lua.toString(-1) catch { 155 175 std.log.err("{}", .{err}); 156 176 return error.LuaError;
+2 -2
src/main.zig
··· 64 64 }, 65 65 .flags = 0, 66 66 }; 67 - try std.posix.sigaction(std.posix.SIG.INT, &action, null); 68 - try std.posix.sigaction(std.posix.SIG.TERM, &action, null); 67 + std.posix.sigaction(std.posix.SIG.INT, &action, null); 68 + std.posix.sigaction(std.posix.SIG.TERM, &action, null); 69 69 }, 70 70 } 71 71