code stringlengths 38 801k | repo_path stringlengths 6 263 |
|---|---|
const std = @import("std");
const Allocator = std.mem.Allocator;
const vk = @import("../include/vk.zig");
const glfw = @import("../include/glfw.zig");
const windowing = @import("../windowing.zig");
const shader = @import("shader.zig");
const BackendError = @import("backend.zig").BackendError;
const enableValidation... | render/src/backend/context.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const expect = std.testing.expect;
const expectEqual = std.testing.expectEqual;
const expectEqualSlices = std.testing.expectEqualSlices;
const expectEqualStrings = std.testing.expectEqualStrings;
const panic = std.debug.panic;
const assert = std.debug.ass... | src/list.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/text.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/param.zig |
pub fn isMath(cp: u21) bool {
if (cp < 0x2b or cp > 0x1eef1) return false;
return switch (cp) {
0x2b => true,
0x3c...0x3e => true,
0x5e => true,
0x7c => true,
0x7e => true,
0xac => true,
0xb1 => true,
0xd7 => true,
0xf7 => true,
0... | .gyro/ziglyph-jecolon-github.com-c37d93b6/pkg/src/autogen/derived_core_properties.zig |
const combn = @import("../combn/combn.zig");
const Result = combn.gllparser.Result;
const Parser = combn.gllparser.Parser;
const Error = combn.gllparser.Error;
const Context = combn.gllparser.Context;
const PosKey = combn.gllparser.PosKey;
const ParserPath = combn.gllparser.ParserPath;
const Sequence = combn.combinator... | src/dsl/grammar.zig |
const std = @import("std");
const stdx = @import("stdx");
const log = stdx.log.scoped(.graphics_test);
const graphics = @import("../../graphics.zig");
const Glyph = graphics.gpu.Glyph;
const Tessellator = graphics.tessellator.Tessellator;
pub const Graphics = struct {
const Self = @This();
default_font_id: g... | graphics/src/backend/test/graphics.zig |
const std = @import("std");
const stdx = @import("stdx");
const graphics = @import("graphics");
const Color = graphics.Color;
const platform = @import("platform");
const ui = @import("../ui.zig");
const Sized = ui.widgets.Sized;
const ScrollList = ui.widgets.ScrollList;
const Text = ui.widgets.Text;
const Row = ui.wid... | ui/src/widgets/file_dialog.zig |
const std = @import("std");
const utility = @import("utility.zig");
// Import modules to reduce file size
usingnamespace @import("ir.zig");
usingnamespace @import("compile-unit.zig");
/// A struct that allows decoding data from LoLa IR code.
pub const Decoder = struct {
const Self = @This();
data: []const u... | src/library/common/decoder.zig |
const Intcode = @import("aoc").aoc2019.Intcode;
const std = @import("std");
test "addition multiplication 1" {
var intcode = try Intcode.init(std.testing.allocator, "1,9,10,3,2,3,11,0,99,30,40,50");
defer intcode.deinit();
_ = try intcode.run();
std.testing.expectEqual(intcode.getMemory(0), 3500);
... | src/test/zig/test_intcode.zig |
const std = @import("std");
const mem = std.mem;
// A simplified hash
pub const Hash = u32;
// A counter to disrupt flash operations. This is loaned to each
// flash device so that the counts are shared across multiple
// partitions/devices.
pub const Counter = struct {
const Self = @This();
// The number ... | nswap/src/flash.zig |
const std = @import("std");
const testing = std.testing;
const darts = @import("darts.zig");
test "missed target" {
const coordinate = comptime darts.Coordinate.init(-9.0, 9.0);
const expected = 0;
const actual = comptime coordinate.score();
comptime testing.expectEqual(expected, actual);
}
test "on ... | exercises/practice/darts/test_darts.zig |
const std = @import("std");
const example_input = @embedFile("./example_input.txt");
const puzzle_input = @embedFile("./puzzle_input.txt");
pub fn main() !void {
std.debug.print("--- Part One ---\n", .{});
std.debug.print("Result: {d}\n", .{part1(puzzle_input)});
std.debug.print("--- Part Two ---\n", .{})... | src/day08/day08.zig |
const std = @import("std");
const simd = @import("simd.zig");
const Allocator = std.mem.Allocator;
const testing = std.testing;
pub const Cookies = struct {
pub const Cookie = struct {
key: []const u8,
value: []const u8,
};
pub const List = std.ArrayList(Cookie);
cookies: List,
par... | packages/zhp/src/cookies.zig |
const std = @import("std");
const ast = std.zig.ast;
const mem = std.mem;
/// Gets a declaration's doc comments, caller must free memory when a value is returned
/// Like:
///```zig
///var comments = getFunctionDocComments(allocator, tree, func);
///defer if (comments) |comments_pointer| allocator.free(comments_point... | src/utils.zig |
const std = @import("std");
const dbgLog_ = @import("Log.zig").dbgLog;
const startsWith = std.mem.startsWith;
const eql = std.mem.eql;
const parse = @import("Parse.zig");
pub fn dbgLog(comptime s: []const u8, args: var) void {
dbgLog_("HTTPS: " ++ s, args);
}
pub const RequestType = enum(u32) {
OPTIONS, GET, ... | src/HTTPMessageParser.zig |
const std = @import("std");
const print = std.debug.print;
const util = @import("util.zig");
const gpa = util.gpa;
const data = @embedFile("../data/day10.txt");
pub fn main() !void {
var timer = try std.time.Timer.start();
var lines = std.mem.tokenize(data, "\r\n");
var chunks = std.ArrayList(u8).init(gpa);
... | src/day10.zig |
usingnamespace @import("root").preamble;
const platform = os.platform;
const libalign = lib.util.libalign;
const range = lib.util.range.range;
const rangeReverse = lib.util.range.rangeReverse;
const pmm = os.memory.pmm;
const Context = *platform.paging.PagingContext;
const MapError = error{
AlreadyPresent,
O... | subprojects/flork/src/memory/paging.zig |
const std = @import("std");
const json = std.json;
const mem = std.mem;
const zfetch = @import("zfetch");
const Host = @import("hosts.zig").Host;
const AyArgparse = @import("ay-arg");
pub fn printVersion(writer: anytype) !void {
try writer.writeAll("scafetch v0.2\n");
}
pub fn printHelp(writer: anytype) !void {
... | src/main.zig |
pub const TSF_Hardware = @as(u32, 1);
pub const TSF_Authenticated = @as(u32, 2);
pub const TSF_IPv6 = @as(u32, 4);
pub const TSF_SignatureAuthenticated = @as(u32, 8);
//--------------------------------------------------------------------------------
// Section: Types (2)
//---------------------------------------------... | win32/system/time.zig |
pub const BT_PORT_MIN = @as(u32, 1);
pub const BT_PORT_MAX = @as(u32, 65535);
pub const BT_PORT_DYN_FIRST = @as(u32, 4097);
pub const AF_BTH = @as(u16, 32);
pub const NS_BTH = @as(u32, 16);
pub const SVCID_BTH_PROVIDER = Guid.initString("06aa63e0-7d60-41ff-afb2-3ee6d2d9392d");
pub const BTH_ADDR_STRING_SIZE = @as(u32, ... | deps/zigwin32/win32/devices/bluetooth.zig |
const std = @import("std");
const mem = std.mem;
const unicode = std.unicode;
/// `caseFoldStr` will caseFold the code points in str, producing a slice of u8 with the new bytes.
/// Caller must free returned bytes.
pub fn caseFoldStr(allocator: *mem.Allocator, str: []const u8) ![]u8 {
var result = std.ArrayList(u... | .gyro/ziglyph-jecolon-github.com-c37d93b6/pkg/src/autogen/case_folding.zig |
const std = @import("std");
const time = std.time;
const Allocator = std.mem.Allocator;
const bindings = @import("bindings.zig");
const c = bindings.c;
const Sdl = bindings.Sdl;
const Gl = bindings.Gl;
const BasicContext = @import("basic_video.zig").BasicContext;
const PixelBuffer = @import("basic_video.zig").PixelBu... | src/sdl/context.zig |
const std = @import("std");
const utils = @import("utils");
const Allocator = std.mem.Allocator;
const ArenaAllocator = std.heap.ArenaAllocator;
const print = utils.print;
fn readInput(arena: *ArenaAllocator, lines_it: *utils.FileLineIterator) anyerror![]i32 {
var numbers = try std.ArrayList(i32).initCapacity(&ar... | day6/src/main.zig |
const anim = @import("Animation.zig");
pub const Animation = anim.Animation;
pub const Mesh = @import("Mesh.zig").Mesh;
pub const MeshRenderer = @import("MeshRenderer.zig").MeshRenderer;
pub const Light = @import("Light.zig").Light;
pub const Texture2D = @import("Texture2D.zig").Texture2D;
const PostProcess = @import("... | src/RTRenderEngine/RTRenderEngine.zig |
const std = @import("std");
const math = std.math;
const expect = std.testing.expect;
const expectEqual = std.testing.expectEqual;
const sdf2 = @import("sdf2.zig");
const affine = @import("affine.zig");
const V2 = affine.V2;
const v2 = V2.init;
const gmath = @import("gmath.zig").gmath(f64);
pub const Circle = struc... | lib/geom.zig |
const systemd = @import("drm/systemd.zig");
const Logind = @import("drm/systemd.zig").Logind;
const inputs = @import("drm/input.zig");
const Input = @import("drm/input.zig").Input;
const DRM = @import("drm/drm.zig").DRM;
const GBM = @import("drm/gbm.zig").GBM;
const EGL = @import("drm/egl.zig").EGL;
pub const DRMBacke... | src/backend/drm.zig |
const std = @import("std");
const build_options = @import("build_options");
const stdx = @import("stdx");
const t = stdx.testing;
const math = stdx.math;
const Mat4 = math.Mat4;
const sdl = @import("sdl");
const gl = @import("gl");
const vk = @import("vk");
const builtin = @import("builtin");
const Backend = build_opti... | platform/window_sdl.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 aoc = @import("../aoc.zig");
const std = @import("std");
const PairCounts = std.StringHashMap(usize);
const AtomCounts = std.AutoHashMap(u8, usize);
pub fn run(problem: *aoc.Problem) !aoc.Solution {
const polymer_template = problem.line().?;
var pair_insertions = std.StringHashMap(u8).init(problem.alloca... | src/main/zig/2021/day14.zig |
const std = @import("std");
const string = []const u8;
const u = @import("./index.zig");
//
//
// zig fmt: off
pub const DepType = enum {
local, // A 'package' derived from files in the same repository.
system_lib, // std.build.LibExeObjStep.linkSystemLibrary
framework, // std.build.LibExeObjStep.l... | src/util/dep_type.zig |
const std = @import("std");
/// A fixed size ring buffer designed for use with scatter/gather I/O.
/// `size` must be a power of two greater than one.
pub fn RingBuffer(comptime T: type, comptime size: usize) type {
if (size < 2 or !std.math.isPowerOfTwo(size))
@compileError("`size` must be a power of two ... | src/common/ring_buffer.zig |
const std = @import("std");
const os = std.os;
const mem = std.mem;
const log = std.log;
const net = std.net;
const time = std.time;
const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const ArenaAllocator = std.heap.ArenaAllocator;
const web = @import("zhp.zig");
const util = @import("util.zig");
... | src/app.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const Module = @import("Module.zig");
const fs = std.fs;
const trace = @import("tracy.zig").trace;
const Package = @import("Package.zig");
const Type = @import("type.zig").Type;
const build_options = @import("build_options");
pub const producer_string = ... | src-self-hosted/link.zig |
const std = @import("std");
const with_trace = true;
const assert = std.debug.assert;
fn trace(comptime fmt: []const u8, args: anytype) void {
if (with_trace) std.debug.print(fmt, args);
}
const Replacement = struct {
from: []const u8,
to: []const u8,
};
fn parse_line(line: []const u8) ?Replacement {
... | 2015/day19.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const assert = std.debug.assert;
const print = std.debug.print;
const input = @embedFile("../input/day17.txt");
const Cube = struct {
dim_x: usize,
dim_y: usize,
dim_z: usize,
data: []bool,
allocator: *Allocator,
const Self = @Th... | src/day17.zig |
pub const NETWORK_ALIVE_LAN = @as(u32, 1);
pub const NETWORK_ALIVE_WAN = @as(u32, 2);
pub const NETWORK_ALIVE_AOL = @as(u32, 4);
pub const NETWORK_ALIVE_INTERNET = @as(u32, 8);
pub const CONNECTION_AOL = @as(u32, 4);
pub const SENSGUID_PUBLISHER = Guid.initString("5fee1bd6-5b9b-11d1-8dd2-00aa004abd5e");
pub const SENSG... | win32/system/event_notification_service.zig |
const std = @import("std");
pub inline fn __builtin_bswap16(val: u16) u16 {
return @byteSwap(u16, val);
}
pub inline fn __builtin_bswap32(val: u32) u32 {
return @byteSwap(u32, val);
}
pub inline fn __builtin_bswap64(val: u64) u64 {
return @byteSwap(u64, val);
}
pub inline fn __builtin_signbit(val: f64) c_... | lib/std/zig/c_builtins.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const unicode = std.unicode;
const warn = std.debug.warn;
const mem = std.mem;
const form_feed = 0x0C;
const line_tabulation = 0x0B;
const space = ' ';
const Position = struct {
begin: usize,
end: usize,
};
const Lexer = struct {
input: []c... | src/baki.zig |
const std = @import("std");
const mecha = @import("../mecha.zig");
const debug = std.debug;
const math = std.math;
/// Constructs a parser that only succeeds if the string starts with `i`.
pub fn char(comptime i: u8) mecha.Parser(void) {
comptime {
return mecha.string(&[_]u8{i});
}
}
test "char" {
... | src/ascii.zig |
const std = @import("std");
usingnamespace @import("ast.zig");
pub const AstFormatter = struct {
indentSize: usize = 4,
const Self = @This();
pub fn init() Self {
return Self{};
}
fn newLine(self: *AstFormatter, writer: anytype, indent: u64) anyerror!void {
var i: ... | src/code_formatter.zig |
const std = @import("std");
const mem = std.mem;
const Symbol = struct {
name: []const u8,
section: []const u8,
kind: enum {
global,
weak,
},
type: enum {
none,
function,
object,
},
protected: bool,
};
// Example usage:
// objdump --dynamic-syms /pa... | tools/gen_stubs.zig |
const std = @import("std");
const print = std.debug.print;
const util = @import("util.zig");
const gpa = util.gpa;
const data = @embedFile("../data/day16.txt");
const BitReader = struct {
bytes: []u8,
byte: u8,
byte_index: usize = 0,
index: usize = 0,
eos: bool = false,
const Self = @This()... | 2021/src/day16.zig |
pub const debugConfig = Config{
// Override values here for your build
.vulkanVersion = 1001000, // Vulkan 1.1
//.recordingEnabled = true,
//.statsStringEnabled = false,
//.debugMargin = 64,
//.debugDetectCorruption = true,
//.debugInitializeAllocations = true,
//.debugGlobalMutex = tru... | include/vma_config.zig |
const std = @import("std");
const Random = std.rand.Random;
const mem = std.mem;
const Isaac64 = @This();
random: Random,
r: [256]u64,
m: [256]u64,
a: u64,
b: u64,
c: u64,
i: usize,
pub fn init(init_s: u64) Isaac64 {
var isaac = Isaac64{
.random = Random{ .fillFn = fill },
.r = undefined,
... | lib/std/rand/Isaac64.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const c = @cImport({
@cInclude("stb_image_write.h");
});
pub fn fileRender(outPath: [:0]const u8, shaderContext: anytype, shaderFn: anytype, width: comptime_int, height: comptime_int, allocator: *Allocator, gpa: anytype) !void {
var timer = try ... | lib/pngShader.zig |
pub fn isDoubleQuote(cp: u21) bool {
return cp == 0x22;
}
pub fn isSingleQuote(cp: u21) bool {
return cp == 0x27;
}
pub fn isHebrewLetter(cp: u21) bool {
if (cp < 0x5d0 or cp > 0xfb4f) return false;
return switch (cp) {
0x5d0...0x5ea => true,
0x5ef...0x5f2 => true,
0xfb1d => ... | .gyro/ziglyph-jecolon-github.com-c37d93b6/pkg/src/autogen/word_break_property.zig |
const xlib = @import("Xlib.zig");
pub const khronos_ssize_t = c_longlong;
pub const khronos_intptr_t = [*c]c_int;
pub const khronos_uint16_t = [*c]c_short;
pub const khronos_uint64_t = c_ulonglong;
pub const khronos_int64_t = c_longlong;
pub const khronos_int32_t = c_int;
pub const GLenum = c_uint;
pub const GLboolean... | modules/platform/src/linux/X11/glx.zig |
const std = @import("std");
const math = @import("math.zig");
pub fn identity() math.mat4x4 {
const zero: f32 = 0.0;
var m: math.mat4x4 = .{@splat(4, zero)} ** 4;
m[0][0] = 1.0;
m[1][1] = 1.0;
m[2][2] = 1.0;
m[3][3] = 1.0;
return m;
}
pub fn mul(a: math.mat4x4, b: math.mat4x4) math.mat4x4... | src/math/mat4x4.zig |
const ZachO = @This();
const std = @import("std");
const fs = std.fs;
const io = std.io;
const mem = std.mem;
const macho = std.macho;
const Allocator = std.mem.Allocator;
usingnamespace @import("ZachO/commands.zig");
allocator: *Allocator,
file: ?fs.File = null,
/// Mach-O header
header: ?macho.mach_header_64 = n... | src/ZachO.zig |
const std = @import("std");
const parseUnsigned = std.fmt.parseUnsigned;
const process = std.process;
const print = std.debug.print;
const page_allocator = std.heap.page_allocator;
const DefaultPrng = std.rand.DefaultPrng;
const ArenaAllocator = std.heap.ArenaAllocator;
const Allocator = std.mem.Allocator;
const ArrayL... | code/word-generator.zig |
const std = @import("std");
const abs = std.math.absInt;
const expectEqual = std.testing.expectEqual;
const ArrayList = std.ArrayList;
pub const Vec3 = struct {
x: i32,
y: i32,
z: i32,
const Self = @This();
pub fn v(x: i32, y: i32, z: i32) Self {
return Self{
.x = x,
... | zig/12.zig |
const comms = @import("comms.zig");
const std = @import("std");
fn valid_client_fd(fd: i32) bool {
// 0, 1, 2 are standard
// 3 -> config dir
// 4 -> config file
return fd > 4;
}
pub fn run(reader: std.fs.File.Reader, writer: std.fs.File.Writer, enable_writing: bool) !void {
try comms.send(writer,... | src/server.zig |
const std = @import("std");
const zig_geojson = @import("main.zig");
const Parser = zig_geojson.Parser;
const BBox = zig_geojson.Parser;
const Point = zig_geojson.Point;
test "simple feature" {
const json =
\\{
\\ "type": "Feature",
\\ "id": "simple feature",
\\ "geometry": {
... | src/tests.zig |
pub const AsynGetDataFlag = extern enum {
DoNotFlush,
};
pub const Blend = extern enum {
Zero = 1,
One = 2,
SrcColor = 3,
InvSrcColor = 4,
SrcAlpha = 5,
InvSrcAlpha = 6,
DestAlpha = 7,
InvDestAlpha = 8,
DestColor = 9,
InvDestColor = 10,
SrcAlphaSat = 11,
BlendFactor... | directx11/core/enum.zig |
pub const heart = "\u{F004}";
pub const star = "\u{F005}";
pub const person = "\u{F007}";
pub const clock = "\u{F017}";
pub const list = "\u{F022}";
pub const flag = "\u{F024}";
pub const bookmark = "\u{F02E}";
pub const bitmap = "\u{F03E}";
pub const edit = "\u{F044}";
pub const circledCross = "\u{F057}";
pub const ci... | src/icon.zig |
const std = @import("std");
const pike = @import("pike");
const io = @import("io.zig");
const sync = @import("sync.zig");
const net = std.net;
const meta = std.meta;
pub const Side = packed enum(u1) {
client,
server,
};
pub const Options = struct {
max_connections_per_client: usize = 16,
max_connecti... | socket.zig |
const std = @import("std");
pub const BuildOptions = struct {
enable_ztracy: bool = false,
enable_fibers: bool = false,
};
pub const BuildOptionsStep = struct {
options: BuildOptions,
step: *std.build.OptionsStep,
pub fn init(b: *std.build.Builder, options: BuildOptions) BuildOptionsStep {
... | libs/ztracy/build.zig |
const std = @import("std");
const stdx = @import("stdx");
const t = stdx.testing;
const walk = @import("walk.zig");
const walk_iterator = @import("walk_iterator.zig");
pub const walkPre = walk.walkPre;
pub const walkPost = walk.walkPost;
pub const walkPreAlloc = walk.walkPreAlloc;
pub const walkPrePost = walk.walkPreP... | stdx/algo/algo.zig |
const std = @import("std");
const os = std.os;
const windows = struct {
usingnamespace std.os.windows;
// docs: https://docs.microsoft.com/en-us/windows/win32/memory/creating-named-shared-memory
pub extern "kernel32" fn CreateFileMappingW(hFile: HANDLE, lpFileMappingAttributes: [*c]SECURITY_ATTRIBUTES, flP... | src/fmapper.zig |
const std = @import("std");
const os = std.os;
const fmt = std.fmt;
const Writer = std.fs.File.Writer;
pub const config = @import("./config.zig");
pub const codes = @import("./codes.zig");
pub const cursor = @import("./cursor.zig");
pub const Color = @import("./Color.zig").Color;
pub const Style = @import("./Style.z... | src/giz.zig |
//--------------------------------------------------------------------------------
// Section: Types (4)
//--------------------------------------------------------------------------------
// TODO: this type is limited to platform 'windows5.0'
const IID_IMarshal_Value = Guid.initString("00000003-0000-0000-c000-00000000... | win32/system/com/marshal.zig |
const std = @import("std");
const zs = @import("zstack.zig");
const Timer = std.os.time.Timer;
const Randomizer = zs.Randomizer;
const Piece = zs.Piece;
// See this thread for some useful reading:
// https://tetrisconcept.net/threads/randomizer-theory.512/
//
// Variances
// ---------
//
// Memoryless: 42
// 63-bag:... | src/randomizer_test.zig |
const std = @import("std");
//const tracy = @import("tracy");
const display = @import("zbox");
const build_options = @import("build_options");
// Author <NAME> (2021), released under the GPL V3 license.
//
// This program is an implementation o... | src/life.zig |
const os = @import("root").os;
const std = @import("std");
const builtin = std.builtin;
const atmcqueue = os.lib.atmcqueue;
const thread = os.thread;
const kepler = os.kepler;
/// Note is the object that represents a notification.
/// They are allocated in place in other types, such as
/// .Stream or .Endpoint
pub con... | src/kepler/ipc.zig |
const std = @import("std");
const eql = std.mem.eql;
const print = std.debug.print;
const testing = std.testing;
const tokenize = std.mem.tokenize;
var gpa_impl = std.heap.GeneralPurposeAllocator(.{}){};
const gpa = gpa_impl.allocator();
const input = @embedFile("./input.txt");
const Nodes = std.StringHashMap(bool);... | src/day12/day12.zig |
const std = @import("std");
usingnamespace (@import("../machine.zig"));
usingnamespace (@import("../util.zig"));
test "add / adc / and / cmp / or / sbb / sub / xor" {
const m32 = Machine.init(.x86_32);
const m64 = Machine.init(.x64);
debugPrint(false);
{
const op1 = Operand.register(.AL);
... | src/x86/tests/math_8086.zig |
const proto = @import("../proto.zig");
pub const FrameHeader = extern struct {
escape_byte: u8 = proto.escape_byte,
current_el: u8,
pad: [6]u8 = undefined,
};
pub const EL3Regs = extern struct {
// Exception handling
ELR_EL3: u64,
SPSR_EL3: u64,
FAR_EL3: u64,
ESR_EL3: u64,
// Pagi... | src/proto/arch/aarch64.zig |
const zm = @import("zetamath");
usingnamespace @import("zetarender");
const std = @import("std");
test "shader" {
std.debug.print("\n", .{});
var shader = try backend.Shader.init(std.heap.c_allocator, "render/test/shaders/vert.spv");
defer shader.deinit();
}
const Vertex = packed struct {
const Self ... | render/test/test.zig |
const std = @import("std");
const meta = @import("meta.zig");
const Allocator = std.mem.Allocator;
const assert = std.debug.assert;
pub fn Node(comptime K: type, comptime V: type, comptime B: u32) type {
return struct {
const Self = @This();
keys: [2 * B - 1]K,
values: [2 * B - 1]V,
... | src/node.zig |
const std = @import("std.zig");
const Allocator = std.mem.Allocator;
const debug = std.debug;
const expect = std.testing.expect;
const expectEqual = std.testing.expectEqual;
/// Priority queue for storing generic data. Initialize with `init`.
pub fn PriorityQueue(comptime T: type) type {
return struct {
co... | lib/std/priority_queue.zig |
const std = @import("std");
const mem = std.mem;
const io = std.io;
const fs = std.fs;
const fmt = std.fmt;
const testing = std.testing;
const Target = std.Target;
const CrossTarget = std.zig.CrossTarget;
const assert = std.debug.assert;
const SparcCpuinfoImpl = struct {
model: ?*const Target.Cpu.Model = null,
... | lib/std/zig/system/linux.zig |
const std = @import("std");
const mem = std.mem;
const OtherLowercase = @This();
allocator: *mem.Allocator,
array: []bool,
lo: u21 = 170,
hi: u21 = 43871,
pub fn init(allocator: *mem.Allocator) !OtherLowercase {
var instance = OtherLowercase{
.allocator = allocator,
.array = try allocator.alloc(... | src/components/autogen/PropList/OtherLowercase.zig |
const std = @import("std");
const mem = std.mem;
const SpacingMark = @This();
allocator: *mem.Allocator,
array: []bool,
lo: u21 = 2307,
hi: u21 = 119154,
pub fn init(allocator: *mem.Allocator) !SpacingMark {
var instance = SpacingMark{
.allocator = allocator,
.array = try allocator.alloc(bool, 1... | src/components/autogen/DerivedGeneralCategory/SpacingMark.zig |
const std = @import("std");
const u = @import("index.zig");
const yaml = @import("./yaml.zig");
//
//
const b = 1;
const kb = b * 1024;
const mb = kb * 1024;
pub const ModFile = struct {
const Self = @This();
alloc: *std.mem.Allocator,
id: []const u8,
name: []const u8,
main: []const u8,
c_i... | src/util/modfile.zig |
const std = @import("std");
const utils = @import("utils.zig");
const Field = utils.Field;
const Instruction = struct {
instr: union(enum) {
// Logical ALU
mov: AluInstr,
mvn: AluInstr,
orr: AluInstr,
eor: AluInstr,
and_: AluInstr,
bic: AluInstr,
tst:... | src/instr.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;
const gui = @import("gui");
const icons = @import("icons.zig");
const nvg = @import("nanovg");
const geometry = @import("gui/geometry.zig");
const Point = geometry.Point;
const Pointf = Point(f32);
const Pointi = Point(i3... | src/CanvasWidget.zig |
const std = @import("std");
const mem = std.mem;
const utils = @import("utils.zig");
const expect = std.testing.expect;
const bibtex = @import("bibtex.zig");
const csl = @import("csl_json.zig");
pub const Error = error {
NoMatchingItemType,
NoMatchingField,
};
/// should be called with an arena allocator
pub... | src/bib_to_csl.zig |
const std = @import("std");
const tvg = @import("tvg");
const args = @import("args");
pub fn main() !u8 {
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
const allocator = &arena.allocator;
const cli = args.parseForCurrentProcess(CliOptions, allocator) catch r... | src/tools/text.zig |
const exec = @import("exec.zig").exec;
const debug = @import("std").debug;
const Parser = @import("parse.zig").Parser;
const Regex = @import("regex.zig").Regex;
const InputBytes = @import("input.zig").InputBytes;
const re_debug = @import("debug.zig");
const std = @import("std");
const ArrayList = std.ArrayList;
const ... | src/vm_test.zig |
const std = @import("std");
const Pkg = std.build.Pkg;
const FileSource = std.build.FileSource;
pub const build_pkgs = struct {
pub const mbedtls = @import(".gyro/zig-mbedtls-mattnite-github.com-a4f5357c/pkg/mbedtls.zig");
pub const libgit2 = @import(".gyro/zig-libgit2-mattnite-github.com-0537beea/pkg/libgit2.... | deps.zig |
const std = @import("std");
const math = std.math;
const assert = std.debug.assert;
const L = std.unicode.utf8ToUtf16LeStringLiteral;
const Mutex = std.Thread.Mutex;
const zwin32 = @import("zwin32");
const w32 = zwin32.base;
const d3d12 = zwin32.d3d12;
const xaudio2 = zwin32.xaudio2;
const xaudio2fx = zwin32.xaudio2fx;... | samples/audio_experiments/src/audio_experiments.zig |
const std = @import("std");
const fs = std.fs;
const io = std.io;
const mem = std.mem;
const testing = std.testing;
const Archive = @import("archive/Archive.zig");
const test1_dir = "test/data/test1";
const test1_gnu_archive = "output_llvm-ar_gnu.a";
const test1_bsd_archive = "output_llvm-ar_bsd.a";
const test1_names... | src/test.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const odbc = @import("odbc");
const RowStatus = odbc.Types.StatementAttributeValue.RowStatus;
const util = @import("util.zig");
const sliceToValue = util.sliceToValue;
/// Given a struct, generate a new struct that can be used for ODBC row-wise binding... | src/result_set.zig |
const c = @import("c.zig");
const std = @import("std");
const zlm = @import("zlm");
const Thread = std.Thread;
const Allocator = std.mem.Allocator;
pub const ShaderError = error{ ShaderCompileError, InvalidGLContextError };
/// The type used for meshes's elements
pub const MeshElementType = c.GLuint;
pub const Mesh ... | didot-opengl/graphics.zig |
//--------------------------------------------------------------------------------
// Section: Types (13)
//--------------------------------------------------------------------------------
pub const DdqAccessLevel = enum(i32) {
NoData = 0,
CurrentUserData = 1,
AllUserData = 2,
};
pub const NoData = DdqAcce... | win32/security/diagnostic_data_query.zig |
const std = @import("std");
const assert = std.debug.assert;
const tools = @import("tools");
const Vec2 = tools.Vec2;
pub fn run(input_text: []const u8, allocator: *std.mem.Allocator) ![2][]const u8 {
var arena = std.heap.ArenaAllocator.init(allocator);
defer arena.deinit();
const chunk_sz = 3 * 1024 * 1... | 2020/day16_bonus.zig |
const std = @import("std");
const fmt = std.fmt;
const warn = std.debug.warn;
const assert = std.debug.assert;
const trace = @import("tracy.zig").trace;
const traceEx = @import("tracy.zig").traceEx;
const traceFrame = @import("tracy.zig").traceFrame;
const Viewport = @import("viewport.zig");
const Mandelbrot = @import... | src/main.zig |
// Style guide is violated here so that @tagName can be used effectively
/// https://datatracker.ietf.org/doc/html/rfc7231#section-4 Initial definiton
/// https://datatracker.ietf.org/doc/html/rfc5789#section-2 PATCH
pub const Method = enum {
GET,
HEAD,
POST,
PUT,
DELETE,
CONNECT,
OPTIONS,
... | lib/std/http/method.zig |
const std = @import("std");
const imr = @import("imr.zig");
const Allocator = std.mem.Allocator;
const eqlIgnoreCase = std.ascii.eqlIgnoreCase;
pub const TagList = std.ArrayList(Tag);
pub const AttributeMap = std.StringHashMap([]const u8);
pub const Tag = struct {
name: []const u8,
text: ?[:0]const u8,
c... | zervo/markups/html.zig |
const std = @import("std");
const print = std.debug.print;
const Map = std.AutoHashMap;
const util = @import("util.zig");
const gpa = util.gpa;
const data = @embedFile("../data/day05.txt");
const Point = struct {
x: i32,
y: i32,
};
fn update(map: *Map(Point, usize), p: Point) !void {
if (map.get(p)) |co... | 2021/src/day05.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const testing = std.testing;
const assert = std.debug.assert;
const FixedBufferAllocator = std.heap.FixedBufferAllocator;
/// Generic k-ary tree represented as a "left-child right-sibling" binary tree.
pub fn Tree(comptime T: type) type {
return stru... | tree.zig |
const common = @import("common.zig");
/// The document open notification is sent from the client
/// to the server to signal newly opened text documents.
/// The document’s content is now managed by the client and
/// the server must not try to read the document’s content
/// using the document’s Uri. Open in this sen... | src/types/text_sync.zig |
const midi = @import("../midi.zig");
const std = @import("std");
const debug = std.debug;
const io = std.io;
const math = std.math;
const mem = std.mem;
const encode = @This();
pub fn message(writer: anytype, last_message: ?midi.Message, msg: midi.Message) !void {
if (msg.channel() == null or last_message == nul... | midi/encode.zig |
const std = @import("std");
const linux = std.os.linux;
const os = std.os;
const renderer = @import("renderer.zig");
const Object = @import("client.zig").Object;
const Context = @import("client.zig").Context;
const Client = @import("client.zig").Client;
const ShmPool = @import("shm_pool.zig").ShmPool;
const buffer = @i... | src/shm_buffer.zig |
const std = @import("std");
const print = std.debug.print;
usingnamespace @import("chunk.zig");
usingnamespace @import("heap.zig");
pub const ArrayListOfValue = std.ArrayList(Value);
pub const Value = union(enum) {
boolean: bool,
number: f64,
nil,
obj: *Obj,
};
pub const ObjType = enum {
str,
... | zvm/src/value.zig |
const assert = @import("std").debug.assert;
const main = @import("main.zig");
const utils = @import("utils.zig");
const w4 = main.w4;
const ptrs = main.ptrs;
const info = main.info;
const ObjId = main.ObjId;
const Team = main.Team;
const max_health = main.max_health;
const team_cnt = main.team_cnt;
const unity_cap ... | src/obj.zig |
const std = @import("std");
const os = std.os;
const mibu = @import("mibu");
const cursor = mibu.cursor;
const clear = mibu.clear;
const RawTerm = mibu.term.RawTerm;
const Buffer = @import("buffer.zig").Buffer;
const Widget = @import("./widget.zig").Widget;
const Queue = @import("./mpsc.zig").Queue;
const Cell = @imp... | src/terminal.zig |
const std = @import("std");
var log_file: ?std.fs.File = null;
/// This is taken from std.log's example of what
/// a logging function might look like
pub fn log(
comptime level: std.log.Level,
comptime scope: @TypeOf(.EnumLiteral),
comptime format: []const u8,
args: anytype,
) void {
if (log_file... | src/util.zig |
const std = @import("std");
var builder: *std.build.Builder = undefined;
pub fn build(b: *std.build.Builder) void {
builder = b;
// Standard target options allows the person running `zig build` to choose
// what target to build for. Here we do not override the defaults, which
// means any target is all... | build.zig |