The DynDN.eS Blog

About DynDN.eS, eQmail, Gentoo & some other network stuff

User Tools

Site Tools


qlibs

qlibs is a static C library based and derived on work of D.J. Bernstein (short: djb). Some people may ask: Why another such project? Why not use e.g. libowfat, bglibs or skalibs? Now, an answer is not easy to give as well as there are pros and cons too.

All of these libs have some points together with qlibs: they are very individual, not in wide spread use, the documentation lacks more or less and in comparison with the standard C library there are nearly no coding examples available. Could this change?

Historical

First I extracted some libs from my eQmail project. It was just to improve maintainability and get a cleaner structure of code. This included a consolidation of code against micromanagement. Later on I did compare these files - which were based on netqmail-1.06 - with other packages, e.g. ucspi-tcp-0.88. I realized the differences because there was some progress in the development. So the second task was to put all the libs to an equal and more recent level. Thus the dns/socket libs were added as well IPv6 support was updated. At this point I introduced qlibs as name of a separate project.

Technical

The base of qlibs is the C development environment partially provided by djb together with his published packages. Important influence came from Felix von Leitner's (fefe) libowfat, e.g. IPv6 functionality. Some minor ideas I got from skalibs. Some through the time obsoleted code was removed and replaced by standard C libraries. But however, keeping qlibs in the spirit of djb - especially security - is a core requirement. And the ease of use has precedence over quantity.

Positioning

To prevent incorrect expectations, qlibs is NOT indented to be a full featured C library environment, even if some people want to see potential. It is far of my prospects to do so in multiple ways. qlibs main positioning is to ease the usage of system functions including to eliminate some possible shortcomings.

Two more important points of qlibs:

  • it requires IPv6 (from the OS) for network functionality
  • it doesn't (and will never) provide backwards compatibility for historical (UNIX) systems

How to get it

qlibs is published and available as a git repository only (yet): qlibs-master.

After download extract the sources and run

$> make

Copy the files  libqlibs.a  and  qlibs.a  into a (e.g.)  /usr/lib/  and the whole content of the folder  include  to (e.g.)  /usr/include/qlibs .

The package is under heavy development and things will change quickly. The steps above are a save method for installation. Alternative checkout  conf-build  and execute

$> make install

Do it at your own risk.

Usage

This is not a full documentation how to use qlibs. It is just to show that qlibs could be used (linked) easily in the standard way. Here an example how to do in a Makefile:

CCFLAGS = -I/usr/include/qlibs
LDFLAGS = -Lqlibs
QLIBS = $(LDFLAGS) -lqlibs
 
hostname:
    $(CC) hostname.c
    $(LD) hostname $(QLIBS)

Or alternative at the command line:

$> cc -o hostname hostname.c -I qlibs/include -Lqlibs -lqlibs hostname.c

For sure, the pathes have to be the right ones.

Projects

There are several project based on qlibs:

  • eQmail (for sure :-))
  • qemu-init - handle qemu VM's
  • Erwin Hoffmann's djbdns FIXME
  • my fork of publicfile (not published yet)

Comments