FOR DEVELOPERS / TECHNICAL REFERENCE

Plain C Reader quickstart

Build the source-free plain C Reader preview example and read hosted, external-index, and member resources.

Illustrated protocol guide → · Technical reference →

The native C Reader is a local review preview for Windows x64 and Linux x64. Its public PreviewC.h and prebuilt library are packaged without implementation source. The review ZIPs are not published yet. This guide explains how to use a package supplied for review; it is not an installation link or a 1.0 compatibility promise. See the complete C ABI reference for every signature and status.

Build the packaged example

Extract the platform-matched ZIP. Use its top-level SDK directory as SDK_ROOT: AmoosedWebGameReader on Windows or AmoosedWebNativeReader on Linux. Its examples/native-c-site.c is the same downloadable source published here. Build against the extracted package, including its public header and prebuilt library. Replace SDK_ROOT below with the absolute path to that directory.

On Windows with Visual Studio 2022 and CMake:

cmake -S SDK_ROOT/examples -B native-c-build -G "Visual Studio 17 2022" -A x64 -DCMAKE_PREFIX_PATH=SDK_ROOT
cmake --build native-c-build --config Release

Run native-c-build/Release/native-c-site.exe. Put SDK_ROOT/bin on the process DLL search path or place the matching DLL beside the executable.

On Linux with CMake, a C compiler, and the package's documented OpenSSL, libcurl, and libpng dependencies:

cmake -S SDK_ROOT/examples -B native-c-build -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=SDK_ROOT
cmake --build native-c-build

Run native-c-build/native-c-site. Use the shared library from the same SDK package; do not mix library and header revisions.

Read a public hosted site

native-c-site https://your-site.example/ ABSOLUTE_OUTPUT_PATH
native-c-site https://your-site.example/ /amoosed.com/app/data.bin ABSOLUTE_OUTPUT_PATH

The first command asks the verified index for its app entry. The second names an indexed resource. The output path must be absolute and inside a trusted local directory. The Reader verifies the carrier parts and complete resource before publishing the output, and refuses to replace an existing file. HTTPS is required except for loopback HTTP during local development.

Read an externally keyed site

native-c-site --external invitation.amwkey https://your-site.example/ ABSOLUTE_OUTPUT_PATH

The example also accepts a packed index ICO in place of .amwkey. It reads the file locally and passes credential bytes to the C library. Only the file path appears in the command arguments. The index credential is a transferable bearer key; keep it out of repositories and logs.

Read a protected member resource

native-c-site --external invitation.amwkey --member member.amwmember https://your-site.example/ /amoosed.com/app/bonus/note.txt ABSOLUTE_OUTPUT_PATH

For a site with a public hosted index, omit --external invitation.amwkey. The example parses the separate .amwmember file, compares its edition ID with the verified index, passes the 32-byte key to the one download, then clears its key buffers. A missing, malformed, or different-edition member credential does not produce an output file. The key does not grant access to an external index by itself.

Recover a standalone WAV exchange

The SDK's examples/native-c-audio.c is the same downloadable source published here. Build the extracted SDK's example project as above, then run:

native-c-audio carrier.wav media-key.hex recovered.bin

Use native-c-build/Release/native-c-audio.exe on Windows or native-c-build/native-c-audio on Linux. The key file contains the separate 64-character hexadecimal media key; it is neither an index credential nor a member key. The example authenticates the complete WAV before it creates the output and refuses to replace an existing file. Keep the key file outside the hosted site and choose a trusted local output path. This revision-14 call handles one self-contained AWA1 WAV, not an indexed multi-clip set or a website wav-4fsk1 resource.

Integrate the C ABI in your product

Include AmoosedWeb/PreviewC.h and link the package's AmoosedWeb::GameReaderC CMake target. Check amw_preview_abi_revision() and amw_preview_capabilities() at startup; require the capability bits for the index, carrier, and protected-content operations you use. Open a site, query its entry or resource metadata, read or download a resource, and release the site handle. Text uses UTF-8 bytes with explicit lengths. Returned strings go into caller-owned buffers. The plain C source shows these calls in order.

The preview API also supports a single-use operation handle for cancellation and a bounded verified memory read. Keep synchronous network calls off the UI thread. See the ABI reference for exact ownership, failure outputs, cancellation rules, and numeric status values. Use the C++ API reference when integrating through C++ instead.

Compatibility status

amw_preview_* revision 16 can still change. The proposed stable general Reader uses a separate amw1_* namespace; no shipped library exports it. The 1.0 design explains the planned symbol, capability, ownership, and additive-minor rules. Local Windows and Linux package tests exercise hosted, external, member, damaged-carrier, cancellation, and output behavior. Real target-host HTTPS and the remaining wrapper/platform parity are still required before a stable public native SDK.