code
stringlengths
38
801k
repo_path
stringlengths
6
263
const std = @import("std"); const mem = std.mem; const GraphemeLink = @This(); allocator: *mem.Allocator, array: []bool, lo: u21 = 2381, hi: u21 = 73111, pub fn init(allocator: *mem.Allocator) !GraphemeLink { var instance = GraphemeLink{ .allocator = allocator, .array = try allocator.alloc(bool,...
src/components/autogen/DerivedCoreProperties/GraphemeLink.zig
const std = @import("../index.zig"); const builtin = @import("builtin"); const os = std.os; const mem = std.mem; const math = std.math; const assert = std.debug.assert; const posix = os.posix; const windows = os.windows; const Os = builtin.Os; const is_posix = builtin.os != builtin.Os.windows; const is_windows = built...
std/os/file.zig
const std = @import("std"); const util = @import("util"); const Wire = enum(u8) { a = 1 << 0, b = 1 << 1, c = 1 << 2, d = 1 << 3, e = 1 << 4, f = 1 << 5, g = 1 << 6, const Self = @This(); fn fromString(wires: []const u8) u8 { var res: u8 = 0; for (wires) |wire| { ...
zig/src/day8.zig
const sf = @import("../sfml_import.zig"); pub fn Vector2(comptime T: type) type { return struct { const Self = @This(); /// The CSFML vector type equivalent const CsfmlEquivalent = switch (T) { u32 => sf.c.sfVector2u, i32 => sf.c.sfVector2i, f32 => sf.c...
src/sfml/system/vector.zig
const fmt = @import("std").fmt; const io = @import("std").io; const BIOS = @import("bios.zig").BIOS; pub const Debug = struct { const PrintContext = packed struct { request: u16, bank: u16, get: u16, put: u16, }; const DebugStream = struct { streamWritten: usize, ...
GBA/debug.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const ShaderConfig = @import("shaderconfig.zig").ShaderConfig; const Jazbz = @import("jabz.zig").Jazbz(f64); const Srgb = @import("jabz.zig").Srgb(u8); const unitbounds = @import("unitbounds.zig"); pub fn SsaaShader(width: usize, height: usize, ssaa: u...
lib/ssaashader.zig
const std = @import("std"); const root = @import("root"); const os = std.os; const builtin = @import("builtin"); pub const PollOptions = packed struct { read: bool = false, write: bool = false, }; pub const CallOptions = packed struct { read: bool = false, write: bool = false, }; pub const WakeOptio...
pike.zig
const std = @import("std"); const fs = std.fs; const mem = std.mem; const Builder = std.build.Builder; const FileSource = std.build.FileSource; const Pkg = std.build.Pkg; const nanovg_build = @import("deps/nanovg-zig/build.zig"); const win32 = Pkg{ .name = "win32", .path = FileSource.relative("deps/zigwin32/win32.zig...
build.zig
const std = @import("std"); const expectEqual = @import("std").testing.expectEqual; test "math" { // std.debug.print("\n{}\n", .{math("a", .{ .a = @as(i8, 7) })}); try expectEqual(@as(i8, 5), math("a", .{ .a = @as(i8, 5) })); try expectEqual(@as(i8, 15), math("a + a + a", .{ .a = @as(i8, 5) })); // std...
src/math.zig
const std = @import("std"); const debug = std.debug; const mem = std.mem; const testing = std.testing; const unicode = std.unicode; const sbp = @import("../ziglyph.zig").sentence_break_property; const CodePoint = @import("CodePoint.zig"); const CodePointIterator = CodePoint.CodePointIterator; pub const Sentence = @T...
src/segmenter/Sentence.zig
const std = @import("std"); const upaya = @import("upaya_cli.zig"); const Texture = @import("texture.zig").Texture; /// Image is a CPU side array of color data with some helper methods that can be used to prep data /// before creating a Texture pub const Image = struct { w: usize = 0, h: usize = 0, pixels:...
src/image.zig
const c = @import("c.zig"); pub usingnamespace c; pub const XID = c_ulong; pub const Mask = c_ulong; pub const Atom = c_ulong; pub const VisualID = c_ulong; pub const Time = c_ulong; pub const Window = XID; pub const Drawable = XID; pub const Font = XID; pub const Pixmap = XID; pub const Cursor = XID; pub const Colorm...
modules/platform/src/linux/X11/X.zig
const std = @import("std"); const pr = @import("private.zig"); /// opengl library pub const gl = @import("core/gl.zig"); /// file system library pub const fs = @import("core/fs.zig"); /// utf8 library pub const utf8 = @import("core/utf8.zig"); /// utils library pub const utils = @import("core/utils.zig"); /// audio l...
src/alka.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const bindings = @import("bindings.zig"); const c = bindings.c; const Gl = bindings.Gl; const Context = @import("context.zig").Context; // currently using old style opengl for compatability // not that I understand opengl pub const BasicContext = stru...
src/sdl/basic_video.zig
// SPDX-License-Identifier: MIT // This file is part of the Termelot project under the MIT license. const std = @import("std"); pub const style = @import("style.zig"); usingnamespace style; pub const event = @import("event.zig"); pub const Backend = @import("backend.zig").backend.Backend; pub const Buffer = @import...
src/termelot.zig
const std = @import("std"); const assert = std.debug.assert; pub const Header = extern struct { comptime { assert(@sizeOf(Header) == 128); } /// A checksum covering only the rest of this header starting from `checksum_body`. /// This allows the header to be trusted without having to recv() or r...
docs/header.zig
const std = @import("std"); const vec4 = std.meta.Vector(4, f64); fn vec1to4(f: f64) vec4 { return @splat(4, f); } fn baseIdx(i: vec4) vec4 { @setFloatMode(.Optimized); return i * (i + vec1to4(1)) * vec1to4(0.5) + vec1to4(1); } fn multAvGeneric(comptime transpose: bool, dst: []vec4, src: []const vec4) vo...
bench/algorithm/spectral-norm/2.zig
const std = @import("std"); const mem = std.mem; const fs = std.fs; const math = std.math; const process = std.process; const md = @import("md/markdown.zig").Markdown; const log = @import("md/log.zig"); const webview = @import("webview/webview.zig"); var DEBUG = false; var LOG_LEVEL = log.logger.Level.Error; var LOG_D...
src/main.zig
const reduce = @import("./reduce.zig"); const bs = @import("./bitstream.zig"); const hamlet = @embedFile("../fixtures/hamlet.txt"); const std = @import("std"); const allocator = std.testing.allocator; const assert = std.debug.assert; const expect = std.testing.expect; const mem = std.mem; // // $ curl -O http://cd.t...
src/reduce_test.zig
const std = @import("std"); const thread = @import("./thread.zig"); const allocator = std.heap.c_allocator; const config = @import("./config.zig"); const util = @import("./util.zig"); const warn = std.debug.print; const c = @cImport({ @cInclude("unistd.h"); @cInclude("pthread.h"); @cInclude("curl/curl.h"...
src/net.zig
const std = @import("std"); const builtin = @import("builtin"); const os = std.os; const Allocator = std.mem.Allocator; const assert = std.debug.assert; const log = std.log.scoped(.storage); const IO = @import("io.zig").IO; const config = @import("config.zig"); const vsr = @import("vsr.zig"); pub const Storage = stru...
src/storage.zig
const std = @import("std"); const date_module = @import("date.zig"); const Date = date_module.Date; const notes_module = @import("notes.zig"); const Notes = notes_module.Notes; const Allocator = std.mem.Allocator; const json = std.json; const dict_module = @import("dict.zig"); const DictArrayUnmanaged = dict_module.Dic...
src/person.zig
//! Lock may be held only once. If the same thread tries to acquire //! the same mutex twice, it deadlocks. This type supports static //! initialization and is at most `@sizeOf(usize)` in size. When an //! application is built in single threaded release mode, all the //! functions are no-ops. In single threaded debu...
lib/std/Thread/Mutex.zig
const std = @import("std"); const utils = @import("utils"); const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.ArenaAllocator; const print = utils.print; fn readInput(arena: *ArenaAllocator, lines_it: *utils.FileLineIterator) anyerror![]i32 { var numbers = try std.ArrayList(i32).initCapacity(&ar...
day7/src/main.zig
const std = @import("std"); const mem = std.mem; const Allocator = mem.Allocator; const testing = std.testing; // BitSet is a naive bitset implementation with an iterator attached. pub const BitSet = struct { const Self = @This(); const wordBits = @bitSizeOf(u64); alloc: *Allocator, bits: ?[]u64 = nul...
lib/nil/bits.zig
const std = @import("std"); 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); } const maxpackets = 29; const Result = struct { qe: u64, s0: u32, }; const Candidate = struct { rem0: u16, r...
2015/day24.zig
const std = @import("std"); const debug = std.debug; const assert = debug.assert; const assertError = debug.assertError; const warn = debug.warn; const ArrayList = std.ArrayList; const parse_args = @import("parse_args.zig"); const ArgIter = parse_args.ArgIter; const ArgRec = parse_args.ArgRec; const ArgUnionFields = p...
test_app.zig
pub const MKSYS_URLMONIKER = @as(u32, 6); pub const URL_MK_LEGACY = @as(u32, 0); pub const URL_MK_UNIFORM = @as(u32, 1); pub const URL_MK_NO_CANONICALIZE = @as(u32, 2); pub const FIEF_FLAG_FORCE_JITUI = @as(u32, 1); pub const FIEF_FLAG_PEEK = @as(u32, 2); pub const FIEF_FLAG_SKIP_INSTALLED_VERSION_CHECK = @as(u32, 4); ...
win32/system/com/urlmon.zig
pub const sibling = 0x01; pub const location = 0x02; pub const name = 0x03; pub const ordering = 0x09; pub const subscr_data = 0x0a; pub const byte_size = 0x0b; pub const bit_offset = 0x0c; pub const bit_size = 0x0d; pub const element_list = 0x0f; pub const stmt_list = 0x10; pub const low_pc = 0x11; pub const high_pc =...
lib/std/dwarf/AT.zig
const std = @import("std"); const builtin = @import("builtin"); const mem = std.mem; const os = std.os; const fs = std.fs; const Compilation = @import("Compilation.zig"); /// Returns the sub_path that worked, or `null` if none did. /// The path of the returned Directory is relative to `base`. /// The handle of the ret...
src/introspect.zig
const std = @import("../../index.zig"); const debug = std.debug; const math = std.math; pub const abs = @import("abs.zig").abs; pub const acosh = @import("acosh.zig").acosh; pub const acos = @import("acos.zig").acos; pub const arg = @import("arg.zig").arg; pub const asinh = @import("asinh.zig").asinh; pub const asin =...
std/math/complex/index.zig
const std = @import("std"); const assert = std.debug.assert; /// A mixin usable with `pub usingnamespace MMIO(@This())` on any enum(usize). /// Adds IO functions for interacting with MMIO addresses defined in the enum members. fn MMIO(comptime T: type) type { return struct { pub fn write(self: T, comptime...
src/mmio.zig
const std = @import("../std.zig"); const Cpu = std.Target.Cpu; pub const Feature = enum { addsubiw, avr0, avr1, avr2, avr25, avr3, avr31, avr35, avr4, avr5, avr51, avr6, avrtiny, @"break", des, eijmpcall, elpm, elpmx, ijmpcall, jmpcall, ...
lib/std/target/avr.zig
const std = @import("std"); const random = std.crypto.random; const ALPHABET = "0123456789ABCDEFGHJKMNPQRSTVWXYZ"; const ULID_LEN = 26; pub fn ulid() [16]u8 { const time_bits = @intCast(u48, std.time.milliTimestamp()); const rand_bits = random.int(u80); const value = (@as(u128, time_bits) << 80) | @as(u...
ulid.zig
const std = @import("std"); const builtin = @import("builtin"); const build_root = "../build/"; const is_windows = std.Target.current.os.tag == .windows; const is_macos = std.Target.current.os.tag == .macos; pub fn build(b: *std.build.Builder) anyerror!void { const mode = b.standardReleaseOptions(); // Prev...
src/build.zig
const std = @import("std"); // const // print = std.debug.// print; const memEql = std.mem.eql; const stringToEnum = std.meta.stringToEnum; const types = @import("types.zig"); const parse = @import("parse.zig"); const Atom = types.Atom; const AtomList = types.AtomList; const Variable = types.Variable; const VarList = t...
eval.zig
const std = @import("std"); const expect = std.testing.expect; const expectEqual = std.testing.expectEqual; const mem = std.mem; test "for loop with pointer elem var" { const source = "abcdefg"; var target: [source.len]u8 = undefined; mem.copy(u8, target[0..], source); mangleString(target[0..]); tr...
test/behavior/for_stage1.zig
const std = @import("std"); const APEMetadata = @import("metadata.zig").APEMetadata; const Allocator = std.mem.Allocator; pub const APEHeader = struct { version: u32, /// Tag size in bytes including footer and all tag items tag_size: u32, item_count: u32, flags: APETagFlags, pub const len: usi...
src/ape.zig
const std = @import("std"); const log = std.log; const assert = std.debug.assert; const cudaz = @import("cudaz"); const cu = cudaz.cu; const png = @import("png.zig"); const utils = @import("utils.zig"); // const hw1_kernel = @import("hw1_kernel.zig"); const resources_dir = "resources/hw1_resources/"; pub fn main() ...
CS344/src/hw1.zig
const std = @import("std"); pub const DemoInterface = struct { instance: InstanceType, initFn: InitFn, deinitFn: DeinitFn, onUIFn: OnUIFn, isVisibleFn: IsVisibleFn, showFn: ShowFn, pub const InstanceType = *u8; pub const InitFn = fn (instance: InstanceType, allocator: std.mem.Allocator...
src/demos/demo_interface.zig
const std = @import("std"); const os = std.os; const fmt = std.fmt; pub const proto = @import("proto.zig"); pub const resolv = @import("resolvconf.zig"); const dns = @import("dns"); const rdata = dns.rdata; pub const DNSPacket = dns.Packet; pub const DNSPacketRCode = dns.ResponseCode; pub const DNSClass = dns.Class;...
src/main.zig
const std = @import("std"); pub const paging = @import("../paging.zig"); const dcommon = @import("../common/dcommon.zig"); const hw = @import("../hw.zig"); pub var K_DIRECTORY: *PageTable = undefined; pub const PAGING = paging.configuration(.{ .vaddress_mask = 0x0000003f_fffff000, }); comptime { std.debug.ass...
dainkrnl/src/riscv64/paging.zig
const clap = @import("clap"); const datetime = @import("datetime"); const message = @import("message.zig"); const producer = @import("producer.zig"); const sab = @import("sab"); const std = @import("std"); const event = std.event; const fs = std.fs; const heap = std.heap; const io = std.io; const log = std.log; const ...
src/main.zig
const builtin = @import("builtin"); const std = @import("std"); const math = std.math; const mem = std.mem; const meta = std.meta; const testing = std.testing; const trait = meta.trait; /// Find the field name which is most likly to be the tag of 'union_field'. /// This function looks at all fields declared before 'u...
src/core/script.zig
const std = @import("std"); const gl = @import("opengl.zig"); const math = std.math; const default_allocator = std.heap.page_allocator; const ArrayList = std.ArrayList; usingnamespace @import("util.zig"); pub const window_name = "genexp003"; pub const window_width = 1920; pub const window_height = 1080; pub const Gen...
src/genexp003.zig
const std = @import("std"); const UserCmdInfo = struct { tick_count: i32, view_angles: [3]f32, forwardmove: f32, sidemove: f32, upmove: f32, buttons: u32, }; fn parseUserCmdInfo(buf: []const u8, prev: UserCmdInfo) !UserCmdInfo { var stream = std.io.fixedBufferStream(buf); var br = std....
src/main.zig
usingnamespace @import("common.zig"); usingnamespace @import("pipelines.zig"); const camera = @import("camera.zig"); const cube_cpu = @import("cube.zig").cpu_mesh; const MAX_LAYER_COUNT = 16; const MAX_EXT_COUNT = 16; const FRAME_LATENCY = 3; const MESH_UPLOAD_QUEUE_SIZE = 16; const WIDTH = 1600; const HEIGHT = 900;...
src/main.zig
const std = @import("std"); const builtin = @import("builtin"); const build_options = @import("build_options"); const zigmod = @import("zigmod"); const util = zigmod.util; const CliError = error { UnknownCommand, }; const commands = struct { const fetch = zigmod.commands_to_bootstrap.fetch; usingnamespac...
src/main.zig
const std = @import("std"); /// Parses arguments for the given specification and our current process. /// - `Spec` is the configuration of the arguments. /// - `allocator` is the allocator that is used to allocate all required memory pub fn parseForCurrentProcess(comptime Spec: type, allocator: *std.mem.Allocator) !Pa...
args.zig
const std = @import("std"); const utils = @import("../ecs/utils.zig"); const Cache = @import("cache.zig").Cache; pub const Assets = struct { caches: std.AutoHashMap(u32, usize), allocator: std.mem.Allocator, pub fn init(allocator: std.mem.Allocator) Assets { return Assets{ .caches = st...
src/resources/assets.zig
const std = @import("std"); const io = std.io; const heap = std.heap; const mem = std.mem; const testing = std.testing; pub const Line = struct { data: []const u8, start: u64, end: u64, }; pub fn LineReader(comptime BufferSize: usize, comptime ReaderType: type) type { return struct { const Sel...
line_reader.zig
const std = @import("std"); const tools = @import("tools"); const with_trace = true; const with_dissassemble = false; const assert = std.debug.assert; fn trace(comptime fmt: []const u8, args: anytype) void { if (with_trace) std.debug.print(fmt, args); } pub fn run(input: []const u8, allocator: std.mem.Allocator)...
2019/day22.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; pub fn run(input...
2019/day07.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); } fn insert(pats: anytype, in: anytype, out: anytype) !void { //trace("pattern bits: {} ->...
2017/day21.zig
const std = @import("std"); const mem = std.mem; const meta = std.meta; const testing = std.testing; const builtin = std.builtin; const debug = std.debug; const TypeInfo = builtin.TypeInfo; pub const RecursiveField = struct { path: []const []const u8, field_type: type, default_value: anytype, is_compt...
src/recursive_field.zig
const std = @import("std"); const zen = std.os.zen; const Keyboard = zen.Server.Keyboard; const MailboxId = zen.MailboxId; const Message = zen.Message; // Circular buffer to hold keypress data. const BUFFER_SIZE = 1024; var buffer = []u8 { 0 } ** BUFFER_SIZE; var buffer_start: usize = 0; var buffer_end: usize = 0; //...
servers/keyboard/main.zig
const std = @import("std"); const os = std.os; const vt = @import("vt-term.zig"); const assertOrPanic = std.debug.assertOrPanic; const EZError = error{ NotImplemented, NoUserInput, }; const EditMode = enum { Normal, Insert, Visual, }; const EditorState = struct { index: usize, // index within...
src/main.zig
const std = @import("std"); pub const vk = @import("lib/vulkan.zig"); pub const vez = @import("lib/vez.zig"); pub const c = @import("lib/glfw3.zig"); const base = @import("main.zig"); const NameSet = std.AutoHashMap([256]u8, void); pub const isDebug = @import("builtin").mode == .Debug; pub fn makeVkVersion(major: u32...
src/utils.zig
const std = @import("std"); const absInt = std.math.absInt; const min = std.math.min; const parseInt = std.fmt.parseInt; const print = std.debug.print; const sort = std.sort; const testing = std.testing; const tokenize = std.mem.tokenize; const input = @embedFile("./input.txt"); const size = 1000; pub fn main() anyer...
src/day07/day07.zig
const builtin = @import("builtin"); pub const WINDOW = u32; pub const PIXMAP = u32; pub const GCONTEXT = u32; pub const REGION = u32; pub const CRTC = u32; pub const SyncFence = u32; pub const EventID = u32; pub const DRAWABLE = extern union { window: WINDOW, pixmap: PIXMAP, }; pub const ATOM = u32; pub const ...
didot-zwl/zwl/src/x11/types.zig
const std = @import("std"); const Builder = @import("std").build.Builder; 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 any target is allowed, and the default is n...
build.zig
const std = @import("std"); const sdl = @import("./sdl.zig"); const core = @import("core"); const Rect = core.geometry.Rect; const Coord = core.geometry.Coord; const makeCoord = core.geometry.makeCoord; pub const version_string = @embedFile("../../zig-cache/version.txt"); pub const sprites = @import("../../zig-cache/...
src/gui/textures.zig
const std = @import("std"); const webgpu = @import("./webgpu.zig"); pub const ComputePipeline = struct { pub const VTable = struct { destroy_fn: fn(*ComputePipeline) void, get_bind_group_layout_fn: fn(*ComputePipeline, u32) ?*webgpu.BindGroupLayout, set_label_fn: fn(*ComputePipeline, [:0]co...
src/pipeline.zig
const std = @import("std"); const math = std.math; pub fn Vec(comptime S: usize, comptime T: type) type { return switch (S) { 2 => extern struct { x: T = 0, y: T = 0, const Self = @This(); pub usingnamespace VecCommonFns(S, T, @This()); pub fn i...
gamekit/math/vec2.zig
usingnamespace std.os; const std = @import("../../../std.zig"); // instruction classes /// jmp mode in word width pub const JMP32 = 0x06; /// alu mode in double word width pub const ALU64 = 0x07; // ld/ldx fields /// double word (64-bit) pub const DW = 0x18; /// exclusive add pub const XADD = 0xc0; // alu/jmp fields...
lib/std/os/bits/linux/bpf.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(.{}){}; const Error = error{ NoDashInRule, NoSpaceInRule, NoColonInRule }; const Validator =...
day_02/src/main.zig
const std = @import("std"); const Elf32_Shdr = std.elf.Elf32_Shdr; const Elf32_Phdr = std.elf.Elf32_Phdr; const paging = @import("paging.zig"); const PageAlign = paging.PageAlign; const Page = paging.Page; const native_endian = @import("builtin").target.cpu.arch.endian(); pub fn print(out: anytype, buf: []const u8)...
src/utils/elf.zig
const std = @import("std"); const zwin32 = @import("zwin32"); const w = zwin32.base; const d3d12 = zwin32.d3d12; const hrPanic = zwin32.hrPanic; const hrPanicOnFail = zwin32.hrPanicOnFail; const zd3d12 = @import("zd3d12"); const common = @import("common"); const c = common.c; const vm = common.vectormath; const GuiRend...
samples/triangle/src/triangle.zig
/// The function fiatP448AddcarryxU56 is an addition with carry. /// Postconditions: /// out1 = (arg1 + arg2 + arg3) mod 2^56 /// out2 = ⌊(arg1 + arg2 + arg3) / 2^56⌋ /// /// Input Bounds: /// arg1: [0x0 ~> 0x1] /// arg2: [0x0 ~> 0xffffffffffffff] /// arg3: [0x0 ~> 0xffffffffffffff] /// Output Bounds: /// ...
fiat-zig/src/p448_solinas_64.zig
const std = @import("std"); const testing = std.testing; const log = std.log; const Allocator = std.mem.Allocator; const ArrayList = std.ArrayList; const numtheory = @import("numtheory"); const inv_mod = numtheory.inv_mod; const Polynomial = @import("polynomial.zig").Polynomial; // only used for testing const Deck = ...
day22/src/instruction.zig
const std = @import("std"); const builtin = @import("builtin"); const io = std.io; const os = std.os; const windows = os.windows; const posix = os.posix; const FOREGROUND_BLACK = u16(0); const FOREGROUND_BLUE = u16(1); const FOREGROUND_GREEN = u16(2); const FOREGROUND_AQUA= u16(3); const FOREGROUND_RED = u16(4); co...
src/index.zig
const std = @import("std"); const log = std.log; const math = std.math; const assert = std.debug.assert; const cuda = @import("cudaz"); const cu = cuda.cu; const png = @import("png.zig"); const utils = @import("utils.zig"); const kernels = @import("hw2_pure_kernel.zig"); const Mat3 = kernels.Mat3; const Mat2Float = k...
CS344/src/hw2_pure.zig
const std = @import("std"); const zp = @import("zplay"); const TextureUnit = zp.graphics.common.Texture.TextureUnit; const SimpleRenderer = zp.graphics.@"3d".SimpleRenderer; const Camera = zp.graphics.@"3d".Camera; const Model = zp.graphics.@"3d".Model; const TextureCube = zp.graphics.texture.TextureCube; const Skybox ...
examples/gltf_demo.zig
const std = @import("std"); const lib = @import("lib/lib.zig"); const TangleStep = lib.TangleStep; 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 tar...
build.zig
const std = @import("std"); const ArrayList = std.ArrayList; const gpu = @import("gpu"); const App = @import("main.zig").App; const zm = @import("zmath"); const UVData = @import("atlas.zig").UVData; const Vec2 = @Vector(2, f32); pub const Vertex = struct { pos: @Vector(4, f32), uv: Vec2, }; const VERTEX_ATTRI...
examples/gkurve/draw.zig
const std = @import("std"); const print = std.debug.print; const util = @import("util.zig"); const gpa = util.gpa; const data = @embedFile("../data/day20.txt"); const Image = struct { key : std.StaticBitSet(512), payload : std.DynamicBitSet, infinitePixelIndex : usize, pub fn deinit(me : *@This()) void { ...
src/day20.zig
usingnamespace @import("psptypes.zig"); pub const PSPPowerCB = extern enum(u32) { Battpower = 0x0000007f, BatteryExist = 0x00000080, BatteryLow = 0x00000100, ACPower = 0x00001000, Suspending = 0x00010000, Resuming = 0x00020000, ResumeComplete = 0x00040000, Standby = 0x00080000, Hold...
src/psp/sdk/psppower.zig
const std = @import("std"); const SParser = @import("SParser.zig"); const Expr = SParser.Expr; const TextIterator = SParser.TextIterator; pub const Error = error{ TopLevelIndent, IndentMismatch, } || SParser.Error; pub fn parseAll(iter: *TextIterator, gpa: std.mem.Allocator) !Expr.Root { var arena = std.h...
src/SweetParser.zig
const std = @import("std"); const u = @import("util.zig"); pub const Expr = @import("Expr.zig"); pub const TextIterator = @import("TextIterator.zig"); pub fn parseAll(iter: *TextIterator, gpa: std.mem.Allocator) Error!Expr.Root { var arena = std.heap.ArenaAllocator.init(gpa); errdefer arena.deinit(); var ...
src/SParser.zig
const std = @import("std"); const builtin = @import("builtin"); pub const pkg = std.build.Pkg{ .name = "curl", .source = .{ .path = srcPath() ++ "/curl.zig" }, }; const Options = struct { openssl_includes: []const []const u8, nghttp2_includes: []const []const u8, zlib_includes: []const []const u8,...
lib/curl/lib.zig
const std = @import("std"); const stdx = @import("stdx.zig"); const builtin = @import("builtin"); const curl = @import("curl"); const uv = @import("uv"); const Curl = curl.Curl; const CurlM = curl.CurlM; const CurlSH = curl.CurlSH; const log = stdx.log.scoped(.http); const EventDispatcher = @import("events.zig").EventD...
stdx/http.zig
pub const ArrayHashMap = array_hash_map.ArrayHashMap; pub const ArrayHashMapUnmanaged = array_hash_map.ArrayHashMapUnmanaged; pub const ArrayList = @import("array_list.zig").ArrayList; pub const ArrayListAligned = @import("array_list.zig").ArrayListAligned; pub const ArrayListAlignedUnmanaged = @import("array_list.zig"...
lib/std/std.zig
const std = @import("std"); const llvm = @import("llvm.zig"); pub const ArchOsAbi = struct { arch: std.Target.Cpu.Arch, os: std.Target.Os.Tag, abi: std.Target.Abi, }; pub const available_libcs = [_]ArchOsAbi{ .{ .arch = .aarch64_be, .os = .linux, .abi = .gnu }, .{ .arch = .aarch64_be, .os = .linux...
src/target.zig
pub const TAG_padding = 0x00; pub const TAG_array_type = 0x01; pub const TAG_class_type = 0x02; pub const TAG_entry_point = 0x03; pub const TAG_enumeration_type = 0x04; pub const TAG_formal_parameter = 0x05; pub const TAG_imported_declaration = 0x08; pub const TAG_label = 0x0a; pub const TAG_lexical_block = 0x0b; pub c...
std/dwarf.zig
const std = @import("../std.zig"); const builtin = @import("builtin"); const assert = std.debug.assert; const testing = std.testing; const mem = std.mem; const Loop = std.event.Loop; /// Thread-safe async/await lock. /// Functions which are waiting for the lock are suspended, and /// are resumed when the lock is relea...
lib/std/event/lock.zig
usingnamespace @import("../engine/engine.zig"); const Literal = @import("../parser/literal.zig").Literal; const LiteralValue = @import("../parser/literal.zig").LiteralValue; const MapTo = @import("mapto.zig").MapTo; const MapToValue = @import("mapto.zig").MapToValue; const std = @import("std"); const testing = std.tes...
src/combn/combinator/sequence_ambiguous.zig
const pike = @import("pike"); const zap = @import("zap"); const std = @import("std"); const net = std.net; const log = std.log.scoped(.apple_pie); const req = @import("request.zig"); const resp = @import("response.zig"); const Request = req.Request; const Response = resp.Response; const os = std.os; /// Alias for an a...
src/server.zig
pub const PKEY_PIDSTR_MAX = @as(u32, 10); //-------------------------------------------------------------------------------- // Section: Types (61) //-------------------------------------------------------------------------------- pub const PROPERTYKEY = extern struct { fmtid: Guid, pid: u32, }; const CLSID_I...
win32/ui/shell/properties_system.zig
pub const BITCOUNT = struct { //! ``` //! const cmd = BITCOUNT.init("test", BITCOUNT.Bounds{ .Slice = .{ .start = -2, .end = -1 } }); //! ``` key: []const u8, bounds: Bounds = .FullString, pub fn init(key: []const u8, bounds: Bounds) BITCOUNT { return .{ .key = key, .bounds = bounds }...
src/commands/strings/bitcount.zig
const std = @import("std"); const builtin = @import("builtin"); const assert = std.debug.assert; const testing = std.testing; /// The set of languages supported. pub const Language = enum { English, }; const line_delimiter = switch (builtin.os.tag) { .windows => "\r\n", else => "\n", }; /// Creates a Wor...
src/lib.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"); pub const Object = opaque { /// Close an open object /// /// This method instructs the library to close an existing object; ...
src/object.zig
pub const TAPI_CURRENT_VERSION = @as(u32, 131074); pub const LINE_ADDRESSSTATE = @as(i32, 0); pub const LINE_CALLINFO = @as(i32, 1); pub const LINE_CALLSTATE = @as(i32, 2); pub const LINE_CLOSE = @as(i32, 3); pub const LINE_DEVSPECIFIC = @as(i32, 4); pub const LINE_DEVSPECIFICFEATURE = @as(i32, 5); pub const LINE_GATHE...
win32/devices/tapi.zig
const sf = struct { pub usingnamespace @import("../sfml.zig"); pub usingnamespace sf.system; }; pub const Event = union(Event.Type) { const Self = @This(); pub const Type = enum(c_int) { closed, resized, lostFocus, gainedFocus, textEntered, keyPressed, ...
src/sfml/window/event.zig
const std = @import("std"); const os = std.os; const c = @cImport({ // process_vm_readv @cInclude("sys/uio.h"); }); // From the man page: // The data to be transferred is identified by remote_iov and riovcnt: // remote_iov is a pointer to an array describing address ranges in the process pid, // The ...
src/helpers/interprocess_rw.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const scanner_mod = @import("./scanner.zig"); const chunks_mod = @import("./chunks.zig"); const debug_mod = @import("./debug.zig"); const Scanner = scanner_mod.Scanner; const Token = scanner_mod.Token; const TokenType = scanner_mod.TokenType; const Chunk ...
src/compiler.zig
pub const padding = 0x00; pub const array_type = 0x01; pub const class_type = 0x02; pub const entry_point = 0x03; pub const enumeration_type = 0x04; pub const formal_parameter = 0x05; pub const imported_declaration = 0x08; pub const label = 0x0a; pub const lexical_block = 0x0b; pub const member = 0x0d; pub const pointe...
lib/std/dwarf/TAG.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/day09.txt"); //...
src/day09.zig
const std = @import("std"); /// Syntactic sugar to refer to the Self/@This() type in the hasFn Signature argument pub const Self = struct{}; /// A function similar to std.meta.hasFn, but providing an extra argument which allows /// to specify the signature of the function. It will check if the given type (which must ...
src/concepts.zig
pub const common = @import("common.zig"); pub const gen2 = @import("gen2.zig"); pub const gen3 = @import("gen3.zig"); pub const gen4 = @import("gen4.zig"); pub const gen5 = @import("gen5.zig"); const std = @import("std"); // TODO: We can't have packages in tests const fun = @import("../../lib/fun-with-zig/src/index.zi...
src/pokemon/index.zig
const std = @import("std"); const builtin = std.builtin; const expect = std.testing.expect; const mem = std.mem; ///References: https://en.wikipedia.org/wiki/Quicksort pub fn sort(A: []i32, lo: usize, hi: usize) void { if (lo < hi) { var p = partition(A, lo, hi); sort(A, lo, std.math.min(p, p -% 1)...
sorting/quicksort.zig