home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 25 / CD_ASCQ_25_1095.iso / dos / prg / bltc125 / _readme < prev    next >
Text File  |  1995-07-25  |  29KB  |  616 lines

  1. --------------------------------
  2. Read me first (sharware release)
  3. BULLET v1.2
  4.  
  5. --Documentation (read this before using CZ)
  6.  
  7. (Any reference to the separate version needed for Borland C/C++ compilers
  8. has been superseded -- the single .LIB works for any standard object
  9. module compiler.)
  10.  
  11. The documentation is online in the CZ.COM/CZ.HLP files. To get started just
  12. make sure CZ.HLP is in the current directory and load CZ:
  13.  
  14.    C>cz
  15.  
  16. It can also be loaded high.
  17.  
  18. Caution:  You will not be able to use CZ very well unless you read
  19.           'Using_CZ' in the TUTORIAL_INDEX.  Spend 5 minutes there
  20.           can save you several hours, even more, in the long run.
  21.           There's nothing mystical about it, if you know how to
  22.           make it do what you want.
  23.  
  24. Press Alt-F1 to hotkey into CZ. Press END (cursor moves to TUTORIAL_INDEX).
  25. Press ENTER. Move the cursor to under Starting_CZ. Press ENTER. Use the
  26. END/ENTER combo to continue until you get the idea. A mouse makes using
  27. CZ even easier.
  28.  
  29. If you want to have a hardcopy of the CZ.HLP use the HLP2TXT.EXE program to
  30. strip off the header info. Load it into your favorite WP or text editor.
  31.  
  32. This package is documentation/source-specific to DOS C and C++ compilers in
  33. that much of the source examples deal with using BULLET under these compilers.
  34. Because of this, this version is called BLTCxxx.ZIP.
  35.  
  36.  
  37. --Installation
  38.  
  39. BULLET comes with the BULLET.LIB in compressed form (BULLET.LI_). It must be
  40. installed using the INSTALL.EXE program. INSTALL performs one function: it
  41. decompresses BULLET.LI_ (to BULLET.LIB) and writes installation information
  42. to the BULLET.LIB file. It does nothing else.
  43.  
  44. To install:
  45.  
  46.    C>install
  47.  
  48. The installation process asks two questions and then decompresses the file so
  49. that BULLET.LIB is ready for use. BULLET.LIB is fully-functional and not
  50. crippled. You may use BULLET.LIB and the BULLET package for evaluation only and
  51. for an evaluation period not to exceed 21 days from the date of installation.
  52. BULLET.LIB works with just about every DOS compiler on the market.
  53.  
  54.  
  55. --Registration
  56.  
  57. BULLET is a shareware product. This means that you may try BULLET during the
  58. evaluation period free of obligation. However, you may not use BULLET after
  59. this evaluation period without registering--you must purchase a license to
  60. use BULLET if you wish to continue to use BULLET or any programs produced with
  61. BULLET. See the !ORDER.FRM for ordering information by check, cash, or money
  62. order. Use !ORDER.CC for ordering by credit card.
  63.  
  64.  
  65. --Upgrades and Updates, Site licensing
  66.  
  67. All updates and upgrades are available from the support BBS free-of-charge.
  68. See the PRODUCT_SUPPORT heading under TUTORIAL_INDEX in CZ for more.
  69.  
  70. Site licensing is available at reasonable rates. Contact me for details.
  71.  
  72.  
  73. --Distribution
  74.  
  75. BBS Sysops may carry BULLET on their BBS provided that all files listed in
  76. the !PACKLST.TXT file are included in the archive. This file must be provided
  77. free of charge, i.e., this file cannot placed in an area that requires users
  78. to pay a fee for per-file download. A general subscription fee BBS is exempt
  79. from this limitation, provided that no specific charge is assessed to this
  80. particular file.
  81.  
  82. Shareware distributors/catalog vendors may carry BULLET on their inventory
  83. provided that: the BULLET package be the only software on the diskette, that
  84. it be made clear that the purchase of the disk does not constitute purchase
  85. of the product, and that no charge greater than a reasonable amount for
  86. distribution services be charged (for example, not more than 5 dollars).
  87. CD-ROM vendors may include BULLET and may charge more than $5 for the CD,
  88. provided that the CD is not for the sole or primary purpose of distributing
  89. Bullet.
  90.  
  91. Only the shareware version of Bullet may be distributed without explicit
  92. permission from the author.
  93.  
  94. In any case, the author of BULLET may at anytime request (and must be granted)
  95. that the BULLET package be no longer advertised/distributed in the vendors
  96. catalog and that within a reasonable time after request, advertising of BULLET
  97. will end (within 6 months and distribution will end immediately). (Basically,
  98. this means that you as a shareware vendor may include BULLET in your
  99. advertising/distributing but that that I, as the author and owner of BULLET,
  100. have the option of having you stop advertising/distributing BULLET, for
  101. whatever reason (such as it becoming a non-shareware commercial product).)
  102.  
  103.  
  104. --------------------------------------------------------
  105. Status value return code with transaction-based routines
  106.  
  107. The transaction-based routines, InsertXB, UpdateXB, ReindexXB, LockXB and
  108. UnlockXB, do not return the completion status. The return value is the
  109. pack index number that failed. The following example assumes that you are
  110. using multiple index files. If you're not, replace AP(x).y with AP.y.
  111.  
  112.    AP[0].Func = INSERTXB;
  113.    pid = BULLET(&AP);
  114.    if (pid == 0) {
  115.       if (AP[0].stat == 0) {
  116.          /* all okay */
  117.       else {                  /* error while adding the data record is       */
  118.          rstat = AP[0].stat;  /* returned in AP(0).stat if and only if pid=0 */
  119.          DoErrorWithDataRecord(stat);
  120.          }
  121.       }
  122.    else {
  123.       rstat = AP[pid-1].stat;             /* -1 since C arrays are 0-based */
  124.       DoErrorWithIndexFile(pid-1, stat);  /* and pid is 1-based */
  125.       }
  126.    }
  127.  
  128. For complete information consult the above named routines in CZ. Note that
  129. ReindexXB does not operate on a data file separately so if its return
  130. code=0 (pid=0) then all operations succeeded. However, with the LockXB
  131. routines, if pid > number_of_packs then the lock on the data file failed.
  132. The following example assumes that two index files and a data file are
  133. to be locked.
  134.  
  135.    packs = 2;            /* 2 packs (two index files per data file) */
  136.    AP[0].Func = LOCKXB;  /* assume AP[1] also done via .nextPtr */
  137.    pid = BULLET(&AP);
  138.    if (pid == 0) {
  139.       /* all okay */
  140.    else
  141.       if (pid <= packs) {   /* error while locking index file and error code */
  142.          rstat = AP[pid-1].stat;     /* in AP[pid-1].stat */
  143.          DoErrorWithIndexFile(stat);
  144.          }
  145.       else {                /* error while locking data file and error code */
  146.          stat = AP[1].stat;    /* in last AP[].stat  ([0] is first, [1] last */
  147.          DoErrorWithDataFile(stat); /* i.e., if here then pid=3 (yes) */
  148.       }
  149.    }
  150.  
  151. --In case a C example does not compile, do not assume that the example is 100%
  152. correct C and that something must be wrong. I'm no C programmer--not by a mile.
  153. If something doesn't compile make the needed corrections. Let me know about my
  154. mistakes and I will be ever so grateful. -chh
  155.  
  156.  
  157. ---------------
  158. Troubleshooting
  159.  
  160. Common problems encountered by new users of Bullet are:
  161.  
  162. P: Data fields are skewed, with some fields containing
  163. parts of other fields' data.
  164.  
  165. S: Most of these problems relate to the way C strings are
  166. 0-terminated, while dBASE DBF fields are fixed-length,
  167. and so need not have the \0.  If you are going to use
  168. strcpy, or any other C run-time library that requires
  169. null-terminated strings, then be sure to provide for this
  170. when you define your DBF record.  For example, if you
  171. want two fields, LASTN and FIRSTN, to each have 15
  172. characters, but will be using C strings, define the
  173. fields as 16.  This will allow room for the \0 on your
  174. strings, and give 15 true character places.
  175.  
  176. Often, the case is such that all appears normal when the
  177. DBF file is accessed (i.e., the data fields don't appear
  178. to be skewed), but indexed access is not correct.  This
  179. is because your program code has templated the data
  180. record consistent with what was written (and is read) at
  181. the DBF level.  However, it is not consistent with the
  182. DBF header specifications (written in CreateDXB) and so
  183. any external access to the DBF (including Bullet keyed
  184. access) will not be correct.
  185.  
  186. Skewed data also results when you change either your
  187. program's data structure template of the DBF record, or
  188. your DBF field list definitions, but don't do the same to
  189. both.  The physical record buffer in your program must
  190. exactly match that of the DBF record.  Off the subject a
  191. bit, but possibly on your mind:  yes, you can create all
  192. this on the fly (i.e., not hard-coded fieldnames, etc.),
  193. but it does require that you manage all offsets yourself,
  194. rather than have the compiler do it for you.  A job for a
  195. C++ wrapper, I suppose.  Certainly do'able as I''ve done
  196. it using a BASIC compiler (see IDEMO.*)
  197.  
  198. Another reason for skewed fields is that the compiler is
  199. modifying the alignment of your program's DBF record
  200. structure.  It is imperative that you instruct your
  201. compiler to not modify any Bullet-used structure:
  202. #pragma pack() is used by many compilers.  Consult your
  203. compiler documentation.  For non-Bullet structures,
  204. alignment doesn't matter to Bullet.  Bullet structures
  205. are any of the Bullet packs, and any DBF record
  206. template/buffer/structure that your program uses to
  207. communicate with Bullet.
  208.  
  209. The main point is to ensure that your physical data
  210. record (structure) you use in your C/C++ program exactly
  211. matches, field for field, that of the DBF record on disk.
  212.  
  213.  
  214. P: Error 240 occurs when attempting to index or reindex
  215. when all else seems to be right.
  216.  
  217. S: dBASE specifications require that fieldnames of the
  218. DBF be 0-filled.  Some programs create DBF files that do
  219. adhear to this specification, but instead just null-
  220. terminate the fieldname.  These files must be fixed
  221. before they can be used by Bullet.  When creating Bullet
  222. DBF files, you must 0-fill the fieldnames (11 bytes, 10
  223. bytes data -- byte 11 always=0).  Memset() can be used to
  224. quickly 0-fill the entire fieldlist.
  225.  
  226.  
  227. P: Find an exact match on a GetEqualXB.
  228.  
  229. S: The problem usually stems from index files created to
  230. allow non-unique keys.  Personally, I don't create index
  231. files where the primary key is not unique, but the demand
  232. was there and so Bullet provides for this.  However,
  233. since there's no real way to offer indexing on physically
  234. indentical keys, Bullet adds an enumerator word at the
  235. end of each key (only if the index file is not using
  236. unique keys).  This two enumerator is in high byte/low
  237. byte order, and is incremented for each duplicate key in
  238. the index file.  For example, if KINGM is added as a key,
  239. and is found to be the first such key by Bullet, the
  240. actual physical key is KINGM\0\0, where the enumerator is
  241. the last two bytes (in Motorola-word order for proper
  242. collating).  Upon the next insert of a "KINGM" key,
  243. Bullet uses KINGM\0\1.  And so on.
  244.  
  245. To search for this key, which by the way is 7 bytes long,
  246. and so reported by StatKXB, though logically it is only
  247. the 5 bytes (as in strcpy(keyExp,"SUBSTR(LASTN,1,5)")
  248. with non-unique keys permitted), you must account for
  249. this in your keybuffer.  For example, in your global
  250. scratch keybuffer (or you can use a separate buffer for
  251. each index file, up to you)  you must specify all 7
  252. bytes, not just the first 5.  This because the data at
  253. bytes 6/7 may not equal \0\0 or \0\1, and so these keys
  254. will not be found (error 201).  In this particular case,
  255. where duplicate keys exist, and you want to locate a
  256. KINGM record, you really have no choice but to start with
  257. strcpy(keybuff,"KINGM\0\0", be aware of the "extra" \0
  258. put by the strcpy function) and GetEqualXB, check the
  259. data record returned, and if not the one wanted, do
  260. GetNextXB until the desired record is located (or not).
  261. Alternatively, you could specify "KINGM\255\255" and use
  262. GetEqualXB followed immediately by GetPrevXB (enumerator
  263. \255\255 is the very last possible, and so will never be
  264. found, but will setup the internal gears so that the
  265. GetPrevXB will locate the very last existing "KINGM??").
  266.  
  267.  
  268. All this is really only a concern if you permit duplicate
  269. keys.  The above could be made unique by adding expanding
  270. the key expression.  For example, a key based on
  271. SUBSTR(LNAME,1,5)+SUBSTR(SSN,6,4) would be pretty unique
  272. (first 5 characters of last name followed by last 4 SSN
  273. numbers (used as characters)).
  274.  
  275.  
  276. Q: How do I specify the key I want to find?
  277.  
  278. A:  The keybuffer (AP.keybuffptr locating it) is filled
  279. with whatever data type you want to locate (hence,
  280. keybuffer is of void type).  If you want to locate a
  281. character key, simply specify the key, such as
  282. strcpy(keybuffer,"whatever") (see "Find an exact match on
  283. GetEqualXB", above).  If you are locating a binary key
  284. value, place the binary value, with the appropriate cast,
  285. into the keybuffer: e.g., *((long *)keybuffer) = 5L;.
  286.  
  287.  
  288. These problems are the most frequently expressed to me.
  289. If you are having other problems related to getting
  290. Bullet going, feel free to contact me at the locations
  291. listed under Product Support.  My ability to quickly
  292. respond to your requests is directly related to how
  293. thorough you are in expressing the exact cicumstances of
  294. any problem.
  295.  
  296. Complete sample programs are in short supply.
  297. Experienced C or C++ programmers that would like their
  298. "Bullet wrappers" possibly included in future releases
  299. are requested to contact me.  Additional samples will be
  300. made available on the BBS, available to all.  Of course,
  301. registered Bullet users will have access to the best of
  302. the best, and always have free access to the current
  303. versions of Bullet.
  304.  
  305. When you've done everything and it's still not working,
  306. it's time to read the documentation!
  307.  
  308. -------------------
  309. Questions & Answers
  310.  
  311. Q: What is BULLET?
  312.  
  313. A: BULLET is a library of program modules that together let the programmer
  314.    develop and create software that can manage huge amounts of data on
  315.    disk using the industry-standard DBF data file format. It also uses high-
  316.    speed b-tree index files to manage keyed data file access.
  317.  
  318.  
  319. Q: What compiler is BULLET for?
  320.  
  321. A: BULLET can be used by nearly all DOS compilers. It's written entirely in
  322.    assembly language. Because of this, it does not require any particular
  323.    programming language or compiler vendor. The 4 requirements are listed
  324.    in the !WHATIS.TXT file.
  325.  
  326.  
  327. Q: Why do I need BULLET when all I need to handle are small amounts of data?
  328.  
  329. A: BULLET can deal with a database as small as 1 record or as large as several
  330.    million. While your current needs may be small, your future needs are bound
  331.    to expand. BULLET can work with you now, and later, even if you switch
  332.    development platforms by moving to another compiler. And BULLET is fast,
  333.    it can deal with a database with millions of records as easily as it can
  334.    with just a few.
  335.  
  336.  
  337. Q: But b-tree stuff, isn't that hard?
  338.  
  339. A: Everything associated with maintaining the database, its data files and its
  340.    index files, is done behind-the-scenes by BULLET. You just specify how the
  341.    data record is to look by specifying the number of fields, their lengths and
  342.    types, and then specify how you want your index files to be based.
  343.  
  344.  
  345. Q: So how do I design my data record?
  346.  
  347. A: You probably have a pretty good idea, already. A good way to determine what
  348.    should go into a database is what you want to come out of it. For example,
  349.    if you're doing a mailing list program, you'll want to have at least the
  350.    name, perhaps broken into first name and last. Also you'll need the mailing
  351.    address--4 lines is usually enough, so you'll want 4 separate address line
  352.    fields. Then there's the State and ZIP, possibly even country. That's the
  353.    minimum. It would look something like this:
  354.  
  355.    FIRSTNAME field of 15 characters; LASTNAME field of 19 characters; ADDR1
  356.    field of 34 characters, ADDR2, ADDR3, ADDR4 as ADDR1; State field of 2
  357.    characters, and ZIP a field of 5 (or 9 if ZIP+4) characters. You could
  358.    specify the ZIP as a numeric field if you wanted.
  359.  
  360.    You'll notice that the longest field is 34 characters. Why? Because most
  361.    mailing labels are 3.5 inches, about 34 characters across. Since the first
  362.    name and last are usually put on the same line, their total should be 34.
  363.  
  364.    You'll probably want to add more fields like telephone number, last time
  365.    written to, oh, just about anything that you'd think would be important to
  366.    know. There you go, you've just designed your data record.
  367.  
  368.  
  369. Q: Then what?
  370.  
  371. A: Then decide how you need to access this data. You'll want to access it at
  372.    least by name, so one index you'll want is on the name. While you could
  373.    specify the entire name be used as a key, say LASTNAME+FIRSTNAME, this is
  374.    a bit of overkill. Instead, you may want to use just a portion of the name.
  375.    A good candidate would be SUBSTR(LASTNAME,1,5)+SUBSTR(FIRSTNAME,1,1). This
  376.    sets up a key that's only 6 bytes long. The first method, using all the
  377.    name, would be 34 bytes long. By keeping your keys short you'll keep your
  378.    index files small and your index performance high. And yes, you can also
  379.    mix numeric field types with character field types in your key expressions.
  380.  
  381.  
  382. Q: But what if I have two or more names that are identical, or very similar
  383.    but have these parts of the names the same?
  384.  
  385. A: BULLET lets you specify if your index files allow only unique key entries or
  386.    whether duplicate keys are permitted. When keying on a name you should have
  387.    your index file allow duplicate keys. What BULLET does is number these
  388.    identical keys by adding a suffix to each key (called an enumerator). This
  389.    enumerator allows the index algorithm to treat each key as a different key.
  390.    If you search the index for all matches in the first 6 characters of the
  391.    key (the enumerators will always be different) these similar names will
  392.    be found in consecutive order. To find out if the key you've just accessed
  393.    is the actual person you had in mind, you'd scan the data record associated
  394.    with that key for other information, such as middle initial, address,
  395.    anything that would make that person recognizable from another with a
  396.    similar key. If it isn't what you're looking for, get the next key and data
  397.    record, and so on until the first 6 characters of the key no longer are the
  398.    6 you're looking for.
  399.  
  400.  
  401. Q: So I've got my data record designed and also my primary index file. What
  402.    else should I do?
  403.  
  404. A: Now that the database is designed most of the "unknown" is taken care of.
  405.    What comes next depends on how you, yourself, program. What I often do
  406.    next is detail exactly what I want the output to be. That way, I've got
  407.    the front and the back and just need to do the middle. The middle is where
  408.    the fun's at. You'll be amazed at just how few of your in-the-middle coding
  409.    is spent on managing the database. BULLET takes care of all the little
  410.    details. You just need to give it the data and tell it what to do with
  411.    it. Or you tell it what to get and it comes back with what you requested.
  412.    You then do whatever you want with that data.
  413.  
  414.  
  415. Q: I've looked at the header file and it sure has a lot of commands. You're
  416.    telling me that this is simple?
  417.  
  418. A: Yes. Once you've created your data and index files, those mid-level
  419.    routines are not often used. Almost everything you do in your in-the-middle
  420.    coding will use the high-level routines. The InsertXB and UpdateXB routines
  421.    handle adding new or changing existing data, and the GetFirstXB, GetNextXB,
  422.    etc., routines handle getting the data. 90% of the time these are the
  423.    routines your program will be using.
  424.  
  425.  
  426. Q: What about all those packs? How can I keep them straight?
  427.  
  428. A: The good thing about modern programming langauges is that they let you
  429.    build reusable code. The ideal way to use BULLET is to build reusable
  430.    code objects in your programming langauge of choice and hide the down-and-
  431.    dirty aspects of dealing with the various packs in those objects. For
  432.    example, a create key routine could be written once and that object used
  433.    for all your other programming projects:
  434.  
  435.       DECLARE FUNCTION CreateNewIndex% (filen$, kx$, kflags%, XBlink%)
  436.  
  437.       FUNCTION CreateNewIndex(filename$, kx$, keyflags, XBlink)
  438.  
  439.       DIM CKP AS CreateKeyPack
  440.       DIM TmpFile AS STRING * 80
  441.       DIM TmpExp AS STRING * 136
  442.  
  443.       TmpFile = filename$ + CHR$(0)
  444.       TmpExp = kx$ + CHR$(0)
  445.  
  446.       CKP.Func = CreateKXB
  447.       CKP.FilenamePtrOff = VARPTR(TmpFile)
  448.       CKP.FilenamePtrSeg = VARSEG(TmpFile)
  449.       CKP.KeyExpPtrOff = VARPTR(TmpExp)
  450.       CKP.KeyExpPtrSeg = VARSEG(TmpExp)
  451.       CKP.XBlink = XBlink
  452.       CKP.keyflags = keyflags
  453.       CKP.CodePageID = -1
  454.       CKP.CountryCode = -1
  455.       CKP.CollatePtrOff = 0
  456.       CKP.CollatePtrSeg = 0
  457.       stat = BULLET(CKP)
  458.       CreateNewIndex = stat
  459.  
  460.       END FUNCTION
  461.  
  462.    The TmpFile and TmpExp were used in this QuickBASIC example so that the
  463.    string data is assigned to a fixed-length string. VARSEG/VARPTR operate
  464.    on fixed-length strings identically in both BASIC 7 and QuickBASIC 4.5.
  465.    If you want to forgo this compatibility you could use a var-len string
  466.    and the BASIC SADD() function instead of VARPTR. I find using the
  467.    temporary fixed-length strings just as easy since a CHR$(0) needs to
  468.    be appended to the string in any case. And they are temporary strings--
  469.    as soon as the CreateNewIndex() routine exits, the memory assigned to the
  470.    Tmp strings is released.
  471.  
  472.    So, once you write this create index object, you can reuse it over and
  473.    over again without needing to recode it every time. Just a simple
  474.  
  475.    stat = CreateNewIndex(filename$,keyexpression$,keyflags,XBlink)
  476.  
  477.    is all you need to put in your in-the-middle code. Oh, the key expression,
  478.    keyflags, and XBlink are all explained under CreateKXB in CZ.
  479.  
  480.  
  481. Q: I think I'm getting the hang of it. What's next?
  482.  
  483. A: Jump in and start coding. You may want to look over, maybe even print out,
  484.    one of the example programs. The BB_CAI10.BAS is straight forward, try
  485.    that. If you have any questions, just pop-up CZ. It's all in there.
  486.  
  487.  
  488. Q: Sounds good. But, tell me, what is the first thing I'm likely to muff?
  489.  
  490. A: Nothing serious. Just make sure that your record structure in memory
  491.    reserves the first byte for the delete tag. Also, make sure that the field
  492.    descriptors you assigned when you created the data file match your in-memory
  493.    structure, i.e., if you've created a data file (using CreateDXB) with say, 3
  494.    fields, each 25 characters long, make sure that your in-memory structure is
  495.    also 3 fields, each 25 characters:
  496.  
  497.       TYPE ExampleRecordTYPE
  498.       tag AS STRING * 1
  499.       Field1 AS STRING * 25
  500.       Field2 AS STRING * 25
  501.       Field3 AS STRING * 25
  502.       END TYPE
  503.  
  504.    Note: it is allowable to alias your physical fields but the total length
  505.    must match the total length of the DBF data record. (Alias meaning that
  506.    instead of using Field1 AS STRING * 25, you use Field1a AS STRING 13 and
  507.    Field1b AS STRING 12. Be sure you know what you're doing!--the IDEMO.BAS
  508.    program uses this technique (not in the strict sense of alias) by using a
  509.    single 4000-byte in-memory record since it can't know beforehand what
  510.    structure a random DBF file has.)
  511.  
  512.    Also, the transaction routines (InsertXB, UpdateXB, ReindexXB, and the
  513.    LockXBs) return a transaction index rather than a completion code. Be sure
  514.    to check the documentation for the routines.
  515.  
  516. Q: I'm off.
  517.  
  518. A: So am I, but be sure to...
  519.  
  520.    ...Read the manual! Until you do you can't take full advantage of BULLET.
  521.  
  522.  
  523. ---------------
  524. What is BULLET?
  525.  
  526. If you've been wanting to create the ultimate database program, or just a simple
  527. mailing list to handle your holiday cards, BULLET is the programming library for
  528. you. BULLET is a library module for programmers developing in MS-DOS. What
  529. language you ask? Would you believe most any? That's right, BULLET is designed
  530. to operate as-is with most compilers* available for DOS (DOS 3.3 or above is
  531. required). This is possible because BULLET is written entirely in assembly
  532. langauge. Everything it needs it has built in, so no specific compiler run-time
  533. library is required. Your compiler simply needs to be able to:
  534.  
  535.  1. Perform a far call to an external routine using the Pascal calling
  536.     convention.
  537.  2. Build a parameter pack, as in a C struct or BASIC TYPE, for example.
  538.  3. Pass a single far pointer by value (of the parameter pack) to the external
  539.     routine.
  540.  4. Accept a return integer value from the external routine (optional).
  541.  
  542. BULLET uses high-speed b-tree indexes and the industry-standard DBF data file
  543. format to quickly and easily move data to and from disk. The BULLET API includes
  544. over 65 functions to perform tasks from low-level direct DOS file I/O to
  545. high-level transaction-based updates to network routines that let you control
  546. who has access to your files and when. National Language Support (NLS) is built
  547. into each key file. This allows you to properly sort mixed-case and/or foreign
  548. language alphabets. BULLET supports character keys up to 64 bytes as well as
  549. 16-/32-bit integer keys (signed or unsigned). Index files specify if duplicate
  550. keys are allowed or whether unique keys are to be enforced. And although dBASE
  551. DBF data file compatiblility is standard, you can create non-standard DBF files,
  552. such as having fields contain binary data. Key expressions are specified using
  553. text, as in kx = "SUBSTR(Fieldname,1,10)+Fieldname+SUBSTR(Fieldname,10,3)". Keys
  554. may be composed of up to 16 separate fields, located anywhere within the record.
  555.  
  556. The transaction nature of BULLET greatly simplifies what is required of the
  557. programmer. For example, let's say you have a 100,000-record data file with 12
  558. active index files and need to insert a new record. With BULLET, you simply
  559. build the data record and call the InsertXB routine. InsertXB adds the record to
  560. the data file, builds all 12 keys and inserts each into the appropriate index
  561. file. If an error occured, say, while inserting the 11th key, BULLET
  562. automatically backs-out all changes just made to the key files and data file. As
  563. another example, say, updating an exisiting data record, you'd make any
  564. modifications to the data record and call the UpdateXB routine. UpdateXB updates
  565. the record in the data file and automatically updates all 12 index files. If an
  566. error occured, say, with the 5th key, BULLET automatically backs-out all changes
  567. made to the key files and data file.  In addition, transaction-based network
  568. routines are available. These high-level lock/unlock routines also automatically
  569. handle the necessary reloading and flushing of file headers. And what  about
  570. performance? Read on.
  571.  
  572. BULLET is fast! The ReindexXB routine indexes your DBF data files in no time
  573. flat: that 100,000 record .DBF can be completely reindexed in under 30 seconds
  574. on a fast computer system. The InsertXB routine can add 1,000 new records and
  575. keys to that 100,000 record database at a rate of over 50 new inserts per
  576. second. This isn't inserting into an empty database, it's inserting into a
  577. database that's already 100,000 records large. UpdateXB can update
  578. 1,000 records in that database at a rate of 20 updates/second. And what about
  579. access speed? How fast can you get to your data once it's in the database? Real
  580. fast! To access from first key to last all 100,000 keys takes less than
  581. 25 seconds (4500+/sec). That shows how fast you can find keys. To access the
  582. keys and also access each data record associated with that key takes a bit
  583. longer. Accessing all 100,000 keys and records takes just over a minute
  584. (1400+/sec). This is in-order access. Incredible. And if you wanted to access
  585. from the last key to the first (reverse-order), the times are just as fast.
  586. What do you get with the BULLET package?
  587.  
  588.  - The BULLET library module, 19K of code and static data space (small indeed)
  589.  - Sample program in C plus an interactive demo for browsing any DBF
  590.  - 200K of documentation, source examples, and a tutorial, all online
  591.  - CZ, the 15K online, context-sensitive, hyper-text help manager
  592.  - Royalty-free use of BULLET in your programs
  593.  
  594. Routines by category:
  595.  
  596. SYSTEM: InitXB, ExitXB, AtExitXB, MemoryXB, BreakXB, BackupFileXB, StatHandleXB,
  597. GetExtErrorXB
  598.  
  599. MID-LEVEL RECORD/KEY ACCESS: CreateDXB, OpenDXB, CloseDXB, StatDXB, ReadDHXB,
  600. FlushDHXB, CopyDHXB, ZapDHXB, CreateKXB, OpenKXB, CloseKXB, StatKXB, ReadKHXB,
  601. FlushKHXB, CopyKHXB, ZapKHXB, GetDescriptorXB, GetRecordXB, AddRecordXB,
  602. UpdateRecordXB, DeleteRecordXB, UndeleteRecordXB, PackRecordsXB, FirstKeyXB,
  603. EqualKeyXB, NextKeyXB, PrevKeyXB, LastKeyXB, StoreKeyXB, DeleteKeyXB,
  604. BuildKeyXB, CurrentKeyXB
  605.  
  606. HIGH-LEVEL ACCESS: GetFirstXB, GetEqualXB, GetNextXB, GetPrevXB, GetLastXB,
  607. InsertXB, UpdateXB, ReindexXB
  608.  
  609. NETWORK: LockXB, UnlockXB, LockKeyXB, UnlockKeyXB, LockDataXB, UnlockDataXB,
  610. DriveRemoteXB, FileRemoteXB, SetRetriesXB
  611.  
  612. LOW-LEVEL DOS ACCESS: DeleteFileDOS, RenameFileDOS, CreateFileDOS,
  613. AccessFileDOS, OpenFileDOS, SeekFileDOS, ReadFileDOS, ExpandFileDOS,
  614. WriteFileDOS, CloseFileDOS, MakeDirDOS
  615.  
  616.