I spent most of my professional life writing programs and even do it as a
hobby from time to time. I wrote various application programs that might
be useful for others as well.
Note that all my programs are written in ANSI-C, possibly using POSIX-
standardized functions where appropriate. Thus I expect only minor
problems when porting to a new platform.
Preprocessor + parser for code instrumentation and analysis.
Contains an ANSI-C compliant preprocessor and parser. It can analyze your
code and show for example function dependencies. Most prominent is a mode
which instruments your code to emit tracing for function calls and returns.
You may also trace variable usage and changes. Furthermore, you can have
tracing for each individual source line and quickly fill your disk :).
Comes along with a compiler frontend wrapper "jscc" to
make usage very simple.
List of recent changes to JSCPP
Another small program included is "jstokmat" which
does pattern matching and changing on C-code ("jstokmat -h"
shows how).
To maintain and modularize libraries of subroutines, I use some utilities to extract prototypes, definitions, and error messages from the sources.
I also have files that define source code dependencies, i. e. which routine uses which etc. These dependencies can be analyzed by jsmakedeps. Maybe less useful is a source code encryption program jscrypt that makes a source code unreadable but still compilable on a target machine. This might be used if one wants to give sources away while restricting the others ability to do much with the program except compiling it.
jshex is a small utility to print binary files as a combined hex dump with printable characters shown as well. Another useful program is jscrcval which adapts/adds checksum tags in files to make the total checksum (as calculated by cksum) any desired value.
jstsort does standard topological sorting, but also specialized topological sorting that groups symbols that are independent, thus resolving the inherent ambiguity in standard topological sorts.
Additionally, this collection contains an archiver jsar, a command line calculator with some additional features like generating function tables jsexpr, and a little utility that replaces parts in a file.
In a lot of programs my gensort-utility turned out to be very
useful. It consists simply of the header file
"gensort.h", contained in the above package. To obtain
a sorting routine, simply define the name of the routine, the data type you
want to sort and how to compare items with preprocessor symbols, and then
simply say
#include <gensort.h>There you have a fast and reliable Quicksort (or alternatively Heapsort) routine! The abilities of the
gensort generated routines are
identical to those obtained by using the qsort routine from the
ANSI-C standard, but by far faster! The package contains
a test program testsort.c that compares the qsort
routines versus the gensort-generated ones.
NEW: I added code to produce "mergesort" routines suitable for linked lists.
A long description how to use it along with some easy examples is at the
begin of the header file gensort.h itself.
The bigsort routine implements a way to sort huge amounts of
data that do not fit into main memory by using a multi-phase sorting on files.
It is a implementation from the book "Algorithms and data structures"
by Niklaus Wirth. Additionally, this routine recognizes small amounts of data
that do fit into memory and resorts to a in-place quicksort.
This is my implementation of Bayer-Trees, which are normally used for indices of data bases. These routines provide all stuff that is needed: Create and destroy; insert, update and delete; load and destroy; search and traverse; check a tree. Included is a test program "testbtree" to demonstrate programming.
File access is done through a modular package "fcache" which allows multi user access via shared memory (System V or POSIX) and provides locking. This part can also be used separately. A administration program "fcacheadmin" and a test program "testfcache" for demonstration purposes.
NEW: For the low-level file format I introduced "dbasefs" - a file system implementation as another modular layer. "dbasefs" employs a schema to protect integrity of written data similar to a journaling file system. The data is written to one or multiple files which is similar to containers (or tablespaces) in a database. An administration program "dbfsadmin" and a test program "testdbfs" is included. Again, this part could be used separately. This part has undergone heavy development and testing during the last year.
A program to test a compiler's compliance to the ANSI-C standard. Some more esoteric but allowed features of the ANSI standard are tested, some preprocessor behaviour is tested. If your compiler does not complain, it's ok!
Depending on the architecture, compilers do padding of structures to force certain types to be aligned. This program shows quickly what alignments are required (i. e. otherwise you get a core dump when accessing values at unaligned addresses) and the imposed ones (i. e. padding in structures).
Well, has anybody ever counted how many times people have written this? I have to admit: I did it, too! This is a CURSES based program. It has a nice introduction and -most notably- an autopilot! So if you are tired of playing yourself, watch the computer play.