code stringlengths 38 801k | repo_path stringlengths 6 263 |
|---|---|
pub const _MM_HINT_T0 = @as(u32, 1);
pub const _MM_HINT_T1 = @as(u32, 2);
pub const _MM_HINT_T2 = @as(u32, 3);
pub const _MM_HINT_NTA = @as(u32, 0);
pub const IOCTL_STORAGE_BASE = @as(u32, 45);
pub const IOCTL_SCMBUS_BASE = @as(u32, 89);
pub const IOCTL_DISK_BASE = @as(u32, 7);
pub const IOCTL_CHANGER_BASE = @as(u32, 4... | deps/zigwin32/win32/system/system_services.zig |
const std = @import("std");
pub const CigarOp = enum(u8) {
match = '=',
mismatch = 'X',
deletion = 'D',
insertion = 'I',
};
pub const Cigar = struct {
const Self = @This();
const Entry = struct {
op: CigarOp,
count: usize = 0,
};
allocator: std.mem.Allocator,
entri... | src/cigar.zig |
const Self = @This();
const std = @import("std");
const hash_map = std.hash_map;
const Allocator = std.mem.Allocator;
const Waypoint = @import("Waypoint.zig");
const Departure = @import("Departure.zig");
const Destination = @import("Destination.zig");
const Route = @import("Route.zig");
/// Allocator associated with... | src/FlightPlan.zig |
const std = @import("std");
const Compiler = @import("Compiler.zig");
const Context = @import("Context.zig");
const GraphemeIterator = @import("ziglyph").GraphemeIterator;
const Node = @import("Node.zig");
const Scope = @import("Scope.zig");
const ScopeStack = @import("ScopeStack.zig");
const Token = @import("Token.zi... | src/Vm.zig |
const std = @import("std");
const ecs = @import("ecs");
// override the EntityTraits used by ecs
pub const EntityTraits = ecs.EntityTraitsType(.medium);
pub const Velocity = struct { x: f32, y: f32 };
pub const Position = struct { x: f32, y: f32 };
const total_entities: usize = 10000;
/// logs the timing for views ... | examples/group_sort.zig |
pub const DTCINSTALL_E_CLIENT_ALREADY_INSTALLED = @as(i32, 384);
pub const DTCINSTALL_E_SERVER_ALREADY_INSTALLED = @as(i32, 385);
pub const XA_SWITCH_F_DTC = @as(u32, 1);
pub const XA_FMTID_DTC = @as(u32, 4478019);
pub const XA_FMTID_DTC_VER1 = @as(u32, 21255235);
pub const XIDDATASIZE = @as(u32, 128);
pub const MAXGTR... | win32/system/distributed_transaction_coordinator.zig |
const pokemon = @import("index.zig");
pub const Info = struct {
game_title: [12]u8,
gamecode: [4]u8,
version: pokemon.Version,
hm_tm_prefix: []const u8,
base_stats: []const u8,
level_up_moves: []const u8,
moves: []const u8,
trainers: []const u8,
parties: []const u8,
evolutions:... | src/pokemon/gen4-constants.zig |
const sf = struct {
usingnamespace @import("sfml");
usingnamespace sf.graphics;
usingnamespace sf.window;
usingnamespace sf.system;
};
pub fn main() !void {
var window = try sf.RenderWindow.createDefault(.{ .x = 600, .y = 600 }, "Heat");
defer window.destroy();
window.setVerticalSyncEnable... | src/examples/heat_haze.zig |
const std = @import("std");
const util = @import("util.zig");
const data = @embedFile("../data/day08.txt");
/// Mapping where each index contains a string representing the segments that digit should normally
/// be using.
const digitMap = [_][]const u8{ "abcefg", "cf", "acdeg", "acdfg", "bcdf", "abdfg", "abdefg", "ac... | src/day08.zig |
const std = @import("std");
const ArenaAllocator = std.heap.ArenaAllocator;
const zigly = @import("zigly.zig");
const Dictionary = zigly.Dictionary;
const UserAgent = zigly.UserAgent;
const Request = zigly.Request;
const Logger = zigly.Logger;
fn start() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{ .saf... | src/tests.zig |
const Wwise = @import("../wwise.zig").Wwise;
const ImGui = @import("../imgui.zig").ImGui;
const DemoInterface = @import("demo_interface.zig").DemoInterface;
const std = @import("std");
const SurfaceInfo = struct {
bank_name: []const u8,
switch_id: u32,
const Self = @This();
pub fn init(bank_name: []c... | src/demos/footsteps_demo.zig |
const std = @import("std");
const Obj = @import("./object.zig").Obj;
const NAN_BOXING = @import("./debug.zig").NAN_BOXING;
pub const Value = if (NAN_BOXING) NanBoxedValue else UnionValue;
pub const NanBoxedValue = packed struct {
data: u64,
const SIGN_BIT: u64 = 0x8000000000000000;
const QNAN: u64 = 0x7f... | src/value.zig |
const std = @import("std");
pub const Tag = enum {
float,
ident,
int,
raw_str,
string,
uint,
kw_and,
kw_break,
kw_continue,
kw_do,
kw_else,
kw_if,
kw_or,
kw_return,
kw_select,
kw_while,
pd_false,
pd_nil,
pd_true,
pd_assert,
pd_atan2... | src/Token.zig |
const expect = std.testing.expect;
const expectEqualSlices = std.testing.expectEqualSlices;
const std = @import("std");
const Allocator = std.mem.Allocator;
const Connect = @import("./packet/connect.zig").Connect;
const ConnAck = @import("./packet/connack.zig").ConnAck;
const Publish = @import("./packet/publish.zig").... | src/mqtt4/packet.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/day12.txt");
//... | src/day12.zig |
const std = @import("std");
const RaxStack = @import("./stack.zig").RaxStack;
const RaxNode = @import("./node.zig").RaxNode;
const RaxIterator = @import("./iterator.zig").RaxIterator;
pub fn Rax(comptime V: type) type {
return struct {
allocator: *std.mem.Allocator,
head: *NodeT,
numElement... | src/simple/rax.zig |
const std = @import("std");
const warn = std.debug.warn;
const assert = std.debug.assert;
const Vector = @import("Vector.zig").Vector;
pub fn Matrix(comptime T: type, comptime S: u32) type {
return struct {
const Self = @This();
data: [S][S]T,
// Values in column-major layout
pub ... | src/Mathematics/Matrix.zig |
const std = @import("std");
const sqlite = @import("sqlite");
const Search = @import("Search.zig");
const Printable = @import("Printable.zig");
const utils = @import("utils.zig");
const db_file_name = "codes.db";
var database: sqlite.SQLite = undefined;
pub fn checkDbExists() !bool {
//Checks if program has acce... | src/db.zig |
const std = @import("std");
const Builder = std.build.Builder;
fn root() []const u8 {
return std.fs.path.dirname(@src().file) orelse ".";
}
fn pathJoinRoot(comptime components: []const []const u8) []const u8 {
var ret = root();
inline for (components) |component|
ret = ret ++ std.fs.path.sep_str +... | libs/mbedtls/mbedtls.zig |
const builtin = @import("builtin");
const std = @import("../std.zig");
const event = std.event;
const assert = std.debug.assert;
const testing = std.testing;
const os = std.os;
const mem = std.mem;
const windows = os.windows;
const Loop = event.Loop;
const fd_t = os.fd_t;
const File = std.fs.File;
pub const RequestNod... | std/event/fs.zig |
const tests = @import("tests.zig");
pub fn addCases(cases: *tests.CompareOutputContext) void {
cases.addRuntimeSafety("@floatToInt cannot fit - negative to unsigned",
\\pub fn panic(message: []const u8, stack_trace: ?*@import("builtin").StackTrace) noreturn {
\\ @import("std").os.exit(126);
... | test/runtime_safety.zig |
const std = @import("std");
const offsets = @import("offsets.zig");
const DocumentStore = @import("document_store.zig");
const analysis = @import("analysis.zig");
const ast = std.zig.ast;
pub const TokenType = enum(u32) {
type,
parameter,
variable,
tagField,
field,
errorTag,
function,
k... | src/semantic_tokens.zig |
const Trie = @This();
const std = @import("std");
const mem = std.mem;
const leb = std.leb;
const log = std.log.scoped(.macho);
const macho = std.macho;
const testing = std.testing;
const assert = std.debug.assert;
const Allocator = mem.Allocator;
pub const Node = struct {
base: *Trie,
/// Terminal info asso... | src/MachO/Trie.zig |
const std = @import("../../std.zig");
const assert = std.debug.assert;
const maxInt = std.math.maxInt;
// See: https://opensource.apple.com/source/xnu/xnu-6153.141.1/bsd/sys/_types.h.auto.html
// TODO: audit mode_t/pid_t, should likely be u16/i32
pub const fd_t = c_int;
pub const pid_t = c_int;
pub const mode_t = c_ui... | lib/std/os/bits/darwin.zig |
const std = @import("../std.zig");
const builtin = std.builtin;
const io = std.io;
pub const Packing = enum {
/// Pack data to byte alignment
Byte,
/// Pack data to bit alignment
Bit,
};
/// Creates a deserializer that deserializes types from any stream.
/// If `is_packed` is true, the data stream i... | lib/std/io/serialization.zig |
const std = @import("std");
const io = std.io;
const math = std.math;
const mem = std.mem;
const assert = std.debug.assert;
const MAXBITS = 15;
const MAXLCODES = 286;
const MAXDCODES = 30;
const MAXCODES = MAXLCODES + MAXDCODES;
const FIXLCODES = 288;
// The maximum length of a Huffman code's prefix we can decode u... | lib/std/compress/deflate.zig |
const std = @import("std");
const enum_parser = @import("enum_parser.zig");
const fmt = @import("fmt_structs.zig");
const expect = std.testing.expect;
const expectError = std.testing.expectError;
const str = []const u8;
const print = std.debug.print;
const Allocator = std.mem.Allocator;
const TokenIterator = std.mem.To... | src/chelar.zig |
const std = @import("std");
const panic = std.debug.panic;
const OutStream = std.io.OutStream;
fn print_to(file: std.fs.File, val: anytype) void {
file.outStream().print("{}", .{val}) catch |err| {
panic("error ({})", .{err});
};
}
pub fn print(val: anytype) void {
print_to(std.io.getStdOut(), va... | lib/utils.zig |
pub const Context = extern struct {
params: Params,
itw: f32,
ith: f32,
tex_data: [*c]u8,
// omitted rest of struct
pub fn init(params: *Params) !*Context {
return fonsCreateInternal(params) orelse error.FailedToCreateFONS;
}
pub fn deinit(self: *Context) void {
fonsDel... | gamekit/deps/fontstash/fontstash.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const ArrayList = 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"... | src/day03.zig |
const std = @import("std");
const math = std.math;
const expect = std.testing.expect;
pub fn __fmah(x: f16, y: f16, z: f16) callconv(.C) f16 {
// TODO: more efficient implementation
return @floatCast(f16, fmaf(x, y, z));
}
pub fn fmaf(x: f32, y: f32, z: f32) callconv(.C) f32 {
const xy = @as(f64, x) * y;... | lib/compiler_rt/fma.zig |
const builtin = @import("builtin");
const TypeId = builtin.TypeId;
const std = @import("index.zig");
/// This function is intended to be used only in tests. It prints diagnostics to stderr
/// and then aborts when actual_error_union is not expected_error.
pub fn expectError(expected_error: anyerror, actual_error_union... | std/testing.zig |
const os = @import("root").os;
const std = @import("std");
const regs = @import("regs.zig");
const paging = @import("../paging.zig");
pub const page_sizes = [_]u64 {
0x1000, // 4K page
0x10000,
0x200000, // 2M page
0x2000000,
0x40000000, // 1G page
0x8000000000, // 512G page
};
const LevelType... | src/platform/x86_64/paging.zig |
const __mulodi4 = @import("mulodi4.zig").__mulodi4;
const testing = @import("std").testing;
fn test__mulodi4(a: i64, b: i64, expected: i64, expected_overflow: c_int) void {
var overflow: c_int = undefined;
const x = __mulodi4(a, b, &overflow);
testing.expect(overflow == expected_overflow and (expected_over... | lib/std/special/compiler_rt/mulodi4_test.zig |
const std = @import("std");
const sling = @import("sling.zig");
const Self = @This();
pub const EditorData = struct {
filePath: ?[]const u8 = null,
selectedObjectGroup: usize = 0,
selectedEntity: usize = 0,
objectToIndex: std.StringHashMap(usize) = std.StringHashMap(usize).init(sling.alloc),
};
baseOb... | src/scene.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const Value = @import("./value.zig").Value;
const Vm = @import("./vm.zig").Vm;
const ObjType = enum {
string,
};
pub const Obj = struct {
obj_type: ObjType,
next: ?*Obj,
pub fn create(vm: *Vm, comptime T: type, obj_type: ObjType) *T {
... | src/object.zig |
usingnamespace @import("root").preamble;
const log = lib.output.log.scoped(.{
.prefix = "Interrupts",
.filter = .info,
}).write;
const msr = @import("aarch64.zig").msr;
pub const InterruptState = bool;
pub fn get_and_disable_interrupts() InterruptState {
// Get interrupt mask flag
var daif = msr(u64... | subprojects/flork/src/platform/aarch64/interrupts.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const math = std.math;
const testing = std.testing;
const util = @import("util.zig");
const Error = util.Error;
/// BinaryFuse8 provides a binary fuse filter with 8-bit fingerprints.
///
/// See `BinaryFuse` for more details.
pub const BinaryFuse8 = Bin... | src/binaryfusefilter.zig |
const std = @import("std");
const Context = @import("Context.zig");
const Node = @import("Node.zig");
const Parser = @import("Parser.zig");
const Scope = @import("Scope.zig");
pub const Opcode = enum {
// Stack operations
pop,
// Predefined constant values
bool_true,
bool_false,
nil,
// Nu... | src/Compiler.zig |
const std = @import("std");
const expect = std.testing.expect;
const expectEqual = std.testing.expectEqual;
const Tag = std.meta.Tag;
const MultipleChoice2 = union(enum(u32)) {
Unspecified1: i32,
A: f32 = 20,
Unspecified2: void,
B: bool = 40,
Unspecified3: i32,
C: i8 = 60,
Unspecified4: voi... | test/behavior/union_stage1.zig |
const aoc = @import("../aoc.zig");
const std = @import("std");
const Map = std.AutoHashMap(aoc.Coord, void);
pub fn run(problem: *aoc.Problem) !aoc.Solution {
var image_enhancement_algorithm = problem.line().?;
var map = Map.init(problem.allocator);
defer map.deinit();
var last_coord = aoc.Coord.init(... | src/main/zig/2021/day20.zig |
pub const Flexcomm = struct {
base: usize,
const Self = @This();
/// Peripheral Select and Flexcomm Interface ID register
pub fn regPselid(self: Self) *volatile u32 {
return @intToPtr(*volatile u32, self.base + 0xff8);
}
pub const PSELID_PERSEL_USART = 0x1;
/// USART Configurati... | examples/drivers/flexcomm.zig |
const std = @import("std");
const testing = std.testing;
// Supported, IANA-registered status codes available
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
pub const Status = struct {
code: u16,
phrase: []const u8,
description: []const u8,
pub fn create(code: u16, phrase: []const u8, des... | src/status.zig |
const fmath = @import("index.zig");
pub fn sqrt(x: var) -> @typeOf(x) {
const T = @typeOf(x);
switch (T) {
f32 => @inlineCall(sqrt32, x),
f64 => @inlineCall(sqrt64, x),
else => @compileError("sqrt not implemented for " ++ @typeName(T)),
}
}
fn sqrt32(x: f32) -> f32 {
const tiny... | src/sqrt.zig |
const std = @import("std");
const vk = @import("../../vk.zig");
const vkctxt = @import("../../vulkan_wrapper/vulkan_context.zig");
const printError = @import("../../application/print_error.zig").printError;
const RGPass = @import("render_graph_pass.zig").RGPass;
const PassList = std.ArrayList(*RGPass);
const RGResou... | src/renderer/render_graph/render_graph.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const panic = std.debug.panic;
const vk = @import("vulkan");
const VK_API_VERSION_1_2 = vk.makeApiVersion(0, 1, 2, 0);
pub const AppVersion = vk.makeApiVersion;
const glfw = @import("glfw");
const saturn_name = "Saturn Engine";
const saturn_version = v... | src/vulkan/instance.zig |
const std = @import("std");
const root = @import("main.zig");
const math = std.math;
const testing = std.testing;
pub const vec4 = Vec4(f32);
pub const vec4_f64 = Vec4(f64);
pub const vec4_i32 = Vec4(i32);
/// A 4 dimensional vector.
pub fn Vec4(comptime T: type) type {
if (@typeInfo(T) != .Float and @typeInfo(T)... | src/vec4.zig |
pub const VDS_NF_VOLUME_ARRIVE = @as(u32, 4);
pub const VDS_NF_VOLUME_DEPART = @as(u32, 5);
pub const VDS_NF_VOLUME_MODIFY = @as(u32, 6);
pub const VDS_NF_VOLUME_REBUILDING_PROGRESS = @as(u32, 7);
pub const VDS_NF_PARTITION_ARRIVE = @as(u32, 11);
pub const VDS_NF_PARTITION_DEPART = @as(u32, 12);
pub const VDS_NF_PARTIT... | win32/storage/virtual_disk_service.zig |
const std = @import("std");
pub fn Combinator(comptime Left: type, comptime Right: type) type {
return struct {
const Self = @This();
/// Take two enum types and yield a new enum that contains the cross product of them.
/// Enum values are ignored to guarantee there are no collisions.
... | src/util/enums.zig |
const std = @import("std");
const expect = std.testing.expect;
pub const CyclicBarrier = struct {
pub const Node = struct {
status: i32=1,
prev: ?*Node=null,
resetEvent: std.ResetEvent,
};
rounds: u32 = 0,
parties: u32,
count: u32,
broken: bool=false,... | CyclicBarrier.zig |
const std = @import("std");
const builtin = @import("builtin");
pub const PlayerCount = 4;
const StartingCoins = 3;
const LoRollEstablishmentPileCount = 5;
const HiRollEstablishmentPileCount = 5;
const MajorEstablishmentPileCount = 2;
//const verboseMode = (builtin.mode == builtin.Mode.Debug);
const verboseMode = fal... | src/game.zig |
// Enums
pub const Factor = enum(c_int) {
zero,
one,
srcColor,
oneMinusSrcColor,
dstColor,
oneMinusDstColor,
srcAlpha,
oneMinusSrcAlpha,
dstAlpha,
oneMinusDstAlpha
};
pub const Equation = enum(c_int) {
add,
subtract,
reverseSubtract
};
const BlendMode = @This();
... | src/sfml/graphics/BlendMode.zig |
const std = @import("std");
const assert = std.debug.assert;
/// A variable length collection of characters
pub const String = struct {
/// The internal character buffer
buffer: ?[]u8,
/// The allocator used for managing the buffer
allocator: *std.mem.Allocator,
/// The total size of the String
... | zig-string.zig |
const std = @import("std");
const mem = std.mem;
pub const Token = struct {
const Self = @This();
token_type: TokenType,
lexeme: []const u8,
// Literal is either a string or a number
literal_string: ?[]const u8 = null,
literal_number: ?f64 = null,
line: usize,
column: usize,
offset... | src/token.zig |
const net = std.net;
const std = @import("std");
const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;
const Connect = @import("./packet/connect.zig").Connect;
const Packet = @import("./packet.zig").Packet;
const Publish = @import("./packet/publish.zig").Publish;
const QoS = @import("../qos.zig").QoS;
c... | src/mqtt4/client.zig |
const std = @import("std");
const debug = std.debug;
const mem = std.mem;
const testing = std.testing;
const unicode = std.unicode;
const GBP = @import("../components.zig").GraphemeBreakProperty;
const CodePoint = @import("CodePoint.zig");
const CodePointIterator = CodePoint.CodePointIterator;
const Emoji = @import(".... | src/segmenter/Grapheme.zig |
const std = @import("std");
const helper = @import("helper.zig");
const Allocator = std.mem.Allocator;
const Grid = helper.Grid;
const BinaryHeap = helper.BinaryHeap;
const input = @embedFile("../inputs/day15.txt");
pub fn run(alloc: Allocator, stdout_: anytype) !void {
const grid = try parseInput(alloc, input);
... | src/day15.zig |
const std = @import("std");
const Answer = struct { @"0": u32, @"1": u64 };
fn charCorruptionScore(c: u8) ?u32 {
return switch (c) {
')' => 3,
']' => 57,
'}' => 1197,
'>' => 25137,
else => null,
};
}
fn charCompletionScore(c: u8) ?u32 {
return switch (c) {
'... | src/day10.zig |
const std = @import("std");
const assert = std.debug.assert;
const window = @import("Window.zig");
const c = @import("c.zig").c;
const expect = std.testing.expect;
const ReferenceCounter = @import("../RefCount.zig").ReferenceCounter;
pub const Buffer = struct {
ref_count: ReferenceCounter = ReferenceCounter{},
... | src/WindowGraphicsInput/Buffer.zig |
const std = @import("std");
const audiometa = @import("audiometa");
const Allocator = std.mem.Allocator;
pub const log_level: std.log.Level = .warn;
pub export fn main() void {
zigMain() catch unreachable;
}
pub fn zigMain() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer std.debug.asser... | test/fuzz.zig |
const std = @import("std");
const builtin = @import("builtin");
pub const pkg = std.build.Pkg{
.name = "openssl",
.source = .{ .path = srcPath() ++ "/openssl.zig" },
};
pub fn addPackage(step: *std.build.LibExeObjStep) void {
step.addPackage(pkg);
step.addIncludeDir(srcPath() ++ "/vendor/include");
}
... | lib/openssl/lib.zig |
const std = @import("std");
const builtin = @import("builtin");
const testing = std.testing;
const expect = testing.expect;
const expectEqual = testing.expectEqual;
test "one param, explicit comptime" {
var x: usize = 0;
x += checkSize(i32);
x += checkSize(bool);
x += checkSize(bool);
try expect(x ... | test/behavior/generics.zig |
const std = @import("../std.zig");
const io = std.io;
const mem = std.mem;
const assert = std.debug.assert;
/// Automatically inserts indentation of written data by keeping
/// track of the current indentation level
pub fn AutoIndentingStream(comptime UnderlyingWriter: type) type {
return struct {
const S... | lib/std/io/auto_indenting_stream.zig |
const builtin = @import("builtin");
const std = @import("../index.zig");
const math = std.math;
const assert = std.debug.assert;
const assertError = std.debug.assertError;
// This implementation is based on that from the rust stlib
pub fn powi(comptime T: type, x: T, y: T) (error{Overflow, Underflow}!T) {
const i... | std/math/powi.zig |
const std = @import("std");
const fs = std.fs;
const io = std.io;
const info = std.log.info;
const print = std.debug.print;
const fmt = std.fmt;
const utils = @import("utils.zig");
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const SEEBACK: usize = 25;
fn isSum(num: usize, parts: []usize) bool {
for (part... | day_09/src/main.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const curl = @cImport({
@cInclude("curl/curl.h");
});
const Repo = struct {
user: []const u8 = undefined,
name: []const u8 = undefined,
url: []const u8 = undefined,
};
pub fn main() anyerror!void {
// var alloc_buf: [10_000_000]u8 = ... | src/main.zig |
const builtin = @import("builtin");
const Os = builtin.Os;
pub use switch(builtin.os) {
Os.linux => @import("linux.zig"),
Os.windows => @import("windows.zig"),
Os.macosx, Os.ios => @import("darwin.zig"),
else => empty_import,
};
const empty_import = @import("../empty.zig");
pub extern "c" fn abort() n... | std/c/index.zig |
const fmath = @import("index.zig");
pub fn tan(x: var) -> @typeOf(x) {
const T = @typeOf(x);
switch (T) {
f32 => @inlineCall(tan32, x),
f64 => @inlineCall(tan64, x),
else => @compileError("tan not implemented for " ++ @typeName(T)),
}
}
const Tp0 = -1.30936939181383777646E4;
const ... | src/tan.zig |
pub const GUID_DEVINTERFACE_SENSOR = Guid.initString("ba1bb692-9b7a-4833-9a1e-525ed134e7e2");
pub const SENSOR_EVENT_STATE_CHANGED = Guid.initString("bfd96016-6bd7-4560-ad34-f2f6607e8f81");
pub const SENSOR_EVENT_DATA_UPDATED = Guid.initString("2ed0f2a4-0087-41d3-87db-6773370b3c88");
pub const SENSOR_EVENT_PROPERTY_CHA... | win32/devices/sensors.zig |
const root = @import("root");
const std = @import("std");
const testing = std.testing;
const assert = std.debug.assert;
pub usingnamespace @import("common.zig");
const nvic_priority_bits = if (@hasDecl(root, "nvic_priority_bits")) root.nvic_priority_bits else 4;
/// ARM DUI 0646C Table 4-17
const SCB_AIRCR_PRIGROUP_P... | v7m.zig |
usingnamespace @import("bits.zig");
const std = @import("std");
const builtin = std.builtin;
const assert = std.debug.assert;
const windows = @import("../windows.zig");
const unexpectedError = windows.unexpectedError;
const GetLastError = windows.kernel32.GetLastError;
const SetLastError = windows.kernel32.SetLastError... | lib/std/os/windows/user32.zig |
const std = @import("std");
const os = @import("windows.zig");
const dcommon = @import("dcommon.zig");
const HRESULT = os.HRESULT;
const RESOURCE_STATES = @import("d3d12.zig").RESOURCE_STATES;
pub const CREATE_DEVICE_FLAG = packed struct {
SINGLETHREADED: bool = false,
DEBUG: bool = false,
SWITCH_TO_REF: b... | src/windows/d3d11.zig |
const builtin = @import("builtin");
const mem = @import("std").mem;
const assert = @import("std").debug.assert;
const crypto = @import("std").crypto;
const testing = @import("std").testing;
pub const Format = enum {
Bare,
Dashed,
Braced,
};
pub const Case = enum {
Lower,
Upper,
};
const GUIDBuilde... | src/guid.zig |
const std = @import("std");
const protobuf = @import("protobuf");
usingnamespace protobuf;
usingnamespace std;
const expected = @embedFile("encode_alltypes.output");
const SubMessage = struct {
substuff1: ArrayList(u8),
substuff2: ?i32,
substuff3: ?i32,
pub const _desc_table = [_]FieldDescriptor{
... | tests/alltypes.zig |
const std = @import("std");
const clap = @import("clap");
const xml = @import("xml.zig");
const svd = @import("svd.zig");
const Database = @import("Database.zig");
const ArenaAllocator = std.heap.ArenaAllocator;
const Allocator = std.mem.Allocator;
const assert = std.debug.assert;
pub const log_level: std.log.Level =... | src/main.zig |
const std = @import("std");
const upaya = @import("upaya.zig");
usingnamespace upaya.sokol;
pub const Texture = extern struct {
img: upaya.sokol.sg_image = undefined,
width: i32 = 0,
height: i32 = 0,
pub const Filter = enum { linear, nearest };
pub const Wrap = enum { clamp, repeat };
pub fn ... | src/texture.zig |
pub const EVT_VARIANT_TYPE_MASK = @as(u32, 127);
pub const EVT_VARIANT_TYPE_ARRAY = @as(u32, 128);
pub const EVT_READ_ACCESS = @as(u32, 1);
pub const EVT_WRITE_ACCESS = @as(u32, 2);
pub const EVT_CLEAR_ACCESS = @as(u32, 4);
pub const EVT_ALL_ACCESS = @as(u32, 7);
//-----------------------------------------------------... | win32/system/event_log.zig |
// DO NOT MODIFY. This is not actually a source file; it is a textual representation of generated code.
// Use only for debugging purposes.
// Auto-generated constructor
// Access: public
Method <init> : V
(
// (no arguments)
) {
ALOAD 0
// Method descriptor: ()V
INVOKESPECIAL java/lang/Object#<init>... | target/generated-sources/gizmo/io/quarkus/deployment/steps/HibernateOrmProcessor$build8.zig |
const std = @import("std");
pub const VectorError = error{
OutOfBounds,
ZeroMaxCountIsUngrowable,
};
pub fn Vector(comptime T: type) type {
const DEFAULT_MAX = 20;
return struct {
arr: []T,
allocator: *std.mem.Allocator,
len: usize,
pub fn initSize(allocator: *... | vector.zig |
const builtin = @import("builtin");
const TypeId = builtin.TypeId;
const std = @import("std");
const assert = std.debug.assert;
const warn = std.debug.warn;
const matrix = @import("matrix.zig");
const Matrix = matrix.Matrix;
const M44f32 = matrix.M44f32;
const vec = @import("vec.zig");
const V3f32 = vec.V3f32;
const... | lookat.zig |
const std = @import("std");
const util = @import("util.zig");
const data = @embedFile("../data/day12.txt");
const Input = struct {
nodes: std.StringHashMap(std.ArrayList([]const u8)),
node_masks: std.StringHashMap(u25),
allocator: std.mem.Allocator,
pub fn init(input_text: []const u8, allocator: std.... | src/day12.zig |
const std = @import("std");
const allocator = std.heap.page_allocator;
const assert = std.debug.assert;
const hash = std.hash;
const math = std.math;
const mem = std.mem;
const time = @import("./time.zig");
const bits = @import("./bits.zig");
const deflate = @import("deflate.zig");
const implode = @import("implode.zi... | src/zip.zig |
const std = @import("std");
const wren = @import("wren");
pub var alloc = std.testing.allocator;
pub const Point = struct {
size:f64 = 0,
pub fn setSize (vm:?*wren.VM) callconv(.C) void {
if(wren.getSlotForeign(vm, 0)) |ptr| {
var point = @ptrCast(*Point,@alignCast(@alignOf(*Point),pt... | example/all_the_old_things.zig |
usingnamespace @import("bits.zig");
usingnamespace @import("system.zig");
var __psp_cwd: [PATH_MAX + 1]u8 = [_]u8{0} ** (PATH_MAX + 1);
pub fn __psp_init_cwd(path: ?*c_void) void {
if (path != null) {
var base_path: [PATH_MAX + 1]u8 = undefined;
var end: ?[*]u8 = null;
_ = strncpy(@ptrCas... | src/psp/os/cwd.zig |
const std = @import("std");
const fs = std.fs;
const math = std.math;
const mem = std.mem;
const whitelist = std.ComptimeStringMap([]const u32, .{
.{ "src/cli.zig", &.{ 35, 39 } },
});
fn whitelisted(path: []const u8, line: u32) bool {
const lines = whitelist.get(path) orelse return false;
return mem.inde... | scripts/lint.zig |
const std = @import("std");
const stdx = @import("stdx");
const t = stdx.testing;
pub const document = @import("document.zig");
/// Simple UTF8 buffer that facilitates text editing.
pub const TextBuffer = struct {
buf: std.ArrayList(u8),
num_chars: u32,
const Self = @This();
pub fn init(alloc: std.m... | stdx/textbuf/textbuf.zig |
const std = @import("std");
const PixelBuffer = @import("../video.zig").PixelBuffer;
const console_ = @import("../console.zig");
const Config = console_.Config;
const Console = console_.Console;
const Cart = @import("../cart.zig").Cart;
const Cpu = @import("../cpu.zig").Cpu;
const common = @import("common.zig");
con... | src/ppu/fast.zig |
const std = @import("std");
const builtin = @import("builtin");
// Description Found Here
// https://www.cmrr.umn.edu/~strupp/serial.html
const CBAUD = 0o000000010017;
const CS5 = 0o0000000;
const CS6 = 0o0000020;
const CS7 = 0o0000040;
const CS8 = 0o0000060;
const CLOCAL = 0o0004000;
const CRTSCTS = 0o020000000000;
... | src/usart.zig |
const std = @import("std");
const testing = std.testing;
const allocator = std.heap.page_allocator;
pub const Map = struct {
rows: usize,
cols: usize,
cells: [2]std.AutoHashMap(Pos, Tile),
curr: usize,
next: usize,
immediate: bool,
pub const Tile = enum(u8) {
Floor = '.',
... | 2020/p11/map.zig |
const std = @import("std");
const testing = std.testing;
const expect = testing.expect;
const expectEqual = testing.expectEqual;
const expectApproxEqRel = testing.expectApproxEqRel;
pub const Vector3 = packed struct {
x: f32,
y: f32,
z: f32,
pub fn init(x: f32, y: f32, z: f32) Vector3 {
return... | src/vector3.zig |
const std = @import("std");
const print = std.debug.print;
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
const alloc = &gpa.allocator;
const Range = struct {
min: usize,
max: usize,
};
const Rule = struct {
lower_range: Range,
upper_range: Range,
};
const INVALID_RANGE = Range{.min = 0, .max = ... | Day16/day16.zig |
pub const windows = @import("std").os.windows;
// General
pub const KEY_EVENT = 0x0001;
pub const MOUSE_EVENT = 0x0002;
pub const WINDOW_BUFFER_SIZE_EVENT = 0x0004;
pub const MENU_EVENT = 0x0008;
pub const FOCUS_EVENT = 0x0010;
pub extern fn GetConsoleOutputCP() c_uint;
pub extern fn SetConsoleOutputCP(wCod... | src/c/c.zig |
const std = @import("std");
pub var allocator = std.heap.c_allocator; // std.heap.page_allocator;
/// Name and type indices aggregate.
pub const NameAndType = struct {
name: u16,
t: u16,
};
/// Field type.
pub const FieldRef = struct {
class: u16,
name_and_type: u16,
};
/// Table 4.4-A. Constant poo... | src/types.zig |
const std = @import("std");
const Application = @import("gui").Application;
const Image = @import("Image.zig");
var clipboard_image: ?Image = null;
pub fn deinit() void {
if (clipboard_image) |image| {
image.deinit();
}
}
usingnamespace switch (@import("builtin").os.tag) {
.windows => @import("Cl... | src/Clipboard.zig |
const std = @import("std");
/// Returns an anonymously namespaced interface function for serializers.
pub fn Serializer(
comptime Context: type,
comptime Ok: type,
comptime Error: type,
comptime MapSerialize: type,
comptime SequenceSerialize: type,
comptime StructSerialize: type,
comptime ... | src/ser/interface/serializer.zig |
const std = @import("std");
const decoder = @import("decoder.zig");
const opfunc = @import("opfunc.zig");
pub const debug = false;
pub const CPUError = error{
OutOfBoundsAccess,
IllegalOpcode,
};
pub const CPUConfig = struct {
// Abstract pointer to data that the memRead/memWrite functions may use
m... | cpu.zig |
const __fixtfti = @import("fixtfti.zig").__fixtfti;
const std = @import("std");
const math = std.math;
const assert = std.debug.assert;
const warn = std.debug.warn;
fn test__fixtfti(a: f128, expected: i128) void {
const x = __fixtfti(a);
//warn("a={}:{x} x={}:{x} expected={}:{x}:u128({x})\n", a, @bitCast(u128,... | std/special/compiler_rt/fixtfti_test.zig |
const std = @import("std");
const Value = @import("value.zig").Value;
const Type = @import("type.zig").Type;
const Module = @import("Module.zig");
const assert = std.debug.assert;
const Air = @This();
instructions: std.MultiArrayList(Inst).Slice,
/// The meaning of this data is determined by `Inst.Tag` value.
/// The... | src/Air.zig |
const std = @import("std");
const leb = std.leb;
const macho = std.macho;
const mem = std.mem;
const assert = std.debug.assert;
const Allocator = mem.Allocator;
/// Table of binding info entries used to tell the dyld which
/// symbols to bind at loading time.
pub const BindingInfoTable = struct {
/// Id of the dy... | src/link/MachO/imports.zig |
const std = @import("std");
const mem = std.mem;
const testing = std.testing;
const Allocator = mem.Allocator;
const bog = @import("bog.zig");
const Token = bog.Token;
const TokenIndex = Token.Index;
const TokenId = @TagType(Token.Id);
const Tree = bog.Tree;
const Node = bog.Node;
const NodeList = std.ArrayList(*Node);... | src/parser.zig |