Port of Apple printf to MS-DOS/FreeDOS by Burkhard Meissner It can be compiled under 16bit gcc as follows: ---------------------------------------------- gcc "-mcmodel=medium" -O4 -fexpensive-optimizations -I. -D__DJGPP__ -c *.c gcc "-mcmodel=medium" -o printf.exe *.o upx --best --ultra-brute --8086 printf.exe It can be compiled under 32bit gcc (djgpp) as follows: ------------------------------------------------------ i586-msdosdjgpp-gcc -I./ -O4 -fexpensive-optimizations -funroll-loops -finline-functions printf.c -o printf i586-msdosdjgpp-strip -I./ -O4 -fexpensive-optimizations -funroll-loops -finline-functions printf.c -o printf rm printf optionally: upx --best --ultra-brute printf.exe Usage: ------ Usually, under Unix, the printf command takes format specifiers as its argument whcih consist of % and a letter. For example. "Dieses ist %i Beispiel%s \n" 1 string under Unix yields "Dieses ist 1 Beispielstring" Under DOS, % is the specifier for environment variables and therefore is caught by the shell. To use the program under DOS, we have to use double %% as in: "Dieses ist %%i Beispiel%%s \n" 1 string to obtain "Dieses ist 1 Beispielstring" The source code comes from the Apple BSD Obase resources and is modified for DOS. The mssing functions have been added from Gnulib and Apple obase. Burkhard Meissner