home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / CODE4-3.ZIP / TC_LIB.ZIP / README < prev    next >
Encoding:
Text File  |  1990-01-20  |  9.9 KB  |  269 lines

  1.  
  2. (c)Copyright Sequiter Software Inc., 1987, 1988, 1989. All rights reserved.
  3.  
  4.  
  5.         README -  Table of Contents
  6.  
  7.    I.    The Code Base 4 Libraries
  8.  
  9.    II.   Installing Code Base 4
  10.  
  11.    III.  Example Programs ('d4more.c' contains some new field routines.)
  12.  
  13.    IV.   Converting from Code Base to Code Base 4
  14.  
  15.    V.    Converting from Code Base 4.xx to Code Base 4.04
  16.  
  17.    VI.   Turbo C 2.0 Problem
  18.  
  19.    VII.  Code Base 4.03 Corrections
  20.  
  21.    VIII. Code Base 4.04 Bug Fix
  22.  
  23.    IX.   dBEditor
  24.  
  25.    X.    Using Code Base with Microsoft Windows
  26.  
  27.    XI.   Quick Reference Help
  28.  
  29.    XII.  Multi-user Problems and Work Arounds.
  30.  
  31.  
  32. The Code Base 4 Libraries
  33.  
  34.    Library files 'T4.LIB', 'M4.LIB', and 'M4CLIP.LIB'  were created 
  35. with Turbo C 2.0 and Microsoft C 5.1 respectively.  The library
  36. files 'M4.LIB' and 'M4CLIP.LIB' have also been tested with Quick C 2.0.
  37.  
  38.    The files used to create the pre-built libraries are present on
  39. the Code Base 4 library diskette.
  40.  
  41.    If you have a different compiler or compiler version, or if you 
  42. with to use Code Base 4 with OS/2, you will not be able to use the 
  43. pre-compiled libraries.  Refer to the Appendix on Library building.
  44.  
  45.  
  46. Installing Code Base 4   
  47.  
  48.    With Code Base 4.04 there is one more diskette.  Consequently,
  49. the header files and examples are on the 'Examples, Header Files 
  50. and Source Diskette'.  As the source no longer fits on one diskette,
  51. there are some source files in the "SOURCE" subdirectory of this
  52. diskette.
  53.  
  54.    As described in the Code Base 4 users guide, you need to copy
  55. the appropriate Code Base 4 files to the appropriate directory of
  56. your hard disk.
  57.  
  58.  
  59. Example Programs
  60.  
  61.    There are several example programs located on the library diskettes:
  62.  
  63.    Program         Use
  64.  
  65.    c4convert.c    A program which, for a number of files, changes
  66.                   character sequences to other character sequences.
  67.           This program extensively uses Code Base 4 routines.
  68.           See below.
  69.  
  70.    d4example.c    The program on page 14 of the Code Base 4 users guide.
  71.  
  72.    d4more.c       VERY IMPORTANT.  This file contains some new, easy
  73.                   to use, field routines.  It also contains an example
  74.                   showing how to use them.  Finally, the example program
  75.                   shows how to use multiple database files, multiple 
  76.                   index files, and 'd4seek'.
  77.  
  78.    d4simple.c     A very short program which implements data entry,
  79.           database manipulation, and a menu.
  80.  
  81.    d4small.c      A program which accesses a database and produces a 
  82.                   13.5K executable file under MSC 5.1.
  83.  
  84.    d4learn.c      An program for interactively executing the Code Base 4
  85.                   database management routines.
  86.  
  87.    n4pull.c       The program on page 122 of the Code Base 4 users guide.
  88.  
  89.    w4example.c     Windowing, Menuing, Data Entry
  90.  
  91.    x4multi.c      A multi-user program for displaying a database.
  92.  
  93.  
  94. Converting from Code Base to Code Base 4
  95.  
  96.    Program 'c4convert' has been provided to convert Code Base 4 programs
  97. into Code Base 4 programs.  Essentially, the convert program searches
  98. for character sequences located in the 'from' field of database
  99. 'convert.dbf'.  It transforms these character sequences into the 
  100. sequences specified by the corresponding 'to' field.  The data
  101. in 'convert.dbf' is set up to transform the character sequences 
  102. 'c3', 'd3', 'e3', 'f3', 'g3', 'h3', 'i3', 'm3', 's3', 'u3', 'v3', and 'x3'
  103. to 'c4', 'd4', 'e4', 'f4', 'g4', 'h4', 'i4', 'm4', 'w4', 'u4', 'v4' and
  104. 'x4' respectively.  The files it operates on are interactively set
  105. within program 'convert'.  By default, it converts and file which
  106. matches the '*.c' wildcard file specification.  All of the identically 
  107. named output files are placed in an output directory.  This output 
  108. directory is '\c4' by default.  Create the output directory before
  109. running program convert.
  110.  
  111.    Make sure that the conversions made do not change parts of your
  112. program which should not be changed.  For example, the hexidecimal
  113. constant '0x37' would be changed to '0x47'.  After the above conversion
  114. is completed, make the following changes:
  115.  
  116.    1.  'd3main.h' no longer is needed.  Remove all references to it
  117.        from your program.  The external variables it defined are now
  118.        defined in source file 'd4init.c'.
  119.  
  120.    2.  's3io' no longer exists.  Instead, you will use routine
  121.        'w4define'.  Note that routine 'd4init' automatically creates
  122.        a default window.
  123.  
  124.    3.  The definition of the integer values returned by 'd3select', and 
  125.        'i3select' have been changed slightly.
  126.  
  127.    4.  Routine 'i3go' has one additional return value.
  128.  
  129.  
  130. Converting from Code Base 4.xx to Code Base 4.04
  131.  
  132.    1.  Routine 'd4go' used to check to make sure the record
  133.        number parameter was less than or equal to the number
  134.        of records in the database.  For performance reasons,
  135.        it no longer does.
  136.  
  137.    2.  Rebuild previous Code Base 4.xx programs which must
  138.        coordinate with Code Base 4.04 programs on a network.
  139.        A minor change was made to ensure Code Base 4.04
  140.        'NDX' file compatibility with dBASE IV.
  141.  
  142.    3.  The default parameters for expression function 'STR'
  143.        have been changed.  They are now the same as dBASE and
  144.        Clipper.
  145.  
  146.  
  147. Turbo C 2.0 Problem
  148.  
  149. When using the medium, small or tiny memory models, the 'malloc' routine
  150. does not work correctly when allocating more than '0xF000' bytes of 
  151. memory.  Consequently, when using Code Base 4 under Turbo C with these
  152. memory models, make the following change to source file 'i4reindex.c':
  153.  
  154.    Change line 835 of 'i4reindex.c' from
  155.  
  156.       large  = h4alloc_try( allocated = 0xFFDE ) ;
  157.  
  158.    to
  159.  
  160.       large  = h4alloc_try( allocated = 0x8000 ) ;
  161.  
  162.  
  163. Code Base 4.03 Corrections
  164.  
  165.    1.  Clipper Users Only
  166.  
  167.        Code Base 4 now works with Clipper Unique Key NTX index files.  
  168.        Ignore the documentation under routine 'i4index' which says that it 
  169.        does not.
  170.  
  171.    2.  Avoid using the 'DTOC' function in index file key expressions.  Use
  172.        function 'DTOS' instead.  dBASE and Clipper format the result
  173.        differently depending on how 'SET DATE' is set.  Consequently, 
  174.        using function 'DTOC' results in an incompatibility with dBASE
  175.        and Clipper index files.
  176.  
  177.    3.  Note that not all of the Code Base source code fit onto the
  178.        'source' disk.  There is additional source code is sub-directory
  179.        'source' of the 'Header', 'Example' and 'Source' disk.  Make sure
  180.        you copy those extra source files before rebuilding your library.
  181.  
  182.  
  183. Code Base 4.04 Bug Fix
  184.  
  185. There is a bug is Code Base 4.04 which only surfaces when using index
  186. files using the key expression 'VAL(STR_VALUE)'.  Note that this function
  187. is seldom used in index files key expressions.   The fix is to change line
  188. 495 of file 'e4exec.c'.
  189.  
  190.    Current Code
  191.  
  192.         *((double *)r_ptr) =   strtod( a.ch, (char **) 0) ;
  193.  
  194.    Line After Fix
  195.  
  196.         *((double *)r_ptr) =   c4atod( a.ch, a_len ) ;
  197.  
  198.  
  199. dBEditor
  200.  
  201. dBEditor, a handy utility program for quickly accessing dBASE
  202. data and index files, is present on the Turbo C library diskette.
  203. The program name is 'EDI.EXE'.       
  204.  
  205. dBEditor also supports interactive window design, calculated fields, 
  206. database relations and single key stroke commands.
  207.  
  208. You probably can figure out how to use 'dBEditor' by experimentation.
  209. However, a users guide is available for US$45.00.  The user's 
  210. guide is 79 pages long and explains 'dBEditor' completely.
  211. For the full retail price of US$99.00 there is also a royalty free
  212. runtime version of dBEditor.                             
  213.  
  214.  
  215. Using Code Base 4.04 with Microsoft Windows 
  216.  
  217.    1.  Refer to the 'WINDOWS_L' conditional compilation switch in the
  218.        appendix on library building.
  219.  
  220.    2.  To limit the amount of memory Code Base 4 uses, consider calling
  221.        'd4init_memory' instead of 'd4init'.  Call 'd4init_memory' 
  222.        once before other Code Base 4 routines are called.  Refer to the
  223.        users guide.
  224.  
  225.        Remember to check the return code which the initialization routine
  226.        returns.  Under Microsoft Windows, the Code Base 4 'u4error' routine
  227.        returns an error if Code Base 4 runs out of memory.  Under DOS,
  228.        lack of memory is treated as a fatal error, and 'u4error' exits
  229.        directly.
  230.  
  231.    3.  Modify 'u4error.c' to display some kind of notification if 
  232.        Code Base 4 detects an error.  Otherwise, make sure you check
  233.        all return codes.  By default, Code Base 4 automatically 
  234.        displays error information under the DOS, OS/2 and Xenix versions
  235.        only.  
  236.  
  237.  
  238. Quick Reference Help
  239.  
  240. The Turbo C library disk contains a file 'quick.ref' on
  241. the root directory which contains a prototype and very short description
  242. of each commonly used routine.  This information can be printed or refered 
  243. to from your text editor.
  244.  
  245.  
  246. Multi-user Problems and Work Arounds
  247.  
  248. A.  When using 'd4skip', lock the corresponding index file before skipping.
  249.     Otherwise, 'd4skip' may not work properly in multi-user operation.
  250.  
  251. B.  As explained in the section on Deadlock, files need to
  252.     be locked in the same order.  However, routine 'd4seek' locks
  253.     the index file and then the database record.  In addition, routine
  254.     'd4write' locks the database record and then the index files.  This
  255.     can cause deadlock.
  256.  
  257.     One way to avoid this problem is to comment out line 47 of 
  258.     routine 'd4go.c'.  This implements dirty reads.  As a result,
  259.     Code Base routines 'd4go', 'd4skip', and 'd4seek' will never
  260.     lock database records.  They will be able to read records locked
  261.     by other users.  Consequently, deadlock will be avoided and it
  262.     becomes the users responsibility for locking database records when
  263.     using these routines.
  264.  
  265.     Another possible solution is to lock the entire database file
  266.     before calling 'd4skip' or 'd4seek'.  This will mean that the 
  267.     database is locked before the index file is locked and will avoid
  268.     deadlock.
  269.