            Public Domain C runtime library
            -------------------------------
            
Version : 0.8
Released: 2004-03-17

Written by Paul Edwards.
Released to the public domain.
You may use this entire package for any purpose whatsoever without
restriction.
            
            
            
INTRODUCTION
------------
            
This project is to create a public domain runtime library which 
conforms to ISO/IEC 9899:1990.  It is expected to be highly OS-specific, 
but hopefully not too compiler-specific.  It is the job of C library 
developers to make unportable but fast code, not that of the application 
developers.  Anyone wishing to contribute to this project, please contact 
Paul Edwards at kerravon@w3.to.

The official method for obtaining PDPCLIB is going to
http://sourceforge.net/projects/pdos
and using CVS and checking out via appropriate tag.



MAIN DESIGN GOALS
-----------------

1. Application developers should not have to resort to DosOpen, open et al 
   in order to get better performance for binary files.
   
2. Application developers should not have to resort to using binary mode to
   get better performance for fgets in text mode.
   

CURRENT STATUS
--------------

A substantial, but still incomplete version under 

OS/2 for:
EMX 0.9b
Watcom C++ 10.0b
IBM CSET++ 2.0
Borland C++ 1.5

DOS for:
Borland C++ 3.1
Watcom C++ 10.0b

MVS for:
IBM C/370 v2r1m0
GCCMVS 3.2

PDOS for:
EMX 0.9b


WHO WANTS IT?
-------------

It is expected that this archive will interest the following groups of
people:

1. People who have a commercial compiler, such as CSET, but would like
to have the source code to the C runtime library, so that they can 
have control over it.

2. People who have a commercial compiler, such as Borland, where
although they have the runtime source, Borland have some restrictions
on the use of their object code, saying that the resultant executable
must have either their copyright notice on it, or yours, or some such
rubbish.

3. People who have EMX 0.9b, but would like to be able to modify the
runtime library code without being bound by any of EMX's licensing
restrictions on doing that.

4. People who are interested in the internal workings of a runtime
library, and would like unrestricted use of any useful code they
may find whilst investigating that.

5. Someone who wants to write their own commercial C compiler and
library, and wants something to use as a base.  This at least gives
you the library, there are no public domain C compilers available
to the best of my knowledge, on any platform.

6. People who have ISO text-processing programs that want a significant
speed improvement.


USAGE
-----

There are makefiles for all the different compilers supported.  Choose
the one you want, and compile it, creating a library if you want, and
then compiling your programs in the same way that the "pdptest" program
is compiled.



PERFORMANCE
-----------

I have done performance testing (of version 0.07 of PDPCLIB) of the 
stated objectives, using perf*.c as the testing tool, and got the 
following results (on OS/2):

                fgets on text files
                -------------------
                
bcc - 12.98 12.98 13.10
gcc - 12.59 12.51 12.45
icc - 7.84 7.72 7.76
wcc - 23.38 23.36 23.34
pbcc - 4.87 4.84 4.85
pgcc - 4.42 4.52 4.50
picc - 4.87 4.96 4.85
pwcc - 4.87 4.85 4.87

summary - cset has the best library, watcom the worst.  pdpclib
creams the lot.  gcc is the best compiler.
                                
                                
                large freads on binary files
                ----------------------------
                
bcc - 2.10 2.01 1.98
gcc - 2.71 2.70 2.64
icc - 3.87 3.88 3.93
wcc - 2.18 2.18 2.18
pbcc - 1.83 1.85 1.87
pgcc - 1.89 1.83 1.87
picc - 1.87 1.84 1.85
pwcc - 1.85 1.83 1.86

summary - Borland has the best library, cset has the worst.
pdpclib creams the lot.  The compilers are equal.


                small freads on binary files
                ----------------------------

bcc - 8.13 8.27 8.42
gcc - 3.98 3.92 3.91
icc - 4.54 4.64 4.68
wcc - 3.89 3.95 3.93
pbcc - 3.24 3.22 3.19
pgcc - 3.41 3.43 3.41
picc - 3.24 3.24 3.21
pwcc - 3.21 3.20 3.21

summary - Borland has the worst library, gcc has the best. pdpclib,
as usual, beats the lot.  The compilers are basically equal,
except that gcc is slightly worse, as it doesn't generate an 
inline memcpy() for the situation I am using it in.  The main 
reason for gcc having the best library is that it has a default 
buffer size of 5120 compared to the others at 4096.  Note - in
other tests I did, gcc was coming out ahead of wcc, by about 5%,
so I don't know why this particular set of tests had them level.


Information:
I used a 486DX33 with a RAM disk in order to perform these tests,
in an effort to concentrate the stats on the library itself rather
than the physical hard disk.
bcc = Borland C++ 1.5 
gcc = EMX 0.9a
icc = CSET++/2 2.0
wcc = Watcom 10.0b
p* = PDPCLIB compiled with one of the above compilers.


KNOWN LIMITATIONS
-----------------

Not all printf and scanf formats are supported.
No maths library.
No floating point support.
Minimal testing.
DOS version doesn't do full long arithmetic.


HISTORY
-------

0.01  A lot of stuff has been implemented, and a lot of stuff has
      not.  However, there has been sufficient amount of work done
      to make it at least interesting reading.

0.02  Further down the track, but not enough to go bananas about.
      Main work was done in fopen(), which is far more robust now.

0.03  Got it working on Watcom, CSET + GNU.  

0.04  Miscellaneous additions

0.05  There is a function for every single function except those in
      the math library, but there are still holes in the system,
      especially with the File I/O.  But now I have all of the
      fundamental design in place.
      
0.06  Much more robust file i/o.

0.07  Many bug fixes and enhancements.

0.50  DOS support, and various bug fixes.

0.51  General tidy up.

0.52  Bug fixes for problems found whilst doing PDOS work.

0.60  Added MVS support, since I suddenly had an MVS machine available
      and had always wondered how on earth C was able to be implemented
      on that environment.  Now I know some of the answers.

0.61  Implemented a stub function required for some situations under
      MSDOS.

0.70  Added PDOS support.

0.71  Completed PDOS and fixed DOS bug.

0.73  Revamped interface to PDOS.

0.80  Many changes to work with GCC (MVS port).


CREDITS
-------

Xiayi Edwards, my wife, for putting up with me in the many many
  man-days it took me to write this, when I should have been doing
  family-related things.
Ray Gardner for making his date routines public domain, plus
  the qsort routine.
Jim Nutt and Rob Duff for releasing strftime to the public domain.
Rowan Crowe for some mods to memcpy.
Matthew Parker for getting the program name under MSDOS.
Phil Roberts for helping to debug the MVS port.
