code
stringlengths
38
801k
repo_path
stringlengths
6
263
const std = @import("std"); const zua = @import("zua.zig"); const Token = zua.lex.Token; // From lopcodes.h: // // We assume that instructions are unsigned numbers. // All instructions have an opcode in the first 6 bits. // Instructions can have the following fields: // 'A': 8 bits // 'B': 9 bits // 'C': 9 bits // ...
src/opcodes.zig
const std = @import("std"); const input = @import("input.zig"); pub fn run(stdout: anytype) anyerror!void { { var input_ = try input.readFile("inputs/day6"); defer input_.deinit(); const result = try part1(&input_); try stdout.print("6a: {}\n", .{ result }); std.debug.asse...
src/day6.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/day07.txt"); //...
src/day07.zig
const std = @import("std"); const zigimg = @import("zigimg"); const nooice = @import("nooice"); usingnamespace @import("global.zig"); const height_max: f32 = 2000; const height_max_normalized = 1; const height_water: f32 = 200; const height_water_normalized = height_water / height_max; const height_mountain_base: f32 ...
src/terrain_generation.zig
const std = @import("std"); const atomic = std.atomic; const Atomic = std.atomic.Atomic; const AtomicOrder = std.builtin.AtomicOrder; pub fn Ring(comptime T: type) type { // FIXME: check this is 64 bytes on all platforms const cacheLineSize = 64; return struct { consumerHead: Atomic(usize), ...
spsc_ring.zig
const std = @import("std"); const dt = @import("datatable.zig"); const testing = std.testing; test "table without using id" { const columns = [_]dt.Column{ .{ .name = "Middle Name", .allow_empty = true }, .{ .name = "<NAME>" }, .{ .name = "Age" }, .{ .name = "Ph No", .max_len = 10 ...
src/main.zig
const std = @import("std"); const Type = @import("../Type.zig"); const DW = std.dwarf; // zig fmt: off /// Definitions of all of the x64 registers. The order is semantically meaningful. /// The registers are defined such that IDs go in descending order of 64-bit, /// 32-bit, 16-bit, and then 8-bit, and each set conta...
src/codegen/x86_64.zig
const std = @import("std"); const wayland = @import("wayland"); const wl = wayland.client.wl; const zwlr = wayland.client.zwlr; const gpa = std.heap.c_allocator; const ToplevelInfo = struct { title: []const u8 = undefined, app_id: []const u8 = undefined, maximized: bool = false, minimized: bool = fal...
ltoplevels.zig
const std = @import("std"); const mem = std.mem; const mpack = @import("./mpack.zig"); const RPC = @import("./RPC.zig"); const ChildProcess = std.ChildProcess; pub fn spawn(allocator: *mem.Allocator) !*std.ChildProcess { //const argv = &[_][]const u8{ "nvim", "--embed" }; const argv = &[_][]const u8{ "nvim", ...
src/io_native.zig
const std = @import("std"); pub fn build(b: *std.build.Builder) !void { _ = try addFuzzer(b, "json", &.{}); _ = try addFuzzer(b, "tokenizer", &.{}); _ = try addFuzzer(b, "parse", &.{}); _ = try addFuzzer(b, "deflate", &.{}); _ = try addFuzzer(b, "deflate-roundtrip", &.{}); const deflate_puff =...
build.zig
const std = @import("std"); const xml = @import("xml.zig"); const Peripheral = @import("Peripheral.zig"); const Register = @import("Register.zig"); const Field = @import("Field.zig"); const ArenaAllocator = std.heap.ArenaAllocator; const Allocator = std.mem.Allocator; pub fn parsePeripheral(arena: *ArenaAllocator, no...
src/atdf.zig
const std = @import("std"); const build_options = @import("build_options"); const stdx = @import("stdx"); const fatal = stdx.fatal; const unsupported = stdx.unsupported; const math = stdx.math; const Vec2 = math.Vec2; const builtin = @import("builtin"); const t = stdx.testing; const sdl = @import("sdl"); const ft = @im...
graphics/src/graphics.zig
const std = @import("../std.zig"); const debug = std.debug; const assert = debug.assert; const testing = std.testing; const mem = std.mem; const Allocator = mem.Allocator; fn never_index_default(name: []const u8) bool { if (mem.eql(u8, "authorization", name)) return true; if (mem.eql(u8, "proxy-authorization"...
lib/std/http/headers.zig
const std = @import("std"); const getty = @import("getty"); const assert = std.debug.assert; const expectEqual = std.testing.expectEqual; const expectEqualSlices = std.testing.expectEqualSlices; const Token = @import("common/token.zig").Token; pub const Serializer = struct { tokens: []const Token, const Se...
src/tests/ser/serializer.zig
const std = @import("std"); const Dependency = @import("Dependency.zig"); const Project = @import("Project.zig"); const utils = @import("utils.zig"); const Engine = @This(); const Allocator = std.mem.Allocator; const ArenaAllocator = std.heap.ArenaAllocator; const StructField = std.builtin.TypeInfo.StructField; const ...
src/Engine.zig
const std = @import("std"); const mem = std.mem; const Allocator = std.mem.Allocator; const assert = std.debug.assert; const Value = @import("value.zig").Value; const Type = @import("type.zig").Type; const TypedValue = @import("TypedValue.zig"); const zir = @import("zir.zig"); const Module = @import("Module.zig"); con...
src/astgen.zig
const std = @import("../../std.zig"); const linux = std.os.linux; const socklen_t = linux.socklen_t; const iovec = linux.iovec; const iovec_const = linux.iovec_const; pub const SYS_io_setup = 0; pub const SYS_io_destroy = 1; pub const SYS_io_submit = 2; pub const SYS_io_cancel = 3; pub const SYS_io_getevents = 4; pub...
std/os/bits/linux/arm64.zig
const std = @import("std"); const mem = std.mem; const Allocator = mem.Allocator; const Sha224 = std.crypto.hash.sha2.Sha224; const Sha384 = std.crypto.hash.sha2.Sha384; const Sha512 = std.crypto.hash.sha2.Sha512; const Sha256 = std.crypto.hash.sha2.Sha256; const Hmac256 = std.crypto.auth.hmac.sha2.HmacSha256; pub con...
src/main.zig
pub const MAX_ERROR_MESSAGE_CHARS = @as(u32, 512); pub const CastingSourceInfo_Property_PreferredSourceUriScheme = "PreferredSourceUriScheme"; pub const CastingSourceInfo_Property_CastingTypes = "CastingTypes"; pub const CastingSourceInfo_Property_ProtectedMedia = "ProtectedMedia"; //----------------------------------...
win32/system/win_rt.zig
const sg = @import("gfx.zig"); // helper function to convert "anything" to a Range struct pub fn asRange(val: anytype) Range { const type_info = @typeInfo(@TypeOf(val)); switch (type_info) { .Pointer => { switch (type_info.Pointer.size) { .One => return .{ .ptr = val, .size...
src/sokol/debugtext.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const ArrayList = std.ArrayList; const File = std.fs.File; const bufferedWriter = std.io.bufferedWriter; const Linenoise = @import("main.zig").Linenoise; const History = @import("history.zig").History; const unicode = @import("unicode.zig"); const width ...
src/state.zig
const std = @import("index.zig"); const io = std.io; const DefaultPrng = std.rand.DefaultPrng; const assert = std.debug.assert; const assertError = std.debug.assertError; const mem = std.mem; const os = std.os; const builtin = @import("builtin"); test "write a file, read it, then delete it" { var raw_bytes: [200 *...
std/io_test.zig
const std = @import("std"); const fs = std.fs; const log = std.log; const allocator = std.heap.c_allocator; const c = @import("c.zig"); // Consts const rgb_space: u32 = 16777216; const conflict_lookup = [_][7]u8{ [_]u8{ 1, 4, 5, 2, 3, 6, 7 }, [_]u8{ 0, 5, 4, 3, 2, 7, 6 }, [_]u8{ 3, 6, 7, 0, 1, 4, 5 }, ...
src/allrgb.zig
const std = @import("std"); const upaya = @import("upaya"); const Item = struct { /// copy of the data before it was modified data: []u8 = undefined, /// pointer to data ptr: usize = undefined, /// size in bytes size: usize = undefined, }; var history = struct { undo: std.ArrayList(Item) =...
tilescript/history.zig
const std = @import("std"); const Allocator = std.mem.Allocator; pub const UrlError = error { EmptyString, MissingScheme, InvalidPort, TooLong }; pub const Url = struct { scheme: []const u8, host: []const u8, port: ?u16, path: []const u8, query: ?[]const u8, allocator: ?*Alloca...
zervo/url.zig
const Bool = c_int; pub const Fixed_32_32 = extern enum(i64) { _ }; pub const Fixed_48_16 = extern enum(i64) { _ }; pub const Fixed_1_31 = extern enum(u32) { _ }; pub const Fixed_1_16 = extern enum(u32) { _ }; pub const Fixed_16_16 = extern enum(i32) { _ }; pub const Fixed = Fixed_16_16; pub const PointFixed = extern...
pixman.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; const Timer = std.time.Timer; const data = @embedFile("data/day01.txt"); const EntriesList = std.ArrayList(i16); const vec_len = 16; const Vec = std.meta.Vector(vec_len, i16); const Mask =...
src/day01.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const odbc = @import("odbc"); pub const Column = struct { table_category: ?[]const u8, table_schema: ?[]const u8, table_name: []const u8, column_name: []const u8, data_type: u16, type_name: []const u8, column_size: ?u32, ...
src/catalog.zig
const std = @import("std"); var allocator = &@import("allocator.zig").fixed.allocator; // Old String -> Integer //export fn atof(str: ?*const u8) f64 { // unreachable; //} export fn atoi(str: [*]const u8) c_int { const buf = std.cstr.toSliceConst(str); return std.fmt.parseInt(c_int, buf, 10) catch 0; } ...
src/stdlib.zig
const std = @import("std"); const zp = @import("zplay"); const dig = zp.deps.dig; const alg = zp.deps.alg; const Vec3 = alg.Vec3; const Vec4 = alg.Vec4; const Mat4 = alg.Mat4; const Framebuffer = zp.graphics.common.Framebuffer; const TextureUnit = zp.graphics.common.Texture.TextureUnit; const TextureCube = zp.graphics....
examples/environment_mapping.zig
const pc_keyboard = @import("../../pc_keyboard.zig"); pub fn mapKeycode(keycode: pc_keyboard.KeyCode, modifiers: pc_keyboard.Modifiers, handle_ctrl: pc_keyboard.HandleControl) pc_keyboard.DecodedKey { const map_to_unicode = handle_ctrl == .MapLettersToUnicode; switch (keycode) { .BackTick => return pc_...
src/keycode/layouts/azerty.zig
const std = @import("std"); const debug = std.debug; const mem = std.mem; const testing = std.testing; /// Returns a set of type `Out` which contains the intersection of `a` and `b`. pub fn intersect(comptime Out: type, allocator: mem.Allocator, a: anytype, b: anytype) !Out { var res = Out.init(allocator); tr...
src/common/set.zig
const std = @import("std"); const assert = std.debug.assert; const mem = std.mem; const Allocator = std.mem.Allocator; const MeasuredAllocator = @This(); allocator: Allocator, child_allocator: Allocator, state: State, /// Inner state of MeasuredAllocator. Can be stored rather than the entire MeasuredAllocator as a ...
src/MeasuredAllocator.zig
pub const CVT_SECONDS = @as(u32, 1); pub const CRYPTPROTECT_PROMPT_ON_UNPROTECT = @as(u32, 1); pub const CRYPTPROTECT_PROMPT_ON_PROTECT = @as(u32, 2); pub const CRYPTPROTECT_PROMPT_RESERVED = @as(u32, 4); pub const CRYPTPROTECT_PROMPT_STRONG = @as(u32, 8); pub const CRYPTPROTECT_PROMPT_REQUIRE_STRONG = @as(u32, 16); pu...
deps/zigwin32/win32/security.zig
const std = @import("std"); const log = std.log.scoped(.@"brucelib.audio"); const Sound = @import("Sound.zig"); const SoundBuffer = @import("common.zig").SoundBuffer; const sin = std.math.sin; const pi = std.math.pi; const tao = 2 * pi; pub const wav = @import("wav.zig"); pub const BufferedSound = struct { buf...
modules/audio/src/main.zig
const std = @import("std"); const builtin = std.builtin; // set log level to debug in Debug mode, info otherwise pub const log_level: std.log.Level = switch (builtin.mode) { .Debug => .debug, .ReleaseSafe, .ReleaseSmall, .ReleaseFast => .info, }; // Define root.log to override the std implementation pub fn lo...
src/log.zig
usingnamespace @import("../engine/engine.zig"); const Literal = @import("../parser/literal.zig").Literal; const LiteralValue = @import("../parser/literal.zig").LiteralValue; const std = @import("std"); const testing = std.testing; const mem = std.mem; pub fn RepeatedContext(comptime Payload: type, comptime Value: typ...
src/combn/combinator/repeated.zig
const kernel = @import("kernel.zig"); const log = kernel.log.scoped(.AVL); pub fn Tree(comptime T: type) type { return struct { root: ?*Item = null, /// This is always refering to the tree const Self = @This(); // TODO: add more keys? const Key = u64; pub const Sea...
src/kernel/avl.zig
const std = @import("std"); const assert = std.debug.assert; const io = std.io; const mem = std.mem; const os = std.os; const build_options = @import("build_options"); const builtin = @import("builtin"); const Lock = @import("Lock.zig"); const flags = @import("flags.zig"); const usage = \\usage: waylock [options...
src/main.zig
const std = @import("std"); const ehdr = @import("../data-structures/ehdr.zig"); const ELF = @import("../elf.zig"); fn ehdrParse64(elf: ELF.ELF) !ehdr.Ehdr { try elf.file.seekableStream().seekTo(0x00); var ehdr1: std.elf.Elf64_Ehdr = undefined; const stream = elf.file.reader(); try stream.readNoEof(std....
src/functions/ehdr.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 Set = Map(usize, void); const util = @import("util.zig"); const gpa = util.gpa; // const data = @...
src/day15.zig
const std = @import("std"); const Map = @import("./map.zig").Map; pub fn main() !void { const out = std.io.getStdOut().writer(); const inp = std.io.getStdIn().reader(); var buf: [20480]u8 = undefined; var count: u32 = 0; while (try inp.readUntilDelimiterOrEof(&buf, '\n')) |line| { count += ...
2019/p19/p19b.zig
const std = @import("std"); const fs = std.fs; pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; const allocator = &gpa.allocator; const input = try fs.cwd().readFileAlloc(allocator, "data/input_13_1.txt", std.math.maxInt(usize)); var lines = std.mem.tokenize(input, "\n"); ...
2020/src/day_13.zig
const std = @import("std"); const sdl = @import("sdl"); const imgui = @import("imgui"); const imgui_impl = @import("imgui/implementation.zig"); pub const input_types = @import("input_types.zig"); pub const renderkit = @import("renderkit"); pub const utils = @import("utils/utils.zig"); pub const math = @import("math/ma...
gamekit/gamekit.zig
pub const ADMINDATA_MAX_NAME_LEN = @as(u32, 256); pub const CLSID_MSAdminBase_W = Guid.initString("a9e69610-b80d-11d0-b9b9-00a0c922e750"); pub const IMGCHG_SIZE = @as(u32, 1); pub const IMGCHG_VIEW = @as(u32, 2); pub const IMGCHG_COMPLETE = @as(u32, 4); pub const IMGCHG_ANIMATE = @as(u32, 8); pub const IMGCHG_MASK = @a...
win32/system/iis.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const errors = @import("../errors.zig"); const image = @import("../image.zig"); const FormatInterface = @import("../format_interface.zig").FormatInterface; const color = @import("../color.zig"); const PixelFormat = @import("../pixel_format.zig").PixelFor...
src/formats/jpeg.zig
const io = @import("std").io; /// Receiver Holding Register (R) const register_rhr = 0; /// Transmitter Holding Register (W) const register_thr = 0; /// Interrupt Enable Register (R/W) const register_ier = 1; /// Interrupt Status Register (R) const register_isr = 2; /// FIFO Control Register (W) const register_fcr = 2...
src/uart.zig
// SPDX-License-Identifier: MIT // This file is part of the `termcon` project under the MIT license. const root = @import("../windows.zig"); const std = @import("std"); const windows = std.os.windows; pub const CONSOLE_TEXTMODE_BUFFER: windows.DWORD = 1; // when hConsoleHandle param is an input handle: const ENABLE...
src/backend/windows/config.zig
pub const names = @import("xkbcommon_names.zig"); pub const Keycode = u32; pub const Keysym = @import("xkbcommon_keysyms.zig").Keysym; pub const KeyDirection = extern enum { up, down, }; pub const LayoutIndex = u32; pub const LayoutMask = u32; pub const LevelIndex = u32; pub const ModIndex = u32; pub cons...
source/river-0.1.0/deps/zig-xkbcommon/src/xkbcommon.zig
const std = @import("std"); const assert = std.debug.assert; const c = @import("c.zig"); const helpers = @import("helpers.zig"); const enc = @import("encode.zig"); const dec = @import("decode.zig"); const seek_key = @import("seek_key.zig"); const seek_path = @import("seek_path.zig"); var alloc = std.heap.GeneralPurpos...
src/lib.zig
const std = @import("std"); usingnamespace (@import("../machine.zig")); usingnamespace (@import("../util.zig")); test "extra instructions" { const m32 = Machine.init(.x86_32); const m64 = Machine.init(.x64); const reg = Operand.register; const regRm = Operand.registerRm; const imm = Operand.immedi...
src/x86/tests/extra.zig
const std = @import("std"); const known_folders = @import("known-folders"); const api = @import("./api.zig"); const shared = @import("./shared.zig"); const allocator = std.heap.page_allocator; var log_file: ?std.fs.File = null; var log_writer: ?std.fs.File.Writer = null; pub fn log( comptime message_level: std.lo...
src/main.zig
const std = @import("std"); const real_input = @embedFile("day-13_real-input"); const test_input = @embedFile("day-13_test-input"); pub fn main() !void { std.debug.print("--- Day 13 ---\n", .{}); const result = try execute(real_input); std.debug.print("there are {} visible dots\n", .{ result }); } fn exe...
day-13.zig
const std = @import("../index.zig"); const crypto = std.crypto; const debug = std.debug; const mem = std.mem; pub const HmacMd5 = Hmac(crypto.Md5); pub const HmacSha1 = Hmac(crypto.Sha1); pub const HmacSha256 = Hmac(crypto.Sha256); pub fn Hmac(comptime H: type) type { return struct { const digest_size = H...
std/crypto/hmac.zig
const std = @import("std"); const testing = std.testing; const meta = std.meta; usingnamespace @import("main.zig"); test "serialization" { const test_cases = .{ .{ .type = struct { compact: bool, schema: u7 }, .value = .{ .compact = true, .schema = 0 }, .expected = "\x8...
src/tests.zig
const std = @import("std"); const warn = std.debug.warn; const mem = std.mem; const fmt = std.fmt; const ascii = std.ascii; const testing = std.testing; const print = std.debug.print; const expect = testing.expect; const assert = std.debug.assert; const Allocator = std.mem.Allocator; const ArrayList = std.ArrayList; co...
src/parse.zig
pub const w4 = @import("wasm4.zig"); const g = @import("graphics.zig"); pub const info = @import("simple_info.zig"); const alphabet = @import("alphabet.zig"); const obj = @import("obj.zig"); // Input const gpad_timer_max = 13; // Map const tilespace = 16; const map_size_x = 15; const map_size_y = 10; const screen_ti...
src/main.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...
2016/day20.zig
const std = @import("std"); const debug = std.debug; const mem = std.mem; const Allocator = mem.Allocator; const ArrayList = std.ArrayList; fn Partition(comptime mod: u8) type { return struct { const Self = this; const digit_count = comptime blk: { var r: i64 = 1; var i: u8 ...
zig/src/078.zig
const std = @import("std"); const pagez = @import("pagez"); const gui = @import("gui"); const fs = std.fs; const mem = std.mem; const max = std.math.max; const print = std.debug.print; const Thread = std.Thread; const Point = pagez.Point; const Position = pagez.Position; const Size = pagez.Size; const expect = std.test...
src/main.zig
const builtin = @import("builtin"); const clap = @import("clap"); const std = @import("std"); const util = @import("util"); const common = @import("common.zig"); const gen3 = @import("gen3.zig"); const rom = @import("rom.zig"); const debug = std.debug; const fs = std.fs; const heap = std.heap; const io = std.io; cons...
src/core/tm35-gen3-offsets.zig
const macro = @import("pspmacros.zig"); comptime { asm (macro.import_module_start("scePower", "0x40010000", "46")); asm (macro.import_function("scePower", "0x2B51FE2F", "scePower_2B51FE2F")); asm (macro.import_function("scePower", "0x442BFBAC", "scePower_442BFBAC")); asm (macro.import_function("scePowe...
src/psp/nids/psppower.zig
const std = @import("std"); const alka = @import("alka"); const m = alka.math; usingnamespace alka.log; pub const mlog = std.log.scoped(.app); pub const log_level: std.log.Level = .info; fn draw() !void { const asset = alka.getAssetManager(); const testpng = try asset.getTexture(1); const srect = m.Rect...
examples/texture_drawing.zig
const std = @import("std"); const stdx = @import("stdx"); const ds = stdx.ds; const v8 = @import("v8"); const v8x = @import("v8x.zig"); const runtime = @import("runtime.zig"); const RuntimeContext = runtime.RuntimeContext; const SizedJsString = runtime.SizedJsString; const adapter = @import("adapter.zig"); const This ...
runtime/gen.zig
const builtin = @import("builtin"); pub const struct_ZigClangConditionalOperator = @OpaqueType(); pub const struct_ZigClangBinaryConditionalOperator = @OpaqueType(); pub const struct_ZigClangAbstractConditionalOperator = @OpaqueType(); pub const struct_ZigClangAPInt = @OpaqueType(); pub const struct_ZigClangAPSInt = @...
src-self-hosted/clang.zig
pub const parseFloat = @import("parse_float/parse_float.zig").parseFloat; pub const ParseFloatError = @import("parse_float/parse_float.zig").ParseFloatError; const std = @import("std"); const math = std.math; const testing = std.testing; const expect = testing.expect; const expectEqual = testing.expectEqual; const exp...
lib/std/fmt/parse_float.zig
const std = @import("std"); const AnalysisContext = @import("document_store.zig").AnalysisContext; const ast = std.zig.ast; /// REALLY BAD CODE, PLEASE DON'T USE THIS!!!!!!! (only for testing) pub fn getFunctionByName(tree: *ast.Tree, name: []const u8) ?*ast.Node.FnProto { var decls = tree.root_node.decls.iterator...
src/analysis.zig
const std = @import("std"); const mem = std.mem; const expect = std.testing.expect; const builtin = @import("builtin"); extern fn random() u8; extern fn consoleLog(message_ptr: [*]const u8, message_len: usize) void; extern fn logRam(ram: [*]u8, ram_len: usize) void; extern fn readBytes(key_ptr: [*]const u8, key_len: u...
src/chip8/main.zig
const std = @import("std"); // Boilerplate reducing object construction / deconstruction interface via dynamic function creation /// Create function that will allocate given T type with given allocator and call 'init' over it with arbitrary argument parameter pub fn autoAlloc(comptime T: type) fn (std.mem.Allocator, ...
zvt-object.zig
pub const QCC_TRUE = @as(u32, 1); pub const QCC_FALSE = @as(u32, 0); pub const ALLJOYN_MESSAGE_FLAG_NO_REPLY_EXPECTED = @as(u32, 1); pub const ALLJOYN_MESSAGE_FLAG_AUTO_START = @as(u32, 2); pub const ALLJOYN_MESSAGE_FLAG_ALLOW_REMOTE_MSG = @as(u32, 4); pub const ALLJOYN_MESSAGE_FLAG_SESSIONLESS = @as(u32, 16); pub cons...
win32/devices/all_joyn.zig
pub const UIALL = @as(u32, 32768); pub const LOGTOKEN_TYPE_MASK = @as(u32, 3); pub const LOGTOKEN_UNSPECIFIED = @as(u32, 0); pub const LOGTOKEN_NO_LOG = @as(u32, 1); pub const LOGTOKEN_SETUPAPI_APPLOG = @as(u32, 2); pub const LOGTOKEN_SETUPAPI_DEVLOG = @as(u32, 3); pub const TXTLOG_SETUPAPI_DEVLOG = @as(u32, 1); pub co...
win32/system/application_installation_and_servicing.zig
const std = @import("std"); const assert = std.debug.assert; const allocator = std.heap.page_allocator; const Computer = @import("./computer.zig").Computer; pub const Pos = struct { const OFFSET: usize = 10000; x: usize, y: usize, pub fn init(x: usize, y: usize) Pos { return Pos{ ...
2019/p15/map.zig
const std = @import("std"); const Builder = std.build.Builder; const path = std.fs.path; fn addIspcObject(b: *Builder, exe: anytype, in_file: []const u8, target: ?[]const u8, is_release: bool) !void { // TODO: dependency management. Automatically pick target TODO: // get cpuid to tell us what target to use ins...
build.zig
const std = @import("../../../std.zig"); const linux = std.os.linux; const socklen_t = linux.socklen_t; const iovec = linux.iovec; const iovec_const = linux.iovec_const; const stack_t = linux.stack_t; const sigset_t = linux.sigset_t; const uid_t = linux.uid_t; const gid_t = linux.gid_t; pub const SYS_restart_syscall =...
lib/std/os/bits/linux/arm-eabi.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const ArrayList = std.ArrayList; const audio_graph = @import("audio_graph.zig"); const wav = @import("wav.zig"); //; pub const generators = struct { // TODO test this // more generators, sine, tri, square, noise // generates one period of...
src/sample_buffer.zig
const std = @import("std"); const math = std.math; const testing = std.testing; /// A 2-dimensional vector, representing the quantity x*e1 + y*e2. pub const Vec2 = extern struct { x: f32, y: f32, /// (0,0) pub const Zero = init(0, 0); /// (1,0) pub const X = init(1, 0); /// (0,1) pub...
src/geo/vec.zig
const rom = @import("../rom.zig"); const std = @import("std"); const io = std.io; const mem = std.mem; // TODO: Replace with Replacing/Escaping streams pub const all = [_]rom.encoding.Char{ .{ "\\x0000", "\x00\x00" }, .{ "\\x0001", "\x01\x00" }, .{ "ぁ", "\x02\x00" }, .{ "あ", "\x03\x00" }, .{ "ぃ",...
src/core/gen4/encodings.zig
const std = @import("std"); const mem = std.mem; const LinearFifo = std.fifo.LinearFifo; const ArrayList = std.ArrayList; const FuncType = @import("common.zig").FuncType; const ValueType = @import("common.zig").ValueType; const Global = @import("common.zig").Global; const Opcode = @import("opcode.zig").Opcode; pub con...
src/validator.zig
const std = @import("std"); const builtin = @import("builtin"); const mem = std.mem; const expect = std.testing.expect; const expectEqualStrings = std.testing.expectEqualStrings; // normal comment /// this is a documentation comment /// doc comment line 2 fn emptyFunctionWithComments() void {} test "empty function w...
test/behavior/basic.zig
const std = @import("../std.zig"); const Allocator = std.mem.Allocator; const AnyErrorOutStream = std.io.OutStream(anyerror); /// This allocator is used in front of another allocator and logs to the provided stream /// on every call to the allocator. Stream errors are ignored. /// If https://github.com/ziglang/zig/is...
lib/std/heap/logging_allocator.zig
const builtin = @import("builtin"); const clap = @import("../clap.zig"); const std = @import("std"); const args = clap.args; const testing = std.testing; const heap = std.heap; const mem = std.mem; const os = std.os; /// The result returned from ::StreamingClap.next pub fn Arg(comptime Id: type) type { return str...
clap/streaming.zig
const std = @import("std"); const panic = std.debug.panic; const assert = std.debug.assert; const L = std.unicode.utf8ToUtf16LeStringLiteral; const zwin32 = @import("zwin32"); const w32 = zwin32.base; const dwrite = zwin32.dwrite; const d2d1 = zwin32.d2d1; pub const GuiRenderer = @import("GuiRenderer.zig"); pub const ...
libs/common/src/common.zig
const std = @import("std"); const sdl = @import("sdl2"); const Texture = @import("Texture.zig"); const font_franklin = @embedFile("franklin.bmp"); pub const ContextError = error{ InitError, WindowError, RendererError, TextureError, }; const Context = @This(); window: sdl.Window, render: sdl.Renderer...
src/Context.zig
const std = @import("std"); const csv = @import("csv"); pub fn main() !void { // var gpa = std.heap.GeneralPurposeAllocator(.{}){}; // defer _ = gpa.deinit(); var arena = std.heap.ArenaAllocator.init(std.heap.c_allocator); defer arena.deinit(); const allocator = &arena.allocator; const csv_pa...
src/main.zig
const util = @import("util.zig"); const acpi = @import("acpi.zig"); /// Base Frequency const oscillator: u32 = 1_193_180; // I/O Ports const channel_arg_base_port: u16 = 0x40; const command_port: u16 = 0x43; const pc_speaker_port: u16 = 0x61; // Set Operating Mode of PITs ==========================================...
kernel/platform/timing.zig
const std = @import("std"); const Allocator = std.mem.Allocator; const assert = std.debug.assert; const print = std.debug.print; const data = @embedFile("data/day16.txt"); const EntriesList = std.ArrayList(Field); const Ticket = [20]u32; const TicketList = std.ArrayList(Ticket); const Field = struct { name: []co...
src/day16.zig
const std = @import("std"); const assert = std.debug.assert; const Allocator = std.mem.Allocator; const clap = @import("clap"); pub fn main() anyerror!void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; defer assert(gpa.deinit() == false); const allocator = gpa.allocator(); const params = compti...
src/main.zig
const std = @import("std"); const mem = std.mem; const Allocator = std.mem.Allocator; const assert = std.debug.assert; const parseUnsigned = std.fmt.parseUnsigned; const net = std.net; const testing = std.testing; const expect = testing.expect; const expectEqualStrings = testing.expectEqualStrings; const ValueMap = st...
src/zigly/zuri/zuri.zig
const std = @import("std"); const Texture = @import("Texture.zig"); const TextureView = @import("TextureView.zig"); const PresentMode = @import("enums.zig").PresentMode; const SwapChain = @This(); /// The type erased pointer to the SwapChain implementation /// Equal to c.WGPUSwapChain for NativeInstance. ptr: *anyopa...
gpu/src/SwapChain.zig
const std = @import("std"); const print = std.debug.print; const Allocator = std.mem.Allocator; const str = []const u8; pub const Cli = @This(); allocator: std.mem.Allocator = std.heap.c_allocator, cmds: *std.BufSet, matches: *std.BufSet, opts: std.ArrayList(Arg) = std.ArrayList(Arg).init(std.heap.c_allocator), args:...
src/util/cli.zig
const std = @import("std"); const arm_m = @import("arm_m"); const timer = @import("ports/" ++ @import("build_options").BOARD ++ "/timer.zig").timer0; const tzmcfi = @cImport(@cInclude("TZmCFI/Gateway.h")); const warn = @import("nonsecure-common/debug.zig").warn; const port = @import("ports/" ++ @import("build_options")...
examples/nonsecure-bench-rtos.zig
//-------------------------------------------------------------------------------- // Section: Types (1) //-------------------------------------------------------------------------------- const IID_IIsolatedEnvironmentInterop_Value = Guid.initString("85713c2e-8e62-46c5-8de2-c647e1d54636"); pub const IID_IIsolatedEnvir...
win32/system/win_rt/isolation.zig
const std = @import("std"); pub const Config = struct {}; pub const Mesh = struct { const Self = @This(); allocator: *std.mem.Allocator, positions: [][3]f32, normals: [][3]f32, uvs: [][2]f32, indices: []u32, pub fn deinit(self: *Self) void { self.allocator.free(self.positions); ...
src/lib.zig
const std = @import("std"); const math = @import("math.zig"); const daedelus = @import("daedelus.zig"); const Vec3 = math.Vec3; const Allocator = std.mem.Allocator; const Random = std.rand.Random; const Vec3f = Vec3(f32); const Material = union(enum) { Metal: struct { reflectCol: Vec3f, emitCol: V...
src/main.zig
const Self = @This(); const std = @import("std"); const mem = std.mem; const wlr = @import("wlroots"); const wayland = @import("wayland"); const wl = wayland.server.wl; const zriver = wayland.server.zriver; const command = @import("command.zig"); const server = &@import("main.zig").server; const util = @import("util...
source/river-0.1.0/river/Control.zig
const std = @import("std"); const pike = @import("pike.zig"); const posix = @import("os/posix.zig"); const Waker = @import("waker.zig").Waker; const io = std.io; const os = std.os; const net = std.net; const mem = std.mem; const meta = std.meta; pub const SocketOptionType = enum(u32) { debug = os.SO.DEBUG, lis...
socket_posix.zig
const std = @import("std"); const debug = std.debug; const io = std.io; const math = std.math; const mem = std.mem; const meta = std.meta; const time = std.time; const Decl = std.builtin.TypeInfo.Declaration; pub fn benchmark(comptime B: type) !void { const args = if (@hasDecl(B, "args")) B.args else [_]void{{}}...
bench.zig
const root = @import("@root"); const std = @import("std"); const builtin = @import("builtin"); var argc_ptr: [*]usize = undefined; comptime { const strong_linkage = builtin.GlobalLinkage.Strong; if (builtin.link_libc) { @export("main", main, strong_linkage); } else if (builtin.os == builtin.Os.wi...
std/special/bootstrap.zig
const std = @import("std"); const ArenaAllocator = std.heap.ArenaAllocator; const Allocator = std.mem.Allocator; const warn = std.debug.warn; const semver = @import("semver"); const json = @import("zson"); const PackageInfo = struct { name: []const u8, version: ?[]const u8, source: ?Source, entry_point...
src/main.zig
const std = @import("../../../std.zig"); const linux = std.os.linux; const socklen_t = linux.socklen_t; const iovec = linux.iovec; const iovec_const = linux.iovec_const; const uid_t = linux.uid_t; const gid_t = linux.gid_t; const pid_t = linux.pid_t; const stack_t = linux.stack_t; const sigset_t = linux.sigset_t; pub ...
lib/std/os/bits/linux/powerpc.zig