home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / streams / handles / streams.doc < prev    next >
Encoding:
Text File  |  1992-04-01  |  2.6 KB  |  58 lines

  1.  
  2.  
  3.      *********** streams under Turbo C and DJGPP ***********
  4.  
  5. First, the bad news. If you are using a version of Turbo C earlier than
  6. BCC++ v3.0, this package includes no code to increase the number of streams
  7. in Turbo C. For these earlier verions of Turbo C, you are still limited to
  8. a maximum of 20 streams. If you want to increase this limit you will have
  9. to re-write the stream handling functions for yourself!
  10.  
  11. Now the good news. If you are using BCC++ 3.0 (and presumably later), you
  12. will get and increased number of streams along with the increased number
  13. of handles. Also, this package includes modifications to DJGPP which
  14. will allow programs to open a number of streams which is limited only by
  15. the number of available handles (a maximum of 252 streams is possible).
  16.  
  17. The steps to follow for DJGPP are: (Note: the diffs are for DJGPP v1.05)
  18.  
  19. (1) Use patch to apply  "include.dif"  to the DJGPP "include" directory.
  20.  
  21. (2) Use patch to apply  "sys.dif"  to the DJGPP "libsrc/c/sys" directory.
  22.  
  23. (3) Now the time-consuming part. Since the FILE structure has now changed
  24.     in size, it is necessary to re-compile ALL library modules which refer
  25.     to the file structure. It is probably simplest to just re-compile the
  26.     whole library! At a minimum, this means switching to the DJGPP
  27.     "libsrc/c" directory and running "make". This needs to be repeated
  28.     with "make -f makefile.p" if you ever use libpc_p.a.
  29.     It appears that the only other file which needs to be re-compiled
  30.     is mouse.c in "libsrc/gr".
  31.  
  32. (4) Put the new libraries in your DJGPP library directory (GCCLIB).
  33.  
  34. (5) Compile test2.exe using "make -f makefile.g" and run the resulting
  35.     test2.exe. You should get a lot of files with names "str_nnn.$$$"
  36.     where nnn ranges from 000 to some maximum value. If all went well,
  37.     this maximum value should be 248, indicating that you had 249 files
  38.     opened as streams at one time. Check that all files have the same
  39.     size (53 bytes).
  40.  
  41.  
  42. It is possible to avoid all of the re-compiling if you do not want more
  43. than 128 handles. To do this you must edit "close.c" from this package
  44. and  #define MAX_FD 128   This will ensure that a handle can never have
  45. a value greater than 127 and can therefore be represented as an unsigned
  46. char. If you want to do this then skip step (1) above and look at the
  47. patch in step (2) above and change the value to 123 (=128-5-3+3) instead.
  48. You will need to re-compile "getdtabl.c" and replace the resulting .o
  49. module in the libraries.
  50.  
  51.  
  52.  
  53.  
  54. 30th March 1992
  55.  
  56. W. Metzenthen
  57. apm233m@vaxc.cc.monash.edu.au
  58.