code stringlengths 38 801k | repo_path stringlengths 6 263 |
|---|---|
const std = @import("std");
const fs = std.fs;
const Image = @import("../image.zig").Image;
const upaya = @import("../upaya.zig");
const math = upaya.math;
const stb = upaya.stb;
pub const TexturePacker = struct {
pub const Size = struct {
width: u16,
height: u16,
};
pub const Sprite = str... | src/utils/texture_packer.zig |
const std = @import("std");
const unistd = @cImport(@cInclude("unistd.h"));
const Coordinate = struct {
x: f64,
y: f64,
z: f64,
fn eql(left: Coordinate, right: Coordinate) bool {
return left.x == right.x and left.y == right.y and left.z == right.z;
}
};
const TestStruct = struct {
coo... | json/test.zig |
const std = @import("std");
const debug = std.debug;
const testing = std.testing;
// taken from https://github.com/libntl/ntl/blob/main/src/ZZ.cpp
// Compute s, t, d such that aa * s + bb * t = d = gcd(a,b)
pub fn xgcd(d: *i64, s: *i64, t: *i64, aa: i64, bb: i64) void {
var u: i64 = undefined;
var v: i64 = und... | share/zig/numtheory.zig |
const wlr = @import("../wlroots.zig");
const os = @import("std").os;
const wl = @import("wayland").server.wl;
const pixman = @import("pixman");
pub const ShmAttributes = extern struct {
fd: c_int,
format: u32,
width: c_int,
height: c_int,
stride: c_int,
offset: os.off_t,
};
pub const Buffer =... | src/types/buffer.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-random-stones.zig |
const std = @import("std");
const assert = std.debug.assert;
const warn = std.debug.warn;
const mem = std.mem;
const math = std.math;
const Queue = std.atomic.Queue;
const Timer = std.os.time.Timer;
const builtin = @import("builtin");
const AtomicOrder = builtin.AtomicOrder;
const AtomicRmwOp = builtin.AtomicRmwOp;
c... | futex.zig |
const std = @import("std");
const json = @import("./zson/src/main.zig");
const mem = std.mem;
const warn = std.debug.warn;
const Channel = std.event.Channel;
const ArenaAllocator = std.heap.ArenaAllocator;
pub const json_rpc_version = "2.0";
/// JSON is an interface for encoding/decoding json values. We use ArenaAllo... | src/protocol.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const meta = std.meta;
const trait = meta.trait;
const testing = std.testing;
/// Creates a new Deserializer type for the given reader type
pub fn Deserializer(comptime ReaderType: type) type {
return struct {
const Self = @This();
//... | src/bencode.zig |
const builtin = @import("builtin");
const std = @import("std");
const mem = std.mem;
const Allocator = mem.Allocator;
const assert = std.debug.assert;
const warn = std.debug.warn;
const gl = @import("modules/zig-sdl2/src/index.zig");
const ie = @import("input_events.zig");
const wdw = @import("window.zig");
const Win... | src/main.zig |
const std = @import("std");
const mem = std.mem;
const print = std.debug.print;
const assert = std.debug.assert;
pub const CsvTokenType = enum {
field, row_end
};
pub const CsvToken = union(CsvTokenType) {
field: []const u8, row_end: void
};
pub const CsvError = error{ ShortBuffer, MisplacedQuote, NoSeparat... | src/main.zig |
const std = @import("std");
const time = std.time;
const math = @import("./math.zig");
fn print_row(stdout: anytype, f: []const u8, v: f32, t: f64) void {
stdout.print("{s: >8} {d: >5.2} {d: >5.2}s {d: >5.3}s\n", .{ f, v, t, t }) catch unreachable;
}
pub fn main() !void {
const stdout = std.io.getStdOut().writ... | src/time.zig |
const std = @import("std");
const ascii = std.ascii;
const fmt = std.fmt;
const mem = std.mem;
const io = std.io;
const assert = std.debug.assert;
const base = @import("../main.zig").base;
usingnamespace @import("common.zig");
const AllocError = mem.Allocator.Error;
pub fn create(options: RequestOptions, reader: a... | lib/hzzp/src/basic/request.zig |
const std = @import("std");
const use_test_input = false;
const filename = if (use_test_input) "day-5_test-input" else "day-5_real-input";
const edge_length = if (use_test_input) 10 else 1000;
const line_count = if (use_test_input) 10 else 500;
pub fn main() !void {
std.debug.print("--- Day 5 ---\n", .{});
v... | day-5.zig |
const std = @import("std");
const math = std.math;
const Module = @import("module.zig").Module;
const Range = @import("common.zig").Range;
const Validator = @import("validator.zig").Validator;
const ValueType = @import("common.zig").ValueType;
const LocalType = @import("common.zig").LocalType;
const ArrayList = std.Arr... | src/instruction.zig |
const std = @import("std");
const headless = @import("headless.zig");
const glfw = @import("glfw.zig");
const drm = @import("drm.zig");
const HeadlessBackend = @import("headless.zig").HeadlessBackend;
const HeadlessOutput = @import("headless.zig").HeadlessOutput;
const GLFWBackend = @import("glfw.zig").GLFWBackend;
con... | src/backend/backend.zig |
pub const HeaderValue = struct {
const Error = error{
Invalid,
};
pub fn parse(value: []const u8) Error![]const u8 {
if (value.len == 0) {
return error.Invalid;
}
for (value) |char| {
if (!HEADER_VALUE_MAP[char]) {
return error.Invali... | src/headers/value.zig |
const std = @import("std");
const jpeg = @import("jpeg_writer.zig");
const multi_threaded = true;
const width = 1024;
const height = 768;
const fov: f32 = std.math.pi / 3.0;
const out_filename = "out.jpg";
const out_quality = 100;
fn vec3(x: f32, y: f32, z: f32) Vec3f {
return Vec3f{ .x = x, .y = y, .z = z };
}... | raytrace.zig |
const std = @import("std");
const maxInt = std.math.maxInt;
const log = std.debug.warn;
const c = @import("c.zig");
const gw = c.gw;
const gmp = c.gmp;
const glue = @import("glue.zig");
pub fn create_gwhandle(ctx: *gw.gwhandle, threads: u8, k: u32, n: u32) void {
gw.gwinit2(ctx, @sizeOf(gw.gwhandle), gw.GWNUM_VE... | helper.zig |
const aoc = @import("../aoc.zig");
const std = @import("std");
const Ship = struct {
const Instruction = struct {
action: u8,
value: isize,
};
ship_coord: aoc.Coord2D = aoc.Coord2D.init(.{0, 0}),
waypoint_coord: aoc.Coord2D,
target_ship: bool,
fn init(waypoint_x: isize, waypoi... | src/main/zig/2020/day12.zig |
const BufferUsage = @import("enums.zig").BufferUsage;
const Buffer = @This();
/// The type erased pointer to the Buffer implementation
/// Equal to c.WGPUBuffer for NativeInstance.
ptr: *anyopaque,
vtable: *const VTable,
pub const VTable = struct {
reference: fn (ptr: *anyopaque) void,
release: fn (ptr: *any... | gpu/src/Buffer.zig |
const std = @import("std");
const interpret = @import("interpret.zig");
const LispExpr = interpret.LispExpr;
const LispInterpreter = interpret.LispInterpreter;
pub const LispToken = struct {
id: Id,
start: usize,
end: usize,
pub const Id = enum {
identifier,
string_literal,
int... | src/parse.zig |
const std = @import("std");
const testing = std.testing;
const Timer = std.time.Timer;
const log = std.log.scoped(.bench);
const words = @embedFile("testdata/words.txt");
const gpa = testing.allocator;
pub fn main() !void {
comptime var radix = @import("main.zig").StringRadixTree(u32){};
comptime {
@s... | src/bench.zig |
const std = @import("std");
const meta = std.meta;
const trait = meta.trait;
const max = std.math.maxInt;
const assert = std.debug.assert;
/// Supported types to be serialized
const Format = enum(u8) {
fixint_base = 0x00,
fixint_max = 0x7F,
fixmap_base = 0x80,
fixmap_max = 0x8F,
fixarray_base = 0x9... | src/main.zig |
const std = @import("std");
const builtin = @import("builtin");
const panic = std.debug.panic;
const Allocator = std.mem.Allocator;
const cwd = std.fs.cwd;
const OpenFlags = std.fs.File.OpenFlags;
const glm = @import("glm.zig");
const Mat4 = glm.Mat4;
const Vec3 = glm.Vec3;
usingnamespace @import("c.zig");
pub const... | src/shader.zig |
const std = @import("std");
const assert = std.debug.assert;
/// An intrusive first in/first out linked list.
/// The element type T must have a field called "next" of type ?*T
pub fn FIFO(comptime T: type) type {
return struct {
const Self = @This();
in: ?*T = null,
out: ?*T = null,
... | src/fifo.zig |
const std = @import("std");
const warn = std.debug.warn;
pub const CommandType = enum(u8) {
PASS,
NICK,
USER,
SERVER,
OPER,
QUIT,
SQUIT,
JOIN,
PART,
MODE,
TOPIC,
NAMES,
LIST,
INVITE,
KICK,
VERSION,
STATS,
LINKS,
TIME,
CONNECT,
TRACE,
... | src/message.zig |
const std = @import("std");
const time = std.time;
const Window = @import("window_sdl.zig").Window;
const irom = @import("rom.zig");
const immu = @import("mmu.zig");
const icpu = @import("cpu.zig");
const igpu = @import("gpu.zig");
const imbc = @import("mbc.zig");
pub const Gb = struct {
mem: [0x10000]u8,
win... | src/gameboy.zig |
const std = @import("std");
const c = @import("c.zig");
const Mat4 = @import("math3d.zig").Mat4;
const Vec3 = @import("math3d.zig").Vec3;
const glsl = @cImport({
@cInclude("sokol/sokol_gfx.h");
@cInclude("shaders/instancing.glsl.h");
});
const rand = @import("std").rand;
const SampleCount = 4;
const NumParticl... | src/example_instancing.zig |
const zervo = @import("zervo");
const std = @import("std");
const ssl = @import("ssl");
const RenderContext = zervo.renderer.RenderContext(GraphicsBackend);
const imr = zervo.markups.imr;
const os = std.os;
const net = std.net;
const warn = std.debug.warn;
const Allocator = std.mem.Allocator;
const zgt = @import("zgt.... | src/main.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/day03.txt");
p... | src/day03.zig |
const builtin = @import("builtin");
const std = @import("std");
const is_nvptx = builtin.cpu.arch == .nvptx64;
const CallingConvention = @import("std").builtin.CallingConvention;
const PtxKernel = if (is_nvptx) CallingConvention.PtxKernel else CallingConvention.Unspecified;
const cu = @import("cudaz").cu;
// stage2 s... | CS344/src/hw2_pure_kernel.zig |
const std = @import("std");
const c_allocator = std.heap.c_allocator;
const StringHashMap = std.StringHashMap;
// For dynamic files
// const GenerateFileError = error{ OutOfMemory, GenericError };
// pub const callback_generate_file = fn (uid: u32, url: []const u8) GenerateFileError![]const u8;
// pub const callback_d... | src/Files.zig |
const std = @import("std");
const root = @import("root");
/// Queues a build job for the C code of Wasm3.
/// This builds a static library that depends on libc, so make sure to link that into your exe!
pub fn compile(b: *std.build.Builder, mode: std.builtin.Mode, target: std.zig.CrossTarget, wasm3_root: []const u8) *s... | submod_build_plugin.zig |
pub fn isBasicLatin(cp: u21) bool {
if (cp < 0x0 or cp > 0x7f) return false;
return switch (cp) {
0x0...0x7f => true,
else => false,
};
}
pub fn isLatin1Supplement(cp: u21) bool {
if (cp < 0x80 or cp > 0xff) return false;
return switch (cp) {
0x80...0xff => true,
... | .gyro/ziglyph-jecolon-github.com-c37d93b6/pkg/src/autogen/blocks.zig |
const std = @import("std");
const prot = @import("../protocols.zig");
const clients = @import("../client.zig");
const windows = @import("../window.zig");
const regions = @import("../region.zig");
const views = @import("../view.zig");
const Context = @import("../client.zig").Context;
const Object = @import("../client.zi... | src/implementations/fw_control.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const assert = std.debug.assert;
const testing = std.testing;
const mustache = @import("../mustache.zig");
const TemplateOptions = mustache.options.TemplateOptions;
const parsing = @import("parsing.zig");
pub fn Trimmer(comptime TextScanner: type, com... | src/parsing/trimmer.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const ArenaAllocator = std.heap.ArenaAllocator;
const assert = std.debug.assert;
const testing = std.testing;
const mustache = @import("../mustache.zig");
const TemplateOptions = mustache.options.TemplateOptions;
pub fn RefCountedSlice(comptime options... | src/parsing/ref_counter.zig |
const Lock = @This();
const std = @import("std");
const builtin = @import("builtin");
const assert = std.debug.assert;
const log = std.log;
const mem = std.mem;
const os = std.os;
const wayland = @import("wayland");
const wl = wayland.client.wl;
const wp = wayland.client.wp;
const ext = wayland.client.ext;
const xkb... | src/Lock.zig |
//--------------------------------------------------------------------------------
// Section: Types (3)
//--------------------------------------------------------------------------------
pub const GRAPHICS_EFFECT_PROPERTY_MAPPING = enum(i32) {
UNKNOWN = 0,
DIRECT = 1,
VECTORX = 2,
VECTORY = 3,
VEC... | win32/system/win_rt/graphics/direct2d.zig |
const std = @import("std");
const snowFlake = struct {
startTime: u64,
lastvalue: u64=0,
const Self = @This();
const worker_mask = 0x3ff;
pub fn init(startTime: u64, workerId: u64) Self {
var v :Self = .{.startTime = startTime, .lastvalue = workerId <<12};
return v;
... | snowFlake.zig |
pub const RELEASE = 0;
pub const PRESS = 1;
pub const REPEAT = 2;
pub const MOUSE_BUTTON_1 = 0;
pub const MOUSE_BUTTON_2 = 1;
pub const MOUSE_BUTTON_3 = 2;
pub const MOUSE_BUTTON_4 = 3;
pub const MOUSE_BUTTON_5 = 4;
pub const MOUSE_BUTTON_6 = 5;
pub const MOUSE_BUTTON_7 = 6;
pub const MOUSE_BUTTON_8 = 7;
pub const MO... | src/WindowGraphicsInput/Constants.zig |
pub const Location = enum {
Escape,
F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12,
F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24,
LeftOf1,
// Number key row, 123...0
NumberKey1, NumberKey2, NumberKey3, NumberKey4, NumberKey5, NumberKey6, NumberKey7, NumberKey8, NumberKey9, NumberKey0,
Rig... | src/drivers/hid/keyboard_keys.zig |
const platform = @import("platform.zig");
const mem = @import("std").mem;
const gdt = @import("gdt.zig");
const interrupts = @import("interrupts.zig");
const isr = @import("isr.zig");
const serial = @import("../../debug/serial.zig");
pub const IDTFlags = struct {
gate_type: u4,
storage_segment: u1,
privile... | src/kernel/arch/x86/idt.zig |
const std = @import("std");
const print = std.debug.print;
const List = std.ArrayList;
const util = @import("util.zig");
const gpa = util.gpa;
const data = @embedFile("../data/day15.txt");
const asc = std.sort.asc(usize);
const Pos = struct {
x: usize,
y: usize,
density: u8,
risk: ?u32 = null,
p... | 2021/src/day15.zig |
const std = @import("std");
const fun = @import("fun");
const debug = std.debug;
const heap = std.heap;
const io = std.io;
const math = std.math;
const mem = std.mem;
const os = std.os;
const scan = fun.scan.scan;
pub fn main() !void {
const stdin = &(try io.getStdIn()).inStream().stream;
const stdout = &(tr... | src/day6.zig |
const std = @import("std");
const os = std.os;
const Builder = std.build.Builder;
const Target = std.Target;
const CrossTarget = std.zig.CrossTarget;
const LibExeObjStep = std.build.LibExeObjStep;
const FileSource = std.build.FileSource;
const builtin = @import("builtin");
const cflags = .{
"-std=c11",
//"-ped... | build.zig |
const std = @import("std");
const Builder = std.build.Builder;
const LibExeObjStep = std.build.LibExeObjStep;
const Pkg = std.build.Pkg;
const CrossTarget = std.zig.CrossTarget;
const Mode = std.builtin.Mode;
const KC85Model = enum {
KC85_2,
KC85_3,
KC85_4,
};
pub fn build(b: *Builder) void {
const ta... | build.zig |
const sokol = @import("sokol");
const sg = sokol.gfx;
const sapp = sokol.app;
const sgapp = sokol.app_gfx_glue;
const shd = @import("shaders/shaders.glsl.zig");
const KC85DisplayWidth = 320;
const KC85DisplayHeight = 256;
const KC85NumPixels = KC85DisplayWidth * KC85DisplayHeight;
const BorderWidth = 10;
const ... | src/host/gfx.zig |
const std = @import("../std.zig");
const builtin = @import("builtin");
pub const syscall_bits = switch (builtin.stage2_arch) {
.x86_64 => @import("plan9/x86_64.zig"),
else => @compileError("more plan9 syscall implementations (needs more inline asm in stage2"),
};
pub const SYS = enum(usize) {
SYSR1 = 0,
... | lib/std/os/plan9.zig |
const std = @import("std.zig");
const debug = std.debug;
const assert = debug.assert;
const testing = std.testing;
const mem = std.mem;
const maxInt = std.math.maxInt;
pub const WriteStream = @import("json/write_stream.zig").WriteStream;
pub const writeStream = @import("json/write_stream.zig").writeStream;
const Str... | lib/std/json.zig |
const builtin = @import("builtin");
test {
_ = @import("behavior/align.zig");
_ = @import("behavior/alignof.zig");
_ = @import("behavior/array.zig");
_ = @import("behavior/bit_shifting.zig");
_ = @import("behavior/bool.zig");
_ = @import("behavior/bugs/394.zig");
_ = @import("behavior/bugs/... | test/behavior.zig |
const std = @import("std");
const builtin = std.builtin;
const debug = std.debug;
const warn = debug.warn;
const build = std.build;
const CrossTarget = std.zig.CrossTarget;
const io = std.io;
const fs = std.fs;
const mem = std.mem;
const fmt = std.fmt;
const ArrayList = std.ArrayList;
const Mode = builtin.Mode;
const L... | test/tests.zig |
const std = @import("std");
const math = std.math;
const mem = std.mem;
const Allocator = mem.Allocator;
const debug = std.debug;
const assert = debug.assert;
const testing = std.testing;
pub const LinearFifoBufferType = union(enum) {
/// The buffer is internal to the fifo; it is of the specified size.
Static... | lib/std/fifo.zig |
const std = @import("std");
const mem = std.mem;
const builtin = @import("builtin");
const Target = @import("target.zig").Target;
const Compilation = @import("compilation.zig").Compilation;
const introspect = @import("introspect.zig");
const assertOrPanic = std.debug.assertOrPanic;
const errmsg = @import("errmsg.zig");... | src-self-hosted/test.zig |
const std = @import("std");
const c = @import("c.zig");
const types = @import("types.zig");
const Glyph = @import("Glyph.zig");
const Outline = @import("Outline.zig");
const Bitmap = @import("Bitmap.zig");
const Error = @import("error.zig").Error;
const intToError = @import("error.zig").intToError;
const GlyphSlot = @... | freetype/src/GlyphSlot.zig |
const std = @import("std.zig");
const builtin = @import("builtin");
pub const SpinLock = struct {
state: State,
const State = enum(u8) {
Unlocked,
Locked,
};
pub const Held = struct {
spinlock: *SpinLock,
pub fn release(self: Held) void {
@atomicStore(Stat... | lib/std/spinlock.zig |
/// combiningClass maps the code point to its combining class value.
pub fn combiningClass(cp: u21) u8 {
return switch (cp) {
0x334...0x338 => 1,
0x1CD4 => 1,
0x1CE2...0x1CE8 => 1,
0x20D2...0x20D3 => 1,
0x20D8...0x20DA => 1,
0x20E5...0x20E6 => 1,
0x20EA...0x2... | src/components/autogen/CombiningMap.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;
//;
// TODO
// check if graph has a node/edge at idx or not
// debug.assert indices are in bounds
// node and edge iterators
pub const NodeIndex = usize;
pub const EdgeIndex = usize;
pub const Direction = enum(us... | src/graph.zig |
const builtin = @import("builtin");
const std = @import("std");
const mem = std.mem;
const print = std.debug.print;
const fs = std.fs;
const ChildProcess = std.ChildProcess;
const process = std.process;
const render_utils = @import("render_utils.zig");
pub const TestCommand = struct {
name: ?[]const u8 = null,
... | src/doctest/test.zig |
const std = @import("std");
const List = std.ArrayList;
const util = @import("util.zig");
const gpa = util.gpa;
const tokenize = std.mem.tokenize;
const parseInt = std.fmt.parseInt;
const print = std.debug.print;
const assert = std.debug.assert;
const data = @embedFile("../data/day03.txt");
const inputType = u12;
co... | src/day03.zig |
const std = @import("std");
const io = std.io;
const math = std.math;
const mem = std.mem;
const testing = std.testing;
fn testBfMethod(comptime method: anytype, comptime program: []const u8, result: []const u8) !void {
var in = [_]u8{0} ** 1024;
var out = [_]u8{0} ** 1024;
var tape = [_]u8{0} ** 1024;
... | bf.zig |
//! Xoroshiro128+ - http://xoroshiro.di.unimi.it/
//!
//! PRNG
const std = @import("std");
const Random = std.rand.Random;
const math = std.math;
const Xoroshiro128 = @This();
random: Random,
s: [2]u64,
pub fn init(init_s: u64) Xoroshiro128 {
var x = Xoroshiro128{
.random = Random{ .fillFn = fill },
... | lib/std/rand/Xoroshiro128.zig |
const std = @import("std");
const main = @import("main.zig");
const builtin = std.builtin;
const executeLine = main.executeLine;
const shigError = main.shigError;
const BuiltinType = enum {
cd,
@"export",
exit,
type,
};
fn builtinCd(ally: *std.mem.Allocator, argv: [][]const u8) !void {
const stdou... | src/builtins.zig |
const c = @import("c.zig");
const utils = @import("utils.zig");
/// Error set
pub const Error = error{ InvalidBinding, NoEmptyBinding };
/// Input info
pub const Info = struct {
/// States
pub const State = enum {
none = 0, pressed, down, released
};
/// For managing key / button states
... | src/kiragine/kira/input.zig |
// This is an implementation of the default "tiled" layout of dwm and the
// 3 other orientations thereof. This code is written for the main stack
// to the left and then the input/output values are adjusted to apply
// the necessary transformations to derive the other orientations.
//
// With 4 views and one main on... | source/river-0.1.0/rivertile/main.zig |
const std = @import("std");
const testing = std.testing;
const print = std.debug.print;
const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;
const input = @embedFile("./input.txt");
pub fn main() anyerror!void {
print("--- Part One ---\n", .{});
print("Result: {d}\n", .{part1()});
print(... | src/day03/day03.zig |
const std = @import("std");
const zt = @import("zt");
const sling = @import("sling.zig");
const ig = @import("imgui");
const menu = @import("editor/menu.zig");
const console = @import("editor/console.zig");
var demoOpen: bool = false;
pub fn editorUI() void {
controls();
menu.update();
if (sling.scene) |... | src/editor.zig |
const std = @import("std");
const c_args = [_][]const u8{
"-D_MSC_VER",
"-std=c11",
"-fno-sanitize=undefined",
};
const cpp_args = [_][]const u8{
"-std=c++17",
"-fno-sanitize=undefined",
};
pub fn build(b: *std.build.Builder) void {
// Standard target options allows the person running `zig bu... | build.zig |
pub const c = @cImport({
@cInclude("zig_wwise.h");
});
const std = @import("std");
const builtin = @import("builtin");
const FixedBufferAllocator = std.heap.FixedBufferAllocator;
pub const Wwise = struct {
pub const AkCallbackFunction = c.ZigAkCallbackFunc;
pub const AkCallbackInfo = c.ZigAkCallbackInfo;
... | src/wwise.zig |
const std = @import("std");
pub const Format = enum(u8) {
rgb = 3,
rgba = 4,
};
pub const Colorspace = enum(u8) {
srgb = 0,
linear = 1,
};
pub const Image = struct {
width: u32,
height: u32,
data: []const u8,
format: Format = .rgba,
colorspace: Colorspace = .srgb,
};
const Result... | src/qoi.zig |
const std = @import("std");
const mem = std.mem;
const heap = std.heap;
const giz = @import("./giz.zig");
pub fn main() !void {
const stdout = std.io.getStdOut();
const w = stdout.writer();
var giz_config: giz.config.Config = giz.config.default();
// TODO Check if this config is working and ansi es... | src/main.zig |
pub const CVT_SECONDS = @as(u32, 1);
//--------------------------------------------------------------------------------
// Section: Types (105)
//--------------------------------------------------------------------------------
pub const TOKEN_PRIVILEGES_ATTRIBUTES = enum(u32) {
ENABLED = 2,
ENABLED_BY_DEFAULT ... | win32/security.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const Bus = @import("../bus.zig").Bus;
const Cart = @import("../cart.zig").Cart;
const DEBUG_INST_TABLE = @import("ops.zig").DEBUG_INST_TABLE;
const INST_TABLE = @import("ops.zig").INST_TABLE;
const Reg = @import("regs.zig").Reg;
const Vip = @import("../... | src/cpu/cpu.zig |
const std = @import("std");
const testing = std.testing;
const c = @import("c.zig").c;
const Error = @import("errors.zig").Error;
const getError = @import("errors.zig").getError;
const Image = @import("Image.zig");
const Cursor = @This();
ptr: *c.GLFWcursor,
// Standard system cursor shapes.
const Shape = enum(isi... | mach-glfw/src/Cursor.zig |
const std = @import("std");
const io = @import("io.zig");
const fprint = @import("fprint.zig");
pub const Log = struct {
const Self = @This();
const tab = " ";
const marker = " - ";
file: ?*io.File,
indent: usize = 0,
parent: ?*const Self = null,
enabled: bool = true,
pub fn child(s... | kernel/log.zig |
const std = @import("std");
const expect = std.testing.expect;
const mem = std.mem;
const Tag = std.meta.Tag;
test "enum value allocation" {
const LargeEnum = enum(u32) {
A0 = 0x80000000,
A1,
A2,
};
try expect(@enumToInt(LargeEnum.A0) == 0x80000000);
try expect(@enumToInt(Large... | test/behavior/enum_stage1.zig |
const std = @import("std");
const net = std.net;
const os = std.os;
const io = std.io;
const Allocator = std.mem.Allocator;
const resolv = @import("resolvconf.zig");
const main = @import("main.zig");
const dns = @import("dns");
const rdata = dns.rdata;
const DNSPacket = dns.Packet;
const DNSPacketRCode = dns.DNSPack... | src/proto.zig |
const std = @import("std");
const rng = @import("../common/rng.zig");
const options = @import("../common/options.zig");
const gen1 = @import("../gen1/data.zig");
const items = @import("data/items.zig");
const moves = @import("data/moves.zig");
const species = @import("data/species.zig");
const types = @import("data/t... | src/lib/gen2/data.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/frame.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 upaya = @import("upaya");
usingnamespace @import("imgui");
pub var ui_tint: ImVec4 = upaya.colors.rgbaToVec4(135, 45, 176, 255);
pub var object: ImU32 = 0;
pub var object_selected: ImU32 = 0;
pub var object_drag_link: ImU32 = 0;
pub var object_link: ImU32 = 0;
pub var white: ImU32 =... | editor/colors.zig |
const X = @import("X.zig");
pub usingnamespace X;
const wchar_t = c_int;
pub const FreeFuncType = ?fn ([*c]Display) callconv(.C) void;
pub const FreeModmapType = ?fn ([*c]XModifierKeymap) callconv(.C) c_int;
pub const struct__XSQEvent = extern struct {
next: [*c]struct__XSQEvent,
event: XEvent,
qserial_n... | modules/platform/src/linux/X11/Xlib.zig |
const std = @import("std");
const assert = std.debug.assert;
const testing = std.testing;
pub const IndentationQueue = struct {
const Self = @This();
pub const Null = struct {
pub inline fn isEmpty(self: @This()) bool {
_ = self;
return true;
}
};
pub const No... | src/rendering/indent.zig |
pub const c = @cImport(@cInclude("upnp/ixml.h"));
const std = @import("std");
const xml = @import("lib.zig");
const ArenaAllocator = std.heap.ArenaAllocator;
const logger = std.log.scoped(.@"xml");
fn AbstractNode(comptime NodeType: type) type {
return struct {
/// Get all child nodes.
pub fn getC... | src/xml.zig |
const std = @import("std");
const parse = @import("parse.zig");
const LispToken = parse.LispToken;
const LispTokenizer = parse.LispTokenizer;
const LispParser = parse.LispParser;
const interpret = @import("interpret.zig");
const LispExpr = interpret.LispExpr;
const LispInterpreter = interpret.LispInterpreter;
const ... | src/main.zig |
//--------------------------------------------------------------------------------
// Section: Types (24)
//--------------------------------------------------------------------------------
const CLSID_CEventSystem_Value = Guid.initString("4e14fba2-2e22-11d1-9964-00c04fbbb345");
pub const CLSID_CEventSystem = &CLSID_CE... | win32/system/com/events.zig |
const std = @import("std");
const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const Rng = std.rand.DefaultPrng;
fn choose(xs: anytype, rand: std.rand.Random) @TypeOf(&xs[0]) {
assert(xs.len > 0);
return &xs[rand.uintLessThan(usize, xs.len)];
}
const WorldHash = struct {
state: u64 = 0x... | src/World.zig |
usingnamespace @import("zig-pdcurses.zig");
// Special characters that are a pain to use programatically any other way
pub const lrcorner:AttrChar = c.ACS_LRCORNER;
pub const urcorner:AttrChar = c.ACS_URCORNER;
pub const ulcorner:AttrChar = c.ACS_ULCORNER;
pub const llcorner:AttrChar = c.ACS_LLCORNER;
pub const plus:... | src/chars.zig |
const Builder = @import("std").build.Builder;
const Step = @import("std").build.Step;
const mem = @import("std").mem;
const fs = @import("std").fs;
const debug = @import("std").debug;
pub fn build(b: *Builder) void {
const mode = b.standardReleaseOptions();
const tracy = b.option([]const u8, "tracy", "Enable ... | build.zig |
/// montecarlo.zig
/// Module to perform some Monte-Carlo simulations in Zig
///
const std = @import("std");
/// result statistic for Monte-Carlo simulations
const Result = struct { success: usize, failed: usize };
/// type of generator for a stimulus of type T of a Monte-Carlo run
fn Generator(comptime T: type) typ... | Zig/benchmark/src/montecarlo.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/day01.txt");
p... | src/day01.zig |
const std = @import("std");
const assert = std.debug.assert;
const crypto = std.crypto;
const fmt = std.fmt;
const mem = std.mem;
const AesBlock = std.crypto.core.aes.Block;
const AuthenticationError = std.crypto.errors.AuthenticationError;
const State = struct {
blocks: [8]AesBlock,
const rounds = 20;
f... | src/main.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");
/// A refspec specifies the mapping between remote and local reference names when fetch or pushing.
pub const Refspec = opaque {
///... | src/refspec.zig |
const std = @import("std");
const pc_keyboard = @import("../../pc_keyboard.zig");
pub const EXTENDED_KEY_CODE: u8 = 0xE0;
pub const KEY_RELEASE_CODE: u8 = 0xF0;
/// Implements state logic for scancode set 1
///
/// Start:
/// E0 => Extended
/// >= 0x80 => Key Up
/// <= 0x7F => Key Down
///
/// Extended:
/// >= 0x80 =... | src/keycode/scancodes/scancode_set1.zig |
const AstGen = @This();
const std = @import("std");
const ast = std.zig.ast;
const mem = std.mem;
const Allocator = std.mem.Allocator;
const assert = std.debug.assert;
const ArrayListUnmanaged = std.ArrayListUnmanaged;
const Zir = @import("Zir.zig");
const trace = @import("tracy.zig").trace;
const BuiltinFn = @import... | src/AstGen.zig |
const std = @import("../std.zig");
const testing = std.testing;
const builtin = std.builtin;
const fs = std.fs;
const mem = std.mem;
const wasi = std.os.wasi;
const ArenaAllocator = std.heap.ArenaAllocator;
const Dir = std.fs.Dir;
const File = std.fs.File;
const tmpDir = testing.tmpDir;
test "Dir.readLink" {
var ... | lib/std/fs/test.zig |
const std = @import("../std.zig");
const assert = std.debug.assert;
const maxInt = std.math.maxInt;
const State = enum {
Complete,
Value,
ArrayStart,
Array,
ObjectStart,
Object,
};
/// Writes JSON ([RFC8259](https://tools.ietf.org/html/rfc8259)) formatted data
/// to a stream. `max_depth` is a... | lib/std/json/write_stream.zig |
const std = @import("std");
const builtin = @import("builtin");
/// Discord utilizes Twitter's snowflake format for uniquely identifiable
/// descriptors (IDs). These IDs are guaranteed to be unique across all of
/// Discord, except in some unique scenarios in which child objects share their
/// parent's ID. Because S... | src/discord.zig |
pub const limine_uuid = extern struct {
a: u32,
b: u16,
c: u16,
d: [8]u8,
};
pub const limine_file = extern struct {
revision: u64,
address: ?*anyopaque,
size: u64,
path: [*c]u8,
cmdline: [*c]u8,
media_type: u32,
unused: u32,
tftp_ip: u32,
tftp_port: u32,
partiti... | src/kernel/arch/x86_64/limine/limine.zig |
const std = @import("std");
const debug = std.debug;
const testing = std.testing;
/// A tuple implementation structured as a tree of `first+second` pairs.
pub fn Tuple(comptime types: []const type) type {
const Functions = struct {
fn At(comptime T: type, comptime i: usize) type {
var info = @... | tuple.zig |