Skip to content

Latest commit

 

History

History
126 lines (106 loc) · 4.55 KB

README.rst

File metadata and controls

126 lines (106 loc) · 4.55 KB

libcommon

libcommon is a collection of reusable C++ code shared by many C++ projects at CM4all GmbH.

The project was created when code duplication between C++ projects got out of hand. Commonly used code was moved into this library, instead of keeping several copies in sync.

The library is meant to be included in other projects as a git submodule. It is a lively and volatile project, which makes it hard to turn it into a shared library. Retaining ABI stability (which is very difficult with C++ anyway) would be too hard at this stage, and not worthwile.

Building libcommon

You need:

Optional dependencies:

To build it, type:

meson . build
ninja -C build

That produces several static libraries.

Contents

Each directory below src contains a sub-library:

  • adata: data structures using our pool allocator
  • co: C++20 Coroutines
  • event: a non-blocking I/O event loop
  • event/net: non-blocking networking libraries
  • event/systemd: non-blocking systemd clients
  • event/uring: integration of io_uring in the event loop
  • http: HTTP protocol definitions and helpers
  • io: file I/O utilities
  • io/config: a configuration file parser
  • io/linux: Linux-specific I/O helpers
  • io/uring: liburing C++ wrapper
  • jwt: helpers for JSON Web Tokens
  • lib: C++ wrappers or additional utilities for various external libraries.
  • lua: Lua C++ wrappers
  • lua/event: non-blocking Lua
  • lua/io: I/O helpers for Lua
  • lua/json: Lua JSON library
  • lua/mariadb: Lua wrapper for libmariadb
  • lua/net: networking helpers for Lua
  • lua/pg: non-blocking PostgreSQL client for Lua
  • lua/sodium: Lua wrappers for libsodium
  • memory: memory allocators
  • net: networking/socket utilities
  • pg: libpq C++ wrappers
  • spawn: a process spawner
  • stock: manage stocks of reusable objects (e.g. for connection pooling)
  • system: operating system utilities
  • thread: helpers for multi-threaded applications
  • time: dealing with date and time
  • translation: implementation of the CM4all translation protocol
  • uri: URI utilities
  • util: generic utilities
  • was: helpers for libwas
  • was/async: a non-blocking implementation of the Web Application Socket protocol

These directories contain C++ wrappers or additional utilities for external libraries:

Special directories:

  • pluggable: contains fallback implementations for modules that should be replaced by applications using libcommon