code
stringlengths
38
801k
repo_path
stringlengths
6
263
const std = @import("std"); const js = @import("../quickjs.zig"); const GlobalContext = @import("../context.zig"); const E = js.JsCFunctionListEntry; fn cTagName(comptime tag: anytype) [*:0]const u8 { return std.meta.tagName(tag) ++ ""; } const target = std.Target.current; var length_atom: js.JsAtom = .invalid; ...
src/mods/c.zig
const std = @import("std"); const fmt = std.fmt; const math = std.math; const mem = std.mem; const testing = std.testing; const Metric = @import("metric.zig").Metric; const HistogramResult = @import("metric.zig").HistogramResult; const e10_min = -9; const e10_max = 18; const buckets_per_decimal = 18; const decimal_bu...
src/Histogram.zig
const main = @import("main.zig"); const vectors = @import("vectors.zig"); const uart = @import("serial/uart.zig"); pub export fn _start() callconv(.Naked) noreturn { // At startup the stack pointer is at the end of RAM // so, no need to set it manually! // Reference this such that the file is analyzed and...
src/start.zig
const std = @import("std"); const mem = std.mem; pub const StatusCode = enum(u16) { // informational Continue = 100, SwitchingProtocols = 101, Processing = 102, EarlyHints = 103, // success Ok = 200, Created = 201, Accepted = 202, NonAuthoritativeInformation = 203, NoConten...
src/routez/http/common.zig
const std = @import("std"); const lexer = @import("lexer.zig"); const data_types = @import("data_types.zig"); const UsedNumberType = data_types.UsedNumberType; pub const Token = struct { id: lexer.Token.Id, start: u32, data: union { text: []const u8, number: UsedNumberType, single_token: u0, } }; pub fn p...
src/parser.zig
const std = @import("std"); const gen1 = @import("../../gen1/data.zig"); const assert = std.debug.assert; const Type = gen1.Type; pub const Move = enum(u8) { None, Pound, KarateChop, DoubleSlap, CometPunch, MegaPunch, PayDay, FirePunch, IcePunch, ThunderPunch, Scratch, ...
src/lib/gen1/data/moves.zig
const Archive = @This(); const builtin = @import("builtin"); const std = @import("std"); const trace = @import("../tracy.zig").trace; const traceNamed = @import("../tracy.zig").traceNamed; const fmt = std.fmt; const fs = std.fs; const mem = std.mem; const logger = std.log.scoped(.archive); const elf = std.elf; const E...
src/archive/Archive.zig
const std = @import("std"); const builtin = @import("builtin"); const clap = @import("clap"); const http = @import("http"); const net = @import("net"); const ssl = @import("ssl"); const Uri = @import("uri").Uri; const Manifest = @import("manifest.zig"); const Import = @import("import.zig").Import; const os = std.os; c...
src/commands.zig
pub const pallet1 = .{ 0xE0F8CF, 0x86C06C, 0x306850, 0x071821, }; pub const pallet12 = .{ 0x86C06C, 0xE0F8CF, 0x071821, 0x306850, }; pub const pallet13 = .{ 0x071821, 0x306850, 0x86C06C, 0xE0F8CF, }; pub const pallet14 = .{ 0x306850, 0x071821, 0xE0F8CF, ...
src/graphics.zig
const std = @import("std"); const DListError = error { EmptyListHasNoNodes, }; pub fn DList(comptime T: type) type { return struct { pub const Node = struct { item: T, next: ?*DList(T).Node, prev: ?*DList(T).Node, }; allocator: *std.mem.Allo...
dllist.zig
const ImageReader = zigimg.ImageReader; const ImageSeekStream = zigimg.ImageSeekStream; const PixelFormat = zigimg.PixelFormat; const assert = std.debug.assert; const color = zigimg.color; const errors = zigimg.errors; const std = @import("std"); const testing = std.testing; const netpbm = zigimg.netpbm; const zigimg =...
tests/formats/netpbm_test.zig
const std = @import("std"); const Self = @This(); // Minimum exponent that for a fast path case, or `-⌊(MANTISSA_EXPLICIT_BITS+1)/log2(5)⌋` min_exponent_fast_path: comptime_int, // Maximum exponent that for a fast path case, or `⌊(MANTISSA_EXPLICIT_BITS+1)/log2(5)⌋` max_exponent_fast_path: comptime_int, // Maximum e...
lib/std/fmt/parse_float/FloatInfo.zig
const std = @import("std"); const benchmark = @import("benchmark"); const testing = std.testing; /// Holds a list of systems that can be executed sequentially or in parallel. /// Parallel execution requires async to be activated, either through /// - zig test --test-evented-io /// or by adding `pub const io_mode = .e...
src/dispatcher.zig
const std = @import("std"); const os = std.os; const mem = std.mem; const process = std.process; const Allocator = std.mem.Allocator; const util = @import("util.zig"); const RequestResponse = struct { command: []const u8, file_name: []const u8, source: []const u8, argv: []const u8, stderr: []const ...
src/play.zig
const zt = @import("zt"); const std = @import("std"); const sling = @import("sling.zig"); const assert = std.debug.assert; fn AssetWrapper(comptime T: type) type { return struct { pub var lookup = std.StringHashMap(usize).init(sling.alloc); pub var data = std.ArrayList(T).init(sling.alloc); };...
src/asset.zig
const std = @import("std"); const ptk = @import("parser-toolkit"); pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; defer _ = gpa.deinit(); const allocator = &gpa.allocator; var line_buffer = std.ArrayList(u8).init(allocator); defer line_buffer.deinit(); var stdin = s...
examples/calculator.zig
const assert = @import("std").debug.assert; const testing = @import("std").testing; /// Create a type representing a raw memory storage with the specified size and /// alignment requirement. pub fn AlignedStorage(comptime size: usize, comptime alignment: u29) type { // For now there doesn't exist a way to directly...
druzhba/storage.zig
const std = @import("std"); pub const SymbolSize = enum(u8) { @"8 bits" = 1, @"16 bits" = 2, @"32 bits" = 4, @"64 bits" = 8, }; const magic_number = [4]u8{ 0xFB, 0xAD, 0xB6, 0x02 }; pub const Linker = struct { const Module = struct { view: View, // will be defined in the link ste...
src/slf.zig
const std = @import("std"); const glfw = @import("glfw.zig"); const time = @import("std").time; const fs = @import("fs.zig"); const c = @import("c.zig"); extern fn alkaLoadIcon(window: ?*glfw.Window, path: [*c]const u8) callconv(.C) bool; pub const Error = error{FailedToLoadIcon} || glfw.GLFWError || fs.Error; co...
src/core/window.zig
const std = @import("std"); const stdx = @import("stdx"); const t = stdx.testing; const graphics = @import("graphics"); const Graphics = graphics.Graphics; const FontId = graphics.FontId; const StdColor = graphics.Color; const Vec2 = stdx.math.Vec2; const vec2 = Vec2.init; const Mat4 = stdx.math.Mat4; const v8 = @impor...
runtime/api_graphics.zig
const std = @import("std"); const stderr = std.debug.warn; const test_data = @embedFile("test_cases.dat"); const llr = @import("llr.zig"); const fermat = @import("fermat.zig"); const helper = @import("helper.zig"); // LLR test expects n not to be too small in relation to k const MIN_N: u32 = 11; pub fn run(max_n: u3...
selftest.zig
const std = @import("std"); pub const Cats = @import("../../components.zig").DerivedGeneralCategory; pub const Numeric = @import("../../components.zig").DerivedNumericType; pub const Props = @import("../../components.zig").PropList; // isDecimal detects all Unicode decimal numbers. pub fn isDecimal(cp: u21) bool { ...
src/components/aggregate/Number.zig
const std = @import("std"); const assert = std.debug.assert; const warn = std.debug.warn; const builtin = @import("builtin"); const TypeId = builtin.TypeId; test "u0" { //warn("\n"); var usize1: usize = undefined; var usize2: usize = undefined; // Test with u1 var one: u1 = 1; assert(one == 1...
u0-tests.zig
const w4 = @import("../wasm4.zig"); const buttons = @import("../components/button.zig"); const Situation = @import("../components/situation.zig").Situation; const std = @import("std"); const textWrap = @import("../components/wrapping-text.zig").textWrap; const gamepad = @import("../gamepad.zig"); const statemachine = @...
src/screens/main-menu.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const ArrayList = std.ArrayList; const Map = std.AutoHashMap; const StrMap = std.StringHashMap; const BitSet = std.DynamicBitSet; const Str = []const u8; const util = @import("util.zig"); const gpa = util.gpa; const data = @embedFile("../data/puzzle/day...
src/day09.zig
const std = @import("std"); const builtin = std.builtin; const TypeInfo = builtin.TypeInfo; const Declaration = TypeInfo.Declaration; const warn = std.debug.warn; // Provided generators pub const C_Generator = @import("generators/c.zig").C_Generator; pub const Python_Generator = @import("generators/python.zig").Python...
src/header_gen.zig
const std = @import("std"); const mem = std.mem; const strings = @import("../strings/strings.zig"); const utf8 = @import("../unicode/utf8/index.zig"); const utf16 = @import("../unicode/utf16/index.zig"); const url = @import("../url/url.zig"); const unicode = @import("../unicode/index.zig"); const Allocator = mem.Alloca...
src/lsp/span/span.zig
const std = @import("std"); const util = @import("util.zig"); const data = @embedFile("../data/day08.txt"); const Display = struct { digits: [10][]const u8 = .{""} ** 10, outputs: [4][]const u8 = .{""} ** 4, digit_masks: [10]std.bit_set.IntegerBitSet(7) = undefined, output_masks: [4]std.bit_set.Intege...
src/day08.zig
const std = @import("std"); const io = std.io; const mem = std.mem; const net = std.net; const os = std.os; usingnamespace @import("../primitive_types.zig"); const sm = @import("../string_map.zig"); const testing = @import("../testing.zig"); pub const PrimitiveReader = struct { const Self = @This(); buffer:...
src/primitive/reader.zig
const std = @import("std"); const math = std.math; const gmath = @import("gmath.zig"); const invSqrt2: f64 = 0.70710678118654752; // sqrt(2)/2 or 1/sqrt(2) const halfSqrt3: f64 = 0.86602540378443865; // sqrt(3)/2 const sin_15_degrees: f64 = 0.25881904510252076; // sin(15°) = -sqrt(2)/4 + sqrt(6)/4 const cos_15_degrees...
lib/affine.zig
const std = @import("std"); const c = @import("c.zig"); pub const Draw = struct { window: c.Window = undefined, display: *c.Display = undefined, drawable: c.Drawable = undefined, gc: c.GC = undefined, _width: u32, _height: u32, const Self = *Draw; pub fn init(self: Self, display: *c.Di...
src/xdraw.zig
/// Definitions of all of the x64 registers. The order is very, very important. /// The registers are defined such that IDs go in descending order of 64-bit, /// 32-bit, 16-bit, and then 8-bit, and each set contains exactly sixteen /// registers. This results in some very, very useful properties: /// /// Any 64-bit re...
src-self-hosted/codegen/x86_64.zig
const std = @import("std"); const mem = std.mem; const expect = std.testing.expect; test "vector wrap operators" { const S = struct { fn doTheTest() void { var v: @Vector(4, i32) = [4]i32{ 2147483647, -2, 30, 40 }; var x: @Vector(4, i32) = [4]i32{ 1, 2147483647, 3, 4 }; ...
test/stage1/behavior/vector.zig
const graphics = @import("didot-graphics"); const zalgebra = @import("zalgebra"); const std = @import("std"); const AssetManager = @import("assets.zig").AssetManager; const AssetHandle = @import("assets.zig").AssetHandle; const Component = @import("components.zig").Component; const Mesh = graphics.Mesh; const Window ...
didot-objects/objects.zig
const std = @import("std"); const mem = std.mem; pub const client_start = 0x00000001; pub const client_end = 0xfeffffff; pub const server_start = 0xff000000; pub const server_end = 0xffffffff; pub const Side = enum { server, client, }; pub fn ObjectMap(comptime Object: type, comptime side: Side) type { ...
src/common/object_map.zig
const std = @import("std"); const string = []const u8; const builtin = @import("builtin"); const ansi = @import("ansi"); const zigmod = @import("./lib.zig"); const u = @import("./util/index.zig"); const yaml = @import("./util/yaml.zig"); const root = @import("root"); const build_options = if (@hasDecl(root, "build_o...
src/common.zig
const std = @import("std"); const mode = @import("builtin").mode; // Checked arithmetic is disabled in non-debug modes to avoid side channels inline fn cast(comptime DestType: type, target: anytype) DestType { if (@typeInfo(@TypeOf(target)) == .Int) { const dest = @typeInfo(DestType).Int; const so...
fiat-zig/src/p384_64.zig
const windows = std.os.windows; const builtin = @import("builtin"); const native_os = builtin.os.tag; const c = @cImport({ if (native_os == .windows) { @cInclude("SDL.h"); } else { @cInclude("SDL2/SDL.h"); } }); const std = @import("std"); const math = @import("std").math; const rand = @imp...
src/main.zig
const std = @import("std"); const mem = std.mem; const print = std.debug.print; const render_utils = @import("render_utils.zig"); pub fn highlightZigCode(raw_src: [:0]const u8, allocator: *std.mem.Allocator, out: anytype) !void { // TODO: who should be doing this cleanup? // We are doing this to preserve the ...
src/doctest/syntax.zig
const std = @import("std"); const helper = @import("helper.zig"); const Allocator = std.mem.Allocator; const Grid = helper.Grid; const input = @embedFile("../inputs/day25.txt"); pub fn run(alloc: Allocator, stdout_: anytype) !void { var grid = try parseInitial(alloc, input); var buffer = try Grid(Tile).init(a...
src/day25.zig
const std = @import("std"); const georgios = @import("georgios"); const utils = @import("utils"); const kernel = @import("root").kernel; const kthreading = kernel.threading; const Thread = kthreading.Thread; const Process = kthreading.Process; const kmemory = kernel.memory; const Range = kmemory.Range; const print = ...
kernel/platform/threading.zig
const semver = @import("pkg/semver"); const unicode = @import("unicode"); const utf8 = unicode.utf8; pub const Version = struct { path: []const u8, version: ?[]const u8, pub fn check(path: []const u8, version: ?[]const u8) !void { try checkPath(path); if (version) |ver| { if (...
src/pkg/module.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const Reader = std.fs.File.Reader; const ArrayList = std.ArrayList; const builtin = @import("builtin"); const mat = @import("zalgebra"); const mat4 = mat.mat4; const vec = mat.vec3; const ParseError = error{ FormatInvalid, FormatNotSupported, }...
src/load_ply.zig
const std = @import("std"); const fun = @import("fun"); const testing = std.testing; const heap = std.heap; const io = std.io; const math = std.math; const mem = std.mem; const os = std.os; const scan = fun.scan.scan; pub fn main() !void { const stdin = &(try io.getStdIn()).inStream().stream; const stdout = ...
src/day7.zig
const Inputs = @This(); const SDL = @import("sdl2"); const ButtonEntry = struct { keycode: SDL.Keycode, port: u1, bitmask: u8 }; const BUTTON_MAP = [_]ButtonEntry{ .{ .keycode = .up, .port = 0, .bitmask = UP }, .{ .keycode = .left, .port = 0, .bitmask = LEFT }, .{ .keycode = .right, .port = 0, .bitmask =...
src/Inputs.zig
const debug = @import("std").debug; const parse = @import("parse.zig"); const compile = @import("compile.zig"); const Expr = parse.Expr; const Instruction = compile.Instruction; const InstructionData = compile.InstructionData; const Program = compile.Program; pub fn printCharEscaped(ch: u8) void { switch (ch) {...
src/debug.zig
const std = @import("std"); const subcommands = @import("../subcommands.zig"); const shared = @import("../shared.zig"); const zsw = @import("zsw"); const log = std.log.scoped(.yes); pub const name = "yes"; pub const usage = \\Usage: {0s} [STRING]... \\ or: {0s} OPTION \\ \\Repeatedly output a line ...
src/subcommands/yes.zig
pub const DosQVariant = c_void; pub const DosQModelIndex = c_void; pub const DosQAbstractItemModel = c_void; pub const DosQAbstractListModel = c_void; pub const DosQAbstractTableModel = c_void; pub const DosQQmlApplicationEngine = c_void; pub const DosQQuickView = c_void; pub const DosQQmlContext = c_void; pub const Do...
src/DOtherSideTypes.zig
const std = @import("std"); const c = @import("c.zig"); const shaderc = @import("shaderc.zig"); // This struct runs a raytracing kernel which uses a compiled scene. // Compiling the scene shader is slower to generate initially, but runs faster. pub const Optimized = struct { const Self = @This(); device: c.W...
src/optimized.zig
test "format string" { try testTransform( \\f"foo {{1:2}:32} bar { 2 \\* \\3:4} baz \t" \\ \\ , \\f"foo {{1:2}:32} bar {2 * \\ 3:4} baz \t" \\ ); } test "try-catch" { try testCanonical( \\try \\ assert(x == y) ...
tests/fmt.zig
const cmp = @import("cmp.zig"); const testing = @import("std").testing; fn test__ucmpti2(a: u128, b: u128, expected: i32) !void { var result = cmp.__ucmpti2(a, b); try testing.expectEqual(expected, result); } test "ucmpti2" { // minInt == 0 // maxInt == 340282366920938463463374607431768211455 // m...
lib/std/special/compiler_rt/ucmpti2_test.zig
const Builder = @import("std").build.Builder; const builtin = @import("builtin"); const std = @import("std"); const CheckFileStep = std.build.CheckFileStep; pub fn build(b: *Builder) void { const target = .{ .cpu_arch = .thumb, .cpu_model = .{ .explicit = &std.Target.arm.cpu.cortex_m4 }, .o...
test/standalone/install_raw_hex/build.zig
const std = @import("std"); const TestContext = @import("../../src/test.zig").TestContext; const linux_arm = std.zig.CrossTarget{ .cpu_arch = .arm, .os_tag = .linux, }; pub fn addCases(ctx: *TestContext) !void { { var case = ctx.exe("hello world", linux_arm); // Regular old hello world ...
test/stage2/arm.zig
// Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, software // distributed und...
win32.zig
const std = @import("std"); const builtin = @import("builtin"); const mem = std.mem; const expect = std.testing.expect; const expectEqual = std.testing.expectEqual; test "@maximum" { if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO if (builtin.zig_backend == .stage2_c) return error....
test/behavior/maximum_minimum.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator); const ally = &arena.allocator; const Deck = std.ArrayList(u8); const p1_init = [_]u8 { 26, 16, 33, 8, ...
src/day22.zig
pub const Token = struct { id: Id, start: usize, end: usize, line: ?*@This() = null, }; pub const Id = enum(u8) { Invalid = 0, Eof = 1, MinusEqual = 30, Slash = 63, Keyword_continue = 75, EqualAngleBracketRight = 114, Keyword_suspend = 22, RBracket = 83, Keyword_nul...
zig/zig_grammar.tokens.zig
const std = @import("std"); const expect = std.testing.expect; const expectEqual = std.testing.expectEqual; test "@sizeOf(T) == 0 doesn't force resolving struct size" { const S = struct { const Foo = struct { y: if (@sizeOf(Foo) == 0) u64 else u32, }; const Bar = struct { ...
test/behavior/sizeof_and_typeof_stage1.zig
// To lay down that the true shape of truth is scientific- // or, what is the same thing, to maintain that truth has only the // Notion as the element of its existence - seems, I know, to contradict // a view which is in our time as prevalent as it is pretentious, // and to go against what that view implies. const st...
src/asm.zig
const std = @import("std"); const mem = std.mem; const page_size = std.mem.page_size; const warn = std.debug.warn; const testing = std.testing; const adma = @import("adma"); test "Use adma" { var a = adma.AdmaAllocator.init(); defer a.deinit(); var aa = &a.allocator; var tmp: [50][]u8 = undefined; ...
tests/adma_tests.zig
usingnamespace @import("psptypes.zig"); test "" { @import("std").meta.refAllDecls(@This()); } pub const AtracError = enum(u32) { ParamFail = (0x80630001), ApiFail = (0x80630002), NoAtracid = (0x80630003), BadCodectype = (0x80630004), BadAtracid = (0x80630005), UnknownFormat = (0x80630006), ...
src/psp/sdk/pspatrac3.zig
const getty = @import("getty"); const std = @import("std"); const eql = std.mem.eql; const testing = std.testing; const expect = testing.expect; const expectEqual = testing.expectEqual; const expectEqualSlices = testing.expectEqualSlices; const expectError = testing.expectError; pub const de = struct { pub fn fr...
src/de.zig
const std = @import("std"); const Mutex = std.Thread.Mutex; pub fn init(alloc: std.mem.Allocator) void { std.debug.assert(allocator == null and allocations == null); allocator = alloc; allocations = std.AutoHashMap(usize, usize).init(allocator.?); allocations.?.ensureTotalCapacity(32) catch unreachable...
libs/zmesh/src/memory.zig
const std = @import("std"); const rec = @import("./record.zig"); const Op = @import("./ops.zig").Op; const Record = rec.Record; const RecordError = rec.RecordError; const expect = std.testing.expect; const lsmtree = @import("main.zig"); pub const WalError = error{ MaxSizeReached, } || RecordError || std.mem.Alloca...
src/wal.zig
pub const NET_IF_OPER_STATUS_DOWN_NOT_AUTHENTICATED = @as(u32, 1); pub const NET_IF_OPER_STATUS_DOWN_NOT_MEDIA_CONNECTED = @as(u32, 2); pub const NET_IF_OPER_STATUS_DORMANT_PAUSED = @as(u32, 4); pub const NET_IF_OPER_STATUS_DORMANT_LOW_POWER = @as(u32, 8); pub const NET_IF_OID_IF_ALIAS = @as(u32, 1); pub const NET_IF_O...
win32/network_management/ip_helper.zig
const std = @import("std"); const assert = std.debug.assert; const ExecError = error{InvalidOpcode}; fn exec(intcode: []i32) !void { var pos: usize = 0; while (true) { switch (intcode[pos]) { 99 => break, 1 => { const pos_x = @intCast(usize, intcode[pos + 1]); ...
zig/02_2.zig
const xcb = @import("../xcb.zig"); pub const id = xcb.Extension{ .name = "Composite", .global_id = 0 }; pub const Redirect = extern enum(c_uint) { @"Automatic" = 0, @"Manual" = 1, }; /// @brief QueryVersioncookie pub const QueryVersioncookie = struct { sequence: c_uint, }; /// @brief QueryVersionReques...
src/auto/composite.zig
const std = @import("std"); const js = @import("../quickjs.zig"); const GlobalContext = @import("../context.zig"); const E = js.JsCFunctionListEntry; pub const utf8 = opaque { fn encode(ctx: *js.JsContext, this: js.JsValue, argc: c_int, argv: [*]js.JsValue) callconv(.C) js.JsValue { if (argc != 1) return ...
src/mods/encoding.zig
const std = @import("std"); const warn = std.debug.print; const Allocator = std.mem.Allocator; const std_allocator = std.heap.c_allocator; // passing through pthread nope const util = @import("./util.zig"); const c = @cImport({ @cInclude("unistd.h"); @cInclude("nng/nng.h"); @cInclude("nng/protocol/pair0/pa...
src/ipc/nng.zig
const std = @import("std"); const hex_print_bits = 64; const hex_print_t = std.meta.Int(.unsigned, hex_print_bits); const hex_print_nibbles = @divExact(hex_print_bits, 4); const printCharacter = @import("root").putchar; // zig fmt freaks out when it sees `noinline` for some reason(?) // zig fmt: off noinline fn prin...
lib/output/fmt.zig
const std = @import("std"); const builtin = @import("builtin"); const IsWasm = builtin.target.isWasm(); const stdx = @import("stdx"); const Duration = stdx.time.Duration; const platform = @import("platform"); const graphics = @import("graphics"); const Color = graphics.Color; const ui = @import("ui"); const Column = ui...
ui/examples/timer.zig
const std = @import("std"); const value = @import("value.zig"); const ArrayList = std.ArrayList; const Value = value.Value; const OpCode = enum(u8) { constant, ret, }; pub const Chunk = struct { code: ArrayList(u8), constants: ArrayList(Value), lines: ArrayList(usize), pub fn init(allocator...
src/chunk.zig
const std = @import("../std.zig"); const assert = std.debug.assert; const Allocator = std.mem.Allocator; const ast = std.zig.ast; const Node = ast.Node; const Tree = ast.Tree; const AstError = ast.Error; const TokenIndex = ast.TokenIndex; const NodeIndex = ast.NodeIndex; const Token = std.zig.Token; pub const Error = ...
lib/std/zig/parse.zig
const std = @import("std"); const crypto = std.crypto; const mem = std.mem; const fmt = std.fmt; const Sha512 = crypto.hash.sha2.Sha512; /// X25519 DH function. pub const X25519 = struct { /// The underlying elliptic curve. pub const Curve = @import("curve25519.zig").Curve25519; /// Length (in bytes) of a...
lib/std/crypto/25519/x25519.zig
const std = @import("index.zig"); const builtin = @import("builtin"); const assert = std.debug.assert; const net = @This(); const posix = std.os.posix; const mem = std.mem; pub const TmpWinAddr = struct.{ family: u8, data: [14]u8, }; pub const OsAddress = switch (builtin.os) { builtin.Os.windows => TmpWin...
std/net.zig
const std = @import("std"); const builtin = std.builtin; const testing = std.testing; /// Thread-safe, lock-free integer pub fn Int(comptime T: type) type { if (!std.meta.trait.isIntegral(T)) @compileError("Expected integral type, got '" ++ @typeName(T) ++ "'"); return extern struct { unprote...
lib/std/atomic/int.zig
const std = @import("std"); const print = std.debug.print; usingnamespace @import("imgui"); const upaya = @import("upaya"); const Texture = upaya.Texture; const rules_win = @import("windows/rules.zig"); const brushes_win = @import("windows/brushes.zig"); const tags_win = @import("windows/tags.zig"); const tile_definit...
tilescript/tilescript.zig
const std = @import("std"); const Node = @This(); tag: ?[]u8 = null, text: ?[]u8 = null, escape_text: bool = true, attributes: std.ArrayListUnmanaged([]u8) = std.ArrayListUnmanaged([]u8){}, child_nodes: std.ArrayListUnmanaged(Node) = std.ArrayListUnmanaged(Node){}, pub fn write(self: Node, writer: anytype) @TypeOf(wri...
html-tree.zig
pub const DML_TARGET_VERSION = @as(u32, 16384); pub const DML_TENSOR_DIMENSION_COUNT_MAX = @as(u32, 5); pub const DML_TENSOR_DIMENSION_COUNT_MAX1 = @as(u32, 8); pub const DML_TEMPORARY_BUFFER_ALIGNMENT = @as(u32, 256); pub const DML_PERSISTENT_BUFFER_ALIGNMENT = @as(u32, 256); pub const DML_MINIMUM_BUFFER_TENSOR_ALIGNM...
win32/ai/machine_learning/direct_ml.zig
pub const CI_VERSION_WDS30 = @as(u32, 258); pub const CI_VERSION_WDS40 = @as(u32, 265); pub const CI_VERSION_WIN70 = @as(u32, 1792); pub const LIFF_LOAD_DEFINED_FILTER = @as(u32, 1); pub const LIFF_IMPLEMENT_TEXT_FILTER_FALLBACK_POLICY = @as(u32, 2); pub const LIFF_FORCE_TEXT_FILTER_FALLBACK = @as(u32, 3); pub const PI...
win32/storage/index_server.zig
const std = @import("std"); const c = @import("internal/c.zig"); const internal = @import("internal/internal.zig"); const bitjuggle = @import("internal/bitjuggle.zig"); const log = std.log.scoped(.git); const git = @import("git.zig"); const hasCredential = @hasDecl(c, "git_credential"); const RawCredentialType = if (...
src/credential.zig
const std = @import("std"); const cast = std.meta.cast; const mode = std.builtin.mode; // Checked arithmetic is disabled in non-debug modes to avoid side channels /// The function addcarryxU56 is an addition with carry. /// Postconditions: /// out1 = (arg1 + arg2 + arg3) mod 2^56 /// out2 = ⌊(arg1 + arg2 + arg3)...
fiat-zig/src/p448_solinas_64.zig
const std = @import("std"); const c = @import("../../c_global.zig").c_imp; // dross-zig const app = @import("../../core/application.zig"); const gly = @import("glyph.zig"); const Glyph = gly.Glyph; // ----------------------------------------------------------------------------- // -----------------------------...
src/renderer/font/font_helpers.zig
const std = @import("std"); const print = @import("std").debug.print; const fs = std.fs; const mem = @import("std").mem; const web = @import("zhp"); const handlers = @import("handlers.zig"); var gpa = std.heap.GeneralPurposeAllocator(.{}){}; pub const io_mode = .evented; const spi = @import("bus/spi.zig"); const l...
src/main.zig
const std = @import("std"); const mem = std.mem; const Allocator = mem.Allocator; const ArrayList = std.ArrayList; pub fn Args(comptime FlagSpec: type) type { return struct { const Self = this; flags: FlagSpec, // Could expose a []const []const u8 directly since we don't want modifiable. ...
src/arg_comptime.zig
const std = @import("std"); const builtin = @import("builtin"); const compiler_rt = @import("index.zig"); pub extern fn __addtf3(a: f128, b: f128) f128 { return addXf3(f128, a, b); } pub extern fn __subtf3(a: f128, b: f128) f128 { const neg_b = @bitCast(f128, @bitCast(u128, b) ^ (u128(1) << 127)); return...
std/special/compiler_rt/addXf3.zig
const __floattitf = @import("floattitf.zig").__floattitf; const testing = @import("std").testing; fn test__floattitf(a: i128, expected: f128) void { const x = __floattitf(a); testing.expect(x == expected); } test "floattitf" { if (@import("std").Target.current.os.tag == .windows) { // TODO https:/...
lib/std/special/compiler_rt/floattitf_test.zig
pub const Registry = struct { copyright: []const u8, decls: []Declaration, api_constants: []ApiConstant, tags: []Tag, features: []Feature, extensions: []Extension, }; pub const Declaration = struct { name: []const u8, decl_type: DeclarationType, }; pub const DeclarationType = union(enu...
generator/openxr/registry.zig
const std = @import("std"); const builtin = @import("builtin"); const is_windows: bool = builtin.os.tag == .windows; const System = @import("../interface/System.zig"); const Dir = @import("../interface/Dir.zig"); const File = @import("../interface/File.zig"); const Config = @import("../config/Config.zig"); const File...
src/backend/FileSystem.zig
const builtin = @import("builtin"); const TypeId = builtin.TypeId; const std = @import("std"); const math = std.math; const assert = std.debug.assert; const warn = std.debug.warn; const bufPrint = std.fmt.bufPrint; const matrix = @import("matrix.zig"); const Matrix = matrix.Matrix; const M44f32 = matrix.M44f32; const...
vec.zig
pub const RGB = struct { const base = 0xe0006800; /// This is the value for the SB_LEDDA_IP.DAT register. /// It is directly written into the SB_LEDDA_IP hardware block, so you /// should refer to http://www.latticesemi.com/view_document?document_id=50668. /// The contents of this register are writ...
riscv-zig-blink/src/fomu/rgb.zig
pub const NERR_BASE = @as(u32, 2100); pub const NERR_PasswordExpired = @as(u32, 2242); pub const CNLEN = @as(u32, 15); pub const LM20_CNLEN = @as(u32, 15); pub const UNCLEN = @as(u32, 17); pub const LM20_UNCLEN = @as(u32, 17); pub const LM20_NNLEN = @as(u32, 12); pub const SNLEN = @as(u32, 80); pub const LM20_SNLEN = @...
deps/zigwin32/win32/network_management/net_management.zig
const std = @import("std"); const sign_extend26 = @import("cpu.zig").sign_extend26; const Allocator = std.mem.Allocator; const Cpu = @import("cpu.zig").Cpu; const Reg = @import("regs.zig").Reg; pub fn illegal(cpu: *Cpu, halfword: u16) void { std.debug.warn("Illegal opcode: 0x{x}\n", .{halfword}); } // move regi...
src/cpu/debug.zig
const std = @import("std"); const tools = @import("tools"); const with_trace = true; const with_dissassemble = false; const assert = std.debug.assert; fn trace(comptime fmt: []const u8, args: anytype) void { if (with_trace) std.debug.warn(fmt, args); } const Computer = tools.IntCode_Computer; const Map = tools.M...
2019/day25a.zig
const std = @import("std"); const clap = @import("clap"); const zlib = @import("zlib"); const Allocator = std.mem.Allocator; // It would be preferable to use .evented here, but std does not support evented file handling yet pub const io_mode = .blocking; pub fn main() anyerror!void { const std_out = std.io.getStd...
src/main.zig
pub const PRLT = @as(u32, 0); pub const PRLE = @as(u32, 1); pub const PRGT = @as(u32, 2); pub const PRGE = @as(u32, 3); pub const PREQ = @as(u32, 4); pub const PRNE = @as(u32, 5); pub const QUERY_SORTASCEND = @as(u32, 0); pub const QUERY_SORTDESCEND = @as(u32, 1); pub const MQ_MOVE_ACCESS = @as(u32, 4); pub const MQ_AC...
win32/system/message_queuing.zig
const std = @import("std"); const strs = [_][]const u8{ "f5a5fd42d16a20302798ef6ed309979b43003d2320d9f0e8ea9831a92759fb4b", "db56114e00fdd4c1f85c892bf35ac9a89289aaecb1ebd0a96cde606a748b5d71", "<KEY>", "536d98837f2dd165a55d5eeae91485954472d56f246df256bf3cae19352a123c", "<KEY>", "d88ddfeed400a875...
src/zeros.zig
const std = @import("std"); usingnamespace @import("common.zig"); usingnamespace @import("location.zig"); pub const TokenKind = enum { Unknown, Newline, Colon, Comma, Period, Range, RangeInclusive, Spread, Bar, Ampersand, Bang, Plus, Minus, As...
src/lexer.zig
usingnamespace @import("root").preamble; const PixelFormat = lib.graphics.pixel_format.PixelFormat; const Color = lib.graphics.color.Color; pub const InvalidateRectFunc = fn (r: *ImageRegion, x: usize, y: usize, width: usize, height: usize) void; pub const ImageRegion = struct { width: usize, height: usize, ...
lib/graphics/image_region.zig
const std = @import("std"); const fun = @import("fun"); const testing = std.testing; const heap = std.heap; const io = std.io; const math = std.math; const mem = std.mem; const os = std.os; const scan = fun.scan.scan; pub fn main() !void { const stdin = &(try io.getStdIn()).inStream().stream; const stdout = ...
src/day11.zig