util
Download util-20240909.tar.gz (13 kb)
This is a collection of single-file C programs, all with the following
useful properties:
- Public domain.
- Only require the C89 standard library, and only a subset of that.
(See util.h for list of excluded functions)
- No dynamic allocations used.
- No floating-point used.
- No 64-bit types used.
Currently the following well-known UNIX utilities are included:
- basename
- cat
- dirname
- echo
- false
- true
- yes
Also included are my own inventions:
- cxd - Hex dump colorizer
- fmt - Text formatter (minimal variant of UNIX fmt)
- segoff - segment/offset calculator (for Intel 80x86 CPUs)
- u2cp437 - Convert text from UTF-8 to IBM PC code page 437
- xd - Hex dump and reverse hex dump utility
The included header files are all self-contained code snippets:
- numtab.h - Lookup table for fast conversion of ASCII hex digits
- strtou32.h - Convert string to 32-bit unsigned integer
- u16.h - Provides 16-bit unsigned integer on C89
- u32.h - Provides 32-bit unsigned integer on C89
- u8.h - Provides 8-bit unsigned integer on C89
- util.h - Miscellaneous macros
33mph.com