home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / DOS / Programa / CCDL122.ZIP / DOC / LIBS.DOC < prev    next >
Encoding:
Text File  |  1996-08-08  |  2.9 KB  |  54 lines

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