home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / APPS / DATABASE / MBASE.ZIP / MBASE.DOX < prev    next >
Encoding:
Text File  |  1991-02-11  |  35.8 KB  |  618 lines

  1.     /\
  2.    /  \
  3. ../    \....METALBASE release version 3.1......................................
  4.  /      \
  5. /        \  Written August 1989 through October 1990 by Huan-Ti
  6. \        /
  7.  \      /   Initially released December 10th 1990
  8.   \    /
  9.    \  /
  10.     \/
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.        "And Calvin ate.  And Food Lion went out of business.  Amen."
  19.  
  20.                                                    --1st Calvin 4:8
  21.  
  22.  
  23. WHY_METALBASE_?________________________________________________________________
  24.  
  25.     The Amiga 500 multi-tasks.  Wow.  It has great graphics.  Yeah.  Phenomenal
  26. sound.  Yippee.  It costs $500.  I bought one.
  27.     A DBase package costs more than the computer.  So does Paradox.  And
  28. Informix.  And almost every other database package on the market.  I didn't
  29. buy one.
  30.     But I needed a database for my system.  Anybody who's ever worked with a
  31. database knows they're addictive--code that's written without a flexible
  32. database backing it up lacks something.  And DBase wants $600 to put that
  33. something back into programs.  No thanks.
  34.     That's why MetalBase was written... its forerunners (versions 1.0 and
  35. 2.0, not available) were designed by the same author with the Amiga line's
  36. needs specifically in mind:  relatively slow floppy drives (Compared to hard
  37. drives), so sparse read-head maneuvering was essential.  Relatively small
  38. memory, when compared with the amounts of memory required by most C compilers
  39. (Lattice needs roughly 300k just to run, for example), so the code had to be
  40. consise, pure, and use few variables.  Expansion was always available; hard
  41. drives, huge memory capacities, extra processors, ram drives -- so the system
  42. had to be readily expandible and flexible enough to meet the requirements of
  43. both a 512k, 1-drive machine and a 4-megabyte, 120-meg hard drive-driven
  44. setup.  And they were.
  45.     The problem was, Amigas can multi-task.  So what is the rest of the
  46. computer doing while a database runs around looking up records on one drive?
  47. Nothing.  Why not let it look up records on another drive?  Fine... that works.
  48. What about on the same drive... using, say, a ram disk, so there are no real
  49. read-heads to worry about positioning?  That would mean each relation would
  50. have to support multi-user access... a requirement around which MetalBase
  51. versions 3.0 and 3.1 focus.  Not only can many terminals access many files at
  52. once, but on multi-terminal systems, each terminal can work simultaneously on
  53. any given file.  Terminals can each use as many relations as a system will
  54. allow, and each relation can be used by over one hundred users at once.  The
  55. code used to create MetaBase 3.X is completely compatible with the Unix )
  56. operating system and all of its derivatives, so its inherent multi-user
  57. ability places it in firm working footing on the most advanced systems on the
  58. market.
  59.     Relations are designed by a user to match his/her exact requirements,
  60. indicies placed as needed on single or composite fields, and records can be
  61. added, retrieved, changed, and deleted as any C programmer so desires.  The
  62. interface is as simple as possible, very fast in execution, and provides a wide
  63. range of error types for exact specification of problems.  A user on any
  64. terminal can choose to lock out other users from any number of relations, so
  65. data that is about to be changed will not be read by others before changes
  66. take place.  Automatic temporary locks are placed on a relation which is about
  67. to undergo a deletion or addition, thus delaying other users' access to files,
  68. so that no data will be read until all indicies have been updated correctly.
  69. This process is entirely system-driven; users never need worry about it at all.
  70. If another user is adding a record to a relation, any terminal requesting a
  71. record lookup will simply wait until the addition is complete before
  72. proceeding. As records are deleted and added through normal use, the algorythms
  73. used to update indicies automatically keep them at top operating speeds, so any
  74. given relation's number of records can grow exponentially while causing only a
  75. linear increase in look-up time.  Any relation can contain over four billion
  76. records (Nearly four billion more than most systems will ever need), and each
  77. record's length can be as large as its system's memory can handle.  In
  78. perspective, MetalBase is infinitely expandible, while requiring very little of
  79. the system on which it operates.
  80.  
  81.  
  82. RELATION_DESIGN________________________________________________________________
  83.  
  84.         A sample relation.  Data      Field # ->  1    2   3    4       5
  85.         is read by selecting one     Record #   _____ ___ ____ ___ ___________
  86.         record from the others by          1   |_____|___|____|___|___________|
  87.         various criteria, and              2   |_____|___|____|___|___________|
  88.         returning it to the user.          3   |Smith| 12| 114| A2|Houston, TX|
  89.         Record 3 (In this example--        4   |-----|---|----|---|-----------|
  90.         actual MetalBase records need
  91.         no such numbering system), if returned, would be placed in a string
  92.         as "Smith| 12| 114| A2|Houston, TX|"
  93.  
  94.     A relation is a collection of records, each record consisting of the same
  95. number of fields, character strings whose length remains constant from record
  96. to record.  Each field need not have the same length as the next in any given
  97. record, but each record will contain the same fields as the others.  The data
  98. the fields contain is, of course, the main purpose of a database--when
  99. thousands of records exist, a system without a database would need vast amounts
  100. of time to find any given record.  Databases decrease dramatically record
  101. retrieval time, while requiring as little additional time to add new and change
  102. old records as possible.
  103.     The key to a database is its indicies--pointers arranged in such a fashion
  104. as to show the system where to look for the record for which it is searching.
  105. The more of these collections of pointers, or indicies, a database has, the
  106. greater the number of different fields a system can search through in order to
  107. find a record meeting certain criteria for a field (Or fields... a single index
  108. can be used to first sort records by one field, and also sort duplicates with
  109. respect to a second field, etc.  MetalBase allows these composite indicies to
  110. key off of as many as 5 different fields).  However, databases require time to
  111. update each index every time you add, delete, or change a field which has an
  112. index placed upon it.  So although retrieval criteria possibilites are expanded
  113. by using many indicies, the amount of time required to change the existing
  114. records in a database will also increase.  For this reason, the number of
  115. indicies a relation will have should be considered carefully.  Use what is
  116. needed, but no more.
  117.  
  118.     Relations for MetalBase take the following form (Words in brackets are
  119. optional syntax, words enclosed in <> are sample entries):
  120.  
  121.         [relation] <equipment>
  122.  
  123.         field <customer>         [length] <5>  [right]
  124.         field <#_purchased>      [length] <3>  [<right>]
  125.         field <part_number>      [length] <4>  [<right>]
  126.         field <price_code>       [length] <3>  [<right>]
  127.         field <shop_address>     [length] <11> [right]
  128.  
  129.         index [on] customer                 [<with duplicates>]
  130.         index [on] part_number|price_code   [with duplicates]
  131.         index [on] price_code               [<with duplicates>]
  132.  
  133.         [end]
  134.  
  135.     Note that the relation-building program released with MetalBase 3.1 also
  136. supports comments at the end of the "field" and "index" lines, as in:
  137.         field shop_address       length 11 ; Comment here ;
  138.     The semicolons must not touch text on either side.  MetalBase 3.1's build
  139. function also supports the ignored keyword "left" in place of "right", for
  140. those who put it there by instinct.
  141.  
  142.     The first line of a schema simply tells the computer what to call the new
  143. relation.  The word 'relation' is optional, as is all text enclosed in
  144. brackets.
  145.     The second section of a schema describes the fields of which every record
  146. in the relation will be composed.  The word immediately following 'field' is
  147. simply a name for the field.  The next point of interest is the number after
  148. 'length'... this number indicates the number of characters in that field.
  149. MetalBase will allow any positive integer here your computer can handle, and
  150. if any length, or the sum of all lengths, is indeed large, BUILD will prompt
  151. you to add certain lines to the beginning of your code to warn the system of
  152. excessive-length records.  The word 'right' immediately following the field
  153. length is optional--if it exists, any data placed in the field which does not
  154. contain enough characters to fill the field will be right-justified.  This is
  155. essential for number fields which will be indexed, as computers interperet
  156. "42" as a number which is much less than "7 " (Note the space to the right of
  157. the seven).  Without the word 'right', all data will be left-justified in the
  158. field.
  159.     After all fields have been declared, indicies are placed on fields and
  160. combinations of fields.  MetalBase requires that you have at least one index
  161. in any relation (This is only logical--a database without indicies is nothing
  162. more than a text file).  After the word 'index' in each line, the names of
  163. fields to be indexed appear, separated by vertical bars ("|").  If more than
  164. one field name appears, MetalBase will declare that index composite.  Making
  165. indicies composite is encouraged--it adds no time to relation updates, but
  166. improves the appearance of output for nearly all purposes.
  167.     Occasionally certain data should not be repeated... for instance, a
  168. person should not be able to visit a physicians office twice at the same time.
  169. In this case, were a relation defined as consisting of the fields "name" and
  170. "visit_time", an index would be declared on "name|time" WITHOUT including the
  171. words 'with duplicates', as seen above.  If such a relation were built,
  172. MetalBase would not allow the space-time continuum to be stretched, as
  173. described previously.  Including the words 'with duplicates' after the
  174. definition of an index remove this error-catching system, for that index alone.
  175. Use of the duplicate-catching system is entirely a case-to-case decision...
  176. there is little difference in the amount of time used between implementing and
  177. not implementing it.
  178.     If the schema described previously exists as "/usr/joe/equip.s", the
  179. command BUILD, a utility included for use with MetalBase, will create a
  180. relation called "equipment.rel" under the directory "/usr/joe".  A sample
  181. output of BUILD is as follows:
  182.  
  183.         % build /usr/joe/equip.s
  184.         Building relation equipment under directory /usr/joe
  185.  
  186.         Fields___________________________________________________
  187.  
  188.         customer     [5] L-Just         #_purchased [3] R-Just
  189.         part_number  [4] R-Just         price_code  [3] R-Just
  190.         shop_address [11] L-Just
  191.  
  192.         Indicies_________________________________________________
  193.  
  194.         customer..........................Duplicates allowed
  195.         part_number|price_code............Duplicates not allowed
  196.         price_code........................Duplicates allowed
  197.  
  198.         Do you wish to continue to build this relation [Y/n] ? <y>
  199.  
  200.         Relation created--zero entries.
  201.  
  202.         % ls -C /usr/joe
  203.         equip.s              equip.rel
  204.         %
  205.  
  206.     Once a relation has been built, it contains no entries, and is ready for
  207. use.  BUILD's sole use is the creation of relations... other utilities
  208. (discussed later) must be used for maintenance of relations (if needed).
  209.  
  210.  
  211. IMPLEMENTAION__________________________________________________________________
  212.  
  213.     A sample program implementing MetalBase follows:
  214.  
  215. (*)     #include <mbase.h>
  216.  
  217.         main ()
  218.         {
  219.            int   file;
  220.            char  str [40];
  221.  
  222. (**)       if ((file = mb_inc ("/usr/joe", 128)) != 0)
  223.             { printf ("File '/usr/joe.rel' cannot be found.\n");
  224.               exit   (1);
  225.             };
  226.  
  227.            if ((mb_sel (file, 2, str, EQUAL, "114|A2") != 0)
  228.             { printf ("Record cannot be found.\n");
  229.               exit   (1);
  230.             };
  231.  
  232.            printf ("Record contains : %s\n", str);
  233.  
  234.            mb_upd (file, "Su | 14|112|C3|Dallas, TX");
  235.  
  236.            mb_sel (file, 1, str, CURRENT, "");
  237.  
  238.            printf ("Updated to      : %s\n", str);
  239.  
  240.            mb_rmv (file);
  241.         }
  242.  
  243.     Manipulation of relations using MetalBase is simple... by including the
  244. MetalBase header file in your programs (As line (*), above) and compiling using
  245. the option "-lmb" (Or "library ..., mbase.lib, ...", depending on your
  246. compiler), you add extra commands to C.  A summary of these follows:
  247.  
  248.  - mb_inc (filename, int) -- this command includes a relation on your desktop,
  249.         so that it becomes accessable.  Any relation you wish to work with
  250.         must be included, as in line (**) above.  If mb_inc returns a negative
  251.         number (Zero is a valid return code-- it does not indicate an error),
  252.         an error has occurred (The most likely one is that the relation cannot
  253.         be found under the given directory).  Note that "filename" does NOT
  254.         include the ".rel" suffix.  BUILD, in analog, does not require that
  255.         you include the ".s" suffix on the name of the schema you are working
  256.         with, but the schema file must end in ".s", as relations must end in
  257.         ".rel".
  258.         The integer passed in is the encryption key for the relation--see the
  259.         section on encryption for more information.  Note that MetalBase 3.0,
  260.         as it does not support encryption, does not require this integer.
  261.         Sorry for the inconvenience.
  262.  
  263.  - mb_sel (file, index, buffer, action, comparison_value) -- this command
  264.         searches a given relation for the record you desire, described by
  265.         "action" and "comparison_value".  "file" is the number returned by
  266.         mb_inc... this code is used in all other functions to indicate which
  267.         relation you intend to work with.  "index" is the index number by which
  268.         you wish to search... numbered sequentially by the order in which they
  269.         were defined in the schema, starting with the number 1.  "buffer" is
  270.         merely a string into which MetalBase can return the record, when found.
  271.         Note that the ENTIRE record will be returned, not just the fields
  272.         indicated through the schema for use by the index.  A list of valid
  273.         actions follows:
  274.            FIRST (or FRST) -- searches for the first record alphabetically.
  275.            LAST -- similarly, seeks the last record alphabetically.
  276.            NEXT -- searches for the next sequential record alphabetically.
  277.            PREVIOUS (PREV) -- as NEXT, searches for the previous record.
  278.            EQUAL (EQUL) -- seeks a record containing fields exactly those in
  279.                 "comparison_value".  If the index used allows duplicates and
  280.                 some exist, EQUAL returns the first of these: all duplicates
  281.                 can be found by subsequent "NEXT" searches.
  282.            GTEQ -- EQUAL returns a NOT_FOUND error if a record cannot be found
  283.                 to precisely match the comparison.  GTEQ acts as EQUAL in all
  284.                 respects but this;  GTEQ will find the record greater
  285.                 alphabetically, or precisely equal to (If one exists), the
  286.                 comparison.
  287.            GTHAN (GTHN) -- Acts as GTEQ, except GTHAN will ignore precise
  288.                 matches.  Useful if you wish to begin searching names, say,
  289.                 after the "Smith"'s.  Another way to accomplish this would be
  290.                 to use LTEQ + "Smith", followed by a NEXT...
  291.            LTEQ -- Searches for a record less alphabetically, or equal to (if
  292.                 one exists), the comparison.  In the event that duplicates of
  293.                 the record about to be returned exist ("Duplicate" being
  294.                 defined locally by a record, whose fields used by a given
  295.                 index are precisely equal to another record's such fields on
  296.                 the same index), LTEQ returns the last of these: all
  297.                 duplicates can be found by subsequent "PREVIOUS" searches.
  298.            LTHN (LTHAN) -- Similar to LTEQ in all but one regard: LTHAN will
  299.                 not return a precise duplicate, instead searching to its
  300.                 left for the record before it.
  301.            CURR (CURRENT) -- After a record is found by a search, MetalBase
  302.                 remembers the location of the record.  Searching with the
  303.                 action CURRENT re-reads this most recent record, and returns
  304.                 it in its entirety.  As with FIRST, LAST, NEXT and PREVIOUS,
  305.                 the value of "comparison_value" is irrelevant in CURRENT --
  306.                 however, CURRENT is also oblivious to index used (As no
  307.                 actual searching takes place... MetalBase merely recalls a
  308.                 known record).
  309.         Please note that the above-described action names merely stand for
  310.         integers, and MetalBase will not understand if you use quotes around
  311.         the names.  These actions must also be written in upper-case.
  312.         "comparison_value" is a string containing a record consisting only of
  313.         the fields needed by an index... each field separated from the next
  314.         by a vertical bar.  The last field may optionally be terminated with
  315.         a vertical bar, if desired.
  316.  
  317.  - mb_upd (file, new_rec, mode) -- After a record is found, it may be updated
  318.         through mb_upd.  MetalBase simply replaces the old record's fields with
  319.         those indicated in "new_rec".  This process usually requires more time
  320.         than any other, as the record must be disconnected from each index in
  321.         turn, changed, and reconnected.  Occasionally, changing a record will
  322.         not change certain indicies.  When this occurs, the update would take
  323.         less time if the index were skipped... and if you feel this extra time
  324.         is necessary, type the word FAST for "mode".  Like the actions for
  325.         mb_sel, FAST and SLOW should not be surrounded in quotes.
  326.         Disconnecting and reconnecting a record, to the contrary of the
  327.         preceeding argument, is a very beneficial process, even for indicies
  328.         which are not changed through a specific update.  The algorhythm used
  329.         for such updating is designed to help normalize the database, much as
  330.         a kitchen-knife case which sharpens blades every time a knife is
  331.         removed or inserted.  A "normalized" index is one in which records have
  332.         been packed as closely together as possible, minimizing lookup time.
  333.         If "mode" is set to SLOW in mb_upd, ALL indicies will be updated in
  334.         this way every time a record is updated.
  335.         An update will be aborted if the changes would violate a non-duplicate
  336.         index.
  337.  
  338.  - mb_del (file, verification) -- After a record is found, it may be removed
  339.         completely by use of mb_del.  Once a record is deleted thus, it CANNOT
  340.         be retrieved.  The "verification" argument should be NULL ("") -- its
  341.         only purpose is to ensure that the command has not been confused with
  342.         mb_rmv, described below.  Due to C's handling of file-length limiting
  343.         pointers, mb_del does not decrease the actual amount of storage space
  344.         for a relation.  Subsequent additions, however, will not increase
  345.         allocation space for a relation until the number of records added
  346.         exceeds the number previously deleted.  To recover this space and
  347.         physically remove deleted records, see the section on Utilities, below.
  348.  
  349.  - mb_add (file, new_rec) -- This command adds a new record to a relation.  If
  350.         adding the record described by "new_rec" would violate a non-duplicate
  351.         index, the addition to the relation will be aborted and an error
  352.         returned (See the section on Errors, below).
  353.  
  354.  - mb_lck (file) -- If, as an example, a program reads a record from a relation
  355.         used by many terminals simulaneously, waits for a user to enter a new
  356.         value for one of its fields, and updates the record, it could prove
  357.         disastrous if the record was read by one terminal, then another...
  358.         updated on one & re-written, and re-updated by the second terminal.  To
  359.         prevent this type of scenario, mb_lck, when used, excludes other users
  360.         from including a relation on their desktop.  Such a lock cannot be
  361.         installed if more than one user is already using the relation.
  362.  
  363.  - mb_unl (file) -- Removes a lock placed on a relation by mv_lck.
  364.         
  365.  - mb_rmv (file) -- This command removes a relation from your desktop.  If the
  366.         file has been locked previously (Via mb_lck), the lock is removed.
  367.  
  368.     Note from the example program above that comparison values in mb_sel, and
  369. new_rec in mb_add and mb_upd need not be spaced correctly, or at all...
  370. MetalBase will automatically justify each field properly before implementing
  371. it.  However, if "7.3 |" (Note the trailing space) is included as, say, a six-
  372. character right-justified field, it will be spaced to "  7.3 |"... the trailing
  373. space remains intact.  Left-justified fields similarly retain any leading
  374. spaces.
  375.  
  376.  
  377. ERRORS_________________________________________________________________________
  378.  
  379. Build / Errors :
  380.  
  381.       Cannot open <file.s>............The schema indicated to Build cannot
  382.                                         be found.
  383.       File <file.s> holds no schema...The schema indicated cannot be used
  384.         definition                      as a definition of a relation.  The
  385.                                         most likely cause is that the file is
  386.                                         empty.
  387.       Field <field> declared after....All fields must be declared before any
  388.         indicies                        indicies are declared.
  389.       Field <field> declared twice....Field names must be unique.  Spaces are
  390.                                         not allowed in field names.
  391.       No fields declared before.......A relation must contain fields, and these
  392.         end reached                     must be declared before any indicies.
  393.       Incorrect syntax................The definition of a field's length or
  394.                                         justification has been entered
  395.                                         incorrectly.
  396.       Field <field> undefined.........An index has been placed on a non-
  397.                                         existant field.  Check spelling.
  398.       No fields declared before end...The schema definition is incomplete: it
  399.         reached                         must contain at least one field and
  400.                                         one index.
  401.       No indicies declared before.....See the above error description.
  402.         end reached
  403.       Identifier <?> not recognized...The only valid words for the beginning
  404.                                         of a line are "relation" or a relation-
  405.                                         name (As the first line), "field",
  406.                                         "index", and (optionally) "end".
  407.       Cannot open relation............The file <file.rel> cannot be written...
  408.                                         possible causes are a media error or
  409.                                         write-protection on the file.
  410.       Relation is busy................Relations cannot be re-built until it is
  411.                                         not being worked with by any users.
  412. Build / Warnings:
  413.  
  414.       Please re-define BUF_LEN as.....If a relation's record length is
  415.                                         excessive, you will receive this
  416.                                         warning.  The line "define BUF_LEN xx",
  417.                                         with the x's representing the number
  418.                                         described in the warning line, must be
  419.                                         included before "#include <mbase.h>".
  420.       Please re-define MAX_FLDS as....If any relation contains more than 30
  421.                                         FIELDS (_not_ records), the line"
  422.                                         #define MAX_FLDS xx" must be inserted
  423.                                         at the beginning of your program, as
  424.                                         with the previous warning.
  425.       Please re-define MAX_CUT as.....If a relation's record length is greater
  426.                                         than 80, you will need to insert the
  427.                                         line "#define MAX_CUT xx", as with the
  428.                                         previous warnings.
  429.       Please re-define MAX_RPT as.....If the length of any field is greater
  430.                                         than 240 characters, you will need to
  431.                                         insert the line "#define MAX_RPT xx",
  432.                                         as with the previous warnings.
  433.       The file about to be created....If you build a relation where a relation
  434.         already exists                  of the same name already exists, any
  435.                                         data in the existing relation will be
  436.                                         erased in favor of the new, empty
  437.                                         relation.
  438. MetalBase / Errors :
  439.  
  440.         0..OKAY...............This is the generic no-problem return code.  All
  441.                                 functions except mb_inc should return 0 if
  442.                                 they have been able to function properly.
  443.     -1000..NOT ENOUGH ROOM....Too many relations are open at once -- mb_inc
  444.                                 cannot allocate enough space for the new
  445.                                 relation.  This error can be prevented by
  446.                                 re-defining MAX_REL, as with build's warning
  447.                                 messages, to a value greater than its default
  448.                                 of 5.  In addition, having many files open at
  449.                                 once may require that you warn <stdio.h>...
  450.                                 consult your system manuals.
  451.     -1001..CANNOT OPEN........The file <file.rel>, where <file> is the name
  452.            RELATION             passed to mb_inc, cannot be opened.  In all
  453.                                 probability, it does not exist.
  454.     -1002..RELATION_HUNG......A user has stopped a program during a record
  455.                                 addition, deletion, or update.  These functions
  456.                                 place temporary locks on a file, which are
  457.                                 removed at the end of their respective
  458.                                 procedures.  Normally other functions will
  459.                                 simply wait for the file to be unlocked, but if
  460.                                 the wait time becomes excessive, this error is
  461.                                 returned and the function aborted.  Try the
  462.                                 function again, and if you recieve this error
  463.                                 a second time, see the section on Utilites to
  464.                                 remove the lock manually.
  465.     -1003..CANNOT READ........The file <file.rel> cannot be read.  This error
  466.            RELATION             is returned only from mb_inc, and is probably
  467.                                 caused by read-protection placed on the file.
  468.     -1004..RELATION BUSY......No more than 120 users may work simultaneously
  469.                                 with a given file.
  470.     -1005..RELATION LOCKED....The relation about to be opened has been locked
  471.                                 intentionally by another user, and is
  472.                                 unavailable for use by others.  If no one is
  473.                                 using this relation, see the section on
  474.                                 Utilites in order to remove the lock on the
  475.                                 relation.
  476.     -1006..LOCK DENIED........A relation cannot be locked while more than one
  477.                                 user is working with it.  If no other users
  478.                                 are on the relation and you still receive this
  479.                                 error, see the section on Utilities in order to
  480.                                 clean the user-count on the relation.
  481.     -1007..ILLEGAL DUPLICATE..The record that has been offered for addition/
  482.                                 update would violate an index that has been
  483.                                 declared to not allow duplicates.
  484.     -1008..CORRUPT INDEX......This relation has an error on an index.  See the
  485.                                 section on Utilites to repair it.  Try to find
  486.                                 which index you were working with at the time
  487.                                 of the error, in order to speed repair.
  488.     -1009..INVALID FILE CODE..Relation codes, the numbers returned by mb_inc,
  489.                                 are always positive.  This error is returned
  490.                                 upon receipt of a negative relation code.
  491.     -1010..NOT OPEN...........The relation with which you are trying to work
  492.                                 has been closed.
  493.     -1011..RECORD INVALID.....Not enough, or too many, fields have been given
  494.                                 for update or addition of a record.
  495.     -1012..INVALID COMP.......The comparison value submitted via mb_sel must
  496.                                 contain exactly the number of fields required
  497.                                 to complete a given index.
  498.     -1013..UNKNOWN ACTION.....A very unlikely error, receipt of this code
  499.                                 indicates you have passed a number greater than
  500.                                 12 or less than 0 to mb_sel as an action.
  501.     -1014..NOT FOUND..........Generic code returned when the record described
  502.                                 cannot be found in the relation searched.  If
  503.                                 you feel it should have been found, check the
  504.                                 index number, action, and comparison value used
  505.                                 in the search.
  506.     -1015..NO CURRENT.........Update and delete act on the record which has
  507.            RECORD               been found most recently.  When a relation has
  508.                                 just been opened, and just after a record is
  509.                                 deleted, there is no such record.
  510.     -1016..INVALID INDEX......A bad index number has been passed to mb_sel.
  511.                                 Valid numbers range 1 through the number of
  512.                                 indicies in a relation.
  513.  
  514.  
  515. UTILITIES______________________________________________________________________
  516.  
  517.     The supporting utilities to MetalBase have not been released with this
  518. package, primarily because I have not bothered to write them yet.  See the
  519. section on SHAREWARE below to see how to register yourself with me (god), as
  520. I'll write any of the following upon request once you're registered.
  521.  
  522.     Utilities include:
  523.        * Repair of bad indicies (Also normalizes relation for maximum speed)
  524.        * Recovering lost space from previous deletes
  525.        * Overhaul of relation (Last two, in one)
  526.        * Removal user-placed locks
  527.        * Removal system-placed locks
  528.  
  529.  
  530. ENCRYPTION______________________________________________________________________
  531.  
  532.     MetalBase 3.1 (not 3.0) automatically encrypts all files.  Users of version
  533. 3.0 may just as well skip this section.
  534.     When a relation is opened (using mb_inc() ), an integer encryption-key is
  535. passed in to MetalBase.  Any records which are added to that relation are
  536. encrypted using this key, and any records which are retrieved are decrypted
  537. similarly before they are returned.  In this way, any information which is
  538. physically stored is encrypted beyond recognition.  As long as this integer key
  539. is the same every time the relation is opened, the encryption is totally user-
  540. transparent: records are passed to mb_inc and mb_upd in normal text, and are
  541. retrieved in normal text, but are stored garbled.  If the key changes, however,
  542. the records retreived in the second session will be decrypted under the new
  543. key, whereas they were encrypted under the former... and the output will be
  544. garbage.
  545.     The values of the integer determine the level of encryption to use (note
  546. that similar numbers, say, 140 and 141, give very different encryption
  547. results):
  548.       0- 64 : Only minimal encryption (Due to the way the encryption method
  549.               works, every character is simply 2's-complimented.  This is
  550.               exceedingly simple to decode, but is easily sufficient to
  551.               confuse any reader)
  552.      65-128 : Slight encryption -- characters are inverted as before, but every
  553.               few characters will be garbaged.
  554.     129-192 : Medium encryption -- more frequent garbage than 65-128.
  555.     193-255 : Total garbage.
  556.  
  557.  
  558. SHAREWARE_(THE_IMPORTANT_PART)__________________________________________________
  559.  
  560.     My name is Richid Jernigan IV.  In the past I have released several not-
  561. terribly-popular programs through PD, the most popular were developed for the
  562. //e'ers of the day (when AE's were so popular) by myself and the Masked
  563. Marauder... Super VH Mod I and ][.  Anything with The Eye (old handle) or
  564. Huan-Ti plastered all over it is mine (I _am_ a bit vain.  Had you noticed?).
  565.     I have designed and written all the versions of MetalBase and all
  566. supporting code.  I claim this code as mine alone, in all ways, shapes, and
  567. forms.
  568.     HOWEVER, I learned most of what I know of programming through examples from
  569. various people, which were distributed freely.  As such, I feel it's only right
  570. for me to try to contribute this, the only thing I can think of which anyone
  571. might want, to the public.  I would therefore like to distribute this freely
  572. and without restriction.
  573.     HOWEVER, I'm also broke.  I've spent too long on this project to see it
  574. suddenly become part of everyone's wet dreams without any financial reward on
  575. my part.  So, I'm releasing it as shareware.  The conditions:
  576.  
  577.         * Give it to as many people as possible.
  578.         * Leave the existing documentation intact.  Add more if you'd like,
  579.           but leave this.  Feel free to add sample programs and relations
  580.           if you like.
  581.         * Leave the credits.  I'm vain and I'm poor, and the publicity for
  582.           me might do me good; if not for my wallet, at least for my ego.
  583.         * Tell me about any bugs you find (God forbid -- you wouldn't
  584.           _believe_ how many tests this thing has been through).
  585.         * Send any modifications to me (as it sez in mbase.c, I'd like to see
  586.           the improved code).  More importantly, SEND IDEAS!  If you'd like
  587.           an improvement, tell me about it!  Whether or not you modify the code
  588.           yourself, I'd like to know what's being done to it.
  589.         * If you find MetalBase useful, elegant (check out _search in mbase.c),
  590.           or just plain worth it, and _certainly_ if you use it in any
  591.           commercial or shareware programs, please send a donation ($5? $10?
  592.           The more the better, really!) to the poor programmer's fund (hehehe):
  593.                 Richid Jernigan IV
  594.                 PO Box 827
  595.                 Norris, TN  37828    <- Yes, folks, he's from TN! <Speee-it!>
  596.           Gimme a name and a mailing address (internet or bitnet account
  597.           names are fine -- just so I can distribute code / information), and
  598.           you'll receive the following:
  599.                 * Any new versions of MetalBase, whenever they pop up
  600.                 * The privilege of being able to request modifications or
  601.                   development of any of the previously-mentioned utilities
  602.                   (which will be sent to everyone on the list when available)
  603.                 * The privilege of being able to DEMAND fixes to any bugs you
  604.                   find (now wouldn't _that_ be fun?)
  605.                 * A big smile from me (worth it, isn't it?  Wreeetch!)
  606.  
  607.           I can also be reached (during the school-year, save for Spring '90-91)
  608.           at (now) rpj@owlnet.rice.edu, or (soon) at richid@owlnet.rice.edu .
  609.  
  610. Share and enjoy!   (God, did I just say that?  Yeech!  I'm quoting books again.)
  611.         ___
  612.        / /                                   The man with the hammer,
  613.       | (___________.----------------.                        Richid
  614.      (   ___________|                 |                (rpj@owlnet.rice.edu)
  615.       ) (           `----------------'                       (Huan-Ti)
  616.      '---`
  617.  
  618.