Project Documentation
src/main.zig
By convention, main.zig is where your main function lives in the case that you are building an executable. If you are making a library, the convention is to delete this file and start with root.zig instead.
pub fn main
pub fn main() !void
Main function
const PI
A constant named PI.
fn GenericStructure
fn GenericStructure(comptime T: type) type
Generic structure factory example
return struct
Field | Description |
---|---|
value: T | Contained value |
src/root.zig
By convention, root.zig is the root source file when making a library. If you are making an executable, the convention is to delete this file and start with main.zig instead.
pub export fn add
pub export fn add(a: i32, b: i32) i32
Example add
function
struct Point
Point structure
Field | Description |
---|---|
x: u32 | Horizontal coordinate |
y: u32 | Vertical coordinate |
pub fn someFunc
pub fn someFunc(a: i32) void
Some function
struct Vec3
3d vector structure