You are invited to learn the innards of the Zig Standard Library by reading the comments and source of the library itself. This document serves as a map to the available namespaces, types, and functions. Click on a name to jump to its location in the source to learn more!
Operating system provided threads.
impl getCurrentId() getCpuCount() spawn() getHandle() detach() join() AutoResetEvent Futex ResetEvent StaticResetEvent Mutex Semaphore Condition spinLoopHint use_pthreads Id CpuCountError SpawnError HandleGeneral purpose hash table when fast iteration over items is desired. Otherwise HashMap is faster. Note the handy StringArrayHashMap() and AutoArrayHashMap() functions.
AutoArrayHashMap() AutoArrayHashMapUnmanaged() StringArrayHashMap() StringArrayHashMapUnmanaged() eqlString() hashString()One of the most popular items in the Standard Library. A list of items that can grow! Give it an allocator.
ArrayList()Handle common operations on ASCII characters (such as detecting upper and lower case letters). See unicode.zig for Unicode-specific operations and mem.zig for most of what you might think of as 'string' operations in other languages.
isAlNum() isAlpha() isCntrl() isDigit() isGraph() isLower() isPrint() isPunct() isSpace() isUpper() isXDigit() isASCII() isBlank() toUpper() toLower() lowerString() allocLowerString() upperString() allocUpperString() eqlIgnoreCase() startsWithIgnoreCase() endsWithIgnoreCase() indexOfIgnoreCasePos() indexOfIgnoreCase() orderIgnoreCase() lessThanIgnoreCase() spacesEncode and decode binary data to and from "ASCII-safe" text Base64 encodings.
Error standard_alphabet_chars standard standard_no_pad url_safe_alphabet_chars url_safe url_safe_no_pad standard_pad_char standard_encoder standard_decoderTypes for compactly storing a series of single bit values.
StaticBitSet()The Zig build system. Performs the same actions as 'make' but build.zig files are written in pure Zig.
Types built into the Zig language itself. This file is indespensible for understanding the metadata available during compile time type introspection and reflection. This file is also used by the compiler!
testVersionParse() default_panic()Access to common C Standard Library functions and such. See the additional functionality imported for each supported platform such as Linux, Windows, FreeBSD, Solaris, etc.
fopen fclose fwrite fread printf abort exit _exit isatty close lseek open openat ftruncate raise read readv pread preadv writev pwritev write pwrite mmap munmap mprotect link linkat unlink unlinkat getcwd waitpid fork access faccessat pipe mkdir mkdirat symlink symlinkat rename renameat chdir fchdir execve dup dup2 readlink readlinkat rmdir getenv sysctl sysctlbyname sysctlnametomib tcgetattr tcsetattr fcntl flock ioctl uname gethostname shutdown bind socketpair listen getsockname getpeername connect accept accept4 getsockopt setsockopt send sendto sendmsg recv recvfrom recvmsg kill getdirentries setuid setgid seteuid setegid setreuid setregid setresuid setresgid malloc realloc free futimes utimes utimensat futimens pthread_create pthread_attr_init pthread_attr_setstack pthread_attr_setstacksize pthread_attr_setguardsize pthread_attr_destroy pthread_self pthread_join pthread_detach pthread_atfork pthread_key_create pthread_key_delete pthread_getspecific pthread_setspecific sem_init sem_destroy sem_post sem_wait sem_trywait sem_timedwait sem_getvalue kqueue kevent getaddrinfo freeaddrinfo getnameinfo gai_strerror poll ppoll dn_expand pthread_mutex_lock pthread_mutex_unlock pthread_mutex_trylock pthread_mutex_destroy pthread_cond_wait pthread_cond_timedwait pthread_cond_signal pthread_cond_broadcast pthread_cond_destroy pthread_rwlock_destroy pthread_rwlock_rdlock pthread_rwlock_wrlock pthread_rwlock_tryrdlock pthread_rwlock_trywrlock pthread_rwlock_unlock dlopen dlclose dlsym sync syncfs fsync fdatasync prctl getrlimit setrlimit fmemopen syslog openlog closelog setlogmask getErrno() tokenizer Token Tokenizer environ PTHREAD_MUTEX_INITIALIZER PTHREAD_COND_INITIALIZER pthread_t max_align_tWhen a father and mother process love each other very much.
createWindowsEnvBlock() createNullDelimitedEnvMap()Common Object File Format for executable, object, and shared library code on elder Unix, MS Windows PE, and UEFI environments.
Note that the listing here has been truncated because of how many dwarf bits there are. :-)
TAG_padding TAG_array_type TAG_class_type TAG_entry_point TAG_enumeration_type TAG_formal_parameter TAG_imported_declaration 592 more...ELF executable and linkable format (executable file format) used by most Unix-like systems. Note that this entry has been truncated because it has a lot of symbols.
int() int32() 37 more...AT_NULL AT_IGNORE AT_EXECFD AT_PHDR AT_PHENT AT_PHNUM AT_PAGESZ 329 more...General purpose hash table. Use ArrayHashMap instead when fast iteration over items is desired. Otherwise this is faster. Note the handy StringHashMap() and AutoHashMap() functions.
getAutoHashFn() getAutoEqlFn() AutoHashMap() AutoHashMapUnmanaged() StringHashMap() StringHashMapUnmanaged() eqlString() hashString() verifyContext()JSON parser and writer. Stream tokens or parse into Zig data types!
validate() parse() parseFree() unescapeValidString() stringify()Little Endian Base 128 is a variable-length compression format for integers. This is what happens when an integer must be taught the ways of love by a gardener in 1901.
readULEB128() writeULEB128() readILEB128() writeILEB128() writeUnsignedFixed()Mach-O executable file format used in NeXTSTEP, macOS, and iOS.
28 more...LC_REQ_DYLD LC_SEGMENT LC_SYMTAB LC_SYMSEG LC_THREAD LC_UNIXTHREAD LC_LOADFVMLIB 276 more...Compare, duplicate, trim, and otherwise manipulate memory. This can be used for most of what you might think of as 'string' operations in other languages.
validationWrap() alignAllocLen() copy() copyBackwards() set() zeroes() zeroInit() order() lessThan() eql() indexOfDiff() Span() span() spanZ() sliceTo() len() lenZ() indexOfSentinel() allEqual() dupe() dupeZ() trimLeft() trimRight() trim() indexOfScalar() lastIndexOfScalar() indexOfScalarPos() indexOfAny() lastIndexOfAny() indexOfAnyPos() indexOf() lastIndexOfLinear() indexOfPosLinear() lastIndexOf() indexOfPos() count() containsAtLeast() readVarInt() readIntNative() readIntForeign() readIntSliceNative() readIntSliceForeign() readInt() readIntSlice() writeIntNative() writeIntForeign() writeInt() writeIntSliceLittle() writeIntSliceBig() writeIntSlice() bswapAllFields() tokenize() split() startsWith() endsWith() join() joinZ() concat() min() max() swap() reverse() rotate() replace() replaceScalar() collapseRepeatsLen() collapseRepeats() replacementSize() replaceOwned() littleToNative() bigToNative() toNative() nativeTo() nativeToLittle() nativeToBig() alignPointerOffset() alignPointer() asBytes() toBytes() bytesAsValue() bytesToValue() bytesAsSlice() sliceAsBytes() alignForward() alignForwardGeneric() doNotOptimizeAway() alignBackwardAnyAlign() alignBackward() alignBackwardGeneric() isValidAlign() isAlignedAnyAlign() isAligned() isAlignedGeneric() alignInBytes() alignInSlice() page_size byte_size_in_bits Allocator toSliceConst toSlice readIntLittle readIntBig readIntSliceLittle readIntSliceBig writeIntLittle writeIntBig writeIntSliceNative writeIntSliceForeign separateLow level networking support.
connectUnixSocket() tcpConnectToHost() tcpConnectToAddress() getAddressList() isValidHostName()