Here is a little mime encoding tool I slapped together when I needed something
on a production box at work (productions = no C development environment,
only the ancient K&R compiler required for god-knows-what sys-admin task).
The resulting program will compile happilly on both the crippled C compilers
bundled with some commercial *nix distributions, and on full ANSI/ISO C
compilers like gcc.
You can download the MIME-tool package here