code stringlengths 38 801k | repo_path stringlengths 6 263 |
|---|---|
pub const std = @import("std");
pub const vk = @import("vk");
pub const vma = @import("vma");
pub const sdl = @import("sdl");
pub usingnamespace @import("simd.zig");
pub const assert = std.debug.assert;
pub const GpuBuffer = struct {
buffer: vk.Buffer,
alloc: vma.Allocation,
pub fn init(
vma_allo... | src/common.zig |
const c = @import("std").c;
usingnamespace @import("zamqp.zig");
pub extern fn amqp_version_number() u32;
pub extern fn amqp_version() [*:0]const u8;
pub extern fn amqp_error_string2(err: status_t) [*:0]const u8;
pub extern fn amqp_cstring_bytes(cstr: [*:0]const u8) bytes_t;
pub extern fn amqp_parse_url(url: [*:0]u8, ... | src/c_api.zig |
//--------------------------------------------------------------------------------
// Section: Types (25)
//--------------------------------------------------------------------------------
pub const HINTERACTIONCONTEXT = *opaque{};
pub const INTERACTION_ID = enum(i32) {
NONE = 0,
MANIPULATION = 1,
TAP = 2... | win32/ui/interaction_context.zig |
const std = @import("std");
const debug = std.debug;
const mem = std.mem;
const log = std.log;
const testing = std.testing;
const Allocator = mem.Allocator;
const AutoHashMap = std.AutoHashMap;
const TailQueue = std.TailQueue;
const ArrayList = std.ArrayList;
const intcode = @import("intcode");
const IntcodeProgram = ... | day23/src/solve.zig |
const std = @import("std");
const georgios = @import("georgios");
const utils = @import("utils");
const kernel = @import("kernel.zig");
const print = @import("print.zig");
const BuddyAllocator = @import("buddy_allocator.zig").BuddyAllocator;
const platform = @import("platform.zig");
pub const AllocError = georgios.... | kernel/memory.zig |
const std = @import("std");
const fs = @import("fs.zig");
const debug = std.debug;
const heap = std.heap;
const mem = std.mem;
const fmt = std.fmt;
const os = std.os;
const rand = std.rand;
fn countParents(comptime Folder: type, folder: *Folder) usize {
var res: usize = 0;
var tmp = folder;
while (tmp.par... | src/nds/test.zig |
const std = @import("std");
const warn = std.debug.warn;
const assert = std.debug.assert;
const types = @import("types.zig");
/// Class file loader type.
pub const Loader = struct {
file: std.fs.File,
fn primitive(self: Loader, comptime T: type) !T {
const size = @sizeOf(T);
var buffer: [size... | src/loader.zig |
const uefi = @import("std").os.uefi;
const Guid = uefi.Guid;
pub const ConfigurationTable = extern struct {
vendor_guid: Guid,
vendor_table: *c_void,
pub const acpi_20_table_guid align(8) = Guid{
.time_low = 0x8868e871,
.time_mid = 0xe4f1,
.time_high_and_version = 0x11d3,
.... | lib/std/os/uefi/tables/configuration_table.zig |
// SPDX-License-Identifier: MIT
// This file is part of the `termcon` project under the MIT license.
const c = @cImport({
@cInclude("termios.h");
@cInclude("sys/ioctl.h");
});
const std = @import("std");
const stdin = std.io.getStdIn();
const stdout = std.io.getStdOut();
const cursor = @import("cursor.zig")... | src/backend/termios/screen.zig |
const os = @import("root").os;
const std = @import("std");
const interrupts = @import("interrupts.zig");
const idt = @import("idt.zig");
const gdt = @import("gdt.zig");
const serial = @import("serial.zig");
const ports = @import("ports.zig");
const regs = @import("regs.zig");
const apic = @import("apic.zig");
const pc... | src/platform/x86_64/x86_64.zig |
const std = @import("std");
const zt = @import("../zt.zig");
usingnamespace @import("gl");
const Self = @This();
pub const VertShaderSource = @embedFile("shader/renderer.vertex");
pub const FragShaderSource = @embedFile("shader/renderer.fragment");
pub const Vertex = extern struct { pos: zt.math.Vec3, col: zt.math.V... | src/zt/renderer.zig |
const std = @import("std");
pub const PrivilegeLevel = enum(u2) {
User = 0,
Supervisor = 1,
Machine = 3,
pub fn getPrivilegeLevel(value: u2) !PrivilegeLevel {
return std.meta.intToEnum(PrivilegeLevel, value) catch {
std.log.emerg("invalid privlege mode {b}", .{value});
... | lib/types.zig |
const std = @import("std");
const zalgebra = @import("zalgebra");
usingnamespace @import("didot-graphics");
usingnamespace @import("didot-objects");
usingnamespace @import("didot-app");
const Vec3 = zalgebra.vec3;
const Quat = zalgebra.quat;
const rad = zalgebra.to_radians;
const Allocator = std.mem.Allocator;
var sc... | examples/planet-test/example-scene.zig |
const clap = @import("clap");
const format = @import("format");
const it = @import("ziter");
const std = @import("std");
const ston = @import("ston");
const util = @import("util");
const debug = std.debug;
const fmt = std.fmt;
const fs = std.fs;
const heap = std.heap;
const io = std.io;
const math = std.math;
const me... | src/randomizers/tm35-rand-wild.zig |
const std = @import("std");
const interop = @import("../interop.zig");
const iup = @import("../iup.zig");
const Impl = @import("../impl.zig").Impl;
const CallbackHandler = @import("../callback_handler.zig").CallbackHandler;
const debug = std.debug;
const trait = std.meta.trait;
const Element = iup.Element;
const H... | src/elements/item.zig |
pub var OUTPUT: *CompositorOutput = undefined;
pub fn main() anyerror!void {
try epoll.init();
var detected_type = backends.detect();
var backend: Backend = try Backend.new(detected_type);
try backend.init();
defer backend.deinit();
try compositor.COMPOSITOR.init();
var o1 = try out.newOu... | src/main.zig |
const std = @import("std");
const builtin = @import("builtin");
const known_folders = @import("known-folders");
/// Caller must free memory.
pub fn askString(allocator: std.mem.Allocator, prompt: []const u8, max_size: usize) ![]u8 {
const in = std.io.getStdIn().reader();
const out = std.io.getStdOut().writer()... | src/setup.zig |
const std = @import("std");
const Type = @import("type.zig").Type;
const log2 = std.math.log2;
const assert = std.debug.assert;
const BigInt = std.math.big.Int;
const Target = std.Target;
const Allocator = std.mem.Allocator;
/// This is the raw data, with no bookkeeping, no memory awareness,
/// no de-duplication, and... | src-self-hosted/value.zig |
const std = @import("std");
const CloneError = error{
SystemResources,
InvalidExe,
AccessDenied,
} || std.os.UnexpectedError;
pub const clone_args = extern struct {
flags: u64, // Flags bit mask
pidfd: u64, // Where to store PID file descriptor (pid_t *)
child_tid: u64, // Where to store child... | src/syscall.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 OneOfAmbiguousContext(comptime Payload: type, comptime Valu... | src/combn/combinator/oneof_ambiguous.zig |
const std = @import("std");
const vec3 = @import("vec3.zig");
const Scene = @import("../scene.zig").Scene;
const Shape = @import("shape.zig").Shape;
const Material = @import("material.zig").Material;
pub fn new_light_scene(alloc: *std.mem.Allocator) !Scene {
var scene = Scene.new(alloc);
const light = try sc... | src/scene/examples.zig |
const std = @import("std");
const mem = std.mem;
const Digit = @This();
allocator: *mem.Allocator,
array: []bool,
lo: u21 = 178,
hi: u21 = 127242,
pub fn init(allocator: *mem.Allocator) !Digit {
var instance = Digit{
.allocator = allocator,
.array = try allocator.alloc(bool, 127065),
};
... | src/components/autogen/DerivedNumericType/Digit.zig |
const std = @import("std");
const pike = @import("pike");
const net = std.net;
const Allocator = std.mem.Allocator;
/// HTTP Status codes according to `rfc7231`
/// https://tools.ietf.org/html/rfc7231#section-6
pub const StatusCode = enum(u16) {
// Informational 1xx
Continue = 100,
// Successful 2xx
Sw... | src/response.zig |
const std = @import("std");
const firm_abi = @import("firm-abi.zig");
/// Codegen helpers for a program
pub const Codegen = struct {
/// Enum with all the binary opcodes
pub const BinaryOperations = enum {
And,
Or,
Eor,
Add,
Sub,
Mul,
Mulh,
Mod,
... | src/codegen.zig |
const std = @import("std");
const mem = std.mem;
const StringHashMap = std.hash_map.StringHashMap;
const ArrayList = std.ArrayList;
/// Represents a token to be emitted by the {{Tokenizer}}.
pub const Token = union(enum) {
DOCTYPE: struct {
name: ?[]const u8 = null,
publicIdentifier: ?[]const u8 = ... | src/token.zig |
const std = @import("std");
const builtin = @import("builtin");
pub usingnamespace @import("ingble.zig");
pub usingnamespace @import("gatt_client_async.zig");
const print = platform_printf;
const enable_print = print_info == 1;
const rom_crc: f_crc_t = @intToPtr(f_crc_t, 0x00000f79);
fn same_version(a: *const pro... | examples-gcc/central_fota/src/fota_client.zig |
const builtin = @import("builtin");
const std = @import("std");
pub const deg_to_rad = std.math.pi / 180.0;
pub const rad_to_deg = 180.0 / std.math.pi;
pub fn cos(x: f32) f32 {
return std.math.cos(x);
}
pub fn sin(x: f32) f32 {
return std.math.sin(x);
}
const x1 = 1.0 / std.math.ln(2.0) - 1.0;
const log2p1_bi... | src/math.zig |
const std = @import("std"); // Zig standard library, duh!
pub fn build(builder: *std.build.Builder) !void {
const ScanProtocolsStep = @import("deps/zig-wayland/build.zig").ScanProtocolsStep;
// Creating the wayland-scanner.
const scanner = ScanProtocolsStep.create(builder);
scanner.addSystemProtocol("... | build.zig |
const Self = @This();
const std = @import("std");
const Allocator = std.mem.Allocator;
const c = @import("xml.zig").c;
/// Possible errors that can be returned by many of the functions
/// in this library. See the function doc comments for details on
/// exactly which of these can be returnd.
pub const Set = error{
... | src/Error.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const StringHashMap = std.StringHashMap;
const _obj = @import("./obj.zig");
const Obj = _obj.Obj;
const objToString = _obj.objToString;
const ObjTypeDef = _obj.ObjTypeDef;
pub const ValueType = enum { Boolean, Number, Null, Void, Obj };
pub const Value ... | src/value.zig |
const std = @import("std");
const builtin = @import("builtin");
const event = std.event;
const os = std.os;
const io = std.io;
const fs = std.fs;
const mem = std.mem;
const process = std.process;
const Allocator = mem.Allocator;
const ArrayList = std.ArrayList;
const Buffer = std.Buffer;
const arg = @import("arg.zig"... | src-self-hosted/main.zig |
const builtin = @import("builtin");
const std = @import("std");
const expect = std.testing.expect;
const expectError = std.testing.expectError;
const expectEqual = std.testing.expectEqual;
test "switch with numbers" {
if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
if (builtin.zig_bac... | test/behavior/switch.zig |
const std = @import("std");
const os = std.os;
const io = std.io;
const mem = std.mem;
const Buffer = std.Buffer;
const llvm = @import("llvm.zig");
const c = @import("c.zig");
const builtin = @import("builtin");
const Target = @import("target.zig").Target;
const warn = std.debug.warn;
const Token = std.zig.Token;
const... | src-self-hosted/module.zig |
const std = @import("std");
const u64_max = std.math.maxInt(u64);
pub const Tag = extern struct {
identifier: u64,
next: u64,
};
pub const StructTagID = enum(u64) {
command_line = 0xe5e76a1b4597a781,
fb_mtrr = 0x6bc1a78ebe871172,
memory_map = 0x2187f79e8612de07,
framebuffer = 0x506461d2950408f... | src/kernel/arch/x86_64/limine/stivale2/header.zig |
const tests = @import("tests.zig");
pub fn addCases(cases: *tests.GenHContext) void {
cases.add("declare enum",
\\const Foo = extern enum.{ A, B, C };
\\export fn entry(foo: Foo) void { }
,
\\enum Foo {
\\ A = 0,
\\ B = 1,
\\ C = 2
\\};
\... | test/gen_h.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const testing = std.testing;
const Tree = @import("Tree.zig");
const Token = Tree.Token;
const TokenIndex = Tree.TokenIndex;
const NodeIndex = Tree.NodeIndex;
const Type = @import("Type.zig");
const Diagnostics = @import("Diagnostics.zig");
const NodeList... | src/InitList.zig |
const std = @import("std");
const assert = std.debug.assert;
const mem = std.mem;
const ArrayList = std.ArrayList;
const testing = std.testing;
const stdout = std.io.getStdOut();
const print = stdout.writer().print;
const flash = @import("flash.zig");
const Work = struct {
src_slot: usize,
src_page: usize,
... | nswap/src/swap.zig |
const std = @import("std");
const c = @import("c.zig");
pub const MemoryMode = enum(u2) {
duplicate = c.HB_MEMORY_MODE_DUPLICATE,
readonly = c.HB_MEMORY_MODE_READONLY,
writable = c.HB_MEMORY_MODE_WRITABLE,
readonly_may_make_writable = c.HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE,
};
pub const Blob = st... | freetype/src/harfbuzz/blob.zig |
const std = @import("std");
const ConstantOrBuffer = @import("trigger.zig").ConstantOrBuffer;
const Span = @import("basics.zig").Span;
const fcdcoffset: f32 = 3.814697265625e-6; // 2^-18
pub const FilterType = enum {
bypass,
low_pass,
band_pass,
high_pass,
notch,
all_pass,
};
// convert a fr... | src/zang/mod_filter.zig |
const std = @import("std");
const gpa = std.heap.c_allocator;
const ansi = @import("ansi");
const u = @import("index.zig");
//
//
pub const b = 1;
pub const kb = b * 1024;
pub const mb = kb * 1024;
pub const gb = mb * 1024;
pub fn print(comptime fmt: []const u8, args: anytype) void {
std.debug.print(fmt++"\n", ... | src/util/funcs.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const assert = std.debug.assert;
const print = std.debug.print;
pub fn main() !void {
two: for (numbers) |n1, i| {
if (i + 1 == numbers.len) @panic(":(");
for (numbers[i + 1 ..]) |n2| {
if (n1 + n2 == 2020) {
... | src/day01.zig |
const std = @import("std");
const assert = std.debug.assert;
const allocator = std.testing.allocator;
const Computer = @import("./computer.zig").Computer;
pub const Pos = struct {
x: usize,
y: usize,
pub fn encode(self: Pos) usize {
return self.x * 10000 + self.y;
}
};
pub const Board = struc... | 2019/p13/board.zig |
/// The function fiatP434AddcarryxU64 is an addition with carry.
/// Postconditions:
/// out1 = (arg1 + arg2 + arg3) mod 2^64
/// out2 = ⌊(arg1 + arg2 + arg3) / 2^64⌋
///
/// Input Bounds:
/// arg1: [0x0 ~> 0x1]
/// arg2: [0x0 ~> 0xffffffffffffffff]
/// arg3: [0x0 ~> 0xffffffffffffffff]
/// Output Bounds:
/... | fiat-zig/src/p434_64.zig |
const std = @import("std.zig");
const builtin = @import("builtin");
const assert = std.debug.assert;
const mem = std.mem;
const math = std.math;
const ziggurat = @import("rand/ziggurat.zig");
const maxInt = std.math.maxInt;
/// Fast unbiased random numbers.
pub const DefaultPrng = Xoshiro256;
/// Cryptographically s... | lib/std/rand.zig |
const std = @import("std");
const assert = std.debug.assert;
const Compilation = @import("Compilation.zig");
const build_options = @import("build_options");
const trace = @import("tracy.zig").trace;
pub fn buildTsan(comp: *Compilation) !void {
if (!build_options.have_llvm) {
return error.ZigCompilerNotBui... | src/libtsan.zig |
const std = @import("std");
const util = @import("util.zig");
const data = @embedFile("../data/day03.txt");
const one = @as(u32, 1);
// Wrapper struct for gamma and epsilon
pub const GammaEpsilon = struct {
gamma: u32 = 0,
epsilon: u32 = 0,
};
/// Get an integer representing the most common bit-values in the... | src/day03.zig |
const std = @import("std");
const util = @import("util");
pub const Instr = enum(u32) {
jmp, acc, nop,
};
pub fn Interpreter(comptime src: []const u8, comptime mixin: anytype) type {
@setEvalBranchQuota(src.len * 1000);
comptime var bytecode: []u32 = &[_]u32{};
comptime {
var index: usize = 0;... | 2020/vm.zig |
pub const GDI_ERROR = @as(i32, -1);
pub const ERROR = @as(u32, 0);
pub const NULLREGION = @as(u32, 1);
pub const SIMPLEREGION = @as(u32, 2);
pub const COMPLEXREGION = @as(u32, 3);
pub const MAXSTRETCHBLTMODE = @as(u32, 4);
pub const POLYFILL_LAST = @as(u32, 2);
pub const LAYOUT_BTT = @as(u32, 2);
pub const LAYOUT_VBH =... | deps/zigwin32/win32/graphics/gdi.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;
const assert = std.debug.assert;
const leb = std.leb;
const mem = std.mem;
const Module = @import("../Module.zig");
const Decl = Module.Decl;
const Inst = @import("../ir.zig").Inst;
const Type = @import("../type.zig").Typ... | src/codegen/wasm.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 ArrayList = std.ArrayList;
const assert = std.debug.assert;
const utils = @import("utils.zig");
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const DIM: usize = ... | day_20/src/main.zig |
const std = @import("std");
const mem = std.mem;
const Allocator = mem.Allocator;
const assert = std.debug.assert;
const Compilation = @import("Compilation.zig");
const Error = Compilation.Error;
const Source = @import("Source.zig");
const Tokenizer = @import("Tokenizer.zig");
const RawToken = Tokenizer.Token;
const Pa... | src/Preprocessor.zig |
const Core = @This();
const std = @import("std");
const mem = std.mem;
const Allocator = mem.Allocator;
const types = @import("../main.zig");
const js = @import("js_interop.zig");
pub const Window = @import("Window.zig");
allocator: std.mem.Allocator,
window: *Window = undefined,
pub fn init(allocator: std.mem.Alloca... | src/wasm/Core.zig |
// mikdusan
// ah got it to work. but you have to take a special step. consider this case:
// 1. spawn "cat" and write some lines to it. let it just inherit stdout/stderr.
// 2. waiting on child won't return until stdin pipe is closed
// 3. you can child.stdin.?.close() but I had to follow it up with child.stdin = nul... | src/executable_and_stdin.zig |
pub const FSRM_DISPID_FEATURE_MASK = @as(u32, 251658240);
pub const FSRM_DISPID_INTERFACE_A_MASK = @as(u32, 15728640);
pub const FSRM_DISPID_INTERFACE_B_MASK = @as(u32, 983040);
pub const FSRM_DISPID_INTERFACE_C_MASK = @as(u32, 61440);
pub const FSRM_DISPID_INTERFACE_D_MASK = @as(u32, 3840);
pub const FSRM_DISPID_IS_PR... | win32/storage/file_server_resource_manager.zig |
const csv = @import("csv.zig");
const std = @import("std");
const io = std.io;
const warn = std.debug.warn;
const testing = std.testing;
const WriterTest = struct {
input: []const []const u8,
output: []const u8,
use_crlf: bool,
comma: u8,
fn init(
input: []const []const u8,
output... | src/encoding/csv/csv_test.zig |
const std = @import("std");
const syntax = @import("syntax.zig");
const mem = std.mem;
const io = std.io;
const math = std.math;
const fs = std.fs;
const os = std.os;
pub const Color = enum {
Reset,
Black,
Red,
Green,
Yellow,
Blue,
Magenta,
Cyan,
White,
Gray,
BrightRed,
... | src/blo.zig |
const std = @import("std");
pub const PreloadedInfo = struct {
width: u16,
height: u16,
bytes_per_line: u16,
};
pub fn preload(reader: anytype) !PreloadedInfo {
var header: [70]u8 = undefined;
_ = try reader.readNoEof(&header);
try reader.skipBytes(58, .{});
const manufacturer = header[0];... | pcx.zig |
const std = @import("std");
const c = @import("c.zig");
const utility = @import("utility.zig");
const Query = struct {
fn Select(comptime M: type, comptime DbHandle: type) type {
const MInfo = @typeInfo(M);
comptime var model_type: type = M;
comptime var is_array = false;
if (MInfo ... | src/database.zig |
const std = @import("std");
const DynamicArray = @import("./dynamic_array.zig").DynamicArray;
const Value = @import("./value.zig").Value;
const Allocator = std.mem.Allocator;
const expect = std.testing.expect;
pub const OpCode = enum(u8) {
const Self = @This();
op_ret,
op_constant,
op_nil,
op_tr... | src/chunks.zig |
const std = @import("std");
const zp = @import("zplay");
const SimpleRenderer = zp.graphics.@"3d".SimpleRenderer;
const Mesh = zp.graphics.@"3d".Mesh;
const Camera = zp.graphics.@"3d".Camera;
const Material = zp.graphics.@"3d".Material;
const Texture2D = zp.graphics.texture.Texture2D;
const dig = zp.deps.dig;
const alg... | examples/mesh_generation.zig |
const std = @import("std");
const request = @import("request.zig");
const builtin = @import("builtin");
const testing = std.testing;
pub const Update = struct {
update_id: i64,
chat_id: i64,
text: []const u8,
};
pub const Telezig = struct {
allocator: std.mem.Allocator,
token: [46]u8,
pub fn ... | src/main.zig |
const builtin = @import("builtin");
const std = @import("std");
const json = std.json;
const mem = std.mem;
pub fn main() anyerror!void {
var arena = std.heap.ArenaAllocator.init(std.heap.direct_allocator);
defer arena.deinit();
const allocator = &arena.allocator;
const args = try std.process.argsAll... | tools/merge_anal_dumps.zig |
const std = @import("std");
const root = @import("root");
const liu = @import("./lib.zig");
const builtin = @import("builtin");
const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;
pub const Obj = enum(u32) {
// These are kept up to date with src/wasm.ts
jsundefined,
jsnull,
log,
... | src/liu/wasm.zig |
const std = @import("std");
const upaya = @import("upaya_cli.zig");
const Texture = @import("texture.zig").Texture;
const Point = @import("math/point.zig").Point;
/// 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 {
... | src/image.zig |
const PixelFormat = @import("pixel_format.zig").PixelFormat;
const color = @import("color.zig");
const std = @import("std");
const mem = std.mem;
const Allocator = mem.Allocator;
const Grayscale1 = color.Grayscale1;
const Grayscale2 = color.Grayscale2;
const Grayscale4 = color.Grayscale4;
const Grayscale8 = color.Grays... | src/pixel_storage.zig |
const Emulator = @import("emulator.zig").Emulator;
const std = @import("std");
const sdl = @cImport({
@cInclude("SDL.h");
});
const key_mapping = [_] struct {
sdl_key: u32,
chip8_key: u8
} {
.{.sdl_key = sdl.SDLK_1, .chip8_key = 0x1},
.{.sdl_key = sdl.SDLK_2, .chip8_key = 0x2},
.{.sdl_key = sdl... | src/main.zig |
const std = @import("std");
const match = @import("path/filepath/match");
const FileInfo = @import("path/file_info").FileInfo;
const mem = std.mem;
const path = std.fs.path;
const File = std.fs.File;
const io = std.io;
const warn = std.debug.warn;
pub const Rule = struct {
patterns: std.ArrayList(Pattern),
... | src/ignore/ignore.zig |
const builtin = @import("builtin");
const std = @import("std");
const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const dlist = @import("dlist.zig");
const ListNode = dlist.ListNode;
const params = @import("params.zig");
//===========================================================================... | src/ziegfried/sblock.zig |
const std = @import("std");
const expect = std.testing.expect;
const expectEqual = std.testing.expectEqual;
const game = @import("game.zig");
const @"u32_2" = game.u32_2;
const @"u16_2" = game.u16_2;
const event = @import("event.zig");
const test_seed: u64 = 0xC0FFEE42DEADBEEF;
test "Critical path" {
const exten... | src/minesweeper/test.zig |
const unicode = @import("./src/index.zig");
const utf8 = unicode.utf8;
const warn = @import("std").debug.warn;
test "ExampleRuneLen" {
warn("\n{}\n", try utf8.runeLen('a'));
warn("{}\n", try utf8.runeLen(0x754c)); // chinese character 0x754c 界
// Test 1/1 ExampleRuneLen...
// 1
// 3
// OK
}
t... | examples.zig |
const std = @import("std");
const os = std.os;
const wayland = @import("wayland");
const wl = wayland.client.wl;
const xdg = wayland.client.xdg;
const wlr = wayland.client.zwlr;
const Surface = @import("Surface.zig");
pub const Context = struct {
running: bool,
shm: ?*wl.Shm,
compositor: ?*wl.Compositor,... | src/main.zig |
const imgui = @import("../../c.zig");
pub const c = @import("c.zig");
pub const ImNodesContext = c.ImNodesContext;
pub const ImNodesEditorContext = c.ImNodesEditorContext;
pub fn setImGuiContext(ctx: *imgui.ImGuiContext) void {
return c.imnodes_SetImGuiContext(ctx);
}
pub fn createContext() ?*c.ImNodesContext {
... | src/deps/imgui/ext/imnodes/imnodes.zig |
const std = @import("std");
const builtin = @import("builtin");
const warn = std.debug.print;
const Allocator = std.mem.Allocator;
const thread = @import("../thread.zig");
const config = @import("../config.zig");
const c = @cImport({
@cInclude("stdio.h");
@cInclude("ui.h");
});
const GUIError = error{ Init, ... | src/gui/libui.zig |
const std = @import("std");
const use_test_input = false;
const filename = if (use_test_input) "day-9_test-input" else "day-9_real-input";
const line_length = if (use_test_input) 10 else 100;
const line_count = if (use_test_input) 5 else 100;
pub fn main() !void {
std.debug.print("--- Day 9 ---\n", .{});
var... | day-9.zig |
const std = @import("std");
const builtin = @import("builtin");
const log = std.log;
const mem = std.mem;
pub usingnamespace std.c;
pub usingnamespace mach_task;
const mach_task = if (builtin.target.isDarwin()) struct {
pub const MachError = error{
/// Not enough permissions held to perform the requested ... | lib/std/os/darwin.zig |
const std = @import("std");
const Token = @import("Token.zig");
pub const Type = union(enum) {
boolean: bool,
builtin: Token.Tag,
float: f64,
func_return: *Node,
global: Token.Tag,
ident: []const u8,
int: i32,
list: []Node,
map: []Entry,
loop_break,
loop_continue,
nil,
... | src/Node.zig |
usingnamespace @import("../bits/linux.zig");
pub fn syscall_pipe(fd: *[2]i32) usize {
return asm volatile (
\\ mov %[arg], %%g3
\\ t 0x6d
\\ bcc,pt %%xcc, 1f
\\ nop
\\ # Return the error code
\\ ba 2f
\\ neg %%o0
\\1:
\\ st %%o0, [%%g3+0]
... | lib/std/os/linux/sparc64.zig |
const std = @import("std");
const mem = std.mem;
const Allocator = mem.Allocator;
const bog = @import("bog.zig");
const Node = bog.Node;
const Type = bog.Type;
/// Id's of all the bytecode instructions
pub const Op = enum(u8) {
move_double = 0x10,
copy_double = 0x11,
discard_single = 0x12,
/// res = ... | src/bytecode.zig |
const std = @import("../std.zig");
const assert = std.debug.assert;
const math = std.math;
const mem = std.mem;
const Allocator = @This();
pub const Error = error{OutOfMemory};
/// Attempt to allocate at least `len` bytes aligned to `ptr_align`.
///
/// If `len_align` is `0`, then the length returned MUST be exactly... | lib/std/mem/Allocator.zig |
const zang = @import("zang");
const common = @import("common.zig");
const c = @import("common/c.zig");
const Instrument = @import("modules.zig").HardSquareInstrument;
pub const AUDIO_FORMAT: zang.AudioFormat = .signed16_lsb;
pub const AUDIO_SAMPLE_RATE = 48000;
pub const AUDIO_BUFFER_SIZE = 1024;
pub const DESCRIPTI... | examples/example_arpeggiator.zig |
usingnamespace @import("core.zig");
const vk = @import("vulkan");
usingnamespace @import("vulkan/device.zig");
usingnamespace @import("vulkan/buffer.zig");
usingnamespace @import("vulkan/image.zig");
const ImageTransferQueue = std.ArrayList(struct {
image: Image,
staging_buffer: Buffer,
});
const BufferTransf... | src/transfer_queue.zig |
const std = @import("std");
const ecs = @import("ecs");
const Registry = @import("ecs").Registry;
const BasicGroup = @import("ecs").BasicGroup;
const OwningGroup = @import("ecs").OwningGroup;
const Velocity = struct { x: f32 = 0, y: f32 = 0 };
const Position = struct { x: f32 = 0, y: f32 = 0 };
const Empty = struct {}... | tests/groups_test.zig |
const builtin = @import("builtin");
const std = @import("std");
pub const MESSIBLE = @import("./fomu/messible.zig").MESSIBLE;
pub const REBOOT = @import("./fomu/reboot.zig").REBOOT;
pub const RGB = @import("./fomu/rgb.zig").RGB;
pub const TIMER0 = @import("./fomu/timer0.zig").TIMER0;
pub const TOUCH = @import("./fomu/... | riscv-zig-blink/src/fomu.zig |
const std = @import("std");
const print = std.debug.print;
const verbose = true;
pub fn Testcase(
comptime func: @TypeOf(std.math.exp),
comptime name: []const u8,
comptime float_type: type,
) type {
if (@typeInfo(float_type) != .Float) @compileError("Expected float type");
return struct {
... | tests/util.zig |
const builtin = @import("builtin");
const clz = @import("count0bits.zig");
const testing = @import("std").testing;
fn test__clzsi2(a: u32, expected: i32) !void {
// stage1 and stage2 diverge on function pointer semantics
switch (builtin.zig_backend) {
.stage1 => {
// Use of `var` here is wo... | lib/compiler_rt/clzsi2_test.zig |
const std = @import("std");
const expect = std.testing.expect;
/// Anchor for non-ELF kernels
pub const Anchor = packed struct {
anchor: [15]u8 = "STIVALE2 ANCHOR",
bits: u8,
phys_load_addr: u64,
phys_bss_start: u64,
phys_bss_end: u64,
phys_stivale2hdr: u64,
};
/// A tag containing a unique id... | src/stivale2.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_while.zig |
usingnamespace @import("root").preamble;
const atomic_queue = lib.containers.atomic_queue;
const guard_size = os.platform.thread.stack_guard_size;
const map_size = os.platform.thread.task_stack_size;
const total_size = guard_size + map_size;
const nonbacked = os.memory.vmm.nonbacked();
/// Separate execution unit
pub... | subprojects/flork/src/thread/task.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 ResultStream = gllparser.ResultStream;
const Literal = @import("../parser/literal... | src/combn/combinator/sequence.zig |
const std = @import("std");
const sdl = @import("sdl");
const builtin = @import("builtin");
const stdx = @import("stdx");
const ptrCastTo = stdx.mem.ptrCastTo;
const c = @cImport({
@cDefine("GL_GLEXT_PROTOTYPES", ""); // Includes glGenVertexArrays
@cInclude("GL/gl.h");
});
const IsWasm = builtin.target.isWasm... | lib/gl/gl.zig |
const std = @import("std");
const Diagnostics = @import("diagnostics.zig").Diagnostics;
pub const TokenType = enum {
const Self = @This();
number_literal,
string_literal,
character_literal,
identifier,
comment,
whitespace,
@"{",
@"}",
@"(",
@")",
@"]",
@"[",
@"... | src/library/compiler/tokenizer.zig |
const std = @import("std");
const c = @import("c.zig");
const types = @import("types.zig");
const Glyph = @import("Glyph.zig");
const Error = @import("error.zig").Error;
const intToError = @import("error.zig").intToError;
const errorToInt = @import("error.zig").errorToInt;
const Outline = @This();
handle: *c.FT_Outli... | freetype/src/Outline.zig |
const std = @import("std");
pub fn atomicFlagTestAndSet(flag: *u1) u1 {
return @atomicRmw(u1, flag, .Xchg, 1, .SeqCst);
}
pub const Semaphore = struct {
const Self = @This();
value: std.atomic.Int(i8) = std.atomic.Int(i8).init(0),
is_mutated: u1 = 0,
pub fn init() void {
.value... | Mutlithreading/semaphore.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const assert = std.debug.assert;
const testing = std.testing;
const test_suites = @import("test_cases.zig").test_suites;
const possibleValues = @import("common.zig").possibleValues;
pub fn StringFinder(comptime T: type) type {
assert(std.meta.trait.... | src/boyer_moore.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const List = std.ArrayList;
const Map = std.AutoHashMap;
const StrMap = std.StringHashMap;
const BitSet = std.DynamicBitSet;
const Str = []const u8;
const int = i64;
const util = @import("util.zig");
const gpa = util.gpa;
const target_min_x = 240;
const... | src/day17.zig |
const std = @import("std");
pub const Version = std.meta.Tuple(&[_]type{ usize, usize });
pub const CompileStep = struct {
pub const base_id = .install_dir;
const Self = @This();
step: std.build.Step,
builder: *std.build.Builder,
/// Version of the Java source
source_version: Version,
//... | jbt.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_named_arguments.zig |
const std = @import("std");
const types = @import("types.zig");
const utils = @import("utils.zig");
var is_inited: bool = false;
const cURL = @cImport({
@cInclude("curl/curl.h");
});
fn writeToBoundedArrayCallback(data: *anyopaque, size: c_uint, nmemb: c_uint, user_data: *anyopaque) callconv(.C) c_uint {
var... | src/httpclient.zig |
const std = @import("std");
const io = std.io;
const cursor = @import("cursor.zig");
const Key = union(enum) {
// unicode character
char: u21,
ctrl: u21,
alt: u21,
fun: u8,
// arrow keys
up: void,
down: void,
left: void,
right: void,
esc: void,
delete: void,
enter... | src/event.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 ArrayList = std.ArrayList;
const utils = @import("utils.zig");
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const Op = enum {
sum,
mul,
pub fn apply... | day_18/src/main.zig |