Here is some software I have written over the ages. It is all in the public domain. You may use the software any way you wish, I do not claim a copyright on any of it. You can remove my name and pass it off as your own if you'd like.
SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
If for any reason your jurisdiction does not recognize waiver of my copyright or the creation of public domain works, then use the CC0 1.0 Universal as a fallback.
|Makefile that can build everything here to use as a reference
|args.c args.h args_test.c
|parser for command-line arguments.
|3D model format file loader for Wavefront OBJ format. These
files are needed:
byte_order.h fileio.c fileio.h logger.c logger.h model.c model.h test-3dsloader.c
|A bijective base-26 numeration system (aka 26-adic). It is the base-26 that is used to label columns in spread sheet programs. It goes A..Z, AA..AZ, BA..BZ, ... This program can convert to the system and from the system. 'A' starts at 0, 'Z' is 25, 'AA' is 26, etc.
|Encodes and decodes numbers in base85 using Ascii85/adobe or modifier RFC1924.
|Loads BDF(Glyph Bitmap Distribution Format) font files to a data structure.
|Example of using bitfields with anonymous struct and union. (GCC extension)
|Macros to define bitfields of any size and manipulate them. example program: bitfield_test.c
|Primitive BMP bitmap image writing program. Only supports 8-bit grayscale images. (Example image)
|I/O buffer library. supports a zero-copy API.
|Example of using C99 arrays to functions
|dumps binary or text file into a C array. supports hexdump, character literals, string escapes, and decimal.
|Portability macros for various compiler and C99 extensions.
|basic example of how a credit card works.
|Simple curses based digital clock. build with -lncurses
|Parses a simple config file using wildcard matching
|convert DOS CP-437 US Character set to UTF8 Unicode.
|Calculates a CRC32 (ANSI X3.66) or CRC16 (Xmodem) on a block of data. [C99]
|Loads Creativyst Table eXchange Format (CTX) files. Which are like "CSV" files.
|Example of rendering an OpenGL cube using VBOs. (requires SDL2)
|converts an unsigned number into a decimal string without using sprintf.
|An example of using CURSES. (late 1990's)
|One of the first TCP/IP socket programs I wrote.
|Wrapper for Windows FindFirstFile()/FindNextFile() to implement a subset of POSIX opendir(), readdir(), closedir() and rewinddir().
|dll.c dll.h dll_test.c dll_plugin1.c
|dll/shared-object loading for Windows and POSIX. Includes test code and an example plug-in.
|Logging macros and function for C89 and C99.
|converts raw console fonts into X11 BDF fonts
|Generates Freecell boards based on Microsoft Freecell. Requires oldrand.c and oldrand.h
|A library to abstract binary file I/O in a slow but easy to read way.
|example of using function pointers
|Utility to look up errno values into symbolic names and error message strings.
|GCD calculator - Greatest Common Divisor
|example of using getaddrinfo and getnameinfo to do IPv4 and IPv6 look-ups transparently
|dynamic arrays using realloc
|example of a priority queue as a heap in an array holding a complete binary tree. Only a moderate amount of testing has gone into this.
|Integer hash table. test/example program: test_ihash.c
|ini.huge.c ini.huge.h demo.ini
|Old version of a library that loads windows-style INI configuration files. (ANSI C)
|a medium sized .ini config file parser.
|a minimalize INI config file parser using scanf
|ipow() is an integer power function for doing exponents.
|linked list macros without documentation. (ANSI C)
|macros and library to log debug messages and status messages. test/example program: logger_test.c
|a handful of useful macros for arrays, compiler options, tracing, and debuging.
|substitute one file extension for another. useful for handling command-line parameters.
|associative array using string hashing
|map2.c map2.h list.h macros.h
|version 2 of associative array hash table code
|allows a file to mapped into memory (read-only) to be used as one big string. NOTE: the file is not null terminated. you must use the len parameter. On 32-bit systems you may have trouble loading very large files (like around 512M - 1GB, depending on your operating system and architecture). A more elegant solution would be to map around 1MB at a time and just move the map forward with a new offset.
|the classic maze drawing algorithm. example
|Pseudo-threads macros. See also "ot.h" below.
|container for holding vertices for 3D objects. with some hacks for 3DS and OBJ file formats.
|utilitiy that turns a list of strings into C source for an enum and optionally a table of strings.
|Phase of the Moon, quick and dirty. With cool ASCII art. (build with -DUNIT_TEST to get a command-line program instead of a library)
|Lists all of your computer's IP addresses. Supports IPv4 and IPv6
|generic networking routines
|framework for writing diagnostic/debug/test code, outputs hex of a TCP socket in real time. easily modified for your tests.
|3D model format file loader for Wavefront OBJ format. These
files are needed:
logger.c logger.h fileio.c fileio.h model.c model.h test-objloader.c
|Implementations of old/obsolete random number generators. Including the generator used in Microsoft Visual C v4.0, the same one used for Microsoft Freecell game.
|Pseudo-threads macros. See also "microthreads" above. Example: test-ot.c
|draw a Hilbert's curve in ASCII. alternate versions: hilbert2.c hilberttiny.c
|mren : mass rename using posix regular expression regex
|A simple template for loading text files to parse.
|3D and 2D line drawing routines using Bresenham's line algorithm the 2D line routine has an enhancement that does an inexpensive distance estimation. some stand-alone distance calculations are included for comparison with the distance estimate in line2d
|Password generator. supports a variety of settings. also an [ugly] example of parsing command-line options without using getopt()
|extensive test program for queue.h (see below)
|inefficient and untested RC4 implementation. primarily for use as a pseudo-random number generator.
|configuration file format parser. Example/test program
|utility to encode and decode RickDate format. example: December 25, 2006 is 1JPCP. This format is useful for appending date information on filenames. There is a 3 and 4 letter version as well.
|round up a number to next power of 2 in few loops
|A poor attempt at a program to strip comments and whitespace from C programs.
|inefficient and untested SHA-1 implementation
|a smaller inefficient and untested SHA-1 implementation
|finds all network interfaces and shows a little information about them. some operating systems list interfaces multiple times because of different flags, modes, etc. if you want to use this code you should be aware that duplicate interfaces is a possibility
|function to do string comparison between a string and a series of chars.
|generate tables useful for performing bit stretching
|example of using the strtok() function
|Password hashing using TEA and XXT algorithms. Completely insecure, but short and simple.
|telnet.c telnet.h arpa-telnet.h
|Telnet protocol parser (add your own network code). snapshot:telnet-jdm-20080523.tar.gz
|Primitive TGA image writing program. Only supports 8-bit indexed color and grayscale images. (Example image)
|Basic texteditor library using buffer-gap algorithm
|tiny text file database API. can preprocess the first line into any sort of key (I use C function prototypes for the key in my udb database). I have an example file for when building the demo, grab dict.usb.gz and gunzip it to try the demo.
|Simple WAV audio file exporter
|Hexdump utility with lots of options. Can display hexdumps in real-time through a pipe, unlike most other utilities.
|No-frills implementation of POSIX getopt(). Test program xgetopt-test.c
|Example of using Imlib2 to set the X wallpaper
Some examples of gas assembler
- hello-amd64.S - Linux/amd64 system call demo
- hello-i386.S - Linux/i386 system call demo using int 0x80
- hello-gate.S - Linux/i386 system call demo using linux-gate.so
here is stuff I didn't write, but I enhanced or just find useful.
- queue.h - Macros from BSD for doing many different kinds of linked lists and queues. (docs: queue.3 queue.txt)
- tree.h - Macros from BSD for doing Splay and Red-Black trees. (docs: tree.3 tree.txt)
You can find more stuff in my found code section.