tiny.sql.decodeHistoryRemoteConfig
Defined in sync.
Source
Source: lib/sql/src/sync.zig:525
zig
pub fn decodeRemoteConfig(allocator: Allocator, bytes: []const u8) Error!RemoteConfig { var reader = RemoteConfigReader.init(bytes); if (try reader.readU32() != remote_config_magic) return error.InvalidRemoteConfig; const format_version = try reader.readU32(); if (format_version != 1 and format_version != remote_config_format_version) return error.InvalidRemoteConfig; const count = try reader.readCount(); const remotes = try allocator.alloc(RemoteConfigEntry, count); var read: usize = 0; errdefer { for (remotes[0..read]) |*remote| remote.deinit(allocator); if (remotes.len != 0) allocator.free(remotes); } for (remotes) |*remote| { const name = try reader.readBytes(); const history_path = try reader.readBytes(); const lock_path = switch (try reader.readU8()) { 0 => null, 1 => try reader.readBytes(), else => return error.InvalidRemoteConfig, }; const default_branch = if (format_version >= 2) switch (try reader.readU8()) { 0 => null, 1 => try reader.readBytes(), else => return error.InvalidRemoteConfig, } else null; remote.* = try RemoteConfigEntry.initWithDefaultBranch(allocator, name, history_path, lock_path, default_branch); read += 1; } try reader.finish(); try validateRemoteEntries(remotes); return .{ .allocator = allocator, .remotes = remotes, };}Source: lib/sql/src/root.zig:117
zig
pub const decodeHistoryRemoteConfig = sync.decodeRemoteConfig;Complete call list
8 direct calls.
tiny.sql.sync.RemoteConfigEntry.initWithDefaultBranch[function] atlib/sql/src/sync.zig:106lib.sql.src.sync.RemoteConfigReader.finish[method] — private source atlib/sql/src/sync.zig:1567in nearest public ownertiny.sql.synclib.sql.src.sync.RemoteConfigReader.init[function] — private source atlib/sql/src/sync.zig:1563in nearest public ownertiny.sql.synclib.sql.src.sync.RemoteConfigReader.readBytes[method] — private source atlib/sql/src/sync.zig:1571in nearest public ownertiny.sql.synclib.sql.src.sync.RemoteConfigReader.readCount[method] — private source atlib/sql/src/sync.zig:1579in nearest public ownertiny.sql.synclib.sql.src.sync.RemoteConfigReader.readU32[method] — private source atlib/sql/src/sync.zig:1590in nearest public ownertiny.sql.synclib.sql.src.sync.RemoteConfigReader.readU8[method] — private source atlib/sql/src/sync.zig:1583in nearest public ownertiny.sql.synclib.sql.src.sync.validateRemoteEntries[function] — private source atlib/sql/src/sync.zig:1721in nearest public ownertiny.sql.sync
Audit
| Definitions | 1 |
|---|---|
| Public names | 2 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |