projects@yorhel.nl
home - git - @ayo
= pgp = only used for releases
key - mit
7446 0D32 B808 10EB A9AF A2E9 6239 4C69 8C27 39FA

Cute decorative scissors, cutting through your code.

Ylib

Ylib is a collection of small and mostly independent C libraries.

Libraries

dbusev (dbusev.h and dbusev.c)

Register a DBusConnection (libdbus-1) with libev.

ecbuf (ecbuf.h)

An automatically expanding type-safe generic circular buffer.

evtp (evtp.h and evtp.c)

A convenient thread pool for libev.

list (list.h)

Simple macros for working with (intrusive) linked lists.

sqlasync (sqlasync.h and sqlasync.c)

Asynchronous wrappers for working with SQLite3 databases.

vec (vec.h)

Type-safe macro-based vector/array implementation. Also has some macros to work with ordered vectors.

ylog (ylog.h and ylog.c)

A low-level logging system for C.

yopt (yopt.h)

A portable and minimal getopt_long() replacement.

yuri (yuri.h and yuri.c)

A minimal URI validation and parsing library.

Documentation for each library can be found in the .h files. To use a library, simply copy the .h and .c file (if any) into your project.

These libraries are maintained in git and can be cloned with git clone git://g.blicky.net/ylib.git. The repo is also available for online browsing.

If you use any of the above libraries, it is advised to occasionally check the repository for updates. Subscribing to its Atom feed is recommended.

Overview

All of these libraries are written with the goal of being small, efficient and portable.

In this context, 'small' refers to the code size -- it is easier to understand and integrate a small library than it is to use a larger one.

'Efficient' refers to having a low memory and computational overhead, where that makes sense. That usually manifests itself in avoiding excessive use of dynamic memory (malloc()/realloc()/free()) and system calls.

My idea of 'portable' is somewhat along the lines of "it should work on any 5+ years old UNIX-like system". In practice this may not always be true due to the lack of rigorous testing, but I very much appreciate patches that help reach this goal. Note that I do not consider native Windows/MSVC part of this equation. Some libraries may work on Windows, others certainly won't. Similarly, these are all C libraries, a C++ compiler may not necessarily like them. Patches to improve Windows or C++ support are welcome, as long as the modifications are not very involved.

Ylib likely won't have everything you need. Here are a few other excellent libraries and library collections. This list is definitely not complete, feel free to contact me if you have more relevant projects to be listed here.