Columns


CUG New Releases

MICRO-C, MIMEQP, BSPline, and More

Victor R. Volkman


Victor R. Volkman received a BS in Computer Science from Michigan Technological University. He has been a frequent contributor to C/C++ Users Journal since 1987. He is currently employed as Senior Analyst at H.C.I.A. of Ann Arbor, Michigan. He can be reached by dial-in at the HAL 9000 BBS (313) 663-4173 or by Usenet mail to sysop@hal9k.com.

New Acquisitions

MICRO-C (CUG #422): MICRO-C C compiler for the PC, over 70 example programs for use with MICRO-C, and demonstration compiler for embedded systems with simulators.

RECIO, MIMEQP, ACCTPOST, RDCF, and BSPLINE (CUG #423): a bevy of tools from authors from around the U.S., including:

CUG #422: MICRO-C C Compiler

Dave Dunfield (Nepean, Ontario, Canada) submits an entire suite of tools from the MICRO-C C compiler development system. This submission includes the MICRO-C C compiler itself (for MS-DOS), more than 70 useful sample programs with full C source, and a demonstration version of MICRO-C for embedded systems. MICRO-C is a tiny compiler which can run in less than 32Kb of RAM, yet is highly independent of CPU and OS. Other distributions of this compiler will run on 68HC08, 6809, 68HC11, 68HC16, 8051/52, 8080/8085, and 8096 CPUs. The CUG Library distribution includes a fully functional MICRO-C compiler executable, built for the MS-DOS 80x86 environment. This version generates code in .ASM format, so Microsoft MASM, Borland TASM, or equivalent are required (not included). MICRO-C version 3.02 (as released on 03/22/94) is immediately available as CUG#422 in a set of four diskettes.

MICRO-C provides much more functionality than Small-C and its many derivatives. Specifically, MICRO-C supports all C statements, operators, and preprocessor directives as well as inline assembly code. MICRO-C includes data types for int, char, unsigned, struct, union, pointers, and typecasting. In other words, MICRO-C gives you everything possible except for typedef, long, double, float, enum, and bit fields. The runtime library does include a long arithmetic package with arbitrary precision up to 256 bits.

Even if you're not especially interested in the MICRO-C compiler, the you may wish to take advantage of the collection of more than 70 sample programs. Although there are simply too many to catalog here, I've listed two dozen of the most interesting:

CCREF     — C source cross referencing program
COMEXT    — Extract comments from C sources
OBSCURE   — Make C program unreadable (but it still
            compiles)
PCC       — Pretty Printer for C (source formatter
CALC      — A TSR programmers (HEX/DECIMAL
            calculator
CMOS      — Read/Write/Verify CMOS RAM from/to/with
            disk file
CSET      — TSR map of IBM PC character set
DIFF      — Displays differences between text files
GREP      — Like UNIX "GREP" search utility
HEM       — Hardware Exception Monitor TSR to trap
            unexpected interrupts
LZC       — Laser commander TSR to control
            HP-compatible printers
MEMSAVE   — Saves memory image to file
MTERM     — Tiny (10K!) TSR ANSI terminal with
            XMODEM
SHOWEXE   — Displays information about an .EXE file
TFB       — TSR File Browser
VALIDATE  — PD version of McAfee's validate. Verify file
            with two CRCs
LAPTALK   — A terminal program with script interpreter
XMODEM    — External file transfer program
MICROCAD  — Mouse-based drawing program
FE        — Font Editor
ASM86     — 8086 assembler
BASIC     — A simple BASIC interpreter
DIS85     — 8085 Cross Disassembler
TTT3D     — 3 dimensional tic-tac-toe
All files in the MICRO-C archives are for personal use only. Any commercial use of information or programs contained in these archives requires written permission from Dunfield Development Systems. You can obtain source code for the MICRO-C compiler by purchasing a license for $100 from Dunfield Development Systems.

CUG #423: RECIO, MIMEQP, ACCTPOST, RDCF, and BSPLINE

The CUG Library has always accommodated C/C++ archives both big and small. This month, I've compiled an anthology of five small but outstanding source archives. William Pierpoint (Camarillo, CA) submits his comprehensive library for streamstyle record I/O. Karl Hahn (Sarasota, FL) contributes MIME binary encode/decode routines for use with e-mail tools. Philip Erdelsky (San Diego, CA) releases source for general ledger posting with 32-bit math library, and a reentrant, DOS-Compatible File System for embedded systems. Last, Keith Vertanen (Pine Springs, MN) sends his brief but succinct implementation of the BSPLINE rendering algorithm. Again, all five archives are immediately available on a single diskette as CUG volume #423.

CUG #423A: RECIO — Record Input Made Easy

The RECIO library contains more than 50 functions and macros enabling file input in which each line becomes a data record, with each record subdivided into fields. Fields may be either character delimited or column delimited. RECIO's learning curve is not steep, since many functions are based on analogous counterparts in stdio. RECIO is freeware and is protected by the GNU Public License. Version 2.00 (as released 04/16/94) appears along with several unrelated archives on CUG volume #423.

Since virtually every program has to do input or output, C programmers are very familiar with the stdio library. Many functions in the recio library are analogous to those in the stdio library, as shown by the following table:

Analogous stdio/recio components

     stdio             recio
----------------------------
FILE        REC
FOPEN_MAX   ROPEN_MAX
stdin       recin
fopen       ropen
fclose      rclose
fgets       rgetrec
fscanf      rgeti, rgetd, rgets, ...
clearerr    rclearerr
feof        reof
ferror      rerror
RECIO includes a makefile only for Borland Turbo C, although it should work with other platforms as well.

CUG #423B: MIMEQP — A Better Encode/Decode For E-mail

MIMEQP inputs files that are mostly ASCII, but contain some non-ASCII characters, and encodes them so that the output file is all ASCII. The characters that were ASCII remain so, so the encoded file is human-readable. The encoding algorithm also limits line lengths to 72 characters. MIMEQP is useful for sending files containing non-ASCII characters through mail servers. MIMEQP (or MIME Quoted-Printable) is defined in RFC 1341. MIMEQP (as released on 05/22/93) appears along with several unrelated archives on CUG volume #423.

MIME is an acronym for Multipurpose Internet Mail Extensions. It builds on the older standard by defining additional fields for mail message headers. These headers describe new types of content and organization for messages.

MIME allows mail messages to contain the following:

MIMEQP encoding replaces all control characters except '\n' and '\t,' all occurrences of '=', and all characters whose ASCII code is greater than 127 with =XX, where XX is the hex value of the ASCII code. The CUG library distribution includes a substantial overview of the MIME standard by Mark Grand, along with an MS-DOS executable.

CUG #423C: ACCTPOST General Ledger Utility

The Plain Vanilla Posting Program II is a simple program that takes over three tedious accounting tasks: posting from the general journal to the general ledger, drawing a trial balance, and putting account balances into a report. The Plain Vanilla Posting Program II is written for the compact memory model (near function, far data) in Turbo C 2.0 for MS-DOS. The author claims some source portability to UNIX variants as well. The Plain Vanilla Posting Program II (as released on 09/01/90) is included with unrelated source archives on CUG volume #423.

The only non-portable part of the program appears in ARITHMET.C, which contains embedded assembly language code. This allows ACCTPOST to catch arithmetic overflows, which would be disastrous for an accounting application if undetected. Otherwise, ACCTPOST is just a simple 32-bit arithmetic package, with only five operations: addition, negation, multiplication, division by 10, and remainder computation for a 32-bit number divided by 10. The last two operations cannot produce overflows and could have written in standard C. Porting to a machine with native 32-bit arithmetic should be simple.

Although the Plain Vanilla Posting Program II is copyrighted, it carries only one restriction: you may not sell the program or any program derived from it. You may give it away or charge a reasonable fee for media duplication, but may not charge anything for the software itself.

CUG #423D: Re-entrant DOS-compatible File System

RDCF is a reentrant and ROMable DOS-compatible file system, designed for use with floppy diskettes and hard disk partitions that do not exceed 32 MB in size. This distribution also includes a simple disk-caching package designed for use with RDCF, which may also be used separately. The distribution includes an MS-DOS utility called FILES, written primarily to test RDCF, in both source and executable form. FILES performs a number of operations on DOS files, including some that cannot be performed from the DOS command line. For example, FILES' DIR command shows the remains of deleted files. This distribution includes complete C source code and documentation for FILES, including a fairly detailed description of the DOS file system.

RDCF is copyrighted, but it is freeware. You may copy it and pass it on freely, as long as you pass on the entire, unmodified package, with its copyright notices intact. You may not resell it, although you may charge a reasonable fee for diskette duplication, shipping, and handling.

CUG #423E: Classic BSPLINE Rendering Algorithm

A spline is a mathematical construct from numerical analysis which is used to fit a curve to an arbitrary set of points. It has obvious uses in statistics and computer graphics rendering. For a description of spline theory and algorithm implementation, see Elementary Numerical Analysis by Kendall Atkinson (1985, Wiley & Sons). BSPLINE performs polynomial interpolation and returns an array of coefficents to describe a spline. BSPLINE was written in C++ for the Borland compiler, though it uses few, if any, features of C++. The library uses function calls from the Borland Graphics Interface to render the bspline on EGA or VGA displays. BSPLINE (as released on 03/11/94) is included with other unrelated archives on CUG volume #423.