Back to code

Download

C Template Library

Summary

The C Template Library is a combination of several useful data structures, such as linked lists, hash maps, growable strings, and more, that attempt to preserve the same efficiency and type safety provided by a hand-coded solution, often by relying on instantiation of types via macros. Functionality, as well as disadvantages, are often comparable to those seen with STL data structures in C++. The components are intentionally written to be mostly independent, so that one need not introduce the entire library into a project in order to use a single useful data structure.

The mostly independent portions of the library each have their own page providing detailed documentation and individual downloads:

C List Template

Implements a singly-linked list with internal storage in a typesafe way.

C Hash Template

Implements a typesafe growable hash table with chaining fully parameterized over its key and value types and the key hash and equality functions.

Prestring

A growable string type designed to be interchangable with C strings while eliminating the possibility of buffer overflow errors.

Download

This download includes all CTL components:

ctl.tar.gz

Back to code

Back to main page

All text and images, but not necessarily linked material, on this page ©1998-2006 Derrick Coetzee and Moonflare and may not be reproduced or used for any purpose without prior written permission except where otherwise indicated.