code
stringlengths
38
801k
repo_path
stringlengths
6
263
/// The function fiat25519AddcarryxU26 is an addition with carry. /// Postconditions: /// out1 = (arg1 + arg2 + arg3) mod 2^26 /// out2 = ⌊(arg1 + arg2 + arg3) / 2^26⌋ /// /// Input Bounds: /// arg1: [0x0 ~> 0x1] /// arg2: [0x0 ~> 0x3ffffff] /// arg3: [0x0 ~> 0x3ffffff] /// Output Bounds: /// out1: [0x0 ~...
fiat-zig/src/curve25519_32.zig
const std = @import("std"); const tools = @import("tools"); const with_trace = false; const with_dissassemble = false; const assert = std.debug.assert; fn trace(comptime fmt: []const u8, args: anytype) void { if (with_trace) std.debug.print(fmt, args); } const Computer = tools.IntCode_Computer; const Vec2 = tool...
2019/day17.zig
const std = @import("std"); const tools = @import("tools"); const with_trace = false; const with_dissassemble = false; const interractive = false; const assert = std.debug.assert; fn trace(comptime fmt: []const u8, args: anytype) void { if (with_trace) std.debug.print(fmt, args); } pub const main = tools.default...
2019/day25.zig
pub const MICROSOFT_URL_EXPERIENCE_PROPERTY = "Microsoft TIP URL Experience"; pub const MICROSOFT_TIP_NO_INSERT_BUTTON_PROPERTY = "Microsoft TIP No Insert Option"; pub const MICROSOFT_TIP_COMBOBOXLIST_PROPERTY = "Microsoft TIP ComboBox List Window Identifier"; pub const MICROSOFT_TIP_OPENING_MSG = "TabletInputPanelOpen...
win32/ui/tablet_pc.zig
pub const window = @import("Window.zig"); pub const input = @import("Input.zig"); pub const c = @import("c.zig").c; pub const ArrayTexture = @import("ArrayTexture.zig").Texture2DArray; pub const CubeMap = @import("CubeMap.zig").CubeMap; pub const Buffer = @import("Buffer.zig").Buffer; const shdr = @import("Shader.zig")...
src/WindowGraphicsInput/WindowGraphicsInput.zig
const std = @import("std"); const print = @import("std").debug.print; pub const WORDSIZE = 8; pub const FIXNUM_MASK = 3; pub const FIXNUM_TAG = 0; pub const FIXNUM_SHIFT = 2; pub const CHAR_MASK = 0xff; pub const CHAR_TAG = 7; pub const CHAR_SHIFT = 8; pub const BOOL_MASK = 0xff; pub const BOOL_TAG = 15; pub const BOOL...
zig/src/representation.zig
const x86_64 = @import("../index.zig"); const bitjuggle = @import("bitjuggle"); const std = @import("std"); const formatWithoutFields = @import("../common.zig").formatWithoutFields; pub const NUMBER_OF_INTERRUPT_HANDLERS = 256; /// An Interrupt Descriptor Table with 256 entries. /// ## **IMPORTANT** - must be align(1...
src/structures/idt.zig
const std = @import("std"); const zarc = @import("zarc"); fn printDir(writer: anytype, file_tree: zarc.zip.FileTree, name: []const u8, depth: usize) anyerror!void { if (file_tree.readDir(name)) |d| { for (d.items) |entry| { try writer.writeByteNTimes('\t', depth); try writer.writeAl...
tests/zip.zig
const std = @import("std"); const zfetch = @import("zfetch"); const fmtValueLiteral = @import("fmt-valueliteral").fmtValueLiteral; const ansi = @import("ansi"); pub fn Main(comptime T: type) type { comptime std.debug.assert(@hasDecl(T, "source_url")); comptime std.debug.assert(@hasDecl(T, "dest_file")); co...
scripts/_common.zig
const std = @import("std"); const json = std.json; const time = std.time; const clap = @import("clap"); const nestedtext = @import("nestedtext.zig"); const WriteError = std.os.WriteError; const File = std.fs.File; const Allocator = std.mem.Allocator; var allocator: Allocator = undefined; const logger = std.log.sco...
src/cli.zig
usingnamespace @import("psptypes.zig"); pub const time_t = u32; const struct_unnamed_5 = extern struct { year: u16, month: u16, day: u16, hour: u16, minutes: u16, seconds: u16, microseconds: u32, }; pub const pspTime = struct_unnamed_5; pub const enum_pspRtcCheckValidErrors = extern enum(c...
src/psp/sdk/psprtc.zig
const std = @import("std"); const json = std.json; const Allocator = std.mem.Allocator; const allocPrint = std.fmt.allocPrint; const utils = @import("utils.zig"); const Info = @import("Info.zig"); pub const Host = enum { github, gitlab, codeberg, default, const hosts_map = std.ComptimeStringMap(Ho...
src/hosts.zig
const std = @import("std"); const alphabet = @import("../bio/bio.zig").alphabet; const Sequence = @import("../sequence.zig").Sequence; const SearchHit = @import("../search.zig").SearchHit; const SearchHitList = @import("../search.zig").SearchHitList; const utils = @import("../utils.zig"); const Cigar = @import("../c...
src/io/alnout_writer.zig
const std = @import("std"); pub fn forAll(comptime T: type) Iterator(T) { return Iterator(T).init(); } fn threwError(func: anytype, item: anytype) bool { const originalStackDepth: usize = blk: { if (@errorReturnTrace()) |trace| { break :blk trace.index; } else { break :...
src/fuzz.zig
const std = @import("std"); const debug = std.debug; const math = std.math; const mem = std.mem; const testing = std.testing; pub fn defaultLeafSize(comptime T: type) comptime_int { return math.max(1, 256 / @sizeOf(T)); } pub fn List(comptime T: type) type { return CustomList(T, defaultLeafSize(T)); } pub f...
src/core/list.zig
const std = @import("std"); //私たちの古いRPG文字構造を覚えていますか?構造体は本当に単なるAです //メモリに対処するための非常に便利な方法。これらの分野(金、 //健康、経験)はすべて特定のサイズの値です。それらを追加してください //一緒に、あなたは全体として構造体のサイズを持っています。 const Character = struct { gold: u32 = 0, health: u8 = 100, experience: u32 = 0, }; //ここでは、定数である "the_narrator"という文字を作成します //キャラクタ構造の(不変)インス...
exercises/051_values.zig
const std = @import("std"); const deps = @import("./deps.zig"); const vkgen = deps.imports.vulkan_zig; const Step = std.build.Step; const Builder = std.build.Builder; const LibExeObjStep = std.build.LibExeObjStep; const Pkg = std.build.Pkg; pub const ResourceGenStep = struct { step: Step, shader_step: *vkgen.S...
build.zig
const std = @import("std"); const builtin = @import("builtin"); const kernel = @import("root").kernel; const io = kernel.io; const print = kernel.print; pub const serial_log = @import("serial_log.zig"); pub const cga_console = @import("cga_console.zig"); pub const segments = @import("segments.zig"); pub const interr...
kernel/platform/platform.zig
pub const zero_width = [_][2]u21{ [2]u21{ 0x0300, 0x036f, }, // Combining Grave Accent ..Combining Latin Small Le [2]u21{ 0x0483, 0x0489, }, // Combining Cyrillic Titlo..Combining Cyrillic Milli [2]u21{ 0x0591, 0x05bd, }, // Hebrew Accent Etnahta ...
src/table_zero.zig
const x86 = @import("src/x86.zig"); const example = @import("example-hello.zig"); const SyscallLinux64 = example.SyscallLinux64; const STDOUT = example.STDOUT; const reg = x86.Operand.register; const imm = x86.Operand.immediate; const memRm = x86.Operand.memoryRmDef; const m64 = x86.Machine.init(.x64); // program d...
example-mmx.zig
const std = @import("std"); usingnamespace (@import("../machine.zig")); usingnamespace (@import("../util.zig")); // QuickRef: https://www.felixcloutier.com/x86/mov const reg = Operand.register; const regRm = Operand.registerRm; const mem = Operand.memoryDef; const memRm = Operand.memoryRmDef; const memRmSeg = Operan...
src/x86/tests/mov.zig
const std = @import("std"); const c = @import("c.zig").c; const glfw = @import("glfw"); const theme = @import("theme.zig"); // https://github.com/dwyl/english-words/ const words_raw = @embedFile("../res/wordlist.txt"); // swedish word list https://github.com/martinlindhe/wordlist_swedish pub fn main() !void { st...
src/main.zig
const std = @import("std"); // Enable different modules in ftmodule.h. // /include has config overrides. // Minor changes: // 1. Added "#include <freetype/internal/ftmmtypes.h>" to ttgxvar.h to fix "unknown type name 'GX_ItemVarStoreRec'" pub const pkg = std.build.Pkg{ .name = "freetype", .source = .{ .path ...
lib/freetype2/lib.zig
const std = @import("std"); const stdx = @import("stdx"); const builtin = @import("builtin"); const platform = @import("platform.zig"); const KeyCode = platform.KeyCode; const KeyDownEvent = platform.KeyDownEvent; const KeyUpEvent = platform.KeyUpEvent; const MouseButton = platform.MouseButton; const MouseDownEvent = p...
platform/event_dispatcher.zig
const std = @import("std"); const DocumentStore = @import("document_store.zig"); const analysis = @import("analysis.zig"); const types = @import("types.zig"); const offsets = @import("offsets.zig"); const log = std.log.scoped(.references); const ast = std.zig.ast; fn tokenReference( handle: *DocumentStore.Handle,...
src/references.zig
const std = @import("../../std.zig"); const builtin = @import("builtin"); const assert = std.debug.assert; const mem = std.mem; const net = std.net; const os = std.os; const linux = os.linux; const testing = std.testing; const io_uring_params = linux.io_uring_params; const io_uring_sqe = linux.io_uring_sqe; const io_u...
lib/std/os/linux/io_uring.zig
const std = @import("std"); const TestContext = @import("../../src/test.zig").TestContext; // These tests should work with all platforms, but we're using linux_x64 for // now for consistency. Will be expanded eventually. const linux_x64 = std.zig.CrossTarget{ .cpu_arch = .x86_64, .os_tag = .linux, }; pub fn a...
test/stage2/cbe.zig
const std = @import("../std.zig"); const assert = std.debug.assert; const State = enum { Start, Backslash, }; pub const ParseStringLiteralError = error{ OutOfMemory, /// When this is returned, index will be the position of the character. InvalidCharacter, }; /// caller owns returned memory pub f...
lib/std/zig/parse_string_literal.zig
const std = @import("std"); const mem = std.mem; const Allocator = mem.Allocator; const assert = std.debug.assert; const Preprocessor = @import("Preprocessor.zig"); const Source = @import("Source.zig"); const Tokenizer = @import("Tokenizer.zig"); const Token = Tokenizer.Token; const Diagnostics = @import("Diagnostics.z...
src/Compilation.zig
const std = @import("std"); const assert = std.debug.assert; const mem = std.mem; const Allocator = mem.Allocator; const EpochSeconds = std.time.epoch.EpochSeconds; const Diagnostics = @import("Diagnostics.zig"); const LangOpts = @import("LangOpts.zig"); const Preprocessor = @import("Preprocessor.zig"); const Source = ...
src/Compilation.zig
const std = @import("std"); const mem = std.mem; const Allocator = mem.Allocator; const Sha256 = std.crypto.hash.sha2.Sha256; const Hmac256 = std.crypto.auth.hmac.sha2.HmacSha256; const Chacha20Poly1305 = std.crypto.aead.chacha_poly.ChaCha20Poly1305; pub const asn1 = @import("asn1.zig"); pub const x509 = @import("x509...
src/main.zig
const std = @import("std"); const expect = @import("std").testing.expect; const zbox = @import("zbox"); pub const log_level: std.log.Level = .debug; pub usingnamespace @import("log_handler"); pub const BorderStyle = enum { border_style_none, border_style_separate, border_style_overlap, }; const box_00...
src/immediata.zig
const std = @import("std"); pub const FIXSTR_SIZE: u8 = 0x1f; pub const FIXARRAY_SIZE: u8 = 0x0f; pub const FIXMAP_SIZE: u8 = 0x0f; pub fn from_u8(u: u8) Format { return Format.from_u8(u); } pub const Format = union(enum) { positive_fix_int: u8, fix_map: u8, fix_array: u8, fix_str: u8, nil, ...
src/format.zig
const semver = @import("main.zig"); const t = @import("./util/index.zig"); const std = @import("std"); const mem = std.mem; const warn = std.debug.warn; const testCase = struct { v: []const u8, valid: bool, }; const test_cases = [_]testCase{ testCase{ .v = "bad", .valid = false }, testCase{ .v = "v1-a...
src/main_test.zig
const tone = @import("tone.zig"); const tune = @import("tune.zig"); const note = @import("note.zig"); const music = @import("music.zig"); const c5 = note.getFreq("C 5".*); const c4 = note.getFreq("C 4".*); const c3 = note.getFreq("C 3".*); const d3 = note.getFreq("D 3".*); const e3 = note.getFreq("E 3".*); const f3 = ...
src/music/parliament-music.zig
const std = @import("std"); const neg = @import("negXi2.zig"); const testing = std.testing; const print = std.debug.print; fn test__negsi2(a: i32, expected: i32) !void { var result = neg.__negsi2(a); try testing.expectEqual(expected, result); } test "negsi2" { // TODO ensuring that math.minInt(i32); retu...
lib/std/special/compiler_rt/negsi2_test.zig
const std = @import("std"); const assert = std.debug.assert; pub const Oid = @import("oids.zig").Oid; pub const Value = std.json.Value; const rpc_version = "\"jsonrpc\":\"2.0\""; pub fn jsonToString( self: Value, comptime fmt: []const u8, context: var, comptime FmtError: type, output: fn (@typeO...
src/index.zig
const std = @import("std"); const warn = std.debug.warn; const assert = std.debug.assert; const Matrix = @import("Matrix.zig").Matrix; pub fn Vector(comptime T: type, comptime S: u32) type { return struct { const Self = @This(); data: [S]T, pub fn x(self: Vector(T, S)) T { ret...
src/Mathematics/Vector.zig
const os = @import("root").os; const platform = os.platform; const ports = @import("ports.zig"); var inited = [1]bool{false} ** 4; pub fn init() void { port(1).try_init(); port(2).try_init(); port(3).try_init(); port(4).try_init(); } pub fn port(comptime port_num: usize) type { const io_base: u16 = switch(...
src/platform/x86_64/serial.zig
const std = @import("std"); const ig = @import("imgui"); const glfw = @import("glfw"); // Private items const PlayRoom = @import("playRoom.zig"); const editor = @import("editor.zig"); const Renderer = @import("renderer.zig"); const SlingSettings = struct { initialScene: ?[]const u8 = null, rememberWindowSettin...
src/sling.zig
// Because SPIR-V requires re-compilation anyway, and so hot swapping will not work // anyway, we simply generate all the code in flushModule. This keeps // things considerably simpler. const SpirV = @This(); const std = @import("std"); const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.ArenaAlloca...
src/link/SpirV.zig
const std = @import("std"); const util = @import("util"); const input = @embedFile("18.txt"); const Token = union(enum) { group: []const Token, literal: u64, add: void, mul: void, fn eval1(self: Token) u64 { switch (self) { .group => |g| { std.debug.assert(g.len...
2020/18.zig
const std = @import("std"); const builtin = @import("builtin"); const fs = std.fs; const io = std.io; const mem = std.mem; const testing = std.testing; const logger = std.log.scoped(.tests); const trace = @import("tracy.zig").trace; const Allocator = std.mem.Allocator; const Archive = @import("archive/Archive.zig"); c...
src/test.zig
const std = @import("std"); const Sink = @import("sink.zig").Sink; const Delegate = @import("delegate.zig").Delegate; pub fn Signal(comptime Event: type) type { return struct { const Self = @This(); calls: std.ArrayList(Delegate(Event)), allocator: ?*std.mem.Allocator = null, pub ...
src/signals/signal.zig
const std = @import("std"); const sdl = @cImport({ @cInclude("SDL.h"); }); const utils = @import("utils.zig"); const Bus = @import("Bus.zig"); const Self = @This(); const Height = 160; const Width = 240; const LCDCAddr = 0x04000000; const GreenSwapAddr = 0x04000002; const LCDSAddr = 0x04000004; const VCounterAddr ...
src/Ppu.zig
const std = @import("std"); const root = @import("main.zig"); const math = std.math; const assert = std.debug.assert; const testing = std.testing; pub const vec3 = Vec3(f32); pub const vec3_f64 = Vec3(f64); pub const vec3_i32 = Vec3(i32); /// A 3 dimensional vector. pub fn Vec3(comptime T: type) type { if (@typeI...
src/vec3.zig
const std = @import("std"); const assert = std.debug.assert; const warn = std.debug.warn; const math = std.math; const Allocator = std.mem.Allocator; const geo = @import("modules/zig-geometry/index.zig"); const gl = @import("modules/zig-sdl2/src/index.zig"); const ColorU8 = @import("../src/color.zig").ColorU8; const...
src/texture.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const List = std.ArrayList; const Map = std.AutoHashMap; const StrMap = std.StringHashMap; const BitSet = std.DynamicBitSet; const Str = []const u8; const int = i64; const util = @import("util.zig"); const gpa = util.gpa; const data = @embedFile("../dat...
src/day24.zig
const std = @import("std"); usingnamespace (@import("../machine.zig")); usingnamespace (@import("../util.zig")); const imm = Operand.immediate; const imm16 = Operand.immediate16; const imm32 = Operand.immediate32; const immSign = Operand.immediateSigned; const immSign16 = Operand.immediateSigned16; const immSign32 = ...
src/x86/tests/jcc.zig
const std = @import("std"); const builtin = @import("builtin"); const opt = @import("opt.zig"); const warn = std.debug.warn; const stdout = &std.io.getStdOut().outStream(); const Allocator = std.mem.Allocator; const fstaterror = std.os.FStatError; pub fn du(paths: std.ArrayList([]const u8), depth: u8, sz: SizeOptions...
src/du.zig
const std = @import("std"); const fmt = std.fmt; const mem = std.mem; const print = std.debug.print; const Allocator = std.mem.Allocator; const ArrayList = std.ArrayList; const AutoHashMap = std.AutoHashMap; const U36_MAX = std.math.maxInt(u36); const Mask = struct { on: u36 = 0, off: u36 = 0, float: u36 ...
14/part2.zig
const std = @import("std"); const args = @import("args"); const File = @import("File.zig"); const Loader = @import("Loader.zig"); const TopOptions = struct { help: bool = false, pub const shorthands = .{ .h = "help", }; }; const Command = union(enum) { run: RunOptions, build: BuildOptions,...
src/main.zig
const std = @import("../std.zig"); const ws2_32 = std.os.windows.ws2_32; const windows = std.os.windows; pub extern "c" fn _errno() *c_int; pub extern "c" fn _msize(memblock: ?*anyopaque) usize; // TODO: copied the else case and removed the socket function (because its in ws2_32) // need to verify which of the...
lib/std/c/windows.zig
pub const Registry = union(enum) { core: CoreRegistry, extension: ExtensionRegistry, }; pub const CoreRegistry = struct { copyright: [][]const u8, /// Hexadecimal representation of the magic number magic_number: []const u8, major_version: u32, minor_version: u32, revision: u32, inst...
tools/spirv/grammar.zig
pub fn VecTable(comptime num_irqs: usize, comptime nameProvider: var) type { return extern struct { stack: ?extern fn () void, handlers: [num_irqs + 16]?extern fn () void, const Self = @This(); pub fn new() Self { @setEvalBranchQuota(10000); comptime { ...
examples/common/vectable.zig
const std = @import("std"); const mem = std.mem; const Control = @This(); allocator: *mem.Allocator, array: []bool, lo: u21 = 0, hi: u21 = 921599, pub fn init(allocator: *mem.Allocator) !Control { var instance = Control{ .allocator = allocator, .array = try allocator.alloc(bool, 921600), }; ...
src/components/autogen/GraphemeBreakProperty/Control.zig
const std = @import("std"); const mem = std.mem; const OtherPunctuation = @This(); allocator: *mem.Allocator, array: []bool, lo: u21 = 33, hi: u21 = 125279, pub fn init(allocator: *mem.Allocator) !OtherPunctuation { var instance = OtherPunctuation{ .allocator = allocator, .array = try allocator....
src/components/autogen/DerivedGeneralCategory/OtherPunctuation.zig
const c = @import("src/c.zig"); const std = @import("std"); const builtin = std.builtin; const debug = std.debug; const math = std.math; const mem = std.mem; const meta = std.meta; const nk = @This(); pub const atlas = @import("src/atlas.zig"); pub const bar = @import("src/bar.zig"); pub const button = @import("src/...
nuklear.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const log = std.log.scoped(.vr); const config = @import("config.zig"); pub const Replica = @import("vr/replica.zig").Replica; pub const Clock = @import("vr/clock.zig").Clock; pub const DeterministicTime = @import("vr/clo...
src/vr.zig
const std = @import("std"); const Answer = struct { @"0": u32, @"1": u32 }; const Point = struct { x: usize, y: usize }; const Neighbors = struct { items: [8]Point, len: usize }; const PathMap = std.StringHashMap(std.ArrayList([]const u8)); fn isSmall(name: []const u8) bool { return std.ascii.isLower(name[0]); }...
src/day12.zig
const std = @import("std"); const testing = std.testing; const main = @import("main.zig"); const wcwidth = main.wcwidth; const wcswidth = main.wcswidth; const sliceWidth = main.sliceWidth; test "null character" { try testing.expectEqual(@as(isize, 0), wcwidth(0)); } test "simple ascii characters" { try testi...
src/test.zig
const boot = @import("bootboot.zig"); const FrameBuffer = @import("framebuffer.zig").FrameBuffer; const Position = @import("framebuffer.zig").Position; const Color = @import("framebuffer.zig").Color; const FrameBufferType = @import("framebuffer.zig").FrameBufferType; const PSFont = @import("psfont.zig").PSFont; const D...
kernel/main.zig
const std = @import("std"); const mem = std.mem; pub fn Reader(comptime Socket: type, comptime buffer_size: usize) type { return struct { const Self = @This(); socket: *Socket, buf: [buffer_size]u8 = undefined, pos: usize = 0, pub inline fn init(socket: *Socket) Self { ...
io.zig
pub const CTL_E_ILLEGALFUNCTIONCALL = @as(i32, -2146828283); pub const CONNECT_E_FIRST = @as(i32, -2147220992); pub const SELFREG_E_FIRST = @as(i32, -2147220992); pub const PERPROP_E_FIRST = @as(i32, -2147220992); pub const OLECMDERR_E_FIRST = @import("../zig.zig").typedConst(HRESULT, @as(i32, -2147221248)); pub const ...
deps/zigwin32/win32/system/com.zig
const std = @import("std"); const fmt = std.fmt; const fs = std.fs; const log = std.log; const mem = std.mem; const Allocator = mem.Allocator; const Release = @import("release.zig").Release; pub fn add(allocator: Allocator, rel: Release) !void { if (mem.eql(u8, rel.distribution, "none")) return error.Dist...
src/service.zig
const std = @import("std"); const builtin = @import("builtin"); const app = @import("app"); const assert = std.debug.assert; const fd_t = std.os.fd_t; const pid_t = std.os.pid_t; // Here we reproduce the data from the zig standard library so that this file can be // compiled by older zig versions. pub const Measureme...
bench.zig
use @import("index.zig"); pub extern "kernel32" stdcallcc fn CancelIoEx(hFile: HANDLE, lpOverlapped: LPOVERLAPPED) BOOL; pub extern "kernel32" stdcallcc fn CloseHandle(hObject: HANDLE) BOOL; pub extern "kernel32" stdcallcc fn CreateDirectoryW(lpPathName: [*]const u16, lpSecurityAttributes: ?*SECURITY_ATTRIBUTES) BOO...
std/os/windows/kernel32.zig
pub const E = enum(u16) { /// No error occurred. /// Same code used for `NSROK`. SUCCESS = 0, /// Operation not permitted PERM = 1, /// No such file or directory NOENT = 2, /// No such process SRCH = 3, /// Interrupted system call INTR = 4, /// I/O error IO = 5,...
lib/std/os/bits/linux/errno/generic.zig
const kernel = @import("kernel.zig"); const Font = kernel.PSF1.Font; const log = kernel.log.scoped(.graphics); const Driver = @This(); const Type = enum(u64) { virtio = 0, }; type: Type, framebuffer: Framebuffer, pub fn draw_char(driver: *Driver, color: Color, point: Point, character: u8) void { const frame...
src/kernel/graphics.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const term = @import("term.zig"); const util = @import("util.zig"); const parse = @import("parse/!mod.zig"); /// Use the `parse.Cst.Printer` to print the tree structure of a cst pub fn printCst( allocator: Allocator, cst: parse.Cst, tokens: ...
fexc/src/debug.zig
pub const OID_OAssociatedIdentityProviderObject = Guid.initString("98c5a3dd-db68-4f1a-8d2b-9079cdfeaf61"); //-------------------------------------------------------------------------------- // Section: Types (20) //-------------------------------------------------------------------------------- pub const IDENTITY_TYPE...
win32/security/authentication/identity/provider.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/test/da...
src/day04.zig
const std = @import("std"); const heap = std.heap; const mem = std.mem; const fmt = std.fmt; const print = std.debug.print; const file = @embedFile("../input.txt"); const PasswordEntry = struct { first_num: u32, second_num: u32, letter: u8, password: []const u8, }; pub fn main() !void { // Once a...
2020/day02/zig/day2.zig
const std = @import("../std.zig"); const CpuFeature = std.Target.Cpu.Feature; const CpuModel = std.Target.Cpu.Model; pub const Feature = enum { atomctl, bool, coprocessor, debug, density, dfpaccel, div32, esp32s2, esp32s3, exception, extendedl32r, fp, highpriinterru...
lib/std/target/xtensa.zig
pub const traits = struct { pub usingnamespace @import("traits/has_decl.zig"); pub usingnamespace @import("traits/has_decls.zig"); pub usingnamespace @import("traits/has_field.zig"); pub usingnamespace @import("traits/has_fields.zig"); pub usingnamespace @import("traits/has_function.zig"); pub u...
src/lib.zig
const std = @import("std"); const Target = std.Target; const Version = std.builtin.Version; const mem = std.mem; const log = std.log; const fs = std.fs; pub fn main() !void { var arena_instance = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer arena_instance.deinit(); const arena = arena_insta...
collect_abilist_files.zig
const std = @import("std"); const gjk = @import("gjk.zig"); const v = @import("v.zig"); const World = @This(); comptime { @setFloatMode(.Optimized); } allocator: std.mem.Allocator, gravity: v.Vec2 = .{ 0, 0 }, slop: f64 = 0.1, // Distance to which collision must be accurate active: std.MultiArrayList(Object) =...
World.zig
// std lib imports const std = @import("std"); const fs = std.fs; const testing = std.testing; const debug = std.debug.print; pub const log_level: std.log.Level = .debug; // application-specific imports const argparse = @import("argparse.zig"); const config = @import("config.zig"); const Console = @import("console.z...
src/main.zig
const std = @import("std"); const Registry = @import("registry.zig").Registry; const Entity = @import("registry.zig").Entity; pub const Actor = struct { registry: *Registry, entity: Entity = undefined, pub fn init(registry: *Registry) Actor { var reg = registry; return .{ .regi...
src/ecs/actor.zig
const c = @import("c.zig").c; // must be in sync with GLFW C constants in modifier group, search for "@defgroup mods Modifier key flags" /// A bitmask of all key modifiers pub const Mods = packed struct { shift: bool = false, control: bool = false, alt: bool = false, super: bool = false, caps_lock...
glfw/src/mod.zig
const std = @import("std"); const Builder = std.build.Builder; const vma_config = @import("include/vma_config.zig"); pub fn build(b: *Builder) !void { // Standard target options allows the person running `zig build` to choose // what target to build for. Here we do not override the defaults, which // means...
build.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const StringHashMap = std.StringHashMap; const AutoHashMap = std.AutoHashMap; const ArrayList = std.ArrayList; const assert = std.debug.assert; const nfa = struct { pub const SymbolKind = enum { epsilon, char, }; pub const Sy...
automata-theory-building-a-regexp-machine/zig-regex/src/lib.zig
pub const WM_DDE_FIRST = @as(u32, 992); pub const WM_DDE_INITIATE = @as(u32, 992); pub const WM_DDE_TERMINATE = @as(u32, 993); pub const WM_DDE_ADVISE = @as(u32, 994); pub const WM_DDE_UNADVISE = @as(u32, 995); pub const WM_DDE_ACK = @as(u32, 996); pub const WM_DDE_DATA = @as(u32, 997); pub const WM_DDE_REQUEST = @as(u...
win32/system/data_exchange.zig
const std = @import("std"); const testing = std.testing; pub const Computer = struct { accum: i32, instr: [1000]Instr, icount: usize, const Op = enum { None, ACC, JMP, NOP, }; const Instr = struct { op: Op, arg: i32, count: usize, ...
2020/p08/computer.zig
const std = @import("std"); const zlm = @import("zlm"); const gl = @import("gl.zig"); const TextureSpec = @import("../track/piece_renderer.zig").TextureSpec; pub const texture_length = 512; pub const block_length = texture_length / 16; const empty_block_array = [_][block_length]bool{[_]bool{false} ** block_length} ...
src/render/texture_atlas.zig
const std = @import("std"); const mem = std.mem; const testing = std.testing; const Allocator = mem.Allocator; const ArrayList = std.ArrayList; const Buffer = std.Buffer; /// A zero-indexed position of a buffer. /// `line = 0, col = 0` is the first line, first character. pub const Position = struct { line: usize...
src/gap-buffer.zig
const std = @import("std"); const warn = std.debug.warn; const time = @import("./src/time.zig"); const Duration = time.Duration; test "now" { var local = time.Location.getLocal(); var now = time.now(&local); warn("\n today's date {}", .{now.date()}); warn("\n today's time {}", .{now.clock()}); war...
example.zig
pub const Context = @import("context.zig").Context; pub const Swapchain = @import("swapchain.zig").Swapchain; pub const buffer = @import("buffer.zig"); pub const Program = @import("../program/program.zig").Program; pub const Uniform = @import("uniform.zig").Uniform; pub const Framebuffer = @import("framebuffer.zig").Fr...
render/src/backend/backend.zig
const std = @import("std"); const math = @import("math.zig").math; const shr = std.math.shr; const shl = std.math.shl; const expectEqual = @import("std").testing.expectEqual; pub const D64 = struct { v: i64, const offset = 32; const lowBits = 0xFFFFFFFF; pub const pi = lit("3.141592653589793238462643...
src/fixed.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const Mirroring = @import("../ines.zig").Mirroring; const Config = @import("../console.zig").Config; const GenericMapper = @import("../mapper.zig").GenericMapper; pub const Prgs = BankSwitcher(0x4000, 2); pub const Chrs = BankSwitcher(0x1000, 2); pub f...
src/mapper/common.zig
const std = @import("std"); const CrossTarget = std.zig.CrossTarget; const TestContext = @import("../../src/test.zig").TestContext; const linux_aarch64 = CrossTarget{ .cpu_arch = .aarch64, .os_tag = .linux, }; const macos_aarch64 = CrossTarget{ .cpu_arch = .aarch64, .os_tag = .macos, }; pub fn addCase...
test/stage2/aarch64.zig
const std = @import("std"); const zangscript = @import("zangscript"); // parse a zig file at runtime looking for builtin module definitions const BuiltinParser = struct { arena_allocator: *std.mem.Allocator, contents: []const u8, tree: *std.zig.ast.Tree, fn getToken(self: BuiltinParser, token_index: u...
tools/zangc/parse_builtins.zig
const std = @import("std"); const Fundude = @import("main.zig"); const c = @cImport({ @cInclude("SDL.h"); }); const input = packed struct { right: bool, left: bool, up: bool, down: bool, a: bool, b: bool, select: bool, start: bool, }; pub fn main() anyerror!u8 { _ = c.SDL_Ini...
src/native.zig
// SPDX-License-Identifier: MIT // This file belongs to the Termelot project under the MIT license. const std = @import("std"); const termelot = @import("termelot.zig"); const Size = termelot.Size; const Position = termelot.Position; const Cell = termelot.Cell; const Rune = termelot.Rune; usingnamespace termelot.sty...
src/buffer.zig
/// The function fiatP224AddcarryxU64 is an addition with carry. /// Postconditions: /// out1 = (arg1 + arg2 + arg3) mod 2^64 /// out2 = ⌊(arg1 + arg2 + arg3) / 2^64⌋ /// /// Input Bounds: /// arg1: [0x0 ~> 0x1] /// arg2: [0x0 ~> 0xffffffffffffffff] /// arg3: [0x0 ~> 0xffffffffffffffff] /// Output Bounds: /...
fiat-zig/src/p224_64.zig
const std = @import("std"); const mem = std.mem; const math = std.math; const testing = std.testing; pub const Error = error{ OutOfMemory, AllocatorRequired }; pub const Algorithm = enum { Bubble, Quick, Insertion, Selection, Comb, Shell, Heap, Merge, Radix, }; /// sort and return...
zort.zig
const builtin = @import("builtin"); const fprint = @import("fprint.zig"); const io = @import("io.zig"); var console_file: ?*io.File = null; pub var debug_print = false; pub fn init(file: ?*io.File, debug: bool) void { console_file = file; debug_print = debug; } pub fn get_console_file() ?*io.File { ret...
kernel/print.zig
const std = @import("std"); const builtin = @import("builtin"); const debug = std.debug; const mem = std.mem; const testing = std.testing; pub const Self = @OpaqueType(); pub fn Interface(comptime T: type) type { const info = @typeInfo(T).Struct; const VTable = struct { funcs: [info.decls.len]fn () vo...
fun/interface.zig
const std = @import("../../std.zig"); const builtin = @import("builtin"); const windows = std.os.windows; const mem = std.mem; const testing = std.testing; const expect = testing.expect; fn testRemoveDotDirs(str: []const u8, expected: []const u8) !void { const mutable = try testing.allocator.dupe(u8, str); def...
lib/std/os/windows/test.zig
const inputFile = @embedFile("./input/day18.txt"); const std = @import("std"); const builtin = @import("builtin"); const Allocator = std.mem.Allocator; const List = std.ArrayList; const Str = []const u8; const BitSet = std.DynamicBitSet; const StrMap = std.StringHashMap; const HashMap = std.HashMap; const Map = std.Aut...
src/day18.zig