code
stringlengths
38
801k
repo_path
stringlengths
6
263
//-------------------------------------------------------------------------------- // Section: Types (233) //-------------------------------------------------------------------------------- // TODO: this type has a FreeFunc 'EngDeleteSemaphore', what can Zig do with this information? pub const HSEMAPHORE = *opaque{};...
deps/zigwin32/win32/ui/display_devices.zig
const std = @import("std"); const assert = std.debug.assert; const imgui = @import("imgui"); const glfw = @import("include/glfw.zig"); const vk = @import("include/vk.zig"); const impl_glfw = @import("imgui_impl_glfw.zig"); const impl_vulkan = @import("imgui_impl_vulkan.zig"); const build_mode = @import("builtin").mo...
examples/example_glfw_vulkan.zig
const std = @import("../std.zig"); const builtin = std.builtin; const assert = std.debug.assert; const maxInt = std.math.maxInt; const elf = std.elf; const vdso = @import("linux/vdso.zig"); const dl = @import("../dynamic_library.zig"); pub usingnamespace switch (builtin.arch) { .i386 => @import("linux/i386.zig"), ...
lib/std/os/linux.zig
const builtin = @import("builtin"); const std = @import("std.zig"); const io = std.io; const math = std.math; const mem = std.mem; const os = std.os; const warn = std.debug.warn; const coff = std.coff; const fs = std.fs; const File = std.fs.File; const ArrayList = std.ArrayList; // Note: most of this is based on info...
lib/std/pdb.zig
const std = @import("std.zig"); const builtin = @import("builtin"); const mem = std.mem; const os = std.os; const assert = std.debug.assert; const testing = std.testing; const elf = std.elf; const windows = std.os.windows; const system = std.os.system; const maxInt = std.math.maxInt; const max = std.math.max; pub cons...
lib/std/dynamic_library.zig
const std = @import("std"); const Impulse = @import("notes.zig").Impulse; const Notes = @import("notes.zig").Notes; const Span = @import("basics.zig").Span; pub const ConstantOrBuffer = union(enum) { constant: f32, buffer: []const f32, }; pub fn constant(x: f32) ConstantOrBuffer { return .{ .constant = x ...
src/zang/trigger.zig
const std = @import("std"); const g = @cImport(@cInclude("grok.h")); const GrokError = @import("error.zig").GrokErrors; const get_error = @import("error.zig").get_error; const json = std.json; const jstruct = struct { word1: ?[]const u8 = null, word2: ?[]const u8 = null, }; pub fn main() !void { const use...
main.zig
const std = @import("std"); const mem = std.mem; const powci = @import("powci.zig").powci; const maxInt = std.math.maxInt; fn Hibitset(comptime Int: type, comptime layers: comptime_int) type { const bitc = comptime std.meta.bitCount(Int); comptime var layer_offsets: [layers]usize = [_]usize{0} ** layers; c...
src/lib.zig
const std = @import("std"); pub const Rela = struct { offset: usize, info: usize, symbol_value: usize, reltype: Reltype, symbol_name: []const u8, section_index: u16, plt_addr: ?usize, }; pub const Syms = struct { num: u64, value: u64, size: u64, symtype: Symtype, bind: Bi...
src/data-structures/sym-n-rela.zig
pub const VDMCONTEXT_i386 = @as(u32, 65536); pub const VDMCONTEXT_i486 = @as(u32, 65536); pub const VDM_KGDT_R3_CODE = @as(u32, 24); pub const VDM_MAXIMUM_SUPPORTED_EXTENSION = @as(u32, 512); pub const V86FLAGS_CARRY = @as(u32, 1); pub const V86FLAGS_PARITY = @as(u32, 4); pub const V86FLAGS_AUXCARRY = @as(u32, 16); pub...
win32/system/virtual_dos_machines.zig
const std = @import("std"); const Company = struct { csv: []const u8, name: []const u8, se: []const u8, income_year: []const u8, company_type: []const u8, taxable_income: []const u8, deficit: []const u8, corporate_tax: []const u8, }; fn csvLineToCompany(line: []const u8) Company { ...
src/main.zig
const std = @import("std"); const Instruction = @import("../common/ir.zig").Instruction; const InstructionName = @import("../common/ir.zig").InstructionName; /// A handle to a location in source code. /// This handle is created by a `CodeWriter` and only that code writer /// knows where this label is located in memor...
src/library/compiler/code-writer.zig
const std = @import("std"); /// Makes all vector and matrix types generic against Real pub fn specializeOn(comptime Real: type) type { return struct { /// Helper for the swizzle operator. /// Returns the type fitting the number of swizzle elements fn SwizzleTypeByElements(comptime i: usize)...
src/pkg/zlm.zig
const std = @import("std"); const fs = std.fs; const constants = @import("../constants.zig"); const logger = std.log.scoped(.dx_data); const DXHeader = @import("dx_header.zig").DXHeader; const DXRecord = @import("dx_record.zig").DXRecord; /// DX Data /// See section 2.3.3 [here](https://isccp.giss.nasa.gov/pub/documen...
zig-dxread/src/models/dx_data.zig
const std = @import("std"); const regs = @import("../types/regs.zig"); const mmio = @import("mmio.zig"); const gpio = @import("gpio.zig"); const mbox = @import("mbox.zig"); const Register = regs.Register; //const NoError = types.errorTypes.NoError; // See page 90 of the BCM2835 manual for information about most of t...
kernel/src/arch/aarch64/io/uart.zig
const std = @import("std"); const Value = std.json.Value; pub const Account = struct { /// A user-friendly string to show when presenting content from this /// account. name: []const u8, /// This is true if the account belongs to the authenticated user rather /// than a group account or a personal...
session.zig
usingnamespace @import("deque"); const std = @import("std"); const Thread = std.Thread; const AMOUNT: usize = 10000; test "single-threaded" { const S = struct { fn task(stealer: Stealer(usize, 32)) void { var left: usize = AMOUNT; while (stealer.steal()) |i| { std....
test/test.zig
const std = @import("std"); test "example" { const data = @embedFile("4_example.txt"); const result = try run(data); try std.testing.expectEqual(@as(u32, 1924), result); } pub fn main() !void { const data = @embedFile("4.txt"); const result = try run(data); std.debug.print("{}\n", .{result}); ...
shritesh+zig/4b.zig
const std = @import("std"); const mem = std.mem; const uefi = std.os.uefi; const Allocator = mem.Allocator; const Guid = uefi.Guid; pub const DevicePathProtocol = packed struct { type: DevicePathType, subtype: u8, length: u16, pub const guid align(8) = Guid{ .time_low = 0x09576e91, .ti...
lib/std/os/uefi/protocols/device_path_protocol.zig
const std = @import("std"); const ascii = std.ascii; const fmt = std.fmt; const mem = std.mem; const assert = std.debug.assert; usingnamespace @import("common.zig"); pub fn create(buffer: []u8, reader: anytype, writer: anytype) Client(@TypeOf(reader), @TypeOf(writer)) { assert(buffer.len >= 32); return Clie...
lib/hzzp/src/base/client.zig
const std = @import("std"); pub fn build(b: *std.build.Builder) void { const target = b.standardTargetOptions(.{}); const mode = b.standardReleaseOptions(); const test_step = b.step("test", "Runs the test suite"); const run_step = b.step("run", "Runs the linker"); const test_runner = b.addTest("s...
build.zig
const std = @import("std"); pub usingnamespace std.os.windows.user32; pub usingnamespace std.os.windows.kernel32; pub const HINSTANCE = std.os.windows.HINSTANCE; pub const HWND = std.os.windows.HWND; pub const WPARAM = std.os.windows.WPARAM; pub const LPARAM = std.os.windows.LPARAM; pub const LRESULT = std.os.windows...
src/backends/win32/win32.zig
pub const SYS_syscall = 0; pub const SYS_exit = 1; pub const SYS_fork = 2; pub const SYS_read = 3; pub const SYS_write = 4; pub const SYS_open = 5; pub const SYS_close = 6; pub const SYS_wait4 = 7; // 8 is old creat pub const SYS_link = 9; pub const SYS_unlink = 10; // 11 is obsolete execv pub const SYS_chdir = 12; pub...
std/os/freebsd/syscall.zig
const builtin = @import("builtin"); const std = @import("std"); const os = std.os; pub const iovec = if (builtin.link_libc) @cImport({ @cInclude("sys/uio.h"); }).iovec else extern struct { iov_base: *c_void, iov_len: usize, }; pub const readv = if (builtin.is_test) testable_rea...
src/c.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const ArrayList = std.ArrayList; const File = std.fs.File; const LinenoiseState = @import("state.zig").LinenoiseState; pub const History = @import("history.zig").History; const term = @import("term.zig"); const isUnsupportedTerm = term.isUnsupportedTerm;...
src/main.zig
const std = @import("std"); const input = @embedFile("data/input17"); 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 part1 = p1: {...
src/day17.zig
const std = @import("std"); const testing = std.testing; const allocator = std.testing.allocator; pub const Number = struct { const PAIR = std.math.maxInt(usize); const State = enum { SEARCH, EXPLODE, SPLIT }; const Cell = struct { num: usize, l: ?*Cell, r: ?*Cell, p: ?*Ce...
2021/p18/number.zig
/// The function fiatP384AddcarryxU32 is an addition with carry. /// Postconditions: /// out1 = (arg1 + arg2 + arg3) mod 2^32 /// out2 = ⌊(arg1 + arg2 + arg3) / 2^32⌋ /// /// Input Bounds: /// arg1: [0x0 ~> 0x1] /// arg2: [0x0 ~> 0xffffffff] /// arg3: [0x0 ~> 0xffffffff] /// Output Bounds: /// out1: [0x0 ...
fiat-zig/src/p384_32.zig
const utils = @import("utils"); const kernel = @import("root").kernel; const print = kernel.print; const memory = kernel.memory; const platform = @import("platform.zig"); const util = @import("util.zig"); const timing = @import("timing.zig"); const c = @cImport({ @cInclude("georgios_bios_int.h"); }); pub const...
kernel/platform/bios_int.zig
const std = @import("std"); const expect = std.testing.expect; const mem = std.mem; const math = std.math; pub fn max(A: []i32) i32 { var max_val: comptime i32 = 0; for (A) |value, index| { if (value > max_val) { max_val = A[index]; } } return max_val; } //Stable sort that ...
sorting/radix_sort.zig
const std = @import("std"); const common = @import("common.zig"); const general = @import("general.zig"); const window = @import("window.zig"); const text_sync = @import("text_sync.zig"); pub const NotificationMessage = struct { jsonrpc: []const u8 = "2.0", /// The method to be invoked. method: []const u...
src/types/notifications.zig
const std = @import("std"); const meta = std.meta; const assert = std.debug.assert; const testing = std.testing; const builtin = std.builtin; const Allocator = std.mem.Allocator; pub fn Num(comptime T: type, endian: std.builtin.Endian) type { const info = @typeInfo(T); if (info != .Int and info != .Float) { ...
src/serde.zig
usingnamespace @import("root").preamble; const log = lib.output.log.scoped(.{ .prefix = "NewTaskEntry", .filter = .info, }).write; const libalign = lib.util.libalign; /// Class that handles calling a function with any arguments on a new stack /// Used as a helper for task creation in platform-specific code p...
subprojects/flork/src/thread/task_entry.zig
const std = @import("std"); const Builder = @import("std").build.Builder; const ReloadStep = @import("./reload_step.zig"); const Self = @This(); pub const PackageAddOptions = union(enum) { Automatic: []const u8, Manual: struct { name: []const u8, src: []const u8, }, None: void, }; pub...
src/build_step.zig
const gllparser = @import("../gllparser/gllparser.zig"); const Error = gllparser.Error; const Parser = gllparser.Parser; const ParserContext = gllparser.Context; const Result = gllparser.Result; const NodeName = gllparser.NodeName; const std = @import("std"); const testing = std.testing; const mem = std.mem; pub cons...
src/combn/parser/end.zig
const std = @import("std"); pub const KeySym = enum { arrow_up, arrow_down, arrow_left, arrow_right, pub fn jsonStringify( value: KeySym, options: std.json.StringifyOptions, out_stream: anytype, ) @TypeOf(out_stream).Error!void { _ = options; try out_st...
src/keys.zig
const std = @import("std"); const builtin = @import("builtin"); pub const enable_tracy = @import("build_options").enable_tracy; const tracy = if (!enable_tracy) @import("tracy.zig") else @import("tracy_fake.zig"); const Allocator = std.mem.Allocator; const Writer = std.fs.File.Writer; const assert = std.debug.assert;...
fastBPE/learnBPE.zig
const std = @import("std"); const EPS = 3e-9; pub const Point = struct { x: f32, y: f32, }; pub fn isCounterClockWise(poly: []const Point) bool { var seq: f32 = 0; for (poly) |a, idx| { const b = poly[(idx + 1) % poly.len]; seq += (b.x - a.x) * (b.y + a.y); } return if (seq < ...
src/winding_number.zig
const std = @import("std"); const testing = std.testing; const Tree = @import("tree.zig").Tree; const Merk = @import("merk.zig").Merk; // TODO: change these as config pub const BatcSizeLimit = 10_000; pub const BatchKeyLimit = 1024; pub const BatchValueLimit = 1024; pub const OpTag = enum(u1) { Put, Del }; pub const ...
src/ops.zig
const std = @import("std"); const builtin = @import("builtin"); const lola = @import("lola"); // This is required for the runtime library to be able to provide // object implementations. pub const ObjectPool = lola.runtime.ObjectPool([_]type{ lola.libs.runtime.LoLaDictionary, lola.libs.runtime.LoLaList, }); ...
src/benchmark/perf.zig
const std = @import("std"); const assert = std.debug.assert; pub fn EncodedType(comptime T: type) type { comptime assert(@typeInfo(T) == .Int); comptime assert(@typeInfo(T).Int.signedness == .unsigned); const num_bits = @typeInfo(T).Int.bits; const num_bytes_ceil = try std.math.divCeil(comptime_int, nu...
src/synchsafe.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const print = std.debug.print; const data = @embedFile("../inputs/day10.txt"); pub fn main() anyerror!void { var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){}; defer _ = gpa_impl.deinit(); const gpa = gpa_impl.allocator(); return m...
src/day10.zig
const std = @import("std"); const upaya = @import("upaya"); pub const Map = struct { w: usize = 64, h: usize = 64, tile_size: usize = 16, tile_spacing: usize = 0, image: []const u8 = "", data: []u8, ruleset: RuleSet, ruleset_groups: std.AutoHashMap(u8, []const u8), pre_rulesets: std...
tilescript/map.zig
const std = @import("std"); const stdx = @import("stdx"); const build_options = @import("build_options"); const Vec2 = stdx.math.Vec2; const vec2 = Vec2.init; const builtin = @import("builtin"); const IsWasm = builtin.target.isWasm(); const graphics = @import("graphics"); const Graphics = graphics.Graphics; const FontI...
graphics/examples/demo.zig
const std = @import("std"); const expect = std.testing.expect; const math = std.math; const pi = std.math.pi; const e = std.math.e; const epsilon = 0.000001; test "@sqrt" { comptime testSqrt(); testSqrt(); } fn testSqrt() void { { var a: f16 = 4; expect(@sqrt(a) == 2); } { ...
test/stage1/behavior/floatop.zig
const std = @import("../std.zig"); const testing = std.testing; const valgrind = std.valgrind; pub const MemCheckClientRequest = extern enum { MakeMemNoAccess = valgrind.ToolBase("MC"), MakeMemUndefined, MakeMemDefined, Discard, CheckMemIsAddressable, CheckMemIsDefined, DoLeakCheck, Cou...
lib/std/valgrind/memcheck.zig
const posix = @import("posix.zig"); pub const iovec = posix.iovec; pub const iovec_const = posix.iovec_const; pub const STDIN_FILENO = 0; pub const STDOUT_FILENO = 1; pub const STDERR_FILENO = 2; pub const mode_t = u0; pub const time_t = i64; // match https://github.com/CraneStation/wasi-libc pub const timespec = s...
lib/std/os/bits/wasi.zig
const std = @import("std"); const testing = std.testing; const console_ = @import("console.zig"); const Console = console_.Console; const Precision = console_.Precision; const video = @import("video.zig"); const audio = @import("audio.zig"); fn testRom( comptime precision: Precision, comptime rom: []const u8...
src/tests.zig
const std = @import("std"); const version = @import("version"); const zzz = @import("zzz"); const Engine = @import("Engine.zig"); const Dependency = @import("Dependency.zig"); const api = @import("api.zig"); const cache = @import("cache.zig"); const utils = @import("utils.zig"); const Allocator = std.mem.Allocator; co...
src/pkg.zig
const fmath = @import("index.zig"); pub fn pow(comptime T: type, x: T, y: T) -> T { switch (T) { f32 => @inlineCall(pow32, x, y), f64 => @inlineCall(pow64, x, y), else => @compileError("pow not implemented for " ++ @typeName(T)), } } fn isOddInteger(x: f64) -> bool { const r = fmat...
src/pow.zig
pub const JET_bitConfigStoreReadControlInhibitRead = @as(u32, 1); pub const JET_bitConfigStoreReadControlDisableAll = @as(u32, 2); pub const JET_bitConfigStoreReadControlDefault = @as(u32, 0); pub const JET_bitDefragmentBatchStart = @as(u32, 1); pub const JET_bitDefragmentBatchStop = @as(u32, 2); pub const JET_bitDefra...
win32/storage/jet.zig
const std = @import("std"); const Allocator = std.mem.Allocator; //-------------------------------------------------------------------------------------------------- const Entry = struct { idx: u32, total_risk: u16, risk: u16, }; //--------------------------------------------------------------------------...
src/day15.zig
const std = @import("std"); pub usingnamespace @cImport({ @cInclude("SDL.h"); }); pub fn init(flags: c_uint) !void { var errCode = SDL_Init(flags); if (errCode != 0) { std.debug.warn("SDL: Failed to init: {s}\n", .{SDL_GetError()}); SDL_ClearError(); return error.InitError; } }...
src/sdl.zig
/// The function fiatPoly1305AddcarryxU26 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: [0x...
fiat-zig/src/poly1305_32.zig
pub const max_touchpoints = 8; pub const max_mousebuttons = 3; pub const max_keycodes = 512; pub const EventType = extern enum(i32) { INVALID, KEY_DOWN, KEY_UP, CHAR, MOUSE_DOWN, MOUSE_UP, MOUSE_SCROLL, MOUSE_MOVE, MOUSE_ENTER, MOUSE_LEAVE, TOUCHES_BEGAN, TOUCHES_MOVED, ...
src/sokol/app.zig
const std = @import("std"); const expectEqual = std.testing.expectEqual; const math = std.math; pub usingnamespace @import("generic_vector.zig"); pub usingnamespace @import("mat4.zig"); pub usingnamespace @import("quaternion.zig"); /// Convert degrees to radians. pub fn toRadians(degrees: anytype) @TypeOf(degrees) { ...
src/main.zig
const std = @import("std"); // Import/expose everything from std.math so that this package can take its place. pub const e = std.math.e; pub const pi = std.math.pi; pub const phi = std.math.phi; pub const tau = std.math.tau; pub const log2e = std.math.log2e; pub const log10e = std.math.log10e; pub const ln2 = std.math...
src/lib.zig
const std = @import("std"); const msgpack = @import("msgpack"); const expect = std.testing.expect; pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; defer _ = gpa.deinit(); // build a map which is going to hold our values var values = std.StringHashMap(msgpack.Value).init(&gpa.a...
examples/value.zig
const std = @import("std"); const windows = @import("../windows.zig").windows; usingnamespace @import("bits.zig"); pub const HBITMAP = *opaque { pub fn toGdiObject(self: HBITMAP) HGDIOBJ { return @ptrCast(HGDIOBJ, self); } }; pub const HGDIOBJ = *opaque {}; pub const Compression = extern enum { B...
didot-zwl/zwl/src/windows/gdi32.zig
const std = @import("std"); const span = std.mem.span; const Span = std.mem.Span; const Child = std.meta.Child; const Allocator = std.mem.Allocator; pub fn iterator(value: anytype) IterOf(@TypeOf(value)) { // Maybe there is a better way of doing this ? if (comptime IterOf(@TypeOf(value)) == @TypeOf(value)) { ...
src/itertools.zig
const std = @import("std"); const common = @import("../common/data.zig"); const DEBUG = @import("../common/debug.zig").print; const options = @import("../common/options.zig"); const protocol = @import("../common/protocol.zig"); const rng = @import("../common/rng.zig"); const data = @import("data.zig"); const assert ...
src/lib/gen1/mechanics.zig
const std = @import("std"); const mem = std.mem; const math = std.math; pub const Error = error{ OutOfMemory, NoMinimum, Missing }; pub fn Art(comptime T: type) type { return extern struct { root: ?*Node, size: usize, allocator: *const std.mem.Allocator, const Tree = @This(); ...
src/art.zig
usingnamespace @import("root").preamble; pub const IA32_EFER = MSR(u64, 0xC0000080); pub const IA32_STAR = MSR(u64, 0xC0000081); pub const IA32_LSTAR = MSR(u64, 0xC0000082); pub const IA32_FMASK = MSR(u64, 0xC0000084); pub const IA32_FS_BASE = MSR(u64, 0xC0000100); pub const IA32_GS_BASE = MSR(u64, 0xC0000101); fn r...
subprojects/flork/src/platform/x86_64/regs.zig
const std = @import("std"); const testing = std.testing; const RelevantFields = &[_][]const u8{ "install", "source", "pkgver()", "check()", "package()", "install()", }; const Content = struct { const Self = @This(); value: []const u8, updated: bool = false, // allocator.creat...
src/pkgbuild.zig
const std = @import("std"); const StringHashMap = std.StringHashMap; const StringArrayHashMap = std.StringArrayHashMap; const StringHashMapUnmanaged = std.StringHashMapUnmanaged; const StringArrayHashMapUnmanaged = std.StringArrayHashMapUnmanaged; const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.Are...
src/dict.zig
const Builder = @This(); const std = @import("std"); const SrcEntry = @import("SrcEntry.zig"); const string = []const u8; pub const DEFAULT_BUILD_DIR = "fimbs-out"; pub const DEFAULT_OBJS_DIR = "objs"; allocator: std.mem.Allocator, cc: string = "clang", cflags: string = "-DDEBUG -Wall", bin_name: string = "a.out",...
src/Builder.zig
const std = @import("std"); const utils = @import("../../utils.zig"); const imgio = @import("../../io.zig"); const color = @import("../../color.zig"); const PixelFormat = @import("../../pixel_format.zig").PixelFormat; const bigToNative = std.mem.bigToNative; const Allocator = std.mem.Allocator; const Colorf32 = color.C...
src/formats/png/types.zig
const std = @import("std"); const requestz = @import("requestz"); pub fn run(event_handler: fn (*std.mem.Allocator, []const u8) anyerror![]const u8) !void { // TODO: remove inferred error set? const prefix = "http://"; const postfix = "/2018-06-01/runtime/invocation"; const lambda_runtime_uri = std.os.gete...
src/lambda.zig
const std = @import("std"); const mem = std.mem; const Allocator = std.mem.Allocator; const Bus = @import("bus.zig").Bus; const Cart = @import("cart.zig").Cart; const Cpu = @import("cpu/cpu.zig").Cpu; const Vip = @import("hw/vip.zig").Vip; const Vsu = @import("hw/vsu.zig").Vsu; const sdl = @cImport(@cInclude("SDL2/S...
src/vb.zig
const prompts = @import("../components/prompt.zig"); const gamepad = @import("../gamepad.zig"); const w4 = @import("../wasm4.zig"); const statemachine = @import("../state-machine.zig"); const std = @import("std"); const Situation = @import("../components/situation.zig").Situation; const sprites = @import("../assets/spr...
src/screens/press-conference.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/day16...
src/day16.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const c = @import("card.zig"); const Card = c.Card; const CardSchema = c.CardSchema; const i = @import("image.zig"); const Image = i.Image; const lua = @import("lua.zig").lua; const util = @import("util.zig"); const sqlite = @import("sqlite.zig").sqlit...
engine/src/engine.zig
const Self = @This(); const std = @import("std"); const mem = std.mem; const wlr = @import("wlroots"); const wl = @import("wayland").server.wl; const server = &@import("main.zig").server; const util = @import("util.zig"); const Box = @import("Box.zig"); const Seat = @import("Seat.zig"); const Subsurface = @import("...
source/river-0.1.0/river/XdgToplevel.zig
const std = @import("std"); const builtin = @import("builtin"); const vtable = @import("vtable.zig"); const testing = std.testing; const math = std.math; const debug = std.debug; const mem = @This(); const TypeInfo = builtin.TypeInfo; pub const AllocError = error{OutOfMemory}; pub const Allocator = struct { con...
src/mem.zig
const std = @import("std"); const gen2 = @import("../../gen2/data.zig"); const assert = std.debug.assert; const Type = gen2.Type; pub const Move = enum(u8) { None, Pound, KarateChop, DoubleSlap, CometPunch, MegaPunch, PayDay, FirePunch, IcePunch, ThunderPunch, Scratch, ...
src/lib/gen2/data/moves.zig
const c = @import("c.zig"); const nk = @import("../nuklear.zig"); const std = @import("std"); const builtin = std.builtin; const debug = std.debug; const heap = std.heap; const math = std.math; const mem = std.mem; const meta = std.meta; const testing = std.testing; pub const Config = c.struct_nk_font_config; pub con...
src/atlas.zig
const fmath = @import("index.zig"); pub fn expm1(x: var) -> @typeOf(x) { const T = @typeOf(x); switch (T) { f32 => @inlineCall(expm1f, x), f64 => @inlineCall(expm1d, x), else => @compileError("exp1m not implemented for " ++ @typeName(T)), } } fn expm1f(x_: f32) -> f32 { const o...
src/expm1.zig
//-------------------------------------------------------------------------------- // Section: Types (7) //-------------------------------------------------------------------------------- const IID_IPrinting3DManagerInterop_Value = Guid.initString("9ca31010-1484-4587-b26b-dddf9f9caecd"); pub const IID_IPrinting3DManag...
win32/system/win_rt/printing.zig
const std = @import("std"); const tools = @import("tools"); const with_trace = true; const assert = std.debug.assert; fn trace(comptime fmt: []const u8, args: anytype) void { if (with_trace) std.debug.print(fmt, args); } pub fn main() anyerror!void { const stdout = std.io.getStdOut().writer(); var arena ...
2017/day7.zig
const std = @import("std"); const tools = @import("tools"); const with_trace = false; fn trace(comptime fmt: []const u8, args: anytype) void { if (with_trace) std.debug.print(fmt, args); } const assert = std.debug.assert; pub const main = tools.defaultMain("2021/day20.txt", run); const Map = tools.Map(u8, 256, 2...
2021/day20.zig
const std = @import("std"); pub fn main() !void { const file = try std.fs.cwd().createFile("foo.tga", .{ .read = true }); defer file.close(); const width: u16 = 300; const height: u16 = 200; // https://stackoverflow.com/a/49658800/695615 // https://en.wikipedia.org/wiki/Truevision_TGA // ...
tga.zig
const std = @import("std"); const io = std.io; const heap = std.heap; const mem = std.mem; const os = std.os; const net = std.net; usingnamespace @import("primitive_types.zig"); pub const PrimitiveReader = @import("primitive/reader.zig").PrimitiveReader; pub const PrimitiveWriter = @import("primitive/writer.zig").Prim...
src/frame.zig
const std = @import("std"); const Arena = std.heap.ArenaAllocator; const expectEqual = std.testing.expectEqual; const expectEqualStrings = std.testing.expectEqualStrings; const yeti = @import("yeti"); const initCodebase = yeti.initCodebase; const tokenize = yeti.tokenize; const parse = yeti.parse; const analyzeSemanti...
src/tests/test_pointer.zig
const std = @import("std"); const c = @cImport({ @cInclude("binding.h"); }); pub const PropertyAttribute = struct { pub const None = c.None; pub const ReadOnly = c.ReadOnly; }; pub const PromiseRejectEvent = struct { pub const kPromiseRejectWithNoHandler = c.kPromiseRejectWithNoHandler; pub const...
src/v8.zig
const c = @cImport({ @cInclude("cfl_dialog.h"); }); pub const NativeFileDialogType = enum(i32) { /// Browse files BrowseFile = 0, /// Browse dir BrowseDir, /// Browse multiple files BrowseMultiFile, /// Browse multiple dirs BrowseMultiDir, /// Browse save file BrowseSaveFile...
src/dialog.zig
const concepts = @import("concepts"); const getty = @import("getty"); const std = @import("std"); pub const Deserializer = struct { allocator: ?std.mem.Allocator = null, tokens: std.json.TokenStream, const Self = @This(); const impl = @"impl Deserializer"; pub fn init(slice: []const u8) Self { ...
src/de/deserializer.zig
const std = @import("std"); const stbi = @import("stb_image"); const common = @import("common.zig"); const TextureFormat = common.TextureFormat; const TextureHandle = common.TextureHandle; pub fn withBackend(comptime backend: anytype) type { return struct { pub const Texture2d = struct { hand...
modules/graphics/src/textures.zig
const std = @import("std"); const stb = @import("stb_image"); const ImGuiImplementation = @import("imguiImplementation.zig"); const TimeManager = @import("timeManager.zig"); const zt = @import("../zt.zig"); const gl = @import("gl"); const glfw = @import("glfw"); const ig = @import("imgui"); var initialized: bool = fa...
src/zt/app.zig
const root = @import("root"); const std = @import("std.zig"); const builtin = @import("builtin"); const assert = std.debug.assert; const uefi = std.os.uefi; const elf = std.elf; const tlcsprng = @import("crypto/tlcsprng.zig"); const native_arch = builtin.cpu.arch; const native_os = builtin.os.tag; var argc_argv_ptr: ...
lib/std/start.zig
const Wasm = @This(); const std = @import("std"); const builtin = @import("builtin"); const mem = std.mem; const Allocator = std.mem.Allocator; const assert = std.debug.assert; const fs = std.fs; const leb = std.leb; const log = std.log.scoped(.link); const wasm = std.wasm; const Atom = @import("Wasm/Atom.zig"); cons...
src/link/Wasm.zig
const std = @import("std"); const aoc = @import("aoc-lib.zig"); pub fn HexTile(q: i8, r: i8) usize { return @intCast(usize, ((@intCast(i32, q) + 127) << 8) + (@intCast(i32, r) + 127)); } pub fn Q(ht: usize) i8 { return @intCast(i8, @intCast(i32, (ht >> 8)) - 127); } pub fn R(ht: usize) i8 { return @intCas...
2020/24/aoc.zig
const expect = std.testing.expect; const expectEqualSlices = std.testing.expectEqualSlices; const std = @import("std"); const mqtt_string = @import("../../mqtt_string.zig"); const Allocator = std.mem.Allocator; const FixedHeader = @import("../packet.zig").Packet.FixedHeader; const QoS = @import("../../qos.zig").QoS; p...
src/mqtt4/packet/publish.zig
const std = @import("std"); const Feature = @import("enums.zig").Feature; const Limits = @import("data.zig").Limits; const Device = @import("Device.zig"); const Adapter = @This(); /// The features which can be used to create devices on this adapter. features: []Feature, _features: [std.enums.values(Feature).len]Feat...
gpu/src/Adapter.zig
const std = @import("std"); const atomic = std.atomic; const fmt = std.fmt; const io = std.io; const math = std.math; const mem = std.mem; const zort = std.sort.sort; const unicode = std.unicode; const CccMap = @import("../components.zig").CombiningMap; const Normalizer = @import("../components.zig").Normalizer; const...
src/collator/Collator.zig
const std = @import("../std.zig"); const math = std.math; const expect = std.testing.expect; const TypeId = std.builtin.TypeId; const maxInt = std.math.maxInt; /// Returns the square root of x. /// /// Special Cases: /// - sqrt(+inf) = +inf /// - sqrt(+-0) = +-0 /// - sqrt(x) = nan if x < 0 /// - sqrt(nan) ...
lib/std/math/sqrt.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 util = @import("util.zig"); const gpa = util.gpa; const data = @embedFile("../data/day13.txt"); //...
src/day13.zig
const std = @import("std"); const print = std.debug.print; pub fn main() anyerror!void { const allocator = std.heap.page_allocator; var file = try std.fs.cwd().openFile( "./inputs/day05.txt", .{ .read = true, }, ); var buf_file = std.io.bufferedReader(file.reader()...
src/day05.zig
const std = @import("std"); // used to get monotonic time, as opposed to wall-clock time var timer: ?std.time.Timer = null; fn nanotime() u64 { if (timer == null) { timer = std.time.Timer.start() catch unreachable; } return timer.?.read(); } // holds the frame, and the nanotime of // when the fra...
src/main.zig
pub const WSDAPI_OPTION_MAX_INBOUND_MESSAGE_SIZE = @as(u32, 1); pub const WSDAPI_OPTION_TRACE_XML_TO_DEBUGGER = @as(u32, 2); pub const WSDAPI_OPTION_TRACE_XML_TO_FILE = @as(u32, 3); pub const WSDAPI_SSL_CERT_APPLY_DEFAULT_CHECKS = @as(u32, 0); pub const WSDAPI_SSL_CERT_IGNORE_REVOCATION = @as(u32, 1); pub const WSDAPI_...
win32/devices/web_services_on_devices.zig
const std = @import("../std.zig"); const Cpu = std.Target.Cpu; pub const Feature = enum { @"16_bit_insts", DumpCode, add_no_carry_insts, aperture_regs, atomic_fadd_insts, auto_waitcnt_before_barrier, ci_insts, code_object_v3, cumode, dl_insts, dot1_insts, dot2_insts, ...
lib/std/target/amdgpu.zig