yahelpers
Enhanced debugging functionality for the ya ecosystem
Loading...
Searching...
No Matches
yahelpers

CI Build and Deploy Docs CodeQL Advanced Release

Some helper functionality (debug helpers; requires C99) for the ya ecosystem.

Table of Contents

  • License
  • Documentation
  • Features
  • Minimal Example
  • Build system support
  • Installation
    • Install with CMake
    • Install with Meson
    • Install with Autotools
  • Which build system should I use
  • ya‑ ecosystem

License

This repository is under the MPL-2.0 License, see LICENSE.md

Documentation

The documentation is generated using Doxygen.

Building the documentation locally

If you prefer to generate the documentation locally instead of using the online version, run:

# Make sure the following packages are installed:
# - doxygen
# - graphviz
# - texlive-latex-base
# - texlive-latex-recommended
# - texlive-latex-extra
# - texlive-fonts-recommended
doxygen Doxyfile
cd doxygen-doc/latex
make

Features

  • Header-only C99 helper library
  • Debugging helpers (assert.h, log.h, logconstants.h)
  • Cross‑platform (Linux, macOS, Windows)
  • Supports CMake, Meson, Autotools and pkg-config
  • Designed for the ya- ecosystem (yastk, yaerrno, ... (more in the future))

Minimal Example

#include <ya-ecosystem/helpers/log.h>
#include <ya-ecosystem/helpers/assert.h>
int main(void) {
LOG_DEBUG("Program started");
int x = 5;
ASSERT(x == 5); // will abort with a helpful message if false
LOG_DEBUG("x = %d", x);
return 0;
}
#define ASSERT(cond)
Prints a debug message if the condition cond is failed.
Definition assert.h:21
#define LOG_DEBUG(formatted_string,...)
Prints a debug message.
Definition log.h:46

Build system support

yahelpers supports three build systems:

  • CMake
  • Meson
  • Autotools

All build systems are fully maintained and tested in CI.

Installation

yahelpers is a header‑only library. You can install it using any of the supported build systems.

Install with CMake

cmake -B build
cmake --build build
sudo cmake --install build

Use in your project:

find_package(yahelpers REQUIRED)
target_link_libraries(your_target PRIVATE yahelpers)

Install with Meson

meson setup build
meson install -C build

Use in your project:

dependency('yahelpers')

Install with Autotools

autoreconf --install
./configure
make
sudo make install

Use in your project:

pkg-config --cflags --libs yahelpers

Which build system should I use?

yahelpers supports three build systems because different users have different needs:

Buildsystem Best suited for Advantages
CMake Most users, modern C projects Widely used, great IDE integration, provides CMake package config files
Meson Users who want fast and clean builds Very fast, simple syntax, minimal boilerplate
Autotools Linux distributions, legacy environments Standard in many distros, extremely portable and compatible

Recommendation:
For new projects → CMake or Meson.

For distributions → Autotools.

<em>ya- Ecosystem</em>

yahelpers is part of the emerging ya- ecosystem, a collection of small, modular C libraries:

  • yahelpers – Debugging helpers
  • yastk – Stack library
  • yaerrno – Error system
  • yabool – Boolean utilities

The goals of all ya- libraries are:

  • header‑only or minimalistic
  • C99‑compatible
  • cross‑platform
  • usable with multiple build systems