Clone
10
Home
Abdelrahman Said edited this page 2026-03-09 22:25:08 +00:00

Wizard Apprentice Standard Library

Wizard Apprentice Standard Library (wapp) is a lightweight collection of reusable utilities for C and C++ projects.

It provides common data structures, memory utilities, OS abstractions, and testing tools in a simple source-distribution format.

The library is primarily written in C11, with some C++11 functionality where necessary.

The goal of wapp is to provide:

  • Practical utilities to replace the C/C++ standard libraries
  • A clean, minimal dependency structure
  • Easy integration without a build system

Features

  • 📦 Header + source design (drop directly into your project)
  • ⚙️ C11 first, C++ compatible
  • 🧩 Modular package system
  • 🧠 Internal dependency management
  • 🧪 Built-in testing framework
  • 🖥️ Cross-platform support (POSIX + Windows)

Quick Start

Download the latest release.

Add the library to your project.

Include

#include "wapp.h"

Build

Add the library source file to your build step:

wapp.c

You can now use the entire library.


Installation Options

wapp can be integrated in three different ways.

Include:

#include "wapp.h"

Compile:

wapp.c

This enables all packages.


2. Single Package

Each package exposes its own interface.

Example:

wapp_base.h
wapp_base.c

Usage:

#include "wapp_base.h"

Compile:

wapp_base.c

3. Multiple Packages

Some packages depend on others.

When compiling multiple packages manually, avoid compiling dependency sources twice. Doing so violates the One Definition Rule.

Package documentation lists all dependencies.


Build Configuration

Two optional macros control runtime checks.

WAPP_DEBUG_ASSERT

Enables additional debug assertions.

Recommended during development.


WAPP_NO_RUNTIME_ASSERT

Disables all runtime safety checks.

⚠️ Not recommended unless you are certain the library is used correctly.


Library Architecture

The library source lives inside the src directory.

src/
├── base
├── common
├── os
├── prng
├── testing
└── uuid

Each directory represents a self-contained package.

Packages may depend on other packages internally. Dependencies are resolved automatically using relative includes, so users usually do not need to manage them manually.

Each package exposes a single public interface:

wapp_<package>.h
wapp_<package>.c

Example:

src/
├── base
│   ├── wapp_base.c
│   └── wapp_base.h
├── os
│   ├── wapp_os.c
│   └── wapp_os.h
├── prng
│   ├── wapp_prng.c
│   └── wapp_prng.h
├── uuid
│   ├── wapp_uuid.c
│   └── wapp_uuid.h
├── testing
│   ├── wapp_testing.c
│   └── wapp_testing.h
├── wapp.c
└── wapp.h

Packages

Package documentation is available in the Packages section.


Building the Library

This section is only required if you want to develop or contribute to the library.

The build scripts compile the library and run both the C and C++ test suites.

The project is primarily developed on Linux and macOS, using make as a task runner.


Clone the Repository

git clone https://git.thewizardapprentice.com/abdelrahman/wizapp-stdlib.git
cd wizapp-stdlib

Build and Run Tests

./build

Available Build Targets

make help

Windows Support

Windows builds are supported using PowerShell.

Run:

build.ps1

The script builds the library using MSVC and runs the test suite.

While it does not yet provide full feature parity with the Makefile, it performs the required build and validation steps.


Contributing

Contributions are welcome.

Please ensure that:

  • New code follows the existing package structure
  • Tests are added when appropriate
  • The project builds and tests pass on supported platforms

License

wapp is distributed under the Apache License 2.0.