home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c162_2 / 1.ddi / $READ.ME < prev    next >
Encoding:
Text File  |  1993-01-15  |  28.2 KB  |  696 lines

  1.  
  2.  
  3.  
  4.       $read.me (c)Copyright Sequiter Software Inc., 1992-1993.
  5.       All rights reserved.
  6.       ----------------------------------------------------------
  7.       
  8.           README -  Table of Contents
  9.       
  10.       I.    Introduction
  11.       
  12.       II.   CodeBase Electronic Documentation Files.
  13.       
  14.       III.  CodeBase Manual and Code Revisions.
  15.       
  16.       IV.   CodeBase Interactive for DOS
  17.       
  18.       V.    Examples.
  19.    
  20.       VI.   Using CodeScreens with CodeBase 5.0.
  21.    
  22.       VII.  CodeBase Public-Access Bulletin Board System.
  23.  
  24.       VIII. Accessing More Than 20 Files in DOS or Windows.
  25.       
  26.       ----------------------------------------------------------
  27.       
  28.       I.    Introduction
  29.       
  30.          CodeBase is a C library for database management.  Its compat-
  31.       ibility allows you to directly create, access, or change dBASE 
  32.       IV, dBASE III, FoxPro or Clipper data, index, or memo files.
  33.       
  34.          CodeBase has full multi-user capabilities.  When programs are 
  35.       run on a network, the network is automatically detected and 
  36.       used.  CodeBase allows both explicit and automatic record 
  37.       locking and file locking.  It is also possible to bypass the 
  38.       locking mechanism and read data locked by another user.
  39.       
  40.          All of the CodeBase functions work together to allow C 
  41.       programmers to program at a very high level.  Programs will 
  42.       execute very quickly, they will be readable and there will be no 
  43.       unnecessary lines of code.
  44.       
  45.          In order to use CodeBase, it is necessary to have a C 
  46.       compiler and it is necessary to have some knowledge of the C 
  47.       programming language.
  48.       
  49.          In addition, for C++ programmers, there is a C++ interface 
  50.       and functionality extension.  There are new string classes which
  51.       let you manipulate text easily.  Fields become strings so that 
  52.       you can manipulate data easily.  Finally, there is an object-
  53.       oriented interface to data and index files.
  54.       
  55.          To accomodate users requiring DOS or UNIX screen management 
  56.  
  57.       capabilities, a software library called 'CodeScreens' is 
  58.       available.  CodeScreens features pop-up and pull-down window 
  59.       support, color screen design capabilities, and print functions, 
  60.       plus much more.
  61.       
  62.          For information on either the CodeBase 5.0 portability 
  63.       version, or CodeScreens, contact Sequiter Software Inc.
  64.       
  65.       ----------------------------------------------------------
  66.       
  67.       II.   CodeBase Electronic Documentation Files.
  68.       
  69.          It is highly recommended that any installed documentation
  70.       files be read in addition to the CodeBase manuals.  These
  71.       documentation files serve as the primary information source
  72.       for Visual Basic and Turbo Pascal for Windows support. 
  73.       
  74.          The various documentation files provide additional specific
  75.       information not found in the CodeBase manual.  Please note
  76.       that only documentation files relevant to the options
  77.       installed will be present on your drive after installation.
  78.       
  79.          All electronic documentation files have been suitably 
  80.       formatted for hard-copy printing.  To print any document, 
  81.       simply direct that file to your printer, using the 'print' 
  82.       command.
  83.       
  84.          The complete list of documentation files that are present 
  85.       on the CodeBase disk are:
  86.       
  87.       GENERAL DOCUMENTATION:
  88.       
  89.       $READ.ME        General user information, manual changes/updates,
  90.                       and installation information. Always installed.
  91.       
  92.       INSTALL.DOC     Information on CodeBase installation.  Includes
  93.                       manual unfolding documentation.
  94.       
  95.       PORT.DOC        Important information when using the CodeBase 5.0
  96.                       portability version.  Not included with the
  97.                       CodeBase 5.0 DOS/WINDOWS version.  Located on
  98.                       ANSI and K&R diskettes.
  99.       
  100.       CODEREP.DOC     Further information on CodeReporter.  Includes 
  101.                       important information regarding the building of
  102.                       the CodeReporter launch utility executables.
  103.       
  104.       COMPILER DOCUMENTATION:
  105.       
  106.       COMPILER.DOC    Borland Turbo C++ 1.01 specific information.
  107.       
  108.       EXAMPLES.DOC    Information on usage of the provided source code
  109.                       examples.
  110.       
  111.       TEST.DOC        Information on usage of the CodeBase test
  112.  
  113.                       programs
  114.       
  115.       45UPGRAD.DOC    CodeBase 4.5 to 5.0 translation information.
  116.       
  117.       ----------------------------------------------------------
  118.       
  119.       III.  CodeBase Manual and Code Revisions
  120.  
  121.       Following are corrections to the CodeBase 5.0 printed documentation:
  122.  
  123.  
  124.       CODEBASE 5.0 REFERENCE GUIDE:
  125.  
  126.       1. Conditional Compilation Switch addendum (page 8)
  127.          New Conditional Compilation Switch.  'S4FLUSH' may be defined
  128.          if a hard-flush is required when writing data to disk:
  129.  
  130.          S4FLUSH   This switch automatically calls function file4flush()
  131.                    whenever a write() occurs.  It is set automatically
  132.                    whenever S4WINDOWS, S4DLL or S4DLL_BUILD is defined.
  133.                    This switch is not usually required, since a write()
  134.                    should perform a flush, but some environments do not
  135.                    flush data immediately.  S4FLUSH is meant to be used
  136.                    with these environments.   See function file4flush().
  137.  
  138.  
  139.       2. CODE4.lock_attempts Clarification (page 17)
  140.  
  141.          If CODE4.lock_attempts is greater than zero, it is the
  142.          number of times a CodeBase function will attempt to lock before
  143.          returning r4locked.
  144.  
  145.          If CODE4.lock_attempts is (int) -1, CodeBase retries until
  146.          it succeeds.
  147.  
  148.          Any other value for CODE4.lock_attempts is undefined.
  149.  
  150.  
  151.       3. file4flush() (page 162)
  152.  
  153.          The 'NOTE' at the bottom of the page is incorrect.  S4WINDOWS   
  154.          does not have to be defined.  file4flush() may be used under DOS
  155.          or other operating systems.
  156.                
  157.  
  158.       4. relate4lock() (page 226)
  159.  
  160.          Under 'Usage', please note that the return value of relate4lock()
  161.          is of type 'int'.
  162.                
  163.          Usage:  int relate4lock( RELATE4 *relate )
  164.  
  165.  
  166.       5. The Comparison Function (page 238)
  167.  
  168.  
  169.          At the bottom of the page is a small table with 'Return' and
  170.          'Meaning' headings.  The '> 0' return should instead read:
  171.  
  172.          > 0          The value pointed to by p1 is greater than p2.
  173.  
  174.  
  175.       6. e4hook()  (page 319)
  176.  
  177.          'Description', third paragraph. The reference to switch 'S4HOOK'
  178.          should instead be 'S4ERROR_HOOK':
  179.  
  180.          Consequently, to turn off error reporting, just define 
  181.          'S4ERROR_HOOK' and do nothing else.
  182.  
  183.  
  184.       7. e4severe()  (page 320)
  185.  
  186.          The parameter listing under 'Usage' should not include
  187.          parameter 'CODE4':
  188.  
  189.          Usage:  void e4severe( int err_code, char *desc )
  190.  
  191.  
  192.       
  193.       CODEBASE SOURCE CODE CHANGES:
  194.       
  195.       Note: Notices of fixes to CodeBase 5.0 will be 
  196.             updated on files contained on Sequiter's BBS system. 
  197.             For more information, refer to section
  198.             "CodeBase Public-Access Bulletin Board System."
  199.  
  200.       ----------------------------------------------------------
  201.  
  202.       IV.   CodeBase Interactive for DOS
  203.       
  204.          Interactive CodeBase 5.0 for DOS is a CodeBase application 
  205.       that allows the interactive manipulation of databases. 
  206.       Interactive CodeBase may be used to test the operation and
  207.       consequence of CodeBase functions, or as a tutorial aid to 
  208.       familiarize users with CodeBase functions, or may be used as a 
  209.       quick and easy way to manipulate databases without coding and
  210.       compiling.  Two DOS Interactive CodeBase executables are currently
  211.       provided.  They are intended for either dBASE IV or FoxPro file
  212.       formats.  Other file formats are supported, but must be recompiled.  
  213.  
  214.          Interactive CodeBase for DOS, known as 'CID', contains all of
  215.       the functionality mentioned above, as well as interactive browse
  216.       and edit facilities.  
  217.  
  218.          To install Interactive CodeBase, select 'Interactive CodeBase
  219.       for DOS' during the CodeBase INSTALL.  Alternatively, you
  220.       may manually UNFOLD the Interactive files, contained in 'INTERACT.FLD'.
  221.  
  222.  
  223.       Using CID:
  224.  
  225.  
  226.         Each provided CID executable program can handle only one of the
  227.       CodeBase-supported index formats.  The file format can be determined
  228.       by examining the last three letters of the executables provided:
  229.  
  230.       eg.  CID_MDX.EXE  is the MDX file format of dBASE IV
  231.            CID_CDX.EXE  is the CDX file format of FoxPro
  232.  
  233.          Also, during CID execution, the file format will be displayed on
  234.       the bottom row of CID's main screen.  Please ensure that the CID
  235.       being used is the proper CID for your file format.  If not, recompile
  236.       as directed, or contact the Sequiter BBS for the correct CID.
  237.  
  238.         You can run Interactive CodeBase for DOS in either color or
  239.       monochrome modes.  Pass the command line argument of MONO to select
  240.       monochrome mode or enter no arguments for color mode:
  241.  
  242.         Eg.         c:\CID_MDX  MONO          ** for  monochrome mode
  243.  
  244.         or          c:\CID_MDX                ** for color mode
  245.  
  246.  
  247.          Upon startup, Interactive CodeBase for DOS will display a
  248.       startup message.  Press any key to clear this message.  The main
  249.       menu bar will then be activated.  You can use the cursor keys
  250.       to move the highlighting over the item that you desire and press
  251.       [ENTER] to select.      
  252.  
  253.          In addition you can use the highlighted hot keys to select a menu
  254.       item.  Holding down the ALT key and pressing a letter will move to
  255.       appropriate menu.  For example, pressing [ALT D] will move you to
  256.       D4DATA menu.  Pressing the letter that is highlighted in an entry of
  257.       the current menu, will select that item.  For example, pressing
  258.       the [O] key while in the I4INDEX menu will select the i4open
  259.       function.
  260.  
  261.            After selecting a function from a menu, you will be presented
  262.       with a variety of menus, and input boxes, prompting you to enter in the
  263.       parameters of the function.  Most functions will present you with a
  264.       list of the databases that are currently open.  You can press the
  265.       [ESC] key to abort most operations.
  266.  
  267.            When all of the parameters have been entered, the function will
  268.       be executed.  If CodeBase encounters any errors, they will be
  269.       displayed in popup boxes.  After execution of a function, the return
  270.       value (if any) will be displayed.
  271.  
  272.       Examples:
  273.  
  274.       To open a database:
  275.  
  276.            -select d4open from the DATA4 menu.  A file requester will then
  277.             appear.
  278.            -enter the directory containing the database you want to open.
  279.            -a list of the databases in that directory will appear.
  280.  
  281.            -select the database moving the highlighting with the cursor
  282.             keys and press [ENTER]
  283.  
  284.       To set the CODE4.safety to FALSE
  285.  
  286.            -select the CODE4 menu.
  287.            -use the cursor keys to move the highlighting over CODE4.safety
  288.            -press the [ENTER] key to togle between true and false.
  289.  
  290.  
  291.       Using the Browser:
  292.  
  293.          InterActive CodeBase for DOS has a built-in Browser.  To browse a
  294.       database, either open it with d4data, or create it with d4create.  Then
  295.       select BROWSER from the main menu.  You will then be presented with a
  296.       list of open databases.  Select the database that you want to browse.
  297.  
  298.       NOTE: Memo field browsing and editing is not yet supported.
  299.  
  300.       Browse Mode:
  301.  
  302.            The following keys have special functions when in browse mode:
  303.  
  304.  
  305.               [UP ARROW]    : Selects the previous record
  306.               [DOWN ARROW]  : Selects the next record
  307.               [LEFT ARROW]  : Selects the previous field
  308.               [RIGHT ARROW] : Selects the next field
  309.               [ESC]         : Leaves Browse mode and activates the menu
  310.               [ENTER]       : Allows you to edit the field
  311.               [PAGE UP]     : Skips back one page of records
  312.               [PAGE DOWN]   : Skips forward one page of records
  313.               [HOME]        : Selects the first field
  314.               [END]         : Selects the last field
  315.               [CNTL HOME]   : Selects the first record
  316.               [CNTL END]    : Selects the last record
  317.               [INS]         : Inserts a new record
  318.               [DEL]         : Toggles the deletion flag
  319.  
  320.           Menu Items:
  321.  
  322.            BROWSE           : Reenters Browse mode
  323.               d4tag_select  : Select one of the database's tags
  324.               d4go          : go to the entered record number
  325.               d4seek        : seek using the currently selected tag
  326.               d4top         : goto the top of the database
  327.               d4bottom      : goto the bottom of the database
  328.               QUIT BROWSER  : quit browser and return the main menu
  329.  
  330.  
  331.       Compiling the Source Code:
  332.  
  333.          Source code for InterActive CodeBase for DOS has been provided
  334.       along with a project file for the Borland C++ (CID.PRJ) and a batch
  335.       file (CID.BAT) for the MSC compilers.  InterActive CodeBase for DOS
  336.  
  337.       uses the CodeScreens screen library.  You will need this library if
  338.       you plan on recompiling this program.  If you do not have
  339.       CodeScreens, but would like CodeBase Interactive for DOS compiled
  340.       for another file format (such as NTX or NDX), you can download these
  341.       versions from our BBS.
  342.  
  343.          If you are using Microsoft C ,you will also have to rebuild the
  344.       CodeBase 5.0 library with the e4error and e4severe functions
  345.       commented out.  InterActive CodeBase for DOS has replacements
  346.       for those routines and the Microsoft C linker will not allow functions
  347.       in a library with the same names as those in the source code.
  348.  
  349.       ----------------------------------------------------------
  350.       
  351.       V.    Examples
  352.       
  353.           There are four sources of CodeBase 5.0 examples:
  354.       
  355.           1.  The manual, for short examples of function (and class)
  356.               usage.
  357.       
  358.           2.  The examples present on the CodeBase 5.0 diskette.
  359.               All examples installed are placed on the CodeBase
  360.               \EXAMPLES subdirectory.  Examples from the manual
  361.               can be found in \EXAMPLES\MANUAL.
  362.       
  363.           3.  The testing and diagnostic code.  These programs test
  364.               the important CodeBase functions, and can also be
  365.               used to ensure that CodeBase 5.0 was installed
  366.               correctly.
  367.       
  368.           4.  Our BBS, which contains new examples produced by our
  369.               developers and examples which users have uploaded.
  370.               Please see 'Section IX: The CodeBase Public-Access
  371.               Bulletin Board System (BBS)' for more information.
  372.       
  373.       ----------------------------------------------------------
  374.       
  375.       VI.   Using CodeScreens with CodeBase 5.0
  376.       
  377.          Sequiter's 'CodeScreens 1.0' is an add-on package that
  378.       contains screen management functions for DOS applications.
  379.       If you are interested in obtaining this screen management
  380.       library, please contact Sequiter Software for more 
  381.       information.
  382.       
  383.          You must have at least CodeScreens version 1.02.  Owners
  384.       of previous versions can contact Sequiter for upgrade 
  385.       information.
  386.  
  387.          CodeScreens 1.02 functions are used by creating a separate
  388.       library, 'W4.LIB', which contains the screen functions.  
  389.  
  390.          When using any screen function, remember to include 'W4.H'
  391.       at the top of your program.  'W4.H' can be found with
  392.  
  393.       CodeScreens.
  394.       
  395.          There are also provided batch files that can be used to 
  396.       compile and link a CodeBase 5.0. application using screen
  397.       functions.  These are named "C4?C.BAT", where '?' is replaced
  398.       by a specific letter denoting the compiler used.
  399.       
  400.       ----------------------------------------------------------
  401.       
  402.       VII. The CodeBase Public-Access Bulletin Board System (BBS)
  403.       
  404.          Any user with a modem may connect with the Sequiter
  405.       Bulletin Board System.  Connection to the BBS is free, 
  406.       although all users are responsible for their own long-
  407.       distance toll charges.  The BBS operates twenty-four hours
  408.       a day, seven days-a-week, excluding maintenance periods.  
  409.       The BBS operates under the DOS environment, running
  410.       WildCat(c) communications software.
  411.       
  412.          The BBS contains several CodeBase-related files and
  413.       documents that may be downloaded.  There is also a message
  414.       system so that electronic correspondence may be left for
  415.       Sequiter staff, or other BBS users.  The files include example
  416.       programs, utilities, add-ons and enhancements, written by
  417.       both Sequiter developers and CodeBase users.  Users are
  418.       invited to upload interesting CodeBase-related files for the
  419.       use of all BBS users.  A list of the latest enhancements, fixes 
  420.       and additions for all Sequiter products is also maintained on
  421.       the Sequiter BBS.  Users are encouraged to periodically
  422.       download these files, and make the appropriate changes.
  423.       
  424.          The phone number for the BBS is found on the back outside
  425.       cover of the CodeBase manual.  The phone number is currently
  426.       (403)-437-2229.
  427.       
  428.          Settings for the connection are:
  429.       
  430.               1200, 2400 or 9600 baud
  431.               ANSI terminal type.
  432.               No parity.
  433.               8 bits.
  434.               1 stop bit.
  435.       
  436.          Upon connection to the Sequiter BBS, a new user will be
  437.       prompted for some information and the selection of a private
  438.       password.  After selection of your password, please memorize
  439.       it since you will be asked for that password on future
  440.       connections to the BBS.
  441.  
  442.       ----------------------------------------------------------
  443.  
  444.       VIII. Accessing More Than 20 Files in DOS or Windows.
  445.  
  446.          Due to a default imposed by most compilers and DOS, no more
  447.       than  twenty files can be opened during the execution of any
  448.  
  449.       one single process by default.  And since the file streams 'stdout',
  450.       'stprn', 'stdin', 'stderr' and 'stdaux' count as files, and
  451.       your executing application counts as well, this leaves only
  452.       fourteen database, index  and memo files that are allowed to
  453.       be opened by any one application.  CodeBase has no inherent
  454.       limit to the number of files opened, but will display an error
  455.       because of the failure of the system function call 'sopen()'.      
  456.  
  457.          Several compilers have patches available for increasing the
  458.       file limit.  However, because of the nature of these patches,
  459.       Sequiter does not provide technical support regarding this issue.
  460.        Please consult  your compiler's manufacturer for information.
  461.        Again, CodeBase has no inherent file limit, but will produce
  462.       an error message when it receives an 'error' return from any
  463.       C library function that is called.     
  464.  
  465.          Don't forget to increase the number of file handles in your 
  466.       CONFIG.SYS file.  To open more than 20 files (eg. 100), you
  467.       need to also modify your CONFIG.SYS file :
  468.  
  469.                  eg.  set  'FILES=100'
  470.  
  471.       
  472.          Please note the above config.sys setting will only affect
  473.       files opened on your local drives.  If you are operating on
  474.       a network drive, note that there is a default setting to the
  475.       number of files specified by your network software.  For example,
  476.       Novell's default setting is 40 files. If you want to increase
  477.       this limit in Novell, create or edit the file 'SHELL.CFG',
  478.       which should be located together with 'IPX.COM' and 'NETX.COM'.
  479.        Add  'FILEHANDLES = n', where  'n' is the maximum number of
  480.       file handles required, into  SHELL.CFG.  Other LAN software
  481.       users should consult their LAN documentation.
  482.  
  483.          Under MicroSoft Windows 3.x, you need to also make a call
  484.       to the function SetHandleCount (eg. SetHandleCount( 100 )).
  485.       If you are using CodeBase 5.0 as a DLL, then you need to add
  486.       this function call to the beginning of the d4init function in
  487.       c4code.c.  This requires you to alter the source code, then 
  488.       to rebuild the DLL and its import library.  If you are using
  489.       CodeBase statically, then all you need to do is add the 
  490.       'SetHandleCount()' function call to your application program.         
  491.  
  492.          General outines of the patches provided by the more popular
  493.       compilers is provided below.  This includes MicroSoft C 6.00a
  494.       and 7.0, Borland C++ 2.0 and 3.0, Turbo C++ 1.01 and Turbo C 2.0.
  495.  
  496.       Microsoft C patch:
  497.       ------------------
  498.  
  499.          By default, MicroSoft is hardcoded to only allow 20 file handles.  
  500.       This limit can be increased by altering the 'startup' code in 
  501.       MicroSoft C and is outlined in the 'readme.doc' file supplied with
  502.       MicroSoft C.
  503.  
  504.  
  505.          You will need to alter the following files:
  506.  
  507.            _FILE.C      (source\startup)
  508.            crt0dat.asm  (source\startup\dos)
  509.       
  510.            1.   _FILE.C :
  511.                            line 18  :  from :  #define _NFILE_ 20
  512.                                        to   :  #define _NFILE_ 100
  513.       
  514.                 crt0dat.asm :
  515.                            line 17  :  from :  _NFILE_ = 20
  516.                                        to   :  _NFILE_ = 100
  517.       
  518.                            line 259 :  (comment this line out)
  519.                            line 731 :  (comment this line out)
  520.                                        - these were commented out because of
  521.                                          an unresolved external. This didn't 
  522.                                          seem to affect the example.
  523.       
  524.                            line 319 - 321 :  (uncomment these lines)
  525.       
  526.            2.   Compile _FILE.C and crt0dat.asm :
  527.       
  528.                  cl -c -AL -W2 -Gsw -Owd _FILE.C
  529.                  masm -Mx -Dmem_L crt0dat.asm
  530.  
  531.            3.   The compiled .OBJs need to be put in the appropriate library.
  532.  
  533.                  DLL :     lib ldllcew-+_FILE;     
  534.                            lib ldllcew-+crt0dat;
  535.             
  536.                  NONDLL :  lib llibcew-+_FILE;
  537.                            lib llibcew-+crt0dat;
  538.       
  539.  
  540.       Borland C++ 2.0, Turbo C++ 1.01 and Turbo C 2.0 patch:
  541.       ------------------------------------------------------
  542.  
  543.          Borland provides patches for both Borland C++ 2.0 and 3.0.  This
  544.       patch is not for Borland C++ 3.0.  See the next section for the 
  545.       Borland C++ 3.0 patch. 
  546.  
  547.          Note that in order for this method to work you must use
  548.       _close() instead of close().  Therefore in all versions of
  549.       CodeBase so far it is necessary to modify the CodeBase source
  550.       code so that close()'s are changed to _close()'s.    
  551.          
  552.          To increase the number of file handles to 50 under Borland 
  553.       compilers simply include the file "filehand.c" in your project
  554.       file (Turbo C 2.0 users must call the function setup() from
  555.       main).  If you wish the number of file handles to be different
  556.       then 50 than simply modify the define value at the beginning
  557.       of "filehand.c".    
  558.          
  559.          So far this fix has been tested using Borland C++ 2.0
  560.  
  561.       on a simple program that opens 50 files locally without CodeBase
  562.       and on the CodeBase 5.0 test programs.  It has not been tested
  563.       over the network yet.  
  564.       
  565.  
  566.       // * * * filehand.c * * *
  567.  
  568.       #include <fcntl.h>
  569.       #include <dos.h>
  570.       
  571.       #define MAX_HANDLES 50
  572.       
  573.       void set_up(void)
  574.       {
  575.          unsigned int _openfd[MAX_HANDLES];
  576.          int j;
  577.       
  578.          /* initialize table of handles and the first five reserved ones */
  579.          /* STDIN, STDOUT, STDPRN, STDAUX, STDERR */
  580.       
  581.          _openfd[0]  =  O_RDONLY |  O_DEVICE;
  582.          _openfd[1]  =  O_WRONLY |  O_DEVICE;
  583.          _openfd[2]  =  O_WRONLY |  O_DEVICE;
  584.          _openfd[3]  =  O_RDWR   |  O_DEVICE |  O_BINARY;
  585.          _openfd[4]  =  O_WRONLY |  O_DEVICE |  O_BINARY;
  586.       
  587.          /* fill remaining slots with -1 (0xFF) so DOS knows they're 
  588.                                                               available */
  589.          for (j=5; j < MAX_HANDLES; j++)
  590.             _openfd[j] = 0xFF;
  591.       
  592.          /* DOS function 58h to set allocation strategy to LAST_FIT.
  593.             FIRST_FIT   -  00h
  594.             BEST_FIT    -  01h
  595.             LAST_FIT    -  02h
  596.          */
  597.          _AH = 0x58;
  598.          _AL = 1;
  599.          _BX = 2;
  600.          geninterrupt(0x21);     /* call DOS */
  601.       
  602.          /* set DOS handle count with function 67h only 
  603.                                                  available in DOS >= 3.3 */
  604.          _AH = 0x67;
  605.          _BX = MAX_HANDLES;
  606.          geninterrupt(0x21);     /* call DOS */
  607.       
  608.          /* DOS function 58h to set allocation strategy to FIRST_FIT */
  609.          _AH = 0x58;
  610.          _AL = 1;
  611.          _BX = 0;
  612.          geninterrupt(0x21);     /* call DOS */
  613.       }
  614.       
  615.       #ifdef __TURBOC__ == 0x18D
  616.  
  617.           In order to fix Turbo C 2.0 you must make an explicit function call
  618.           to setup() at the beginning of main() (comment out these lines)
  619.       #else
  620.           #ifdef __TURBOC__ == 0x400
  621.               This fix does not work with Borland C++ 3.0.  It only works on
  622.               Turbo C 2.0, Turbo C++ 1.01, and Borland C++ 2.0
  623.           #else
  624.               #pragma startup set_up 64  /* automatically invokes set_up() at
  625.                                             program startup for Turbo C++ 1.01
  626.                                             and Borland C++ 2.0 */
  627.           #endif
  628.       #endif
  629.  
  630.  
  631.       Borland C++ 3.0 patch:
  632.       ----------------------
  633.  
  634.          This patch was obtained directly from Borland International Inc.
  635.       This patch involves changes to one file from the RTL ( Run-Time
  636.       Library ): _NFILE.H
  637.  
  638.       A change to this file affects these files: FILES.C and FILES2.C .    
  639.       Therefore, FILES.C and FILES2.C must be recompiled and re-linked.
  640.  
  641.          Please note that this fix has not been extensively tested
  642.       by Sequiter.       
  643.  
  644.  
  645.            1.   _NFILE.H:
  646.  
  647.                 // _NFILE.H
  648.                 // Copyright (C) 1992 Borland International, Inc.
  649.                 // All Rights Reserved
  650.  
  651.                 // Maximum number of open FILES
  652.                 #define _NFILE_ 20       /* change 20 to larger value */
  653.  
  654.                 //........................................................
  655.  
  656.  
  657.          You will now have to replace the files FILES.C and FILES2.C in
  658.       the standard library with the patched files.  You must first compile
  659.       FILES.C and FILES2.C.  You can do this as follows:
  660.  
  661.             bcc -c -mX FILES.C FILES2.C
  662.  
  663.      where the X in -mX is the memory model being used.  Each memory
  664.      model used must have these changes made to each repective memory model
  665.      library.
  666.  
  667.      eg.  For large model usage:
  668.  
  669.             bcc -c -ml FILES.C FILES2.C
  670.  
  671.  
  672.  
  673.         Now link the new modules into the library.  For example, the large
  674.      model link would be:
  675.  
  676.             tlib cX.lib -+FILES.OBJ -+FILES2.OBJ   
  677.             tlib cwX.lib -+FILES.OBJ -+FILES2.OBJ  
  678.  
  679.      where the X is the memory model being used.  Each memory
  680.      model used must have these changes made to each repective memory model
  681.      library.
  682.  
  683.      eg.  For large model usage:
  684.  
  685.             tlib cl.lib -+FILES.OBJ -+FILES2.OBJ   
  686.             tlib cwl.lib -+FILES.OBJ -+FILES2.OBJ  
  687.  
  688.  
  689.      Both of these lines should be executed.  'CL.LIB' is a Borland DOS   
  690.      library, and 'CWL.LIB' is a Borland Windows library.
  691.  
  692.         Once completed, you should now be able to open more than twenty
  693.      files.  
  694.  
  695.                   ------   END   ------
  696.