code
stringlengths
38
801k
repo_path
stringlengths
6
263
pub const sabaton = @import("../../sabaton.zig"); pub const io = sabaton.io_impl.uart_mmio_32; pub const ElfType = [*]u8; pub const panic = sabaton.panic; const std = @import("std"); pub const display = @import("display.zig"); pub const acpi = struct { pub fn init() void { if(sabaton.fw_cfg.find_file("etc/acpi...
src/platform/virt_aarch64/main.zig
const std = @import("std"); const assert = std.debug.assert; pub const config = @import("config.zig"); pub const Account = packed struct { id: u128, /// Opaque third-party identifier to link this account (many-to-one) to an external entity: user_data: u128, /// Reserved for accounting policy primitive...
src/tigerbeetle.zig
const std = @import("std"); const expect = std.testing.expect; // would cause lose wake up event // threadlocal var threadlocal_resetevent = std.AutoResetEvent{}; /// Condition variable /// support wait(), timedWait(), signal(), signalAll() pub const Condition = struct { ///this struct is on stack ...
Condition.zig
const std = @import("std"); const math = std.math; const assert = std.debug.assert; const L = std.unicode.utf8ToUtf16LeStringLiteral; const zwin32 = @import("zwin32"); const w = zwin32.base; const d3d12 = zwin32.d3d12; const hrPanic = zwin32.hrPanic; const hrPanicOnFail = zwin32.hrPanicOnFail; const zd3d12 = @import("...
samples/intro/src/intro5.zig
const std = @import("std"); const mem = std.mem; const fs = std.fs; const maxBytesRead = std.math.maxInt(u32); const Brain = @import("brain.zig").Brain; const usage = \\Usage: brain [command] \\ \\ Commands: \\ \\ code [BRAIN] Give brainfuck code to execute \\ file [PATH] Execute the...
src/main.zig
const std = @import("std"); const expect = std.testing.expect; pub const TextInfo = struct { font_size: i16, flags: u8, charset: u8, stretch_h: u16, aa: u8, padding_up: u8, padding_right: u8, padding_down: u8, padding_left: u8, spacing_horiz: u8, spacing_vert: u8, outlin...
bmfont.zig
const utils = @import("utils"); const georgios = @import("georgios"); const kernel = @import("root").kernel; const print = kernel.print; const kthreading = kernel.threading; const ps2 = @import("ps2.zig"); const interrupts = @import("interrupts.zig"); const vbe = @import("vbe.zig"); pub const interrupt_number: u8 =...
kernel/platform/system_calls.zig
const std = @import("std"); const fs = std.fs; const fmt = std.fmt; const mem = std.mem; const math = std.math; const json = std.json; const ChildProcess = std.ChildProcess; const log = @import("../src/md/log.zig"); const translate = @import("../src/md/translate.zig"); const Node = @import("../src/md/parse.zig").Node;...
test/util.zig
const std = @import("std"); const c = @import("c.zig"); const glsl = @cImport({ @cInclude("sokol/sokol_gfx.h"); @cInclude("shaders/triangle.glsl.h"); }); const State = struct { pass_action: c.sg_pass_action, main_pipeline: c.sg_pipeline, main_bindings: c.sg_bindings, }; var state: State = undefine...
src/example_triangle.zig
const std = @import("std"); const print = std.debug.print; const CFO = @import("./CFO.zig"); const OSHA = @import("./OSHA.zig"); const parse = @import("./parse.zig"); const FLIR = @import("./Old_FLIR.zig"); const page_allocator = std.heap.page_allocator; var the_cfo: ?*CFO = null; pub fn addr_lookup(addr: usize) usiz...
src/main.zig
const std = @import("std"); const luf = @import("luf"); const log = std.log.scoped(.luf_cli); pub fn main() !void { var gpa_alloc = std.heap.GeneralPurposeAllocator(.{}){}; defer _ = gpa_alloc.deinit(); const gpa = &gpa_alloc.allocator; const args = try parse(gpa); defer { for (args) |arg...
src/cli/main.zig
const std = @import("std"); const iup = @import("iup.zig"); const MainLoop = iup.MainLoop; const Dialog = iup.Dialog; const Button = iup.Button; const MessageDlg = iup.MessageDlg; const Multiline = iup.Multiline; const Label = iup.Label; const Text = iup.Text; const VBox = iup.VBox; const HBox = iup.HBox; const Menu =...
src/button_example.zig
const std = @import("std"); const vk = @import("vk"); const gvk = @import("graphics.zig"); pub const Pipeline = struct { pipeline: vk.VkPipeline, layout: vk.VkPipelineLayout, pub fn deinit(self: Pipeline, device: vk.VkDevice) void { vk.destroyPipeline(device, self.pipeline, null); vk.destr...
graphics/src/backend/vk/pipeline.zig
const std = @import("std"); const aoc = @import("aoc-lib.zig"); fn calc(alloc: std.mem.Allocator, nums: []const usize, maxTurn: usize) usize { var lastSeen = alloc.alloc(usize, maxTurn) catch unreachable; defer alloc.free(lastSeen); std.mem.set(usize, lastSeen, 0); var n: usize = undefined; var p: ...
2020/15/aoc.zig
const std = @import("std"); const math = std.math; const qnan128 = @bitCast(f128, @as(u128, 0x7fff800000000000) << 64); const inf128 = @bitCast(f128, @as(u128, 0x7fff000000000000) << 64); const __multf3 = @import("mulXf3.zig").__multf3; const __mulxf3 = @import("mulXf3.zig").__mulxf3; const __muldf3 = @import("mulXf3...
lib/std/special/compiler_rt/mulXf3_test.zig
const std = @import("std"); const Builder = std.build.Builder; const glfw = @import("libs/mach-glfw/build.zig"); const system_sdk = @import("libs/mach-glfw/system_sdk.zig"); pub const LinuxWindowManager = enum { X11, Wayland, }; pub const Options = struct { /// Only respected on Linux. linux_window_ma...
gpu/build_dawn.zig
const std = @import("std"); const mem = std.mem; const ChangesWhenCasemapped = @This(); allocator: *mem.Allocator, array: []bool, lo: u21 = 65, hi: u21 = 125251, pub fn init(allocator: *mem.Allocator) !ChangesWhenCasemapped { var instance = ChangesWhenCasemapped{ .allocator = allocator, .array =...
src/components/autogen/DerivedCoreProperties/ChangesWhenCasemapped.zig
const std = @import("std"); const testing = std.testing; const ArrayList = std.ArrayList; pub const deserialize = @import("deserialize.zig").deserialize; const hasFn = std.meta.trait.hasFn; const implementsRLP = hasFn("encodeToRLP"); pub fn serialize(comptime T: type, data: T, list: *ArrayList(u8)) !void { if (co...
src/main.zig
const std = @import("std"); const Record = @import("lsmtree").Record; const KeyLengthType = @import("lsmtree").KeyLengthType; const Pointer = @import("lsmtree").Pointer; const Op = @import("lsmtree").Op; const Error = error{ArrayTooSmall}; // Writes into the provided array a Pointer byte array using the provided Rec...
src/serialize/pointer.zig
const datetime = @import("datetime"); const mecha = @import("mecha"); const std = @import("std"); const debug = std.debug; const heap = std.heap; const json = std.json; const math = std.math; const mem = std.mem; pub const Season = enum(u4) { spring, summer, fall, winter, undef, }; pub const Site...
src/anime.zig
const std = @import("std"); const os = std.os; const time = os.time; const assert = std.debug.assert; pub const Status = enum { Locked, Unlocked, Timeout, }; pub const Umutex = struct { atom: std.atomic.Int(usize), /// uMutexes are allocated pub fn init(allocator: *std.mem.Allocator) !*Umutex...
umutex.zig
const std = @import("std"); const assert = std.debug.assert; const fs = std.fs; const mem = std.mem; const zbs = std.build; const ScanProtocolsStep = @import("deps/zig-wayland/build.zig").ScanProtocolsStep; /// While a river release is in development, this string should contain the version in development /// with the...
source/river-0.1.0/build.zig
const std = @import("std"); usingnamespace (@import("../machine.zig")); usingnamespace (@import("../util.zig")); // QuickRef: https://www.felixcloutier.com/x86/xchg const reg = Operand.register; const regRm = Operand.registerRm; const memRm = Operand.memoryRmDef; const memRmSeg = Operand.memoryRm; test "xchg" { ...
src/x86/tests/xchg.zig
const proto = @import("proto"); const std = @import("std"); const gdb = @import("gdb"); const client = @import("client.zig"); pub const target_xml = @embedFile("aarch64.xml"); pub const num_default_registers = 32; pub const HookedInstr = [4]u8; fn readWithEL(comptime EL: comptime_int) !Frame { const RemoteFrame...
src/client/aarch64.zig
const std = @import("std"); const arch = @import("root").arch; const kernel = @import("kernel.zig"); const logger = @TypeOf(kernel.logger).childOf(@typeName(@This())){}; pub fn directMapping() *DirectMapping { return arch.mm.directMapping(); } pub fn directTranslate(phys: PhysicalAddress) VirtualAddress { co...
kernel/mm.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const gui = @import("gui"); const nvg = @import("nanovg"); const Rect = @import("gui/geometry.zig").Rect; const Point = @import("gui/geometry.zig").Point; const BlendMode = @import("color.zig").BlendMode; const image_alpha_data = @embedFile("../data/ble...
src/BlendModeWidget.zig
pub const WLDP_LOCKDOWN_UNDEFINED = @as(u32, 0); pub const WLDP_LOCKDOWN_DEFINED_FLAG = @as(u32, 2147483648); pub const WLDP_LOCKDOWN_CONFIG_CI_FLAG = @as(u32, 1); pub const WLDP_LOCKDOWN_CONFIG_CI_AUDIT_FLAG = @as(u32, 2); pub const WLDP_LOCKDOWN_UMCIENFORCE_FLAG = @as(u32, 4); pub const WLDP_LOCKDOWN_AUDIT_FLAG = @as...
deps/zigwin32/win32/system/windows_programming.zig
const std = @import("std"); const builtin = @import("builtin"); const uv = @import("../uv/lib.zig"); const ssl = @import("../openssl/lib.zig"); const Options = struct { openssl_includes: []const []const u8, libuv_includes: []const []const u8, zlib_includes: []const []const u8, }; pub const pkg = std.buil...
lib/h2o/lib.zig
const gfx = @import("gfx.zig"); const std = @import("std"); const js = struct { const GPUSize32 = u32; const GPUSize64 = usize; const GPUIndex32 = u32; const GPUSignedOffset32 = i32; const GPUIntegerCoordinate = u32; const ObjectId = u32; const DescId = ObjectId; const ContextId = Obje...
src/gfx_web.zig
const std = @import("../std.zig"); const math = std.math; const expect = std.testing.expect; fn frexp_result(comptime T: type) type { return struct { significand: T, exponent: i32, }; } pub const frexp32_result = frexp_result(f32); pub const frexp64_result = frexp_result(f64); /// Breaks x in...
lib/std/math/frexp.zig
mod: *Module, /// Alias to `mod.gpa`. gpa: Allocator, /// Points to the temporary arena allocator of the Sema. /// This arena will be cleared when the sema is destroyed. arena: Allocator, /// Points to the arena allocator for the owner_decl. /// This arena will persist until the decl is invalidated. perm_arena: Alloca...
src/Sema.zig
const std = @import("../std.zig"); const builtin = @import("builtin"); const unicode = std.unicode; const mem = std.mem; const fs = std.fs; const os = std.os; pub const GetAppDataDirError = error{ OutOfMemory, AppDataDirUnavailable, }; /// Caller owns returned memory. /// TODO determine if we can remove the a...
lib/std/fs/get_app_data_dir.zig
usingnamespace @import("bits.zig"); pub const SOCKET = *opaque {}; pub const INVALID_SOCKET = @intToPtr(SOCKET, ~@as(usize, 0)); pub const GROUP = u32; pub const ADDRESS_FAMILY = u16; pub const WSAEVENT = HANDLE; // Microsoft use the signed c_int for this, but it should never be negative pub const socklen_t = u32; ...
lib/std/os/windows/ws2_32.zig
const std = @import("std"); const c = @cImport({ @cInclude("epoxy/gl.h"); }); comptime { std.testing.refAllDecls(@This()); } pub usingnamespace @import("types.zig"); pub const ErrorHandling = enum { /// OpenGL functions will log the error, but will not assert that no error happened log, /// Ass...
zgl.zig
const std = @import("std"); const assert = std.debug.assert; const log = std.log.scoped(.codegen); const math = std.math; const mem = std.mem; const Allocator = mem.Allocator; const builtin = @import("builtin"); const link = @import("../../link.zig"); const Module = @import("../../Module.zig"); const TypedValue = @impo...
src/arch/sparcv9/CodeGen.zig
const std = @import("std"); const kernel = @import("../../kernel.zig"); const assert = kernel.assert; const TODO = kernel.TODO; const align_forward = kernel.align_forward; const string_eq = kernel.string_eq; const starts_with = kernel.string_starts_with; const ends_with = kernel.string_ends_with; const read_big_endian ...
src/kernel/arch/riscv64/device_tree.zig
const std = @import("std"); const builtin = @import("builtin"); const expect = std.testing.expect; const fifo = std.fifo; const io = std.io; const math = std.math; const mem = std.mem; const testing = std.testing; const ArrayList = std.ArrayList; const deflate = @import("compressor.zig"); const inflate = @import("dec...
lib/std/compress/deflate/compressor_test.zig
const print = @import("std").debug.print; pub fn main() void { // ALL numeric literals in Zig are of type comptime_int or // comptime_float. They are of arbitrary size (as big or // little as you need). // // Notice how we don't have to specify a size like "u8", // "i32", or "f64" when we assi...
exercises/066_comptime.zig
const std = @import("std"); const PrintHelper = @import("print_helper.zig").PrintHelper; const BuiltinPackage = @import("builtins.zig").BuiltinPackage; const ParseResult = @import("parse.zig").ParseResult; const Module = @import("parse.zig").Module; const ModuleParam = @import("parse.zig").ModuleParam; const ModuleCode...
src/zangscript/codegen_zig.zig
const std = @import("std"); const examples = [_][]const u8{ "play", "song", "subsong", "envelope", "stereo", "curve", "detuned", "laser", "portamento", "arpeggiator", "sampler", "polyphony", "polyphony2", "delay", "mouse", "two", "script", "script...
build.zig
const sabaton = @import("root").sabaton; const std = @import("std"); var bus0base: usize = undefined; var bus0size: usize = undefined; var bar32base: usize = undefined; var bar64base: usize = undefined; fn pci_bars_callback(dev: Addr) bool { const header_type = dev.get_header_type(); const num_bars: u8 = switch(h...
src/platform/pci.zig
const std = @import("std"); const math = std.math; const assert = std.debug.assert; const L = std.unicode.utf8ToUtf16LeStringLiteral; const zwin32 = @import("zwin32"); const w = zwin32.base; const d3d12 = zwin32.d3d12; const hrPanic = zwin32.hrPanic; const hrPanicOnFail = zwin32.hrPanicOnFail; const zd3d12 = @import("...
samples/intro/src/intro4.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const nvg = @import("nanovg"); const gui = @import("../gui.zig"); const event = @import("../event.zig"); const Point = @import("../geometry.zig").Point; const Rect = @import("../geometry.zig").Rect; const Button = @This(); pub const ButtonStyle = enum(...
src/gui/widgets/Button.zig
const int = @import("int.zig"); const std = @import("std"); const builtin = std.builtin; pub const Error = error{InvalidPointer}; /// A data structure representing a relative pointer in binary data. /// Useful for decoding binary data using only `packed` structs. pub fn RelativePointer( /// The pointer type that...
src/core/rom/ptr.zig
const std = @import("std"); const os = @import("root").os; const paging = os.memory.paging; const RangeAlloc = os.lib.range_alloc.RangeAlloc; const Mutex = os.thread.Mutex; var sbrk_head: usize = undefined; pub fn init(phys_high: usize) !void { os.log("Initializing vmm with base 0x{X}\n", .{phys_high}); ...
src/memory/vmm.zig
const atan2 = @import("std").math.atan2; const sqrt = @import("std").math.sqrt; const cos = @import("std").math.cos; const sin = @import("std").math.sin; usingnamespace @import("common.zig"); /// Generic Vector2 Type pub fn Generic(comptime T: type) type { switch (T) { i16, i32, i64, i128, f16, f32, f64...
src/kiragine/kira/math/vec2.zig
pub const FS_INITIALIZING = @as(u32, 536870912); pub const FS_DIALING = @as(u32, 536870913); pub const FS_TRANSMITTING = @as(u32, 536870914); pub const FS_RECEIVING = @as(u32, 536870916); pub const FS_COMPLETED = @as(u32, 536870920); pub const FS_HANDLED = @as(u32, 536870928); pub const FS_LINE_UNAVAILABLE = @as(u32, 5...
deps/zigwin32/win32/devices/fax.zig
const layout = @import("layout.zig"); const x86 = @import("x86.zig"); const fmt = @import("std").fmt; use @import("lib").tty; // Hold the VGA status. var vga = VGA.init(VRAM_ADDR); //// // Initialize the terminal. // pub fn initialize() void { disableCursor(); vga.clear(); } //// // Print a formatted string ...
kernel/tty.zig
const std = @import("std"); const concepts = @import("../../lib.zig").concepts; const assert = std.debug.assert; pub fn Visitor( comptime Context: type, comptime Value: type, comptime visitBool: @TypeOf(struct { fn f(self: Context, comptime Error: type, input: bool) Error!Value { _ = ...
src/de/interface/visitor.zig
const std = @import("std"); const stdx = @import("stdx"); const algo = stdx.algo; const log = stdx.log.scoped(.grammar); const ds = stdx.ds; const parser = @import("parser.zig"); const NodeTag = parser.NodeTag; const NodePtr = parser.NodePtr; const builder = @import("builder.zig"); pub const Grammar = struct { co...
parser/grammar.zig
const std = @import("std"); const builtin = @import("builtin"); const wasi = std.os.wasi; const Allocator = std.mem.Allocator; const unexpectedErrno = std.os.unexpectedErrno; const GetCommandLineW = std.os.windows.kernel32.GetCommandLineW; /// An iterator over an array of null-terminated argument strings. pub const Ar...
zlaap.zig
const std = @import("std"); const print = std.debug.print; usingnamespace @import("value.zig"); usingnamespace @import("chunk.zig"); usingnamespace @import("compiler.zig"); usingnamespace @import("heap.zig"); pub var vm: VM = undefined; pub const ObjStringHashOfValue = std.hash_map.AutoHashMap(*ObjString, Value); pub...
zvm/src/vm.zig
pub const CmsdkTimer = struct { base: usize, const Self = @This(); /// Construct a `CmsdkTimer` object using the specified MMIO base address. pub fn withBase(base: usize) Self { return Self{ .base = base }; } pub fn regCtrl(self: Self) *volatile u32 { return @intToPtr(*volatil...
examples/drivers/cmsdk_timer.zig
const std = @import("std"); const os = std.os; const warn = std.debug.warn; const expectEqual = std.testing.expectEqual; const readv = @import("c.zig").readv; const MemSegments = @import("read_map.zig").Segments; const NeedleType = @import("input.zig").NeedleType; // TODO@Performance: A linked list is likely to offer ...
src/memory.zig
// const std = @import("../std.zig"); const builtin = std.builtin; usingnamespace std.c; extern "c" fn _errnop() *c_int; pub const _errno = _errnop; pub extern "c" fn find_directory(which: c_int, volume: i32, createIt: bool, path_ptr: [*]u8, length: i32) u64; pub extern "c" fn find_thread(thread_name: ?*c_void) i...
lib/std/c/haiku.zig
pub const numbers = [_]usize{ 1539, 1914, 1866, 1407, 1706, 1423, 1834, 1700, 1573, 1486, 1743, 1394, 1693, 1705, 1530, 1811, 1626, 1473, 1901, 1481, 1527, 1841, 1891, 1750, 1343, 1899, 401, 1896, 1627, ...
src/input01.zig
const Command = @This(); const std = @import("std"); const parser = @import("parser.zig"); const Arg = @import("Arg.zig"); const ArgMatches = @import("arg_matches.zig").ArgMatches; const mem = std.mem; const ArrayList = std.ArrayList; const Allocator = mem.Allocator; const Setting = struct { takes_value: bool, ...
src/Command.zig
const std = @import("std"); const input = @embedFile("data/input16"); usingnamespace @import("util.zig"); pub fn main() !void { var allocator_state = std.heap.ArenaAllocator.init(std.heap.page_allocator); defer allocator_state.deinit(); const allocator = &allocator_state.allocator; const result = scan...
src/day16.zig
const std = @import("std"); const c = @import("internal/c.zig"); const internal = @import("internal/internal.zig"); const log = std.log.scoped(.git); const git = @import("git.zig"); /// This type bundles all functionality that does not act on an instance of an object pub const Handle = struct { /// De-initialize...
src/handle.zig
const std = @import("std"); const os = std.os; const fs = std.fs; const linux = os.linux; const io = std.io; const fmt = std.fmt; const mem = std.mem; const FixedBufferAllocator = std.heap.FixedBufferAllocator; const assert = std.debug.assert; const termios = @import("termios.zig"); const BELL = [_]u8{7}; // Bell cons...
src/vt-term.zig
pub const PROCESSOR_NUMBER_PKEY = PROPERTYKEY { .fmtid = @import("../zig.zig").Guid.initString("5724c81d-d5af-4c1f-a103-a06e28f204c6"), .pid = 1 }; pub const GUID_DEVICE_BATTERY = Guid.initString("72631e54-78a4-11d0-bcf7-00aa00b7b32a"); pub const GUID_DEVICE_APPLICATIONLAUNCH_BUTTON = Guid.initString("629758ee-986e-4d9...
win32/system/power.zig
const std = @import("std"); const builtin = @import("builtin"); const Builder = std.build.Builder; const CommandStep = std.build.CommandStep; const gcc_arm = "/usr/gcc-arm-none-eabi-8-2018-q4-major"; const repoName = "zig-on-rpi-using-ultibo"; const version = "v20190307"; const Config = struct { conf: []const u8,...
build.zig
const builtin = @import("builtin"); const std = @import("std"); const expect = std.testing.expect; const HasFuncs = struct { state: u32, func_field: *const fn (u32) u32, fn inc(self: *HasFuncs) void { self.state += 1; } fn get(self: HasFuncs) u32 { return self.state; } fn...
test/behavior/member_func.zig
pub const std = @import("std"); pub const imr = @import("markups/imr.zig"); const Url = @import("url.zig").Url; const Document = imr.Document; const Tag = imr.Tag; const Allocator = std.mem.Allocator; const Event = union(enum) { MouseButton: struct { pressed: bool, x: f64, y: f64 } }; ...
zervo/renderer.zig
const Interpreter = @This(); const std = @import("std"); const utils = @import("utils.zig"); const MEMORY_SIZE = 30_000; const SyntaxError = error{ OpenBracketNotFound, CloseBracketNotFound, }; src: []const u8, src_current_index: usize = 0, src_next_index: usize = 0, mem: [MEMORY_SIZE]u8 = [_]u8{0} ** MEMOR...
src/Interpreter.zig
const std = @import("std"); const testing = std.testing; const ArrayList = std.ArrayList; const ArrayListUnmanaged = std.ArrayListUnmanaged; const StringHashMapUnmanaged = std.StringHashMapUnmanaged; const lex = @import("lex.zig"); const parse = @import("parse.zig"); const assert_one_match = true; const OutKind = en...
src/run.zig
const std = @import("std"); const pike = @import("pike.zig"); const windows = @import("os/windows.zig"); const PackedWaker = @import("waker.zig").PackedWaker; const math = std.math; const meta = std.meta; pub const SignalType = packed struct { terminate: bool = false, interrupt: bool = false, quit: bool = ...
signal_windows.zig
pub const PspDisplayPixelFormats = extern enum(c_int) { Format565 = 0, Format5551 = 1, Format4444 = 2, Format8888 = 3, }; pub const PspDisplaySetBufSync = extern enum(c_int) { Immediate = 0, Nextframe = 1, }; pub const PspDisplayErrorCodes = extern enum(c_int) { Ok = 0, Pointer = 21474...
src/psp/sdk/pspdisplay.zig
const std = @import("std"); const stdx = @import("stdx"); const build_options = @import("build_options"); const Backend = build_options.GraphicsBackend; const t = stdx.testing; const Vec2 = stdx.math.Vec2; const ds = stdx.ds; const graphics = @import("graphics"); const sdl = @import("sdl"); const curl = @import("curl")...
runtime/runtime.zig
const std = @import("std"); const assert = @import("std").debug.assert; const misc = @import("misc.zig"); usingnamespace @import("c.zig"); const warn = std.debug.warn; pub const List = std.ArrayList(Entry); pub const Allocator = std.mem.Allocator; fn log(comptime arg: []const u8) void { warn(arg, .{}); } /// Cl...
src/todo.zig
const subo = @import("subo.zig"); const std = @import("std"); const testing = std.testing; const math = std.math; fn test__subodi4(a: i64, b: i64) !void { var result_ov: c_int = undefined; var expected_ov: c_int = undefined; var result = subo.__subodi4(a, b, &result_ov); var expected: i64 = simple_subo...
lib/std/special/compiler_rt/subodi4_test.zig
const std = @import("std"); pub fn Key(comptime S: type) type { return struct { const Self = @This(); index: S, version: S, pub fn equals(lhs: Self, rhs: Self) bool { return lhs.index == rhs.index and lhs.version == rhs.version; } }; } fn Slot(comptime S: t...
src/slotmap.zig
const std = @import("std"); const panic = std.debug.panic; const assert = std.debug.assert; const bufPrint = std.fmt.bufPrint; const c = @import("c.zig"); const debug_gl = @import("debug_gl.zig"); const AllShaders = @import("all_shaders.zig").AllShaders; const StaticGeometry = @import("static_geometry.zig").StaticGeome...
src/main.zig
const std = @import("std"); const warn = std.debug.print; const Allocator = std.mem.Allocator; const toot_lib = @import("./toot.zig"); const util = @import("./util.zig"); pub const TootList = SomeList(*toot_lib.Type); pub fn SomeList(comptime T: type) type { return struct { list: ListType, const...
src/toot_list.zig
const std = @import("std"); pub fn build(b: *std.build.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 any target is allowed, and the default is native. Other options // for rest...
build.zig
test "zig fmt: change @typeOf to @TypeOf" { try testTransform( \\const a = @typeOf(@as(usize, 10)); \\ , \\const a = @TypeOf(@as(usize, 10)); \\ ); } test "zig fmt: comptime struct field" { try testCanonical( \\const Foo = struct { \\ a: i32, \...
lib/std/zig/parser_test.zig
const std = @import("../../std.zig"); const maxInt = std.math.maxInt; pub fn S_ISCHR(m: u32) bool { return m & S_IFMT == S_IFCHR; } // See: // - https://gitweb.dragonflybsd.org/dragonfly.git/blob/HEAD:/include/unistd.h // - https://gitweb.dragonflybsd.org/dragonfly.git/blob/HEAD:/sys/sys/types.h // TODO: mode_t s...
lib/std/os/bits/dragonfly.zig
const std = @import("std"); const CrossTarget = std.zig.CrossTarget; const TestContext = @import("../../src/test.zig").TestContext; const linux_x64 = std.zig.CrossTarget{ .cpu_arch = .x86_64, .os_tag = .linux, }; const macos_x64 = CrossTarget{ .cpu_arch = .x86_64, .os_tag = .macos, }; const all_targets...
test/stage2/x86_64.zig
const std = @import("std"); const builtin = @import("builtin"); const assert = std.debug.assert; const Allocator = std.mem.Allocator; const log = std.log.scoped(.codegen); const math = std.math; const native_endian = builtin.cpu.arch.endian(); const llvm = @import("llvm/bindings.zig"); const link = @import("../link.zi...
src/codegen/llvm.zig
const std = @import("std"); const mem = std.mem; const c = @import("./c.zig"); const glfw = @import("./main.zig"); const VideoMode = glfw.VideoMode; /// Gamma ramp. const GammaRamp = glfw.GammaRamp; /// Opaque monitor object. pub const Monitor = packed struct { const Self = @This(); handle: *c.GLFWmonitor, ...
src/monitor.zig
const std = @import("std.zig"); const builtin = std.builtin; const os = std.os; const fs = std.fs; const BufMap = std.BufMap; const mem = std.mem; const math = std.math; const Allocator = mem.Allocator; const assert = std.debug.assert; const testing = std.testing; pub const abort = os.abort; pub const exit = os.exit; ...
lib/std/process.zig
const std = @import("std"); const interfaces = @import("interface"); usingnamespace @import("environment.zig"); usingnamespace @import("vm.zig"); usingnamespace @import("value.zig"); /// Non-owning interface to a abstract LoLa object. /// It is associated with a object handle in the `ObjectPool` and provides /// a wa...
src/library/runtime/objects.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const Target = std.Target; const log = std.log.scoped(.codegen); const assert = std.debug.assert; const Module = @import("../Module.zig"); const Decl = Module.Decl; const Type = @import("../type.zig").Type; const Value = @import("../value.zig").Value; co...
src/codegen/spirv.zig
const std = @import("std"); const fs = std.fs; const io = std.io; const info = std.log.info; const print = std.debug.print; const fmt = std.fmt; const utils = @import("utils.zig"); var gpa = std.heap.GeneralPurposeAllocator(.{}){}; fn parseMask(line: []const u8, allow: u8) usize { var res: usize = 0; const o...
day_14/src/main.zig
const e = @import("erl_nif.zig"); const std = @import("std"); const builtin = @import("builtin"); const BeamMutex = @import("beam_mutex.zig").BeamMutex; /////////////////////////////////////////////////////////////////////////////// // BEAM allocator definitions ///////////////////////////////////////////////////////...
priv/beam/beam.zig
pub const SYNC_VERSION_FLAG_FROM_FEED = @as(u32, 1); pub const SYNC_VERSION_FLAG_HAS_BY = @as(u32, 2); pub const SYNC_SERIALIZE_REPLICA_KEY_MAP = @as(u32, 1); pub const SYNC_FILTER_INFO_FLAG_ITEM_LIST = @as(u32, 1); pub const SYNC_FILTER_INFO_FLAG_CHANGE_UNIT_LIST = @as(u32, 2); pub const SYNC_FILTER_INFO_FLAG_CUSTOM =...
win32/system/windows_sync.zig
const uefi = @import("std").os.uefi; const Guid = uefi.Guid; const TableHeader = uefi.tables.TableHeader; const Time = uefi.Time; const TimeCapabilities = uefi.TimeCapabilities; const Status = uefi.Status; const MemoryDescriptor = uefi.tables.MemoryDescriptor; /// Runtime services are provided by the firmware before a...
lib/std/os/uefi/tables/runtime_services.zig
const std = @import("std"); const warn = std.debug.warn; const assert = std.debug.assert; const c = @import("c.zig").c; const mem = std.mem; const builtin = @import("builtin"); const wgi = @import("WindowGraphicsInput.zig"); const Files = @import("../Files.zig"); const image = @import("Image.zig"); var maxVertexAttrib...
src/WindowGraphicsInput/Window.zig
const std = @import("std"); const assert = std.debug.assert; const warn = std.debug.warn; const Allocator = std.mem.Allocator; usingnamespace @import("../main/util.zig"); pub const systemFunc = fn (self: *SystemSelf, params: VariantMap) void; pub const SystemFuncDef = struct { pass: []const u8, phase: u8 = 0,...
code/core/system.zig
const std = @import("std"); const builtin = std.builtin; fn __clzsi2_generic(a: i32) callconv(.C) i32 { @setRuntimeSafety(builtin.is_test); var x = @bitCast(u32, a); var n: i32 = 32; // Count first bit set using binary search, from Hacker's Delight var y: u32 = 0; inline for ([_]i32{ 16, 8, 4...
lib/std/special/compiler_rt/clzsi2.zig
pub const Entry = union(enum) { const DataS = struct { const Self = @This(); const Granularity = enum(u1) { Byte = 0, Page = 1, }; const Direction = enum(u1) { Up = 0, Down = 1, }; base: u32, limit: u20, ...
src/gdt.zig
const std = @import("std"); const backend = @import("backend.zig"); const c = @cImport({ @cInclude("GLFW/glfw3.h"); }); var previous_x: f64 = 0; var previous_y: f64 = 0; pub const GLFWBackend = struct { windowCount: i32, hidden: *c.GLFWwindow, const Self = @This(); pub fn init(self: *Self) !void...
src/backend/glfw.zig
const std = @import("std"); const registry = @import("registry.zig"); /// generates versioned "handles" (https://floooh.github.io/2018/06/17/handles-vs-pointers.html) /// you choose the type of the handle (aka its size) and how much of that goes to the index and the version. /// the bitsize of version + id must equal ...
src/ecs/handles.zig
const std = @import("std"); const Pkg = std.build.Pkg; const platform = @import("../platform/lib.zig"); const graphics = @import("../graphics/lib.zig"); const GraphicsBackend = @import("../platform/backend.zig").GraphicsBackend; const stdx = @import("../stdx/lib.zig"); const stb = @import("../lib/stb/lib.zig"); const ...
graphics/lib.zig
const std = @import("std"); const ascii = std.ascii; const mem = std.mem; const time = std.time; const Address = std.net.Address; const assert = std.debug.assert; const testing = std.testing; const Allocator = std.mem.Allocator; const AtomicFile = std.fs.AtomicFile; const Headers = @import("headers.zig").Headers; cons...
src/request.zig
pub const FILTER_NAME_MAX_CHARS = @as(u32, 255); pub const VOLUME_NAME_MAX_CHARS = @as(u32, 1024); pub const INSTANCE_NAME_MAX_CHARS = @as(u32, 255); pub const FLTFL_AGGREGATE_INFO_IS_MINIFILTER = @as(u32, 1); pub const FLTFL_AGGREGATE_INFO_IS_LEGACYFILTER = @as(u32, 2); pub const FLTFL_ASI_IS_MINIFILTER = @as(u32, 1);...
win32/storage/installable_file_systems.zig
const std = @import("std"); usingnamespace @import("zalgebra"); usingnamespace @import("collision/aabb.zig"); const c = @import("c.zig"); const opengl = @import("opengl_renderer.zig"); const vertex = @import("vertex.zig"); fn genBoxMesh(half_size: vec3) opengl.Mesh { var vertices = [_]vertex.TexturedVertex { ...
src/test_box.zig
const Mir = @This(); const std = @import("std"); const builtin = @import("builtin"); const assert = std.debug.assert; const bits = @import("bits.zig"); const Register = bits.Register; instructions: std.MultiArrayList(Inst).Slice, /// The meaning of this data is determined by `Inst.Tag` value. extra: []const u32, pu...
src/arch/riscv64/Mir.zig
const std = @import("std"); const builtin = @import("builtin"); const expect = std.testing.expect; test "integer division" { if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest; if (builtin.zig_backend == .stage2_arm) retur...
test/behavior/int_div.zig
// TODO: pick the best index to put them into instead of at the end // - e.g. find a common previous symbol and put it after that one // - they definitely need to go into the correct section const std = @import("std"); const builtin = std.builtin; const mem = std.mem; const log = std.log; const elf = std....
tools/gen_stubs.zig