alyxshang/xian
A light string library for Zig. :thread: :lizard: (W.I.P.)
A light string library for Zig. :thread: :lizard:
This repository contains the source code for a package for the Zig programming language to provide various functionality for working with strings and string slices. Xiàn (线) is the Chinese word for "string".
xian
to your build.zig.zon
To use the Xiàn package in your Zig project, run the following command from the root of your Zig project:
zig fetch --save git+https://github.com/alyxshang/xian#v.0.1.0
This will add the Zhangshield package to your build.zig.zon
file.
xian
in your build.zig
To declare the Xiàn module in your build.zig
, the following Zig
code is required:
const xian = b.dependency("xian", .{});
const xian_mod = xian.module("xian");
Depending on which modules are declared in your build.zig
and which modules
you want to add Xiàn to, the following line is required:
exe_mod.addImport("xian", xian_mod);
exe_mod
is representative for a module for an executable you have previously
declared in your build.zig
. Please note the following: The name used for importing
Xiàn into your code corresponds to the string slice used in the function call
addImport
.
To view this package's API please clone this repository and run the command
zig build-lib -femit-docs src/root.zig
from the repository's root or
view them here.