Vendored libraries
C libraries built for both targets and linked into your program.
How they ship
Each library ships as a static archive per target, lib<name>.a in res/libs/vendor/<triple>, beside the headers it was built from in res/libs/vendor/include/<name>. Adam's linker puts the code a program calls into the program itself, so no DLL or shared object ships beside the exe.
A library's .C unit names it in each routine's external clause (External declarations): external "zlib" is found as libzlib.a. Most libraries also have an .Ext unit with an Adam API over the C one (C libraries: .C and .Ext):
module exe vendor_zlib;
import System.SysUtils, System.Zlib.Ext;
// True when both arrays hold the same bytes
func Same(const AFirst: ByteArray; const ASecond: ByteArray): bool;
var
LI: int64;
begin
if len(AFirst) <> len(ASecond) then
return false;
end;
for LI := 0 to len(AFirst) - 1 do
if AFirst[LI] <> ASecond[LI] then
return false;
end;
end;
return true;
end;
var
GData: ByteArray;
GPacked: ByteArray;
GBack: ByteArray;
GError: string;
GI: int64;
begin
setlength(GData, 1000);
for GI := 0 to 999 do
GData[GI] := uint8(GI mod 10);
end;
if ZlibDeflate(GData, ZlibFormat.Gzip, 9, GPacked, GError) then
println("packed smaller: {}", len(GPacked) < len(GData));
end;
if ZlibInflate(GPacked, ZlibFormat.Gzip, GBack, GError) then
println("same bytes back: {}", Same(GData, GBack));
end;
end.
packed smaller: true
same bytes back: true
The libraries
| Library | Release, license | What it does | Units |
|---|---|---|---|
c | musl v1.2.6, MIT | Adam's own C library, built with the same flags for every target, so a routine gives the same result on both | System.LibC.C (its math.h and string.h routines) |
zlib | zlib license | deflate, zlib and gzip data | System.Zlib.C, System.Zlib.Ext |
minizip | zlib license | zip archives | System.Minizip.C |
yyjson | 0.13.0, MIT | JSON | System.JSON.C, System.JSON.Ext |
tomlc17 | MIT | TOML v1.0 and v1.1 | System.TOML.C, System.TOML.Ext |
xml2 | libxml2 v2.15.4, MIT | XML, XPath, schemas, HTML | System.XML.C, System.XML.Ext |
raylib | 6.2, zlib license | windows, input, 2D and 3D drawing, audio | System.Raylib.C, System.Raylib.Ext |
raven | v0.3.0, Apache-2.0 | windows of widgets, layout panels and themes | System.Raven.C, System.Raven.Ext, System.Raven.Raylib |
sdl3 | release-3.4.18, zlib license | windows, rendering, GPU, input, audio, gamepads | System.SDL3.C |
sdl3_mixer | release-3.2.4, zlib license | mixing tracks decoded from WAV, FLAC, MP3, Ogg Vorbis and MIDI | System.SDL3_mixer.C |
mojoal | zlib license | OpenAL 1.1 over SDL3's audio | System.MojoAL.C |
pl_mpeg | MIT | MPEG-1 video and MP2 audio | System.pl_mpeg.C |
Where libraries are found
A library is searched in each module's @addlibrarypath folders, in module and directive order (Directives), then in res/libs/vendor/<triple> and res/libs/system/<triple> beside adam.exe, then where the target's OS keeps its own.
res/libs/system/<triple> holds what the OS provides: on x86_64-windows-gnu its import libraries (kernel32.lib and the rest), on x86_64-linux-gnu .abi tables naming each symbol's version and shared library for glibc and libX11.