[ Home | Docs | News | Resources | Download] |
GAUL Documentation: Support functions |
Several libraries of utility functions are distributed with the GAUL source code. These were written for rapid and easy development of portable C code. The provided routines are not developed along with GAUL, but packaged with it to facilitate easy distribution and installation. You are welcome to use these independently of GAUL. Many of them are routinely used in several projects, both GPL'd and proprietry. This shortfall is slowly being rectified. I apologise that these are not well documented, but they are generally very simple to use. These sets of functions include:
|
Linked lists are very powerful, yet simple, container structures. Two versions are implemented.
|
Tree structures are discussed in all good programming textbooks. This is an efficient implementation of the AVL tree structure. |
Flexible wrapper around the standard malloc() routines..
memory_util.c is intended as a general purpose, portable, memory tracking package that replaces the system calls realloc, calloc and realloc and free with "safer" routines while keeping track of all the memory currently allocated. Additional facilities to enable array overflow checks are included. The neat thing about all this is that it can sit over the top of any other memory debugging library which replaces the standard malloc routines, transparently. Has an easy-to-use memory chunk implementation. Chunks are created/destroyed using mem_chunk_new() and mem_chunk_destroy(). Individual atoms are created/destroyed using mem_chunk_alloc() and mem_chunk_free(). This may be disabled by defining MEMORY_NO_CHUNKS at compile time. Compile the code with MEMORY_ALLOC_SAFE for simple wrappers around the standard system allocation memory routines. Compile with MEMORY_ALLOC_DEBUG for fully auditing wrappers. Compile with neither for the standard routines only. When MEMORY_ALLOC_DEBUG is defined or MEMORY_NO_CHUNKS is not defined, my AVL tree implementation is required. FAQ: Q. Why not just use Purify? A. I can't afford it. Q. Well, ElectricFence is free - so why not use that? A. It is horrendously slow, and a huge memory hog. |
Routines for random number generation.
Portable routines for generating pseudo random numbers with the following features:
The algorithm used is the Mitchell and Moore variant of the standard additive number generator. The required array of numbers is populated by a using single seed value by using a linear congruential pseudo random number generator. Usage:
|
Anything must be an improvement over the standard C string API! (To be honest, this isn't really any improvement, but it is a bit more comprehensive.)
|
An alternative to null-terminated strings.
|
Flexible log handling.
|
Portability wrappers for MPI-like toolkits.
|
Simple indexed table implementation.
|
Simple timer routines. S-lang intrinsic function wrappers are provided.
|
Functions and wrappers used as a result of porting efforts. These are required to overcome the problem of functions used being missing on alternative platforms.
|
[ Home | Docs | News | Resources | Download] |
Hosted by: |
© 2001-2002, "Stewart Adcock" <stewart@linux-domain.com> All rights reserved. |
All trademarks on this page are probably owned by their respective companies. You can insert you own favourite disclaimer here. |