home *** CD-ROM | disk | FTP | other *** search
- libs were implemented according to 'The Waite Group's Essential Guide
- to ANSI C'- ISbN 0-672-22673-1. My copy is circa 1989.
-
- Floating point library functions are not supported at this time, as I
- have no way to test them. This includes things like atof and difftime
- as well as most of the math libraries.
-
- All the functions in this book were implmented except floating point.
- However, process control stuff is kind of sketchy at this time. Most
- of the IO library, part of the time library, and the malloc library
- functions require operating system support. Hooks were left in
- the code, function starting with an _ll_ are meant to provide the
- interface between the operating system and the C libraries. To test
- the libraries I assembled everything in upper case and used BC45
- library routines as the OS interface. If you need to port the libaries
- to another platform, consult clibs\stdinc\libp.h and
- clibs\io\test\locio.c for implementation detail of the low-level
- functions.
-
- There may be a variety of cases where things don't work as expected.
- For example scanf will only read one line no matter what... when a
- function such as strftime requires a buffer length to be given the
- results are undefined if the text length exceeds the buffer length.
- Also I just found out the opening a file with the 'a' attribute is
- supposed to override any attempt to set the position for write in the
- file... in this implementation all it does is position to the end of
- the file at open time.
-
- Where possible, i have done away with static buffers (which makes these
- libraries non-compatible). Functions such as asctime which are
- supposed to return a pointer to a static buffer instead allocate a
- bunch of space on the stack and put the buffer at the bottom of it.
- This allows you a little freedom to call other subroutines... however
- for maximum portability you should immediately copy such buffers to a
- malloced data area or a local buffer. This was done to allow more
- re-entrancy than strict ANSI allows for. Most things are re-entrant
- like this, except for the IO libraries, malloc, and miscellaneous
- things like strtok() which require a context to be maintained from one
- call to the next. However, malloc calls a 'hook' function _ll_transfer
- if you access it while an access is already in progress. This allows
- for primitive multitasking... e.g. you can suspend the current malloc
- and go finish the one in progress. This could also be done with the
- I/O libraries but I haven't done it.
-
- ERRNO isn't supported at this time.
-
- Many of the library functions depend on having the startup/rundown code
- included. This code initializes a few global variables and executes
- any startup/rundown functions the libraries need for initialization
- and cleanup.
-
- I have only done minimal testing on the 68K version of the
- libraries at this time; most of the testing is done on the 386. 68K
- testing is limited to the assembly routines annd the startup routines.