home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
view JSON data
|
view as text
This file was processed as: DOS BACKUP file
(archive/dosBackupFile).
You can browse this item here: README.230
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| DOS BACKUP file (archive/dosBackupFile)
| magic
| Supported |
100%
| file
| DOS 2.0-3.2 backed up file \CBTREE\PROGRAMS\README.230
| default
| |
99%
| file
| data
| default
| |
51%
| TrID
| DOS 2.0-3.2 backup
| default
| |
48%
| TrID
| MP3 audio
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| ff 01 00 00 00 5c 43 42 | 54 52 45 45 5c 50 52 4f |.....\CB|TREE\PRO|
|00000010| 47 52 41 4d 53 5c 52 45 | 41 44 4d 45 2e 32 33 30 |GRAMS\RE|ADME.230|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000050| 00 00 00 1c 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000080| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000090| 20 52 45 4c 45 41 53 45 | 20 53 48 45 45 54 20 66 | RELEASE| SHEET f|
|000000a0| 6f 72 20 43 42 54 52 45 | 45 20 56 65 72 73 69 6f |or CBTRE|E Versio|
|000000b0| 6e 20 32 2e 33 30 0d 0a | 20 20 20 20 20 20 20 20 |n 2.30..| |
|000000c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000000d0| 20 20 20 52 65 76 69 73 | 65 64 20 31 31 2f 30 31 | Revis|ed 11/01|
|000000e0| 2f 38 37 0d 0a 0d 0a 54 | 68 69 73 20 64 6f 63 75 |/87....T|his docu|
|000000f0| 6d 65 6e 74 20 64 65 73 | 63 72 69 62 65 73 20 74 |ment des|cribes t|
|00000100| 68 65 20 63 68 61 6e 67 | 65 73 20 77 68 69 63 68 |he chang|es which|
|00000110| 20 79 6f 75 20 6d 75 73 | 74 20 6d 61 6b 65 20 74 | you mus|t make t|
|00000120| 6f 20 79 6f 75 72 20 73 | 6f 75 72 63 65 20 63 6f |o your s|ource co|
|00000130| 64 65 0d 0a 69 6e 20 6f | 72 64 65 72 20 74 6f 20 |de..in o|rder to |
|00000140| 75 70 67 72 61 64 65 20 | 66 72 6f 6d 20 76 65 72 |upgrade |from ver|
|00000150| 73 69 6f 6e 20 31 2e 33 | 78 20 74 6f 20 76 65 72 |sion 1.3|x to ver|
|00000160| 73 69 6f 6e 20 32 2e 78 | 2e 20 20 42 41 43 4b 55 |sion 2.x|. BACKU|
|00000170| 50 20 41 4c 4c 20 59 4f | 55 52 20 53 4f 55 52 43 |P ALL YO|UR SOURC|
|00000180| 45 0d 0a 41 4e 44 20 49 | 4e 44 45 58 20 46 49 4c |E..AND I|NDEX FIL|
|00000190| 45 53 20 42 45 46 4f 52 | 45 20 50 52 4f 43 45 45 |ES BEFOR|E PROCEE|
|000001a0| 44 49 4e 47 21 0d 0a 0d | 0a 31 2e 20 62 74 72 69 |DING!...|.1. btri|
|000001b0| 6e 69 74 28 29 20 6e 6f | 77 20 61 6c 6c 6f 63 61 |nit() no|w alloca|
|000001c0| 74 65 73 20 6d 65 6d 6f | 72 79 20 66 6f 72 20 62 |tes memo|ry for b|
|000001d0| 74 63 6f 6d 6d 6f 2e 62 | 74 6b 65 79 2e 20 54 68 |tcommo.b|tkey. Th|
|000001e0| 69 73 20 6d 65 61 6e 73 | 20 79 6f 75 20 73 68 6f |is means| you sho|
|000001f0| 75 6c 64 0d 0a 20 20 20 | 6e 6f 74 20 64 6f 20 74 |uld.. |not do t|
|00000200| 68 69 73 2e 20 20 54 68 | 65 20 6e 75 6d 62 65 72 |his. Th|e number|
|00000210| 20 6f 66 20 62 79 74 65 | 73 20 61 6c 6c 6f 63 61 | of byte|s alloca|
|00000220| 74 65 64 20 69 73 20 62 | 74 63 6f 6d 6d 6f 2e 62 |ted is b|tcommo.b|
|00000230| 74 6b 65 79 6c 65 6e 20 | 2b 20 31 2e 0d 0a 20 20 |tkeylen |+ 1... |
|00000240| 20 62 74 63 6f 6d 6d 6f | 2e 62 74 6b 65 79 6c 65 | btcommo|.btkeyle|
|00000250| 6e 20 69 73 20 64 65 66 | 69 6e 65 64 20 62 79 20 |n is def|ined by |
|00000260| 42 54 53 45 54 55 50 2e | 45 58 45 2e 0d 0a 0d 0a |BTSETUP.|EXE.....|
|00000270| 32 2e 20 41 20 6e 65 77 | 20 66 75 6e 63 74 69 6f |2. A new| functio|
|00000280| 6e 20 62 74 72 74 65 72 | 6d 28 26 62 74 63 6f 6d |n btrter|m(&btcom|
|00000290| 6d 6f 29 20 68 61 73 20 | 62 65 65 6e 20 61 64 64 |mo) has |been add|
|000002a0| 65 64 20 74 6f 20 64 65 | 2d 69 6e 69 74 69 61 6c |ed to de|-initial|
|000002b0| 69 7a 65 20 79 6f 75 72 | 0d 0a 20 20 20 42 2b 74 |ize your|.. B+t|
|000002c0| 72 65 65 2e 20 20 49 74 | 20 63 75 72 72 65 6e 74 |ree. It| current|
|000002d0| 6c 79 20 72 65 6c 65 61 | 73 65 73 20 6d 65 6d 6f |ly relea|ses memo|
|000002e0| 72 79 20 61 6c 6c 6f 63 | 61 74 65 64 20 66 6f 72 |ry alloc|ated for|
|000002f0| 20 62 74 63 6f 6d 6d 6f | 2e 62 74 6b 65 79 20 61 | btcommo|.btkey a|
|00000300| 6e 64 0d 0a 20 20 20 62 | 74 63 6f 6d 6d 6f 2e 62 |nd.. b|tcommo.b|
|00000310| 74 72 65 63 6e 75 6d 2e | 20 20 59 6f 75 20 73 68 |trecnum.| You sh|
|00000320| 6f 75 6c 64 20 63 61 6c | 6c 20 74 68 69 73 20 66 |ould cal|l this f|
|00000330| 75 6e 63 74 69 6f 6e 20 | 69 6e 73 74 65 61 64 20 |unction |instead |
|00000340| 6f 66 20 64 69 72 65 63 | 74 6c 79 0d 0a 20 20 20 |of direc|tly.. |
|00000350| 66 72 65 65 69 6e 67 20 | 62 74 63 6f 6d 6d 6f 2e |freeing |btcommo.|
|00000360| 62 74 6b 65 79 2e 20 20 | 54 68 69 73 20 66 75 6e |btkey. |This fun|
|00000370| 63 74 69 6f 6e 20 77 69 | 6c 6c 20 68 61 76 65 20 |ction wi|ll have |
|00000380| 69 6e 63 72 65 61 73 65 | 64 20 66 75 6e 63 74 69 |increase|d functi|
|00000390| 6f 6e 61 6c 69 74 79 0d | 0a 20 20 20 69 6e 20 66 |onality.|. in f|
|000003a0| 75 74 75 72 65 20 72 65 | 6c 65 61 73 65 73 2e 20 |uture re|leases. |
|000003b0| 20 54 68 65 72 65 66 6f | 72 65 20 69 74 20 69 73 | Therefo|re it is|
|000003c0| 20 76 65 72 79 20 69 6d | 70 6f 72 74 61 6e 74 20 | very im|portant |
|000003d0| 74 6f 20 73 74 61 72 74 | 20 75 73 69 6e 67 20 74 |to start| using t|
|000003e0| 68 65 0d 0a 20 20 20 62 | 74 72 69 6e 69 74 28 29 |he.. b|trinit()|
|000003f0| 2f 62 74 72 74 65 72 6d | 28 29 20 66 75 6e 63 74 |/btrterm|() funct|
|00000400| 69 6f 6e 20 70 61 69 72 | 2e 0d 0a 0d 0a 33 2e 20 |ion pair|.....3. |
|00000410| 62 74 63 6f 6d 6d 6f 2e | 62 74 72 65 63 6e 75 6d |btcommo.|btrecnum|
|00000420| 20 75 73 65 64 20 74 6f | 20 62 65 20 61 6e 20 61 | used to| be an a|
|00000430| 72 72 61 79 20 6f 66 20 | 4d 41 58 41 52 52 41 59 |rray of |MAXARRAY|
|00000440| 20 6c 6f 6e 67 73 2e 20 | 20 49 74 20 69 73 20 6e | longs. | It is n|
|00000450| 6f 77 20 61 0d 0a 20 20 | 20 70 6f 69 6e 74 65 72 |ow a.. | pointer|
|00000460| 20 74 6f 20 61 20 64 79 | 6e 61 6d 69 63 61 6c 6c | to a dy|namicall|
|00000470| 79 20 61 6c 6c 6f 63 61 | 74 65 64 20 6d 65 6d 6f |y alloca|ted memo|
|00000480| 72 79 20 62 6c 6f 63 6b | 20 77 68 69 63 68 20 69 |ry block| which i|
|00000490| 73 20 61 6c 6c 6f 63 61 | 74 65 64 20 69 6e 0d 0a |s alloca|ted in..|
|000004a0| 20 20 20 62 74 72 69 6e | 69 74 28 29 2e 20 54 68 | btrin|it(). Th|
|000004b0| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 62 79 74 65 |e number| of byte|
|000004c0| 73 20 61 6c 6c 6f 63 61 | 74 65 64 20 69 73 3a 0d |s alloca|ted is:.|
|000004d0| 0a 0d 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |... | |
|000004e0| 20 20 20 20 20 20 20 20 | 20 73 69 7a 65 6f 66 28 | | sizeof(|
|000004f0| 6c 6f 6e 67 29 20 2a 20 | 28 62 74 63 6f 6d 6d 6f |long) * |(btcommo|
|00000500| 2e 62 74 6d 61 78 20 2b | 20 31 29 2e 0d 0a 0d 0a |.btmax +| 1).....|
|00000510| 20 20 20 62 74 63 6f 6d | 6d 6f 2e 62 74 6d 61 78 | btcom|mo.btmax|
|00000520| 20 69 73 20 64 65 66 69 | 6e 65 64 20 69 6e 20 42 | is defi|ned in B|
|00000530| 54 53 45 54 55 50 2e 45 | 58 45 20 61 73 20 74 68 |TSETUP.E|XE as th|
|00000540| 65 20 66 69 65 6c 64 20 | 4d 61 78 20 52 65 63 73 |e field |Max Recs|
|00000550| 2e 20 20 54 68 65 20 6d | 61 69 6e 0d 0a 20 20 20 |. The m|ain.. |
|00000560| 69 6d 70 61 63 74 20 6f | 66 20 74 68 69 73 20 6f |impact o|f this o|
|00000570| 6e 20 79 6f 75 72 20 73 | 6f 75 72 63 65 20 69 73 |n your s|ource is|
|00000580| 20 74 68 61 74 20 61 6c | 6c 20 6f 63 63 75 72 72 | that al|l occurr|
|00000590| 65 6e 63 65 73 20 6f 66 | 20 4d 41 58 41 52 52 41 |ences of| MAXARRA|
|000005a0| 59 2d 31 20 73 68 6f 75 | 6c 64 0d 0a 20 20 20 62 |Y-1 shou|ld.. b|
|000005b0| 65 20 72 65 70 6c 61 63 | 65 64 20 77 69 74 68 20 |e replac|ed with |
|000005c0| 62 74 63 6f 6d 6d 6f 2e | 62 74 6d 61 78 2e 0d 0a |btcommo.|btmax...|
|000005d0| 0d 0a 34 2e 20 47 45 54 | 53 45 51 2c 20 47 45 54 |..4. GET|SEQ, GET|
|000005e0| 41 4c 4c 20 61 6e 64 20 | 74 68 65 20 6e 65 77 20 |ALL and |the new |
|000005f0| 66 75 6e 63 74 69 6f 6e | 20 47 45 54 4b 45 59 53 |function| GETKEYS|
|00000600| 20 6f 66 74 65 6e 20 6e | 65 65 64 20 74 6f 20 62 | often n|eed to b|
|00000610| 65 20 63 61 6c 6c 65 64 | 0d 0a 20 20 20 73 65 76 |e called|.. sev|
|00000620| 65 72 61 6c 20 74 69 6d | 65 73 20 69 6e 20 73 65 |eral tim|es in se|
|00000630| 71 75 65 6e 63 65 20 62 | 65 66 6f 72 65 20 74 68 |quence b|efore th|
|00000640| 65 20 65 6e 74 69 72 65 | 20 69 6e 64 65 78 20 68 |e entire| index h|
|00000650| 61 73 20 62 65 65 6e 20 | 73 63 61 6e 6e 65 64 2e |as been |scanned.|
|00000660| 20 20 54 68 65 73 65 0d | 0a 20 20 20 66 75 6e 63 | These.|. func|
|00000670| 74 69 6f 6e 73 20 6e 6f | 77 20 6d 61 69 6e 74 61 |tions no|w mainta|
|00000680| 69 6e 20 69 6e 74 65 72 | 6e 61 6c 20 76 61 72 69 |in inter|nal vari|
|00000690| 61 62 6c 65 73 20 77 68 | 69 63 68 20 72 65 6d 65 |ables wh|ich reme|
|000006a0| 6d 62 65 72 20 74 68 65 | 20 73 74 61 74 65 20 6f |mber the| state o|
|000006b0| 66 20 74 68 65 0d 0a 20 | 20 20 66 75 6e 63 74 69 |f the.. | functi|
|000006c0| 6f 6e 20 62 65 74 77 65 | 65 6e 20 63 61 6c 6c 73 |on betwe|en calls|
|000006d0| 2e 20 20 54 68 69 73 20 | 6d 65 61 6e 73 3a 0d 0a |. This |means:..|
|000006e0| 20 20 20 20 20 6f 20 20 | 49 6d 70 72 6f 76 65 64 | o |Improved|
|000006f0| 20 70 65 72 66 6f 72 6d | 61 6e 63 65 2c 0d 0a 20 | perform|ance,.. |
|00000700| 20 20 20 20 6f 20 20 74 | 68 65 20 6f 72 69 67 69 | o t|he origi|
|00000710| 6e 61 6c 20 6b 65 79 20 | 6e 6f 20 6c 6f 6e 67 65 |nal key |no longe|
|00000720| 72 20 68 61 73 20 74 6f | 20 62 65 20 72 65 2d 6c |r has to| be re-l|
|00000730| 6f 61 64 65 64 20 62 65 | 74 77 65 65 6e 20 63 61 |oaded be|tween ca|
|00000740| 6c 6c 73 0d 0a 20 20 20 | 20 20 20 20 20 28 61 6c |lls.. | (al|
|00000750| 74 68 6f 75 67 68 20 74 | 68 69 73 20 77 69 6c 6c |though t|his will|
|00000760| 20 68 61 76 65 20 6e 6f | 20 68 61 72 6d 66 75 6c | have no| harmful|
|00000770| 20 65 66 66 65 63 74 29 | 2c 0d 0a 20 20 20 20 20 | effect)|,.. |
|00000780| 6f 20 20 74 68 65 20 66 | 75 6e 63 74 69 6f 6e 73 |o the f|unctions|
|00000790| 20 2a 4d 55 53 54 2a 20 | 62 65 20 63 61 6c 6c 65 | *MUST* |be calle|
|000007a0| 64 20 72 65 70 65 61 74 | 65 64 6c 79 20 75 6e 74 |d repeat|edly unt|
|000007b0| 69 6c 20 61 20 6c 65 73 | 73 20 74 68 61 6e 20 66 |il a les|s than f|
|000007c0| 75 6c 6c 0d 0a 20 20 20 | 20 20 20 20 20 62 6c 6f |ull.. | blo|
|000007d0| 63 6b 20 69 73 20 72 65 | 74 75 72 6e 65 64 20 28 |ck is re|turned (|
|000007e0| 66 65 77 65 72 20 74 68 | 61 6e 20 62 74 63 6f 6d |fewer th|an btcom|
|000007f0| 6d 6f 2e 62 74 6d 61 78 | 20 72 65 63 6f 72 64 20 |mo.btmax| record |
|00000800| 6e 75 6d 62 65 72 73 20 | 77 65 72 65 0d 0a 20 20 |numbers |were.. |
|00000810| 20 20 20 20 20 20 72 65 | 74 75 72 6e 65 64 29 2c | re|turned),|
|00000820| 20 6f 72 20 42 54 4e 4f | 54 46 4e 44 20 77 61 73 | or BTNO|TFND was|
|00000830| 20 72 65 74 75 72 6e 65 | 64 2e 20 20 49 66 20 74 | returne|d. If t|
|00000840| 68 65 20 63 61 6c 6c 69 | 6e 67 20 73 65 71 75 65 |he calli|ng seque|
|00000850| 6e 63 65 20 69 73 20 74 | 6f 0d 0a 20 20 20 20 20 |nce is t|o.. |
|00000860| 20 20 20 62 65 20 74 65 | 72 6d 69 6e 61 74 65 64 | be te|rminated|
|00000870| 20 62 65 66 6f 72 65 20 | 6f 6e 65 20 6f 66 20 74 | before |one of t|
|00000880| 68 65 73 65 20 63 6f 6e | 64 69 74 69 6f 6e 73 20 |hese con|ditions |
|00000890| 69 73 20 6d 65 74 2c 20 | 74 68 65 20 66 75 6e 63 |is met, |the func|
|000008a0| 74 69 6f 6e 0d 0a 20 20 | 20 20 20 20 20 20 66 72 |tion.. | fr|
|000008b0| 65 65 5f 73 76 6b 65 79 | 28 26 62 74 63 6f 6d 6d |ee_svkey|(&btcomm|
|000008c0| 6f 29 20 2a 4d 55 53 54 | 2a 20 62 65 20 63 61 6c |o) *MUST|* be cal|
|000008d0| 6c 65 64 2e 20 20 54 68 | 69 73 20 69 73 20 69 6e |led. Th|is is in|
|000008e0| 20 6f 72 64 65 72 20 74 | 6f 20 72 65 73 65 74 20 | order t|o reset |
|000008f0| 74 68 65 0d 0a 20 20 20 | 20 20 20 20 20 69 6e 74 |the.. | int|
|00000900| 65 72 6e 61 6c 20 76 61 | 72 69 61 62 6c 65 73 2e |ernal va|riables.|
|00000910| 20 20 4e 6f 74 20 64 6f | 69 6e 67 20 74 68 69 73 | Not do|ing this|
|00000920| 20 6d 61 79 20 62 65 20 | 64 61 6e 67 65 72 6f 75 | may be |dangerou|
|00000930| 73 20 74 6f 20 74 68 65 | 20 68 65 61 6c 74 68 20 |s to the| health |
|00000940| 6f 66 0d 0a 20 20 20 20 | 20 20 20 20 79 6f 75 72 |of.. | your|
|00000950| 20 42 2b 74 72 65 65 73 | 2e 0d 0a 0d 0a 56 65 72 | B+trees|.....Ver|
|00000960| 73 69 6f 6e 20 32 2e 31 | 30 3a 0d 0a 0d 0a 35 2e |sion 2.1|0:....5.|
|00000970| 20 54 68 65 20 43 42 54 | 52 45 45 20 4e 55 4c 4c | The CBT|REE NULL|
|00000980| 20 6b 65 79 20 76 61 6c | 75 65 20 68 61 73 20 62 | key val|ue has b|
|00000990| 65 65 6e 20 63 68 61 6e | 67 65 64 20 66 72 6f 6d |een chan|ged from|
|000009a0| 20 74 68 72 65 65 20 37 | 46 27 73 20 74 6f 20 61 | three 7|F's to a|
|000009b0| 20 73 69 6e 67 6c 65 20 | 37 46 0d 0a 20 20 20 69 | single |7F.. i|
|000009c0| 6e 20 6f 72 64 65 72 20 | 74 6f 20 73 75 70 70 6f |n order |to suppo|
|000009d0| 72 74 20 6b 65 79 20 6c | 65 6e 67 74 68 73 20 6f |rt key l|engths o|
|000009e0| 66 20 6c 65 73 73 20 74 | 68 61 6e 20 33 20 63 68 |f less t|han 3 ch|
|000009f0| 61 72 61 63 74 65 72 73 | 2e 20 20 54 68 69 73 20 |aracters|. This |
|00000a00| 6d 65 61 6e 73 0d 0a 20 | 20 20 74 68 61 74 20 74 |means.. | that t|
|00000a10| 68 65 20 66 69 72 73 74 | 20 63 68 61 72 61 63 74 |he first| charact|
|00000a20| 65 72 20 6f 66 20 61 6c | 6c 20 6b 65 79 73 20 6d |er of al|l keys m|
|00000a30| 75 73 74 20 62 65 20 62 | 65 74 77 65 65 6e 20 30 |ust be b|etween 0|
|00000a40| 78 30 31 20 61 6e 64 20 | 30 78 37 65 0d 0a 20 20 |x01 and |0x7e.. |
|00000a50| 20 69 6e 63 6c 75 73 69 | 76 65 2e 20 20 54 68 69 | inclusi|ve. Thi|
|00000a60| 73 20 69 73 20 74 79 70 | 69 63 61 6c 20 66 6f 72 |s is typ|ical for|
|00000a70| 20 41 53 43 49 49 20 6b | 65 79 73 2e 0d 0a 0d 0a | ASCII k|eys.....|
|00000a80| 36 2e 20 54 68 65 20 73 | 6f 75 72 63 65 20 66 69 |6. The s|ource fi|
|00000a90| 6c 65 20 27 62 74 67 69 | 76 65 72 2e 63 27 20 68 |le 'btgi|ver.c' h|
|00000aa0| 61 73 20 62 65 65 6e 20 | 72 65 6e 61 6d 65 64 20 |as been |renamed |
|00000ab0| 74 6f 20 27 67 69 76 65 | 69 64 78 72 2e 63 27 2e |to 'give|idxr.c'.|
|00000ac0| 0d 0a 0d 0a 37 2e 20 54 | 68 65 20 65 78 74 65 72 |....7. T|he exter|
|00000ad0| 6e 61 6c 20 76 61 72 69 | 61 62 6c 65 20 27 66 72 |nal vari|able 'fr|
|00000ae0| 65 65 73 70 63 27 20 68 | 61 73 20 62 65 65 6e 20 |eespc' h|as been |
|00000af0| 72 65 6d 6f 76 65 64 2e | 20 20 54 68 65 20 66 75 |removed.| The fu|
|00000b00| 6e 63 74 69 6f 6e 73 20 | 77 68 69 63 68 0d 0a 20 |nctions |which.. |
|00000b10| 20 20 75 73 65 64 20 27 | 66 72 65 65 73 70 63 27 | used '|freespc'|
|00000b20| 20 68 61 76 65 20 74 68 | 65 72 65 66 6f 72 65 20 | have th|erefore |
|00000b30| 62 65 65 6e 20 6d 6f 64 | 69 66 69 65 64 20 74 6f |been mod|ified to|
|00000b40| 20 72 65 63 65 69 76 65 | 20 27 66 72 65 65 73 70 | receive| 'freesp|
|00000b50| 63 27 20 61 73 20 61 0d | 0a 20 20 20 70 61 72 61 |c' as a.|. para|
|00000b60| 6d 65 74 65 72 2e 20 20 | 54 68 65 73 65 20 69 6e |meter. |These in|
|00000b70| 63 6c 75 64 65 3a 0d 0a | 0d 0a 20 20 20 20 20 20 |clude:..|.. |
|00000b80| 70 75 74 66 68 64 72 28 | 66 64 2c 20 66 72 65 65 |putfhdr(|fd, free|
|00000b90| 73 70 63 29 20 20 20 61 | 6e 64 20 20 20 67 65 74 |spc) a|nd get|
|00000ba0| 66 68 64 72 28 66 72 65 | 65 73 70 63 2c 20 66 64 |fhdr(fre|espc, fd|
|00000bb0| 29 2e 0d 0a 0d 0a 20 20 | 20 54 68 69 73 20 69 73 |)..... | This is|
|00000bc0| 20 6f 66 20 69 6d 70 6f | 72 74 61 6e 63 65 20 6f | of impo|rtance o|
|00000bd0| 6e 6c 79 20 74 6f 20 74 | 68 6f 73 65 20 75 73 65 |nly to t|hose use|
|00000be0| 72 73 20 77 68 6f 20 75 | 73 65 20 74 68 65 73 65 |rs who u|se these|
|00000bf0| 20 6c 6f 77 65 72 20 6c | 65 76 65 6c 0d 0a 20 20 | lower l|evel.. |
|00000c00| 20 66 75 6e 63 74 69 6f | 6e 73 2e 0d 0a 0d 0a 38 | functio|ns.....8|
|00000c10| 2e 20 41 20 6d 61 63 72 | 6f 20 62 74 73 65 65 6b |. A macr|o btseek|
|00000c20| 28 29 20 68 61 73 20 62 | 65 65 6e 20 61 64 64 65 |() has b|een adde|
|00000c30| 64 20 74 6f 20 63 62 74 | 72 65 65 2e 68 2e 20 20 |d to cbt|ree.h. |
|00000c40| 54 68 69 73 20 69 73 20 | 75 73 65 66 75 6c 20 69 |This is |useful i|
|00000c50| 6e 20 73 65 65 6b 69 6e | 67 0d 0a 20 20 20 74 6f |n seekin|g.. to|
|00000c60| 20 61 20 72 65 63 6f 72 | 64 20 73 70 65 63 69 66 | a recor|d specif|
|00000c70| 69 65 64 20 62 79 20 62 | 74 63 6f 6d 6d 6f 2e 62 |ied by b|tcommo.b|
|00000c80| 74 6c 6f 63 2e 20 20 54 | 68 65 20 75 73 61 67 65 |tloc. T|he usage|
|00000c90| 20 6f 66 20 74 68 65 20 | 6d 61 63 72 6f 20 69 73 | of the |macro is|
|00000ca0| 3a 0d 0a 0d 0a 20 20 20 | 20 20 20 62 74 73 65 65 |:.... | btsee|
|00000cb0| 6b 28 66 64 2c 20 62 74 | 6c 6f 63 2c 20 72 65 63 |k(fd, bt|loc, rec|
|00000cc0| 6c 65 6e 29 2e 0d 0a 0d | 0a 20 20 20 46 6f 72 20 |len)....|. For |
|00000cd0| 65 78 61 6d 70 6c 65 2c | 20 61 66 74 65 72 20 63 |example,| after c|
|00000ce0| 61 6c 6c 69 6e 67 20 47 | 45 54 52 45 43 20 66 6f |alling G|ETREC fo|
|00000cf0| 72 20 61 20 67 69 76 65 | 6e 20 6b 65 79 2c 20 79 |r a give|n key, y|
|00000d00| 6f 75 20 77 6f 75 6c 64 | 20 63 61 6c 6c 3a 0d 0a |ou would| call:..|
|00000d10| 0d 0a 20 20 20 20 20 20 | 62 74 73 65 65 6b 28 66 |.. |btseek(f|
|00000d20| 64 2c 20 62 74 63 6f 6d | 6d 6f 2e 62 74 6c 6f 63 |d, btcom|mo.btloc|
|00000d30| 2c 20 62 74 63 6f 6d 6d | 6f 2e 62 74 64 61 74 6c |, btcomm|o.btdatl|
|00000d40| 65 6e 29 3b 0d 0a 0d 0a | 20 20 20 74 6f 20 73 65 |en);....| to se|
|00000d50| 65 6b 20 74 6f 20 74 68 | 65 20 64 65 73 69 72 65 |ek to th|e desire|
|00000d60| 64 20 72 65 63 6f 72 64 | 2e 20 20 62 74 73 65 65 |d record|. btsee|
|00000d70| 6b 28 29 20 74 61 6b 65 | 73 20 63 61 72 65 20 6f |k() take|s care o|
|00000d80| 66 20 74 68 65 20 22 72 | 65 63 6f 72 64 0d 0a 20 |f the "r|ecord.. |
|00000d90| 20 20 6c 6f 63 61 74 69 | 6f 6e 20 6d 69 6e 75 73 | locati|on minus|
|00000da0| 20 6f 6e 65 22 20 61 72 | 69 74 68 6d 65 74 69 63 | one" ar|ithmetic|
|00000db0| 20 66 6f 72 20 79 6f 75 | 2e 20 20 53 65 65 20 67 | for you|. See g|
|00000dc0| 65 74 66 70 61 74 2e 63 | 20 66 6f 72 20 61 20 73 |etfpat.c| for a s|
|00000dd0| 69 6d 70 6c 65 0d 0a 20 | 20 20 65 78 61 6d 70 6c |imple.. | exampl|
|00000de0| 65 20 6f 6e 20 74 68 65 | 20 75 73 65 20 6f 66 20 |e on the| use of |
|00000df0| 62 74 73 65 65 6b 28 29 | 2e 0d 0a 20 20 20 49 4d |btseek()|... IM|
|00000e00| 50 4f 52 54 41 4e 54 20 | 4e 4f 54 45 3a 20 20 54 |PORTANT |NOTE: T|
|00000e10| 68 65 20 62 74 63 6f 6d | 6d 6f 2e 62 74 6c 6f 63 |he btcom|mo.btloc|
|00000e20| 20 72 65 74 75 72 6e 20 | 76 61 6c 75 65 20 6d 61 | return |value ma|
|00000e30| 79 20 63 68 61 6e 67 65 | 20 69 6e 20 61 20 66 75 |y change| in a fu|
|00000e40| 74 75 72 65 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |ture.. | |
|00000e50| 20 20 20 20 20 20 20 20 | 20 20 72 65 6c 65 61 73 | | releas|
|00000e60| 65 2e 20 20 57 65 20 74 | 68 65 72 65 66 6f 72 65 |e. We t|herefore|
|00000e70| 20 72 65 63 6f 6d 6d 65 | 6e 64 20 74 68 61 74 20 | recomme|nd that |
|00000e80| 79 6f 75 20 73 74 61 72 | 74 20 75 73 69 6e 67 0d |you star|t using.|
|00000e90| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |. | |
|00000ea0| 20 20 20 20 20 62 74 73 | 65 65 6b 28 29 20 73 6f | bts|eek() so|
|00000eb0| 20 74 68 61 74 20 74 68 | 69 73 20 70 6f 73 73 69 | that th|is possi|
|00000ec0| 62 6c 65 20 66 75 74 75 | 72 65 20 63 68 61 6e 67 |ble futu|re chang|
|00000ed0| 65 20 77 69 6c 6c 0d 0a | 20 20 20 20 20 20 20 20 |e will..| |
|00000ee0| 20 20 20 20 20 20 20 20 | 20 20 20 20 62 65 20 74 | | be t|
|00000ef0| 72 61 6e 73 70 61 72 65 | 6e 74 20 74 6f 20 79 6f |ranspare|nt to yo|
|00000f00| 75 72 20 73 6f 75 72 63 | 65 20 63 6f 64 65 2e 0d |ur sourc|e code..|
|00000f10| 0a 0d 0a 39 2e 20 20 41 | 20 6e 65 77 20 66 75 6e |...9. A| new fun|
|00000f20| 63 74 69 6f 6e 20 62 74 | 5f 6f 70 65 6e 28 29 20 |ction bt|_open() |
|00000f30| 68 61 73 20 62 65 65 6e | 20 61 64 64 65 64 20 74 |has been| added t|
|00000f40| 6f 20 73 75 70 70 6f 72 | 74 20 74 68 65 20 6e 65 |o suppor|t the ne|
|00000f50| 77 20 66 69 6c 65 0d 0a | 20 20 20 20 70 72 6f 74 |w file..| prot|
|00000f60| 65 63 74 69 6f 6e 20 6d | 6f 64 65 20 70 61 72 61 |ection m|ode para|
|00000f70| 6d 74 65 72 73 20 6f 66 | 20 74 68 65 20 6f 70 65 |mters of| the ope|
|00000f80| 6e 28 29 20 66 75 6e 63 | 74 69 6f 6e 2e 20 20 62 |n() func|tion. b|
|00000f90| 74 5f 6f 70 65 6e 28 29 | 20 61 6c 73 6f 0d 0a 20 |t_open()| also.. |
|00000fa0| 20 20 20 6d 61 69 6e 74 | 61 69 6e 73 20 63 6f 6d | maint|ains com|
|00000fb0| 70 61 74 69 62 69 6c 69 | 74 79 20 77 69 74 68 20 |patibili|ty with |
|00000fc0| 6f 6c 64 65 72 20 63 6f | 6d 70 69 6c 65 72 73 2e |older co|mpilers.|
|00000fd0| 20 20 59 6f 75 20 73 68 | 6f 75 6c 64 20 75 73 65 | You sh|ould use|
|00000fe0| 20 62 74 5f 6f 70 65 6e | 28 29 0d 0a 20 20 20 20 | bt_open|().. |
|00000ff0| 69 6e 73 74 65 61 64 20 | 6f 66 20 6f 70 65 6e 28 |instead |of open(|
|00001000| 29 20 74 6f 20 6f 70 65 | 6e 20 41 4c 4c 20 79 6f |) to ope|n ALL yo|
|00001010| 75 72 20 64 61 74 61 20 | 61 6e 64 20 69 6e 64 65 |ur data |and inde|
|00001020| 78 20 66 69 6c 65 73 2c | 20 65 73 70 65 63 69 61 |x files,| especia|
|00001030| 6c 6c 79 0d 0a 20 20 20 | 20 61 74 20 70 6c 61 63 |lly.. | at plac|
|00001040| 65 73 20 77 68 65 72 65 | 20 61 20 6e 65 77 20 66 |es where| a new f|
|00001050| 69 6c 65 20 6d 61 79 20 | 62 65 20 63 72 65 61 74 |ile may |be creat|
|00001060| 65 64 2e 20 20 53 65 65 | 20 62 74 66 69 6f 2e 68 |ed. See| btfio.h|
|00001070| 20 66 6f 72 20 6d 6f 72 | 65 0d 0a 20 20 20 20 69 | for mor|e.. i|
|00001080| 6e 66 6f 72 6d 61 74 69 | 6f 6e 2e 20 20 53 65 65 |nformati|on. See|
|00001090| 20 62 6c 64 32 6b 65 79 | 73 2e 63 20 66 6f 72 20 | bld2key|s.c for |
|000010a0| 61 6e 20 65 78 61 6d 70 | 6c 65 20 6f 6e 20 68 6f |an examp|le on ho|
|000010b0| 77 20 74 6f 20 75 73 65 | 20 62 74 5f 6f 70 65 6e |w to use| bt_open|
|000010c0| 28 29 2e 0d 0a 0d 0a 56 | 65 72 73 69 6f 6e 20 32 |().....V|ersion 2|
|000010d0| 2e 31 31 3a 0d 0a 0d 0a | 31 30 2e 20 41 20 6e 65 |.11:....|10. A ne|
|000010e0| 77 20 75 74 69 6c 69 74 | 79 20 43 48 4b 42 54 52 |w utilit|y CHKBTR|
|000010f0| 45 45 2e 43 20 68 61 73 | 20 62 65 65 6e 20 61 64 |EE.C has| been ad|
|00001100| 64 65 64 20 61 6e 64 20 | 70 65 72 66 6f 72 6d 73 |ded and |performs|
|00001110| 20 69 6e 74 65 67 72 69 | 74 79 20 63 68 65 63 6b | integri|ty check|
|00001120| 73 20 6f 6e 0d 0a 20 20 | 20 20 74 68 65 20 73 70 |s on.. | the sp|
|00001130| 65 63 69 66 69 65 64 20 | 42 2b 74 72 65 65 20 69 |ecified |B+tree i|
|00001140| 6e 64 65 78 20 66 69 6c | 65 2e 0d 0a 0d 0a 31 31 |ndex fil|e.....11|
|00001150| 2e 20 42 75 67 20 66 69 | 78 20 66 6f 72 20 47 45 |. Bug fi|x for GE|
|00001160| 54 41 4c 4c 20 61 6e 64 | 20 47 45 54 4b 45 59 53 |TALL and| GETKEYS|
|00001170| 3a 20 69 66 20 74 68 65 | 20 66 69 6e 61 6c 20 63 |: if the| final c|
|00001180| 61 6c 6c 20 74 6f 20 61 | 20 73 65 72 69 65 73 20 |all to a| series |
|00001190| 6f 66 20 47 45 54 41 4c | 4c 0d 0a 20 20 20 20 6f |of GETAL|L.. o|
|000011a0| 70 65 72 61 74 69 6f 6e | 73 20 68 61 70 70 65 6e |peration|s happen|
|000011b0| 65 64 20 74 6f 20 65 78 | 61 63 74 6c 79 20 66 69 |ed to ex|actly fi|
|000011c0| 6c 6c 20 74 68 65 20 62 | 74 63 6f 6d 6d 6f 2e 62 |ll the b|tcommo.b|
|000011d0| 74 72 65 63 6e 75 6d 20 | 62 6c 6f 63 6b 2c 20 74 |trecnum |block, t|
|000011e0| 68 65 6e 0d 0a 20 20 20 | 20 74 68 65 20 4e 45 58 |hen.. | the NEX|
|000011f0| 54 20 63 61 6c 6c 20 74 | 6f 20 47 45 54 41 4c 4c |T call t|o GETALL|
|00001200| 2f 47 45 54 4b 45 59 53 | 20 77 6f 75 6c 64 20 6e |/GETKEYS| would n|
|00001210| 6f 74 20 72 65 74 75 72 | 6e 20 42 54 4e 4f 54 46 |ot retur|n BTNOTF|
|00001220| 4e 44 2c 20 61 73 20 69 | 74 20 73 68 6f 75 6c 64 |ND, as i|t should|
|00001230| 0d 0a 20 20 20 20 68 61 | 76 65 2e 20 20 4e 6f 77 |.. ha|ve. Now|
|00001240| 20 69 74 20 64 6f 65 73 | 2e 0d 0a 0d 0a 31 32 2e | it does|.....12.|
|00001250| 20 41 20 62 75 66 66 65 | 72 2d 66 75 6c 6c 20 63 | A buffe|r-full c|
|00001260| 68 65 63 6b 20 69 6e 20 | 67 65 74 69 64 78 72 28 |heck in |getidxr(|
|00001270| 29 20 61 6c 6c 6f 77 65 | 64 20 34 20 62 79 74 65 |) allowe|d 4 byte|
|00001280| 73 20 74 6f 6f 20 6d 61 | 6e 79 20 74 6f 20 62 65 |s too ma|ny to be|
|00001290| 20 72 65 61 64 20 69 6e | 74 6f 0d 0a 20 20 20 20 | read in|to.. |
|000012a0| 74 68 65 20 62 75 66 66 | 65 72 2e 20 20 54 68 69 |the buff|er. Thi|
|000012b0| 73 20 68 61 73 20 6e 6f | 77 20 62 65 65 6e 20 66 |s has no|w been f|
|000012c0| 69 78 65 64 2e 0d 0a 0d | 0a 31 33 2e 20 52 65 6d |ixed....|.13. Rem|
|000012d0| 69 6e 64 65 72 3a 20 74 | 68 65 20 63 62 74 72 65 |inder: t|he cbtre|
|000012e0| 65 28 29 20 65 72 72 6f | 72 20 6d 65 73 73 61 67 |e() erro|r messag|
|000012f0| 65 73 20 61 72 65 20 73 | 74 6f 72 65 64 20 69 6e |es are s|tored in|
|00001300| 20 74 68 65 20 66 69 6c | 65 0d 0a 20 20 20 20 22 | the fil|e.. "|
|00001310| 63 6b 65 72 72 6f 72 2e | 6d 73 67 2e 22 20 20 49 |ckerror.|msg." I|
|00001320| 66 20 79 6f 75 20 77 6f | 75 6c 64 20 6c 69 6b 65 |f you wo|uld like|
|00001330| 20 76 65 72 62 6f 73 65 | 20 65 72 72 6f 72 20 6d | verbose| error m|
|00001340| 65 73 73 61 67 65 73 20 | 74 6f 20 62 65 20 64 69 |essages |to be di|
|00001350| 73 70 6c 61 79 65 64 2c | 0d 0a 20 20 20 20 69 6e |splayed,|.. in|
|00001360| 73 74 65 61 64 20 6f 66 | 20 6a 75 73 74 20 6e 75 |stead of| just nu|
|00001370| 6d 65 72 69 63 61 6c 20 | 63 6f 64 65 73 2c 20 6b |merical |codes, k|
|00001380| 65 65 70 20 61 20 63 6f | 70 79 20 6f 66 20 74 68 |eep a co|py of th|
|00001390| 69 73 20 66 69 6c 65 20 | 69 6e 20 74 68 65 20 63 |is file |in the c|
|000013a0| 75 72 72 65 6e 74 0d 0a | 20 20 20 20 64 69 72 65 |urrent..| dire|
|000013b0| 63 74 6f 72 79 2e 20 20 | 45 72 72 6f 72 20 6d 65 |ctory. |Error me|
|000013c0| 73 73 61 67 65 73 20 77 | 69 6c 6c 20 61 6c 73 6f |ssages w|ill also|
|000013d0| 20 67 65 74 20 77 72 69 | 74 74 65 6e 20 74 6f 20 | get wri|tten to |
|000013e0| 74 68 65 20 66 69 6c 65 | 20 22 65 72 72 6f 72 2e |the file| "error.|
|000013f0| 66 69 6c 22 0d 0a 20 20 | 20 20 77 68 65 6e 20 74 |fil".. | when t|
|00001400| 68 65 79 20 6f 63 63 75 | 72 2e 0d 0a 0d 0a 56 65 |hey occu|r.....Ve|
|00001410| 72 73 69 6f 6e 20 32 2e | 32 30 3a 0d 0a 0d 0a 31 |rsion 2.|20:....1|
|00001420| 34 2e 20 56 65 72 73 69 | 6f 6e 20 32 2e 32 30 20 |4. Versi|on 2.20 |
|00001430| 61 6c 6c 6f 77 73 20 6d | 75 6c 74 69 70 6c 65 20 |allows m|ultiple |
|00001440| 42 2b 74 72 65 65 73 20 | 74 6f 20 62 65 20 73 74 |B+trees |to be st|
|00001450| 6f 72 65 64 20 69 6e 20 | 61 20 73 69 6e 67 6c 65 |ored in |a single|
|00001460| 20 69 6e 64 65 78 20 66 | 69 6c 65 2e 0d 0a 20 20 | index f|ile... |
|00001470| 20 20 49 6e 20 6f 72 64 | 65 72 20 74 6f 20 73 75 | In ord|er to su|
|00001480| 70 70 6f 72 74 20 74 68 | 69 73 20 65 6e 68 61 6e |pport th|is enhan|
|00001490| 63 65 6d 65 6e 74 2c 20 | 73 65 76 65 72 61 6c 20 |cement, |several |
|000014a0| 63 68 61 6e 67 65 73 20 | 68 61 76 65 20 62 65 65 |changes |have bee|
|000014b0| 6e 20 6d 61 64 65 20 74 | 6f 0d 0a 20 20 20 20 74 |n made t|o.. t|
|000014c0| 68 65 20 43 42 54 52 45 | 45 20 6c 69 62 72 61 72 |he CBTRE|E librar|
|000014d0| 79 20 66 75 6e 63 74 69 | 6f 6e 73 20 61 73 20 77 |y functi|ons as w|
|000014e0| 65 6c 6c 20 61 73 20 74 | 68 65 20 73 75 70 70 6f |ell as t|he suppo|
|000014f0| 72 74 20 75 74 69 6c 69 | 74 69 65 73 3a 0d 0a 0d |rt utili|ties:...|
|00001500| 0a 20 20 20 20 20 20 20 | 6f 20 20 20 42 54 53 45 |. |o BTSE|
|00001510| 54 55 50 2e 45 58 45 20 | 68 61 73 20 61 20 6e 65 |TUP.EXE |has a ne|
|00001520| 77 20 66 69 65 6c 64 20 | 66 6f 72 20 74 68 65 20 |w field |for the |
|00001530| 49 6e 64 65 78 20 46 69 | 6c 65 20 4e 61 6d 65 2e |Index Fi|le Name.|
|00001540| 20 20 54 68 65 20 64 65 | 66 61 75 6c 74 0d 0a 20 | The de|fault.. |
|00001550| 20 20 20 20 20 20 20 20 | 20 20 6e 61 6d 65 20 77 | | name w|
|00001560| 69 6c 6c 20 62 65 20 79 | 6f 75 72 20 42 2b 74 72 |ill be y|our B+tr|
|00001570| 65 65 20 4e 61 6d 65 20 | 70 6c 75 73 20 74 68 65 |ee Name |plus the|
|00001580| 20 65 78 74 65 6e 74 69 | 6f 6e 20 22 2e 69 64 78 | extenti|on ".idx|
|00001590| 22 2e 20 20 54 68 65 20 | 54 42 41 0d 0a 20 20 20 |". The |TBA.. |
|000015a0| 20 20 20 20 20 20 20 20 | 66 69 65 6c 64 20 73 68 | |field sh|
|000015b0| 6f 75 6c 64 20 62 65 20 | 6c 65 66 74 20 7a 65 72 |ould be |left zer|
|000015c0| 6f 20 66 6f 72 20 6e 6f | 77 2e 20 20 49 66 20 79 |o for no|w. If y|
|000015d0| 6f 75 20 64 65 73 69 72 | 65 20 6d 75 6c 74 69 70 |ou desir|e multip|
|000015e0| 6c 65 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 42 |le.. | B|
|000015f0| 2b 74 72 65 65 73 20 74 | 6f 20 72 65 73 69 64 65 |+trees t|o reside|
|00001600| 20 69 6e 20 74 68 65 20 | 73 61 6d 65 20 49 6e 64 | in the |same Ind|
|00001610| 65 78 20 46 69 6c 65 2c | 20 74 68 65 6e 20 79 6f |ex File,| then yo|
|00001620| 75 20 73 68 6f 75 6c 64 | 20 73 70 65 63 69 66 79 |u should| specify|
|00001630| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 74 68 65 |.. | the|
|00001640| 20 53 41 4d 45 20 49 6e | 64 65 78 20 46 69 6c 65 | SAME In|dex File|
|00001650| 20 4e 61 6d 65 20 66 6f | 72 20 41 4c 4c 20 74 68 | Name fo|r ALL th|
|00001660| 65 20 42 2b 74 72 65 65 | 73 20 74 68 61 74 20 61 |e B+tree|s that a|
|00001670| 72 65 20 74 6f 20 62 65 | 0d 0a 20 20 20 20 20 20 |re to be|.. |
|00001680| 20 20 20 20 20 63 6f 6e | 74 61 69 6e 65 64 20 69 | con|tained i|
|00001690| 6e 20 69 74 2e 20 20 42 | 54 53 45 54 55 50 2e 45 |n it. B|TSETUP.E|
|000016a0| 58 45 20 6e 6f 77 20 68 | 61 73 20 61 20 44 65 6c |XE now h|as a Del|
|000016b0| 65 74 65 20 66 75 6e 63 | 74 69 6f 6e 20 74 6f 20 |ete func|tion to |
|000016c0| 61 6c 6c 6f 77 0d 0a 20 | 20 20 20 20 20 20 20 20 |allow.. | |
|000016d0| 20 20 79 6f 75 20 74 6f | 20 64 65 6c 65 74 65 20 | you to| delete |
|000016e0| 61 20 70 61 72 74 69 63 | 75 6c 61 72 20 42 2b 74 |a partic|ular B+t|
|000016f0| 72 65 65 20 65 6e 74 72 | 79 2e 0d 0a 0d 0a 20 20 |ree entr|y..... |
|00001700| 20 20 20 20 20 6f 20 20 | 20 42 54 50 41 52 4d 53 | o | BTPARMS|
|00001710| 2e 42 54 52 20 68 61 73 | 20 61 6e 20 65 78 70 61 |.BTR has| an expa|
|00001720| 6e 64 65 64 20 73 74 72 | 75 63 74 75 72 65 2e 20 |nded str|ucture. |
|00001730| 20 42 54 53 45 54 55 50 | 2e 45 58 45 20 73 68 6f | BTSETUP|.EXE sho|
|00001740| 75 6c 64 20 62 65 20 72 | 75 6e 0d 0a 20 20 20 20 |uld be r|un.. |
|00001750| 20 20 20 20 20 20 20 66 | 6f 72 20 65 61 63 68 20 | f|or each |
|00001760| 6f 66 20 79 6f 75 72 20 | 42 2b 74 72 65 65 73 20 |of your |B+trees |
|00001770| 74 6f 20 75 70 64 61 74 | 65 20 74 68 65 20 42 54 |to updat|e the BT|
|00001780| 50 41 52 4d 53 2e 42 54 | 52 20 66 69 6c 65 2e 20 |PARMS.BT|R file. |
|00001790| 20 45 61 63 68 20 6f 66 | 0d 0a 20 20 20 20 20 20 | Each of|.. |
|000017a0| 20 20 20 20 20 79 6f 75 | 72 20 42 2b 74 72 65 65 | you|r B+tree|
|000017b0| 20 65 6e 74 72 69 65 73 | 20 73 68 6f 75 6c 64 20 | entries| should |
|000017c0| 62 65 20 22 65 64 69 74 | 65 64 2c 22 20 74 68 65 |be "edit|ed," the|
|000017d0| 6e 20 74 68 65 20 72 65 | 73 75 6c 74 69 6e 67 20 |n the re|sulting |
|000017e0| 6e 65 77 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |new.. | |
|000017f0| 73 65 74 74 69 6e 67 73 | 20 73 68 6f 75 6c 64 20 |settings| should |
|00001800| 62 65 20 73 61 76 65 64 | 2e 20 20 54 68 69 73 20 |be saved|. This |
|00001810| 69 73 20 74 6f 20 6d 61 | 6b 65 20 79 6f 75 72 20 |is to ma|ke your |
|00001820| 70 61 72 61 6d 65 74 65 | 72 20 66 69 6c 65 0d 0a |paramete|r file..|
|00001830| 20 20 20 20 20 20 20 20 | 20 20 20 63 6f 6d 70 61 | | compa|
|00001840| 74 69 62 6c 65 20 77 69 | 74 68 20 74 68 65 20 63 |tible wi|th the c|
|00001850| 68 61 6e 67 65 73 20 6d | 61 64 65 20 74 6f 20 73 |hanges m|ade to s|
|00001860| 75 70 70 6f 72 74 20 6d | 75 6c 74 69 70 6c 65 20 |upport m|ultiple |
|00001870| 42 2b 74 72 65 65 73 20 | 69 6e 20 61 0d 0a 20 20 |B+trees |in a.. |
|00001880| 20 20 20 20 20 20 20 20 | 20 73 69 6e 67 6c 65 20 | | single |
|00001890| 69 6e 64 65 78 20 66 69 | 6c 65 2e 0d 0a 0d 0a 20 |index fi|le..... |
|000018a0| 20 20 20 20 20 20 6f 20 | 20 20 62 74 72 69 6e 69 | o | btrini|
|000018b0| 74 28 29 20 68 61 73 20 | 62 65 65 6e 20 65 6e 68 |t() has |been enh|
|000018c0| 61 6e 63 65 64 20 74 6f | 20 75 73 65 20 74 68 65 |anced to| use the|
|000018d0| 20 6e 65 77 20 69 6e 66 | 6f 72 6d 61 74 69 6f 6e | new inf|ormation|
|000018e0| 20 69 6e 20 74 68 65 0d | 0a 20 20 20 20 20 20 20 | in the.|. |
|000018f0| 20 20 20 20 42 54 50 41 | 52 4d 53 2e 42 54 52 20 | BTPA|RMS.BTR |
|00001900| 66 69 6c 65 2e 20 20 49 | 6e 20 70 61 72 74 69 63 |file. I|n partic|
|00001910| 75 6c 61 72 2c 20 62 74 | 72 69 6e 69 74 28 29 20 |ular, bt|rinit() |
|00001920| 6e 6f 77 20 69 6e 69 74 | 69 61 6c 69 7a 65 73 20 |now init|ializes |
|00001930| 74 68 65 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |the.. | |
|00001940| 6e 65 77 20 62 74 63 6f | 6d 6d 6f 20 73 74 72 75 |new btco|mmo stru|
|00001950| 63 74 75 72 65 20 6d 65 | 6d 62 65 72 20 22 69 64 |cture me|mber "id|
|00001960| 78 6e 61 6d 65 22 20 77 | 69 74 68 20 74 68 65 20 |xname" w|ith the |
|00001970| 49 6e 64 65 78 20 46 69 | 6c 65 20 4e 61 6d 65 0d |Index Fi|le Name.|
|00001980| 0a 20 20 20 20 20 20 20 | 20 20 20 20 77 68 69 63 |. | whic|
|00001990| 68 20 79 6f 75 20 73 70 | 65 69 63 69 66 69 65 64 |h you sp|eicified|
|000019a0| 20 69 6e 20 42 54 53 45 | 54 55 50 2e 45 58 45 2e | in BTSE|TUP.EXE.|
|000019b0| 20 20 57 65 20 75 72 67 | 65 20 74 6f 20 72 65 66 | We urg|e to ref|
|000019c0| 65 72 20 74 6f 0d 0a 20 | 20 20 20 20 20 20 20 20 |er to.. | |
|000019d0| 20 20 79 6f 75 72 20 69 | 6e 64 65 78 20 66 69 6c | your i|ndex fil|
|000019e0| 65 20 6e 61 6d 65 73 20 | 74 68 72 6f 75 67 68 20 |e names |through |
|000019f0| 62 74 63 6f 6d 6d 6f 2e | 69 64 78 6e 61 6d 65 2c |btcommo.|idxname,|
|00001a00| 20 61 73 20 77 68 65 6e | 20 79 6f 75 0d 0a 20 20 | as when| you.. |
|00001a10| 20 20 20 20 20 20 20 20 | 20 62 74 5f 6f 70 65 6e | | bt_open|
|00001a20| 28 29 20 79 6f 75 72 20 | 69 6e 64 65 78 20 66 69 |() your |index fi|
|00001a30| 6c 65 73 2e 0d 0a 0d 0a | 20 20 20 20 20 20 20 6f |les.....| o|
|00001a40| 20 20 20 49 66 20 63 72 | 65 61 74 62 74 72 28 29 | If cr|eatbtr()|
|00001a50| 20 69 73 20 63 61 6c 6c | 65 64 2c 20 69 74 20 73 | is call|ed, it s|
|00001a60| 68 6f 75 6c 64 20 62 65 | 20 63 61 6c 6c 65 64 20 |hould be| called |
|00001a70| 49 4d 4d 45 44 49 41 54 | 45 4c 59 0d 0a 20 20 20 |IMMEDIAT|ELY.. |
|00001a80| 20 20 20 20 20 20 20 20 | 66 6f 6c 6c 6f 77 69 6e | |followin|
|00001a90| 67 20 74 68 65 20 63 6f | 72 72 65 73 70 6f 6e 64 |g the co|rrespond|
|00001aa0| 69 6e 67 20 63 61 6c 6c | 20 74 6f 20 62 74 72 69 |ing call| to btri|
|00001ab0| 6e 69 74 28 29 2c 20 61 | 6e 64 20 42 45 46 4f 52 |nit(), a|nd BEFOR|
|00001ac0| 45 20 61 6e 79 0d 0a 20 | 20 20 20 20 20 20 20 20 |E any.. | |
|00001ad0| 20 20 73 75 62 73 65 71 | 75 65 6e 74 20 63 61 6c | subseq|uent cal|
|00001ae0| 6c 73 20 74 6f 20 62 74 | 72 69 6e 69 74 28 29 2e |ls to bt|rinit().|
|00001af0| 20 20 54 68 69 73 20 69 | 73 20 65 78 74 72 65 6d | This i|s extrem|
|00001b00| 65 6c 79 20 69 6d 70 6f | 72 74 61 6e 74 20 77 68 |ely impo|rtant wh|
|00001b10| 65 6e 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 6d |en.. | m|
|00001b20| 75 6c 74 69 70 6c 65 20 | 42 2b 74 72 65 65 73 20 |ultiple |B+trees |
|00001b30| 61 72 65 20 63 6f 6e 74 | 61 69 6e 65 64 20 69 6e |are cont|ained in|
|00001b40| 20 61 20 73 69 6e 67 6c | 65 20 69 6e 64 65 78 20 | a singl|e index |
|00001b50| 66 69 6c 65 2e 0d 0a 0d | 0a 20 20 20 20 20 20 20 |file....|. |
|00001b60| 6f 20 20 20 63 72 65 61 | 74 62 74 72 28 29 20 6e |o crea|tbtr() n|
|00001b70| 6f 77 20 6f 6e 6c 79 20 | 74 61 6b 65 73 20 61 20 |ow only |takes a |
|00001b80| 73 69 6e 67 6c 65 20 70 | 61 72 61 6d 65 74 65 72 |single p|arameter|
|00001b90| 20 28 74 68 65 20 61 64 | 64 72 65 73 73 20 6f 66 | (the ad|dress of|
|00001ba0| 20 74 68 65 0d 0a 20 20 | 20 20 20 20 20 20 20 20 | the.. | |
|00001bb0| 20 62 74 63 6f 6d 6d 6f | 20 73 74 72 75 63 74 75 | btcommo| structu|
|00001bc0| 72 65 29 2c 20 73 69 6e | 63 65 20 74 68 65 20 73 |re), sin|ce the s|
|00001bd0| 65 63 6f 6e 64 20 70 61 | 72 61 6d 65 74 65 72 20 |econd pa|rameter |
|00001be0| 28 74 68 65 20 49 6e 64 | 65 78 20 66 69 6c 65 0d |(the Ind|ex file.|
|00001bf0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 4e 61 6d 65 |. | Name|
|00001c00| 29 20 69 73 20 6e 6f 77 | 20 69 6e 63 6c 75 64 65 |) is now| include|
|00001c10| 64 20 69 6e 20 74 68 65 | 20 62 74 63 6f 6d 6d 6f |d in the| btcommo|
|00001c20| 20 73 74 72 75 63 74 75 | 72 65 2e 0d 0a 20 20 20 | structu|re... |
|00001c30| 20 20 20 20 20 20 20 20 | 63 72 65 61 74 62 74 72 | |creatbtr|
|00001c40| 28 29 20 68 61 73 20 62 | 65 65 6e 20 73 75 62 73 |() has b|een subs|
|00001c50| 74 61 6e 74 69 61 6c 6c | 79 20 6d 6f 64 69 66 69 |tantiall|y modifi|
|00001c60| 65 64 20 66 6f 72 20 75 | 73 65 20 77 69 74 68 20 |ed for u|se with |
|00001c70| 6d 75 6c 74 69 70 6c 65 | 0d 0a 20 20 20 20 20 20 |multiple|.. |
|00001c80| 20 20 20 20 20 42 2b 74 | 72 65 65 73 20 69 6e 20 | B+t|rees in |
|00001c90| 61 20 73 69 6e 67 6c 65 | 20 69 6e 64 65 78 20 66 |a single| index f|
|00001ca0| 69 6c 65 2e 20 20 50 72 | 65 76 69 6f 75 73 6c 79 |ile. Pr|eviously|
|00001cb0| 2c 20 63 72 65 61 74 62 | 74 72 28 29 20 77 6f 75 |, creatb|tr() wou|
|00001cc0| 6c 64 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 61 |ld.. | a|
|00001cd0| 6c 77 61 79 73 20 74 72 | 75 6e 63 61 74 65 20 61 |lways tr|uncate a|
|00001ce0| 6e 20 65 78 69 73 74 69 | 6e 67 20 69 6e 64 65 78 |n existi|ng index|
|00001cf0| 20 66 69 6c 65 20 61 6e | 64 20 69 6e 69 74 69 61 | file an|d initia|
|00001d00| 6c 69 7a 65 20 69 74 20 | 77 69 74 68 20 61 0d 0a |lize it |with a..|
|00001d10| 20 20 20 20 20 20 20 20 | 20 20 20 73 69 6e 67 6c | | singl|
|00001d20| 65 20 65 6d 70 74 79 20 | 72 6f 6f 74 20 6e 6f 64 |e empty |root nod|
|00001d30| 65 2e 20 20 53 69 6e 63 | 65 20 74 68 65 72 65 20 |e. Sinc|e there |
|00001d40| 6d 61 79 20 62 65 20 6d | 75 74 69 70 6c 65 20 42 |may be m|utiple B|
|00001d50| 2b 74 72 65 65 73 20 69 | 6e 20 61 6e 0d 0a 20 20 |+trees i|n an.. |
|00001d60| 20 20 20 20 20 20 20 20 | 20 69 6e 64 65 78 20 66 | | index f|
|00001d70| 69 6c 65 2c 20 63 72 65 | 61 74 62 74 72 28 29 20 |ile, cre|atbtr() |
|00001d80| 43 41 4e 4e 4f 54 20 6e | 6f 77 20 74 72 75 6e 63 |CANNOT n|ow trunc|
|00001d90| 61 74 65 20 74 68 65 20 | 66 69 6c 65 20 77 69 74 |ate the |file wit|
|00001da0| 68 6f 75 74 0d 0a 20 20 | 20 20 20 20 20 20 20 20 |hout.. | |
|00001db0| 20 64 65 73 74 72 6f 79 | 69 6e 67 20 74 68 65 20 | destroy|ing the |
|00001dc0| 6f 74 68 65 72 20 42 2b | 74 72 65 65 73 20 61 73 |other B+|trees as|
|00001dd0| 20 77 65 6c 6c 2e 20 20 | 49 66 20 6d 6f 72 65 20 | well. |If more |
|00001de0| 74 68 61 6e 20 6f 6e 65 | 20 42 2b 74 72 65 65 0d |than one| B+tree.|
|00001df0| 0a 20 20 20 20 20 20 20 | 20 20 20 20 61 6c 72 65 |. | alre|
|00001e00| 61 64 79 20 65 78 69 73 | 74 73 20 69 6e 20 61 20 |ady exis|ts in a |
|00001e10| 67 69 76 65 6e 20 69 6e | 64 65 78 20 66 69 6c 65 |given in|dex file|
|00001e20| 2c 20 63 72 65 61 74 62 | 74 72 28 29 20 77 69 6c |, creatb|tr() wil|
|00001e30| 6c 20 6e 6f 77 20 64 65 | 6c 65 74 65 0d 0a 20 20 |l now de|lete.. |
|00001e40| 20 20 20 20 20 20 20 20 | 20 4f 4e 4c 59 20 74 68 | | ONLY th|
|00001e50| 6f 73 65 20 6e 6f 64 65 | 73 20 62 65 6c 6f 6e 67 |ose node|s belong|
|00001e60| 69 6e 67 20 74 6f 20 74 | 68 61 74 20 42 2b 74 72 |ing to t|hat B+tr|
|00001e70| 65 65 2e 20 54 68 69 73 | 20 70 72 6f 63 65 73 73 |ee. This| process|
|00001e80| 20 63 61 6e 20 74 61 6b | 65 0d 0a 20 20 20 20 20 | can tak|e.. |
|00001e90| 20 20 20 20 20 20 73 65 | 76 65 72 61 6c 20 6d 6f | se|veral mo|
|00001ea0| 6d 65 6e 74 73 20 61 6e | 64 20 69 74 20 69 73 20 |ments an|d it is |
|00001eb0| 74 68 65 72 65 66 6f 72 | 65 20 72 65 63 6f 6d 6d |therefor|e recomm|
|00001ec0| 65 6e 64 65 64 20 74 68 | 61 74 20 79 6f 75 20 64 |ended th|at you d|
|00001ed0| 65 76 65 6c 6f 70 0d 0a | 20 20 20 20 20 20 20 20 |evelop..| |
|00001ee0| 20 20 20 61 6e 20 61 70 | 70 6c 69 63 61 74 69 6f | an ap|plicatio|
|00001ef0| 6e 20 28 69 66 20 70 6f | 73 73 69 62 6c 65 29 20 |n (if po|ssible) |
|00001f00| 75 73 69 6e 67 20 73 65 | 70 61 72 61 74 65 20 69 |using se|parate i|
|00001f10| 6e 64 65 78 20 66 69 6c | 65 73 20 66 6f 72 20 65 |ndex fil|es for e|
|00001f20| 61 63 68 0d 0a 20 20 20 | 20 20 20 20 20 20 20 20 |ach.. | |
|00001f30| 42 2b 74 72 65 65 2e 20 | 41 66 74 65 72 20 64 65 |B+tree. |After de|
|00001f40| 76 65 6c 6f 70 6d 65 6e | 74 20 79 6f 75 20 63 61 |velopmen|t you ca|
|00001f50| 6e 20 65 61 73 69 6c 79 | 20 70 6c 61 63 65 20 61 |n easily| place a|
|00001f60| 6c 6c 20 79 6f 75 72 20 | 42 2b 74 72 65 65 73 0d |ll your |B+trees.|
|00001f70| 0a 20 20 20 20 20 20 20 | 20 20 20 20 69 6e 20 61 |. | in a|
|00001f80| 20 73 69 6e 67 6c 65 20 | 69 6e 64 65 78 20 66 69 | single |index fi|
|00001f90| 6c 65 2e 20 20 53 65 65 | 20 42 6c 64 32 6b 65 79 |le. See| Bld2key|
|00001fa0| 73 2e 63 20 77 68 69 63 | 68 20 73 75 70 70 6f 72 |s.c whic|h suppor|
|00001fb0| 74 73 20 62 6f 74 68 0d | 0a 20 20 20 20 20 20 20 |ts both.|. |
|00001fc0| 20 20 20 20 6d 65 74 68 | 6f 64 73 2e 0d 0a 0d 0a | meth|ods.....|
|00001fd0| 56 65 72 73 69 6f 6e 20 | 32 2e 32 31 3a 0d 0a 0d |Version |2.21:...|
|00001fe0| 0a 31 35 2e 20 54 68 65 | 20 70 6f 72 74 61 62 6c |.15. The| portabl|
|00001ff0| 65 20 66 69 6c 65 20 6f | 70 65 6e 69 6e 67 20 66 |e file o|pening f|
|00002000| 75 6e 63 74 69 6f 6e 20 | 62 74 5f 6f 70 65 6e 28 |unction |bt_open(|
|00002010| 29 20 6e 6f 77 20 73 75 | 70 70 6f 72 74 73 20 74 |) now su|pports t|
|00002020| 68 65 20 4f 5f 43 52 45 | 41 54 0d 0a 20 20 20 20 |he O_CRE|AT.. |
|00002030| 6d 6f 64 65 20 66 6c 61 | 67 2e 20 20 4e 6f 72 6d |mode fla|g. Norm|
|00002040| 61 6c 6c 79 20 4f 5f 4e | 45 57 20 69 73 20 75 73 |ally O_N|EW is us|
|00002050| 65 64 20 74 6f 20 73 70 | 65 63 69 66 79 20 61 20 |ed to sp|ecify a |
|00002060| 6e 65 77 2f 65 6d 70 74 | 79 20 66 69 6c 65 2e 0d |new/empt|y file..|
|00002070| 0a 20 20 20 20 4f 5f 43 | 52 45 41 54 20 77 69 6c |. O_C|REAT wil|
|00002080| 6c 20 6c 65 61 76 65 20 | 61 6e 20 65 78 69 73 74 |l leave |an exist|
|00002090| 69 6e 67 20 66 69 6c 65 | 20 75 6e 74 6f 75 63 68 |ing file| untouch|
|000020a0| 65 64 2e 0d 0a 0d 0a 31 | 36 2e 20 41 6c 6c 20 6d |ed.....1|6. All m|
|000020b0| 6f 64 75 6c 65 73 20 77 | 68 69 63 68 20 75 73 65 |odules w|hich use|
|000020c0| 20 62 74 5f 6f 70 65 6e | 28 29 20 73 68 6f 75 6c | bt_open|() shoul|
|000020d0| 64 20 69 6e 63 6c 75 64 | 65 20 74 68 65 20 43 42 |d includ|e the CB|
|000020e0| 54 52 45 45 20 66 69 6c | 65 20 49 2f 4f 0d 0a 20 |TREE fil|e I/O.. |
|000020f0| 20 20 20 68 65 61 64 65 | 72 20 22 62 74 66 69 6f | heade|r "btfio|
|00002100| 2e 68 22 2e 0d 0a 0d 0a | 31 37 2e 20 54 68 65 20 |.h".....|17. The |
|00002110| 65 72 72 6f 72 20 72 65 | 70 6f 72 74 69 6e 67 20 |error re|porting |
|00002120| 66 75 6e 63 74 69 6f 6e | 20 63 6b 65 72 72 6f 72 |function| ckerror|
|00002130| 28 29 20 6e 6f 77 20 75 | 73 65 73 20 6c 6f 77 2d |() now u|ses low-|
|00002140| 6c 65 76 65 6c 20 66 69 | 6c 65 0d 0a 20 20 20 20 |level fi|le.. |
|00002150| 64 65 73 63 72 69 70 74 | 6f 72 73 20 74 6f 20 77 |descript|ors to w|
|00002160| 72 69 74 65 20 74 6f 20 | 45 52 52 4f 52 2e 46 49 |rite to |ERROR.FI|
|00002170| 4c 2e 20 20 54 68 69 73 | 20 6d 65 61 6e 73 20 74 |L. This| means t|
|00002180| 68 61 74 20 74 68 65 20 | 43 42 54 52 45 45 20 4c |hat the |CBTREE L|
|00002190| 69 62 72 61 72 79 0d 0a | 20 20 20 20 70 72 6f 70 |ibrary..| prop|
|000021a0| 65 72 20 6e 6f 77 20 68 | 61 73 20 4e 4f 20 45 58 |er now h|as NO EX|
|000021b0| 50 4c 49 43 49 54 20 72 | 65 66 65 72 65 6e 63 65 |PLICIT r|eference|
|000021c0| 73 20 74 6f 20 46 49 4c | 45 20 73 74 72 65 61 6d |s to FIL|E stream|
|000021d0| 73 2e 20 20 54 68 65 20 | 6c 69 62 72 61 72 79 0d |s. The |library.|
|000021e0| 0a 20 20 20 20 73 74 69 | 6c 6c 20 68 61 73 20 69 |. sti|ll has i|
|000021f0| 6d 70 6c 69 63 69 74 20 | 72 65 66 65 72 65 6e 63 |mplicit |referenc|
|00002200| 65 73 20 27 73 74 64 6f | 75 74 27 20 76 69 61 20 |es 'stdo|ut' via |
|00002210| 63 61 6c 6c 73 20 74 6f | 20 70 72 69 6e 74 66 28 |calls to| printf(|
|00002220| 29 2c 20 65 74 63 2e 2c | 20 62 75 74 0d 0a 20 20 |), etc.,| but.. |
|00002230| 20 20 74 68 65 73 65 20 | 63 61 6e 20 65 61 73 69 | these |can easi|
|00002240| 6c 79 20 62 65 20 72 65 | 6d 6f 76 65 64 20 77 69 |ly be re|moved wi|
|00002250| 74 68 6f 75 74 20 65 66 | 66 65 63 74 69 6e 67 20 |thout ef|fecting |
|00002260| 74 68 65 20 66 75 6e 63 | 74 69 6f 6e 61 6c 69 74 |the func|tionalit|
|00002270| 79 20 6f 66 20 74 68 65 | 0d 0a 20 20 20 20 6c 69 |y of the|.. li|
|00002280| 62 72 61 72 79 2e 0d 0a | 0d 0a 31 38 2e 20 53 75 |brary...|..18. Su|
|00002290| 70 70 6f 72 74 20 61 64 | 64 65 64 20 66 6f 72 20 |pport ad|ded for |
|000022a0| 45 63 6f 73 6f 66 74 20 | 43 20 63 6f 6d 70 69 6c |Ecosoft |C compil|
|000022b0| 65 72 20 61 6e 64 20 41 | 6d 69 67 61 20 4d 61 6e |er and A|miga Man|
|000022c0| 78 20 63 6f 6d 70 69 6c | 65 72 2e 20 20 53 70 65 |x compil|er. Spe|
|000022d0| 63 69 61 6c 0d 0a 20 20 | 20 20 74 68 61 6e 6b 73 |cial.. | thanks|
|000022e0| 20 74 6f 20 44 61 76 69 | 64 20 45 2e 20 48 6f 6c | to Davi|d E. Hol|
|000022f0| 74 20 66 6f 72 20 68 69 | 73 20 77 6f 72 6b 20 69 |t for hi|s work i|
|00002300| 6e 20 70 6f 72 74 69 6e | 67 20 74 6f 20 74 68 65 |n portin|g to the|
|00002310| 20 41 6d 69 67 61 20 4d | 61 6e 78 0d 0a 20 20 20 | Amiga M|anx.. |
|00002320| 20 63 6f 6d 70 69 6c 65 | 72 2e 0d 0a 0d 0a 56 65 | compile|r.....Ve|
|00002330| 72 73 69 6f 6e 20 32 2e | 33 30 3a 0d 0a 0d 0a 31 |rsion 2.|30:....1|
|00002340| 39 2e 20 54 68 69 73 20 | 76 65 72 73 69 6f 6e 20 |9. This |version |
|00002350| 61 64 64 73 20 73 75 70 | 70 6f 72 74 20 66 6f 72 |adds sup|port for|
|00002360| 20 76 61 72 69 61 62 6c | 65 20 6c 65 6e 67 74 68 | variabl|e length|
|00002370| 20 72 65 63 6f 72 64 73 | 2e 20 20 54 68 65 20 73 | records|. The s|
|00002380| 75 70 70 6f 72 74 0d 0a | 20 20 20 20 66 75 6e 63 |upport..| func|
|00002390| 74 69 6f 6e 73 20 61 72 | 65 20 69 6e 20 74 68 65 |tions ar|e in the|
|000023a0| 20 66 69 6c 65 20 62 74 | 76 61 72 6c 65 6e 2e 63 | file bt|varlen.c|
|000023b0| 2e 20 20 57 69 74 68 20 | 61 20 66 65 77 20 65 78 |. With |a few ex|
|000023c0| 63 65 70 74 69 6f 6e 73 | 2c 20 76 61 72 69 61 62 |ceptions|, variab|
|000023d0| 6c 65 0d 0a 20 20 20 20 | 6c 65 6e 67 74 68 20 72 |le.. |length r|
|000023e0| 65 63 6f 72 64 73 20 6f | 70 65 72 65 61 74 65 20 |ecords o|pereate |
|000023f0| 74 68 65 20 73 61 6d 65 | 20 77 61 79 20 61 73 20 |the same| way as |
|00002400| 66 69 78 65 64 2d 6c 65 | 6e 67 74 68 20 72 65 63 |fixed-le|ngth rec|
|00002410| 6f 72 64 73 2e 20 20 54 | 68 65 0d 0a 20 20 20 20 |ords. T|he.. |
|00002420| 73 75 70 70 6f 72 74 20 | 70 72 6f 67 72 61 6d 73 |support |programs|
|00002430| 20 68 61 76 65 20 61 6c | 6c 20 62 65 65 6e 20 6d | have al|l been m|
|00002440| 6f 64 69 66 69 65 64 20 | 28 61 73 20 61 70 70 6c |odified |(as appl|
|00002450| 69 63 61 62 6c 65 29 20 | 74 6f 20 75 73 65 20 61 |icable) |to use a|
|00002460| 20 73 61 6d 70 6c 65 0d | 0a 20 20 20 20 76 61 72 | sample.|. var|
|00002470| 69 61 62 6c 65 20 6c 65 | 6e 67 74 68 20 64 61 74 |iable le|ngth dat|
|00002480| 61 20 66 69 6c 65 2e 20 | 20 53 69 6d 70 6c 79 20 |a file. | Simply |
|00002490| 69 6e 76 6f 6b 65 20 74 | 68 65 20 70 72 6f 67 72 |invoke t|he progr|
|000024a0| 61 6d 20 77 69 74 68 20 | 74 68 65 20 22 2d 76 22 |am with |the "-v"|
|000024b0| 0d 0a 20 20 20 20 6f 70 | 74 69 6f 6e 20 61 6e 64 |.. op|tion and|
|000024c0| 20 69 74 20 77 69 6c 6c | 20 75 73 65 20 74 68 65 | it will| use the|
|000024d0| 20 76 61 72 69 61 62 6c | 65 20 6c 65 6e 67 74 68 | variabl|e length|
|000024e0| 20 64 61 74 61 62 61 73 | 65 2e 20 20 49 6e 20 70 | databas|e. In p|
|000024f0| 61 72 74 69 63 75 6c 61 | 72 3a 0d 0a 20 20 20 20 |articula|r:.. |
|00002500| 20 20 6f 20 20 42 4c 44 | 32 4b 45 59 53 20 2d 76 | o BLD|2KEYS -v|
|00002510| 20 20 20 2d 2d 20 62 75 | 69 6c 64 20 61 20 77 6f | -- bu|ild a wo|
|00002520| 72 6b 69 6e 67 20 64 61 | 74 61 62 61 73 65 20 77 |rking da|tabase w|
|00002530| 2f 20 74 77 6f 20 6b 65 | 79 73 0d 0a 20 20 20 20 |/ two ke|ys.. |
|00002540| 20 20 6f 20 20 55 53 45 | 52 42 54 52 20 20 2d 76 | o USE|RBTR -v|
|00002550| 20 20 20 2d 2d 20 69 6e | 74 65 72 61 63 74 69 76 | -- in|teractiv|
|00002560| 65 20 64 65 6d 6f 6e 73 | 74 72 61 74 69 6f 6e 0d |e demons|tration.|
|00002570| 0a 20 20 20 20 20 20 6f | 20 20 42 4c 44 42 54 52 |. o| BLDBTR|
|00002580| 45 45 20 2d 76 20 20 20 | 2d 2d 20 72 65 62 75 69 |EE -v |-- rebui|
|00002590| 6c 64 73 20 74 68 65 20 | 70 72 69 6d 61 72 79 20 |lds the |primary |
|000025a0| 42 2b 74 72 65 65 0d 0a | 20 20 20 20 20 20 6f 20 |B+tree..| o |
|000025b0| 20 43 42 54 52 53 45 51 | 20 20 2d 76 20 20 20 2d | CBTRSEQ| -v -|
|000025c0| 2d 20 67 6f 65 73 20 22 | 69 6e 73 69 64 65 22 20 |- goes "|inside" |
|000025d0| 74 68 65 20 42 2b 74 72 | 65 65 20 66 6f 72 20 73 |the B+tr|ee for s|
|000025e0| 65 71 75 65 6e 74 69 61 | 6c 20 6b 65 79 73 0d 0a |equentia|l keys..|
|000025f0| 20 20 20 20 20 20 6f 20 | 20 54 49 4d 45 43 42 35 | o | TIMECB5|
|00002600| 20 20 2d 76 20 20 20 2d | 2d 20 73 61 6d 70 6c 65 | -v -|- sample|
|00002610| 20 43 42 54 52 45 45 20 | 6f 70 65 72 61 74 69 6f | CBTREE |operatio|
|00002620| 6e 20 74 69 6d 69 6e 67 | 20 73 75 69 74 65 0d 0a |n timing| suite..|
|00002630| 0d 0a 32 30 2e 20 54 6f | 20 69 6e 76 6f 6b 65 20 |..20. To| invoke |
|00002640| 76 61 72 69 61 62 6c 65 | 2d 6c 65 6e 67 74 68 20 |variable|-length |
|00002650| 72 65 63 6f 72 64 73 2c | 20 73 70 65 63 69 66 79 |records,| specify|
|00002660| 20 61 20 44 61 74 61 20 | 52 65 63 6f 72 64 20 4c | a Data |Record L|
|00002670| 65 6e 67 74 68 20 6f 66 | 20 30 0d 0a 20 20 20 20 |ength of| 0.. |
|00002680| 28 7a 65 72 6f 29 20 69 | 6e 20 42 54 53 45 54 55 |(zero) i|n BTSETU|
|00002690| 50 2e 45 58 45 2e 20 20 | 4d 61 6b 65 20 73 75 72 |P.EXE. |Make sur|
|000026a0| 65 20 41 4c 4c 20 69 6e | 64 65 78 65 73 20 66 6f |e ALL in|dexes fo|
|000026b0| 72 20 61 20 67 69 76 65 | 6e 20 64 61 74 61 20 66 |r a give|n data f|
|000026c0| 69 6c 65 0d 0a 20 20 20 | 20 61 67 72 65 65 21 0d |ile.. | agree!.|
|000026d0| 0a 0d 0a 32 31 2e 20 42 | 6c 64 32 6b 65 79 73 2e |...21. B|ld2keys.|
|000026e0| 63 20 69 73 20 6e 6f 77 | 20 65 73 70 65 63 69 61 |c is now| especia|
|000026f0| 6c 6c 79 20 77 65 6c 6c | 20 63 6f 6d 6d 65 6e 74 |lly well| comment|
|00002700| 65 64 20 61 6e 64 20 69 | 73 20 61 20 67 6f 6f 64 |ed and i|s a good|
|00002710| 20 73 74 61 72 74 69 6e | 67 20 70 6f 69 6e 74 0d | startin|g point.|
|00002720| 0a 20 20 20 20 66 6f 72 | 20 6c 6f 6f 6b 69 6e 67 |. for| looking|
|00002730| 20 69 6e 74 6f 20 76 61 | 72 69 61 62 6c 65 20 6c | into va|riable l|
|00002740| 65 6e 67 74 68 20 72 65 | 63 6f 72 64 73 2e 0d 0a |ength re|cords...|
|00002750| 0d 0a 32 32 2e 20 41 20 | 6e 65 77 20 66 75 6e 63 |..22. A |new func|
|00002760| 74 69 6f 6e 20 69 6e 69 | 74 64 61 74 28 66 64 2c |tion ini|tdat(fd,|
|00002770| 20 26 62 74 63 6f 6d 6d | 6f 29 20 68 61 73 20 62 | &btcomm|o) has b|
|00002780| 65 65 6e 20 61 64 64 65 | 64 20 74 6f 20 74 68 65 |een adde|d to the|
|00002790| 20 6c 69 62 72 61 72 79 | 20 77 68 69 63 68 0d 0a | library| which..|
|000027a0| 20 20 20 20 77 69 6c 6c | 20 61 75 74 6f 6d 61 74 | will| automat|
|000027b0| 69 63 61 6c 6c 79 20 69 | 6e 69 74 69 61 6c 69 7a |ically i|nitializ|
|000027c0| 65 20 79 6f 75 72 20 64 | 61 74 61 20 66 69 6c 65 |e your d|ata file|
|000027d0| 20 68 65 61 64 65 72 20 | 72 65 63 6f 72 64 2e 20 | header |record. |
|000027e0| 20 49 74 20 77 69 6c 6c | 0d 0a 20 20 20 20 77 6f | It will|.. wo|
|000027f0| 72 6b 20 70 72 6f 70 65 | 72 6c 79 20 66 6f 72 20 |rk prope|rly for |
|00002800| 62 6f 74 68 20 66 69 78 | 65 64 2d 20 61 6e 64 20 |both fix|ed- and |
|00002810| 76 61 72 69 61 62 6c 65 | 2d 6c 65 6e 67 74 68 20 |variable|-length |
|00002820| 72 65 63 6f 72 64 73 2e | 0d 0a 0d 0a 32 33 2e 20 |records.|....23. |
|00002830| 42 65 66 6f 72 65 20 63 | 61 6c 6c 69 6e 67 20 49 |Before c|alling I|
|00002840| 4e 53 45 52 54 2c 20 62 | 74 63 6f 6d 6d 6f 2e 62 |NSERT, b|tcommo.b|
|00002850| 74 64 74 61 6c 65 6e 20 | 6d 75 73 74 20 62 65 20 |tdtalen |must be |
|00002860| 73 65 74 20 74 6f 20 74 | 68 65 20 6c 65 6e 67 74 |set to t|he lengt|
|00002870| 68 20 6f 66 0d 0a 20 20 | 20 20 79 6f 75 72 20 28 |h of.. | your (|
|00002880| 76 61 72 69 61 62 6c 65 | 2d 6c 65 6e 67 74 68 29 |variable|-length)|
|00002890| 20 72 65 63 6f 72 64 2e | 20 20 54 68 69 73 20 69 | record.| This i|
|000028a0| 73 20 6f 6e 6c 79 20 72 | 65 71 75 69 72 65 64 20 |s only r|equired |
|000028b0| 66 6f 72 20 74 68 65 20 | 49 4e 53 45 52 54 0d 0a |for the |INSERT..|
|000028c0| 20 20 20 20 6f 70 65 72 | 61 74 69 6f 6e 2c 20 61 | oper|ation, a|
|000028d0| 6e 64 20 77 68 65 6e 20 | 75 73 69 6e 67 20 76 61 |nd when |using va|
|000028e0| 72 69 61 62 6c 65 2d 6c | 65 6e 67 74 68 20 72 65 |riable-l|ength re|
|000028f0| 63 6f 72 64 73 2e 0d 0a | 0d 0a 32 34 2e 20 54 68 |cords...|..24. Th|
|00002900| 65 20 6d 61 63 72 6f 20 | 62 74 73 65 65 6b 76 28 |e macro |btseekv(|
|00002910| 66 64 2c 20 72 65 63 6c | 6f 63 2c 20 72 65 63 73 |fd, recl|oc, recs|
|00002920| 69 7a 29 20 68 61 73 20 | 62 65 65 6e 20 61 64 64 |iz) has |been add|
|00002930| 65 64 20 74 6f 20 63 62 | 74 72 65 65 2e 68 20 66 |ed to cb|tree.h f|
|00002940| 6f 72 20 75 73 65 0d 0a | 20 20 20 20 77 69 74 68 |or use..| with|
|00002950| 20 76 61 72 69 61 62 6c | 65 20 6c 65 6e 67 74 68 | variabl|e length|
|00002960| 20 72 65 63 6f 72 64 73 | 2e 20 20 49 74 20 69 73 | records|. It is|
|00002970| 20 64 65 73 69 67 6e 65 | 64 20 74 6f 20 62 65 20 | designe|d to be |
|00002980| 63 6f 6d 70 61 74 69 62 | 6c 65 20 77 69 74 68 0d |compatib|le with.|
|00002990| 0a 20 20 20 20 62 74 73 | 65 65 6b 28 29 2e 0d 0a |. bts|eek()...|
|000029a0| 0d 0a 32 35 2e 20 54 68 | 65 20 66 75 6e 63 74 69 |..25. Th|e functi|
|000029b0| 6f 6e 73 20 69 6e 20 67 | 65 74 66 70 61 74 76 2e |ons in g|etfpatv.|
|000029c0| 63 20 61 6e 64 20 70 75 | 74 66 70 61 74 76 2e 63 |c and pu|tfpatv.c|
|000029d0| 20 28 63 2e 66 2e 20 67 | 65 74 66 70 61 74 2e 63 | (c.f. g|etfpat.c|
|000029e0| 20 61 6e 64 0d 0a 20 20 | 20 20 70 75 74 66 70 61 | and.. | putfpa|
|000029f0| 74 2e 63 29 20 64 65 6d | 6f 6e 73 74 72 61 74 65 |t.c) dem|onstrate|
|00002a00| 20 67 65 74 74 69 6e 67 | 20 61 6e 64 20 70 75 74 | getting| and put|
|00002a10| 74 69 6e 67 20 76 61 72 | 69 61 62 6c 65 2d 6c 65 |ting var|iable-le|
|00002a20| 6e 67 74 68 20 72 65 63 | 6f 72 64 73 2e 0d 0a 0d |ngth rec|ords....|
|00002a30| 0a 32 36 2e 20 54 77 6f | 20 76 61 72 61 69 62 6c |.26. Two| varaibl|
|00002a40| 65 20 6c 65 6e 67 74 68 | 20 72 65 63 6f 72 64 20 |e length| record |
|00002a50| 66 75 6e 63 74 69 6f 6e | 73 20 77 69 6c 6c 20 62 |function|s will b|
|00002a60| 65 20 64 69 72 65 63 74 | 6c 79 20 6e 65 65 64 65 |e direct|ly neede|
|00002a70| 64 20 62 79 20 79 6f 75 | 72 0d 0a 20 20 20 20 61 |d by you|r.. a|
|00002a80| 70 70 6c 69 63 61 74 69 | 6f 6e 3a 0d 0a 20 20 20 |pplicati|on:.. |
|00002a90| 20 20 20 6f 20 20 62 74 | 73 69 7a 76 61 72 28 66 | o bt|sizvar(f|
|00002aa0| 64 2c 20 72 65 63 6c 6f | 63 29 2c 20 61 6e 64 0d |d, reclo|c), and.|
|00002ab0| 0a 20 20 20 20 20 20 6f | 20 20 62 74 6e 78 74 76 |. o| btnxtv|
|00002ac0| 61 72 28 66 64 2c 20 72 | 65 63 6c 6f 63 29 2e 0d |ar(fd, r|ecloc)..|
|00002ad0| 0a 0d 0a 20 20 20 20 62 | 74 73 69 7a 76 61 72 28 |... b|tsizvar(|
|00002ae0| 29 20 77 69 6c 6c 20 72 | 65 74 75 72 6e 20 74 68 |) will r|eturn th|
|00002af0| 65 20 73 69 7a 65 20 6f | 66 20 74 68 65 20 72 65 |e size o|f the re|
|00002b00| 63 6f 72 64 20 61 74 20 | 74 68 65 20 73 70 65 63 |cord at |the spec|
|00002b10| 69 66 69 65 64 20 72 65 | 63 6f 72 64 0d 0a 20 20 |ified re|cord.. |
|00002b20| 20 20 6c 6f 63 61 74 69 | 6f 6e 2e 20 20 59 6f 75 | locati|on. You|
|00002b30| 20 77 69 6c 6c 20 6e 65 | 65 64 20 74 6f 20 63 61 | will ne|ed to ca|
|00002b40| 6c 6c 20 74 68 69 73 20 | 66 75 6e 63 74 69 6f 6e |ll this |function|
|00002b50| 20 62 65 66 6f 72 65 20 | 72 65 61 64 69 6e 67 20 | before |reading |
|00002b60| 79 6f 75 72 0d 0a 20 20 | 20 20 72 65 63 6f 72 64 |your.. | record|
|00002b70| 20 73 6f 20 79 6f 75 20 | 6b 6e 6f 77 20 68 6f 77 | so you |know how|
|00002b80| 20 6d 75 63 68 20 74 6f | 20 72 65 61 64 2e 0d 0a | much to| read...|
|00002b90| 0d 0a 20 20 20 20 62 74 | 6e 78 74 76 61 72 28 29 |.. bt|nxtvar()|
|00002ba0| 20 77 69 6c 6c 20 72 65 | 74 75 72 6e 20 74 68 65 | will re|turn the|
|00002bb0| 20 6c 6f 63 61 74 69 6f | 6e 20 6f 66 20 74 68 65 | locatio|n of the|
|00002bc0| 20 6e 65 78 74 20 72 65 | 63 6f 72 64 20 61 66 74 | next re|cord aft|
|00002bd0| 65 72 20 74 68 65 20 67 | 69 76 65 6e 0d 0a 20 20 |er the g|iven.. |
|00002be0| 20 20 6f 6e 65 2e 20 20 | 49 66 20 74 68 65 20 27 | one. |If the '|
|00002bf0| 72 65 63 6c 6f 63 27 20 | 69 73 20 31 4c 20 28 61 |recloc' |is 1L (a|
|00002c00| 6e 20 22 69 6c 6c 65 67 | 61 6c 22 20 72 65 63 6f |n "illeg|al" reco|
|00002c10| 72 64 20 6c 6f 63 61 74 | 69 6f 6e 29 2c 20 69 74 |rd locat|ion), it|
|00002c20| 20 77 69 6c 6c 0d 0a 20 | 20 20 20 72 65 74 75 72 | will.. | retur|
|00002c30| 6e 20 74 68 65 20 6c 6f | 63 61 74 69 6f 6e 20 6f |n the lo|cation o|
|00002c40| 66 20 74 68 65 20 46 49 | 52 53 54 20 72 65 63 6f |f the FI|RST reco|
|00002c50| 72 64 2e 20 20 54 68 69 | 73 20 66 75 6e 63 74 69 |rd. Thi|s functi|
|00002c60| 6f 6e 20 63 61 6e 20 62 | 65 20 75 73 65 64 20 66 |on can b|e used f|
|00002c70| 6f 72 0d 0a 20 20 20 20 | 73 63 61 6e 6e 69 6e 67 |or.. |scanning|
|00002c80| 20 79 6f 75 72 20 64 61 | 74 61 20 62 61 73 65 20 | your da|ta base |
|00002c90| 6f 72 20 72 65 2d 69 6e | 64 65 78 69 6e 67 2e 20 |or re-in|dexing. |
|00002ca0| 20 53 65 65 20 62 6c 64 | 62 74 72 65 65 2e 63 20 | See bld|btree.c |
|00002cb0| 66 6f 72 20 61 6e 20 65 | 78 61 6d 70 6c 65 2e 0d |for an e|xample..|
|00002cc0| 0a 0d 0a 32 37 2e 20 54 | 68 65 20 70 72 6f 67 72 |...27. T|he progr|
|00002cd0| 61 6d 20 4d 4b 43 42 54 | 52 45 45 2e 45 58 45 20 |am MKCBT|REE.EXE |
|00002ce0| 68 61 73 20 62 65 65 6e | 20 72 65 6e 61 6d 65 64 |has been| renamed|
|00002cf0| 20 74 6f 20 4d 41 4b 42 | 54 52 45 45 2e 45 58 45 | to MAKB|TREE.EXE|
|00002d00| 2e 0d 0a 0d 0a 32 38 2e | 20 54 68 65 20 70 72 6f |.....28.| The pro|
|00002d10| 67 72 61 6d 20 43 4b 42 | 54 52 45 45 2e 45 58 45 |gram CKB|TREE.EXE|
|00002d20| 20 68 61 73 20 62 65 65 | 6e 20 72 65 6e 61 6d 65 | has bee|n rename|
|00002d30| 64 20 74 6f 20 43 48 4b | 42 54 52 45 45 2e 45 58 |d to CHK|BTREE.EX|
|00002d40| 45 2e 0d 0a 0d 0a 32 39 | 2e 20 54 68 65 20 70 72 |E.....29|. The pr|
|00002d50| 6f 67 72 61 6d 20 44 45 | 4c 42 54 52 45 45 2e 45 |ogram DE|LBTREE.E|
|00002d60| 58 45 20 68 61 73 20 62 | 65 65 6e 20 70 72 6f 76 |XE has b|een prov|
|00002d70| 69 64 65 64 20 74 6f 20 | 64 65 6c 65 74 65 20 61 |ided to |delete a|
|00002d80| 20 42 2b 74 72 65 65 20 | 66 72 6f 6d 20 61 6e 0d | B+tree |from an.|
|00002d90| 0a 20 20 20 20 69 6e 64 | 65 78 20 66 69 6c 65 2e |. ind|ex file.|
|00002da0| 20 20 49 66 20 74 68 65 | 20 69 6e 64 65 78 20 66 | If the| index f|
|00002db0| 69 6c 65 20 68 61 73 20 | 6d 6f 72 65 20 74 68 61 |ile has |more tha|
|00002dc0| 6e 20 6f 6e 65 20 42 2b | 74 72 65 65 2c 20 69 74 |n one B+|tree, it|
|00002dd0| 20 77 69 6c 6c 20 64 65 | 6c 65 74 65 0d 0a 20 20 | will de|lete.. |
|00002de0| 20 20 6f 6e 6c 79 20 74 | 68 6f 73 65 20 6e 6f 64 | only t|hose nod|
|00002df0| 65 73 20 62 65 6c 6f 6e | 67 69 6e 67 20 74 6f 20 |es belon|ging to |
|00002e00| 74 68 65 20 6f 6e 65 20 | 73 70 65 63 69 66 69 65 |the one |specifie|
|00002e10| 64 2e 0d 0a 0d 0a 53 55 | 4d 4d 41 52 59 3a 0d 0a |d.....SU|MMARY:..|
|00002e20| 31 2e 20 20 54 61 6b 65 | 20 6f 75 74 20 6d 65 6d |1. Take| out mem|
|00002e30| 6f 72 79 20 61 6c 6c 6f | 63 61 74 69 6f 6e 20 63 |ory allo|cation c|
|00002e40| 61 6c 6c 73 20 66 6f 72 | 20 62 74 63 6f 6d 6d 6f |alls for| btcommo|
|00002e50| 2e 62 74 6b 65 79 2e 0d | 0a 32 2e 20 20 52 65 70 |.btkey..|.2. Rep|
|00002e60| 6c 61 63 65 20 63 61 6c | 6c 73 20 74 6f 20 66 72 |lace cal|ls to fr|
|00002e70| 65 65 20 62 74 63 6f 6d | 6d 6f 2e 62 74 6b 65 79 |ee btcom|mo.btkey|
|00002e80| 20 77 69 74 68 20 62 74 | 72 74 65 72 6d 28 26 62 | with bt|rterm(&b|
|00002e90| 74 63 6f 6d 6d 6f 29 2e | 0d 0a 33 2e 20 20 52 65 |tcommo).|..3. Re|
|00002ea0| 70 6c 61 63 65 20 6f 63 | 63 75 72 72 65 6e 63 65 |place oc|currence|
|00002eb0| 73 20 6f 66 20 4d 41 58 | 41 52 52 41 59 2d 31 20 |s of MAX|ARRAY-1 |
|00002ec0| 77 69 74 68 20 62 74 63 | 6f 6d 6d 6f 2e 62 74 6d |with btc|ommo.btm|
|00002ed0| 61 78 2e 0d 0a 34 2e 20 | 20 47 45 54 53 45 51 2c |ax...4. | GETSEQ,|
|00002ee0| 20 47 45 54 41 4c 4c 20 | 61 6e 64 20 47 45 54 4b | GETALL |and GETK|
|00002ef0| 45 59 53 20 6d 75 73 74 | 20 62 65 20 63 61 6c 6c |EYS must| be call|
|00002f00| 65 64 20 72 65 70 65 61 | 74 65 64 6c 79 20 75 6e |ed repea|tedly un|
|00002f10| 74 69 6c 20 66 65 77 65 | 72 20 74 68 61 6e 0d 0a |til fewe|r than..|
|00002f20| 20 20 20 20 62 74 63 6f | 6d 6d 6f 2e 62 74 6d 61 | btco|mmo.btma|
|00002f30| 78 20 72 65 63 6f 72 64 | 73 20 61 72 65 20 72 65 |x record|s are re|
|00002f40| 74 75 72 6e 65 64 2e 20 | 20 4f 74 68 65 72 77 69 |turned. | Otherwi|
|00002f50| 73 65 20 66 72 65 65 5f | 73 76 6b 65 79 28 26 62 |se free_|svkey(&b|
|00002f60| 74 63 6f 6d 6d 6f 29 20 | 6d 75 73 74 0d 0a 20 20 |tcommo) |must.. |
|00002f70| 20 20 62 65 20 63 61 6c | 6c 65 64 2e 0d 0a 35 2e | be cal|led...5.|
|00002f80| 20 20 44 65 63 6c 61 72 | 65 20 6c 6f 63 61 6c 20 | Declar|e local |
|00002f90| 76 65 72 73 69 6f 6e 20 | 6f 66 20 27 66 72 65 65 |version |of 'free|
|00002fa0| 73 70 63 27 20 28 77 68 | 65 72 65 20 75 73 65 64 |spc' (wh|ere used|
|00002fb0| 29 20 61 6e 64 20 70 61 | 73 73 20 61 73 20 70 61 |) and pa|ss as pa|
|00002fc0| 72 61 6d 65 74 65 72 20 | 74 6f 0d 0a 20 20 20 20 |rameter |to.. |
|00002fd0| 67 65 74 66 68 64 72 28 | 29 20 61 6e 64 20 70 75 |getfhdr(|) and pu|
|00002fe0| 74 66 68 64 72 28 29 2e | 0d 0a 36 2e 20 20 52 65 |tfhdr().|..6. Re|
|00002ff0| 70 6c 61 63 65 20 61 6c | 6c 20 20 6c 73 65 65 6b |place al|l lseek|
|00003000| 28 20 66 64 2c 20 28 62 | 74 6c 6f 63 2d 31 29 20 |( fd, (b|tloc-1) |
|00003010| 2a 20 72 65 63 6c 65 6e | 2c 20 30 20 29 20 20 63 |* reclen|, 0 ) c|
|00003020| 61 6c 6c 73 20 77 69 74 | 68 0d 0a 20 20 20 20 20 |alls wit|h.. |
|00003030| 20 20 20 20 20 20 20 20 | 20 20 20 62 74 73 65 65 | | btsee|
|00003040| 6b 28 66 64 2c 20 20 62 | 74 6c 6f 63 2c 20 72 65 |k(fd, b|tloc, re|
|00003050| 63 6c 65 6e 29 20 20 69 | 6e 76 6f 63 61 74 69 6f |clen) i|nvocatio|
|00003060| 6e 73 2e 0d 0a 37 2e 20 | 20 55 73 65 20 62 74 5f |ns...7. | Use bt_|
|00003070| 6f 70 65 6e 28 29 20 69 | 6e 73 74 65 61 64 20 6f |open() i|nstead o|
|00003080| 66 20 6f 70 65 6e 28 29 | 2c 20 61 6e 64 20 69 6e |f open()|, and in|
|00003090| 63 6c 75 64 65 20 22 62 | 74 66 69 6f 2e 68 22 2e |clude "b|tfio.h".|
|000030a0| 0d 0a 38 2e 20 20 4b 65 | 65 70 20 74 68 65 20 65 |..8. Ke|ep the e|
|000030b0| 72 72 6f 72 20 6d 65 73 | 73 61 67 65 20 66 69 6c |rror mes|sage fil|
|000030c0| 65 20 22 63 6b 65 72 72 | 6f 72 2e 6d 73 67 22 20 |e "ckerr|or.msg" |
|000030d0| 69 6e 20 74 68 65 20 63 | 75 72 72 65 6e 74 20 64 |in the c|urrent d|
|000030e0| 69 72 65 63 74 6f 72 79 | 20 66 6f 72 0d 0a 20 20 |irectory| for.. |
|000030f0| 20 20 76 65 72 62 6f 73 | 65 20 65 72 72 6f 72 20 | verbos|e error |
|00003100| 6d 65 73 73 61 67 65 73 | 2e 0d 0a 39 2e 20 20 52 |messages|...9. R|
|00003110| 75 6e 20 42 54 53 45 54 | 55 50 20 61 6e 64 20 65 |un BTSET|UP and e|
|00003120| 6e 74 65 72 20 74 68 65 | 20 22 65 64 69 74 22 20 |nter the| "edit" |
|00003130| 6d 6f 64 65 20 66 6f 72 | 20 45 41 43 48 20 6f 66 |mode for| EACH of|
|00003140| 20 79 6f 75 72 20 42 2b | 74 72 65 65 73 2e 20 20 | your B+|trees. |
|00003150| 45 6e 74 65 72 0d 0a 20 | 20 20 20 74 68 65 20 70 |Enter.. | the p|
|00003160| 72 6f 70 65 72 20 6e 61 | 6d 65 20 66 6f 72 20 74 |roper na|me for t|
|00003170| 68 65 20 49 6e 64 65 78 | 20 46 69 6c 65 20 63 6f |he Index| File co|
|00003180| 72 72 65 73 70 6f 6e 64 | 69 6e 67 20 74 6f 20 65 |rrespond|ing to e|
|00003190| 61 63 68 20 6f 66 20 79 | 6f 75 72 20 42 2b 74 72 |ach of y|our B+tr|
|000031a0| 65 65 73 2e 0d 0a 20 20 | 20 20 54 68 65 6e 20 5b |ees... | Then [|
|000031b0| 53 5d 61 76 65 20 74 68 | 65 20 6e 65 77 20 73 65 |S]ave th|e new se|
|000031c0| 74 74 69 6e 67 73 2e 20 | 20 54 68 65 20 66 69 6c |ttings. | The fil|
|000031d0| 65 20 42 54 50 41 52 4d | 53 2e 42 54 52 20 77 69 |e BTPARM|S.BTR wi|
|000031e0| 6c 6c 20 62 65 20 75 70 | 64 61 74 65 64 2e 0d 0a |ll be up|dated...|
|000031f0| 31 30 2e 20 49 6e 63 6c | 75 64 65 20 22 62 74 66 |10. Incl|ude "btf|
|00003200| 69 6f 2e 68 22 20 69 6e | 20 74 68 6f 73 65 20 6d |io.h" in| those m|
|00003210| 6f 64 75 6c 65 73 20 74 | 68 61 74 20 75 73 65 20 |odules t|hat use |
|00003220| 62 74 5f 6f 70 65 6e 28 | 29 2e 0d 0a 31 31 2e 20 |bt_open(|)...11. |
|00003230| 41 6c 6c 20 63 61 6c 6c | 73 20 74 6f 20 63 72 65 |All call|s to cre|
|00003240| 61 74 62 74 72 28 29 20 | 28 69 66 20 61 6e 79 29 |atbtr() |(if any)|
|00003250| 20 73 68 6f 75 6c 64 20 | 62 65 20 70 6c 61 63 65 | should |be place|
|00003260| 64 20 69 6d 6d 65 64 69 | 61 74 65 6c 79 20 61 66 |d immedi|ately af|
|00003270| 74 65 72 20 74 68 65 0d | 0a 20 20 20 20 63 6f 72 |ter the.|. cor|
|00003280| 72 65 73 70 6f 6e 64 69 | 6e 67 20 63 61 6c 6c 20 |respondi|ng call |
|00003290| 74 6f 20 62 74 72 69 6e | 69 74 28 29 20 61 6e 64 |to btrin|it() and|
|000032a0| 20 62 65 66 6f 72 65 20 | 61 6e 79 20 66 75 72 74 | before |any furt|
|000032b0| 68 65 72 20 63 61 6c 6c | 73 20 74 6f 0d 0a 20 20 |her call|s to.. |
|000032c0| 20 20 62 74 72 69 6e 69 | 74 28 29 2e 20 20 54 68 | btrini|t(). Th|
|000032d0| 69 73 20 69 73 20 52 45 | 51 55 49 52 45 44 20 69 |is is RE|QUIRED i|
|000032e0| 66 20 79 6f 75 20 61 72 | 65 20 70 6c 61 63 69 6e |f you ar|e placin|
|000032f0| 67 20 6d 75 6c 74 69 70 | 6c 65 20 42 2b 74 72 65 |g multip|le B+tre|
|00003300| 65 73 20 69 6e 20 61 0d | 0a 20 20 20 20 73 69 6e |es in a.|. sin|
|00003310| 67 6c 65 20 69 6e 64 65 | 78 20 66 69 6c 65 2e 0d |gle inde|x file..|
|00003320| 0a 31 32 2e 20 55 73 65 | 20 74 68 65 20 66 75 6e |.12. Use| the fun|
|00003330| 63 74 69 6f 6e 20 69 6e | 69 74 64 61 74 28 66 64 |ction in|itdat(fd|
|00003340| 2c 20 26 62 74 63 6f 6d | 6d 6f 29 20 74 6f 20 69 |, &btcom|mo) to i|
|00003350| 6e 69 74 69 61 6c 69 7a | 65 20 79 6f 75 72 20 64 |nitializ|e your d|
|00003360| 61 74 61 20 66 69 6c 65 | 0d 0a 20 20 20 20 68 65 |ata file|.. he|
|00003370| 61 64 65 72 20 72 65 63 | 6f 72 64 2e 0d 0a 31 33 |ader rec|ord...13|
|00003380| 2e 20 55 73 65 20 62 74 | 73 69 7a 76 61 72 28 29 |. Use bt|sizvar()|
|00003390| 20 74 6f 20 67 65 74 20 | 74 68 65 20 73 69 7a 65 | to get |the size|
|000033a0| 20 6f 66 20 79 6f 75 72 | 20 76 61 72 69 61 62 6c | of your| variabl|
|000033b0| 65 20 6c 65 6e 67 74 68 | 20 64 61 74 61 20 72 65 |e length| data re|
|000033c0| 63 6f 72 64 2e 0d 0a 20 | 20 20 20 54 68 65 6e 20 |cord... | Then |
|000033d0| 75 73 65 20 62 74 73 65 | 65 6b 76 28 29 20 74 6f |use btse|ekv() to|
|000033e0| 20 73 65 65 6b 20 74 6f | 20 69 74 2e 20 20 54 68 | seek to| it. Th|
|000033f0| 65 6e 20 72 65 61 64 20 | 69 74 2e 20 20 48 49 4e |en read |it. HIN|
|00003400| 54 3a 20 20 73 69 6e 63 | 65 20 74 68 65 0d 0a 20 |T: sinc|e the.. |
|00003410| 20 20 20 72 65 63 6f 72 | 64 20 73 69 7a 65 20 69 | recor|d size i|
|00003420| 73 20 65 6d 62 65 64 64 | 65 64 20 69 6e 20 74 68 |s embedd|ed in th|
|00003430| 65 20 64 61 74 61 20 66 | 69 6c 65 2c 20 75 73 65 |e data f|ile, use|
|00003440| 20 62 74 73 69 7a 76 61 | 72 28 29 20 6f 6e 6c 79 | btsizva|r() only|
|00003450| 20 6a 75 73 74 0d 0a 20 | 20 20 20 62 65 66 6f 72 | just.. | befor|
|00003460| 65 20 72 65 61 64 69 6e | 67 20 74 68 65 20 64 61 |e readin|g the da|
|00003470| 74 61 20 72 65 63 6f 72 | 64 2e 20 20 54 68 69 73 |ta recor|d. This|
|00003480| 20 77 69 6c 6c 20 72 65 | 64 75 63 65 20 6f 76 65 | will re|duce ove|
|00003490| 72 61 6c 6c 20 61 63 63 | 65 73 73 20 74 69 6d 65 |rall acc|ess time|
|000034a0| 2e 0d 0a 0d 0a 4e 4f 54 | 45 3a 20 52 75 6e 20 42 |.....NOT|E: Run B|
|000034b0| 54 53 45 54 55 50 2e 45 | 58 45 20 61 6e 64 20 73 |TSETUP.E|XE and s|
|000034c0| 70 65 63 69 66 79 20 74 | 68 65 20 76 61 6c 75 65 |pecify t|he value|
|000034d0| 20 79 6f 75 20 68 61 64 | 20 66 6f 72 20 4d 41 58 | you had| for MAX|
|000034e0| 41 52 52 41 59 2d 31 20 | 61 73 0d 0a 20 20 20 20 |ARRAY-1 |as.. |
|000034f0| 20 20 4d 61 78 20 52 65 | 63 73 2e 20 20 53 65 65 | Max Re|cs. See|
|00003500| 20 41 70 70 65 6e 64 69 | 78 20 42 20 69 6e 20 74 | Appendi|x B in t|
|00003510| 68 65 20 6d 61 6e 75 61 | 6c 3a 20 79 6f 75 20 6d |he manua|l: you m|
|00003520| 61 79 20 68 61 76 65 20 | 74 6f 20 72 65 2d 69 6e |ay have |to re-in|
|00003530| 64 65 78 20 69 66 0d 0a | 20 20 20 20 20 20 43 65 |dex if..| Ce|
|00003540| 6c 6c 73 20 50 65 72 20 | 49 6e 64 65 78 20 42 6c |lls Per |Index Bl|
|00003550| 6f 63 6b 20 69 73 20 63 | 68 61 6e 67 65 64 20 62 |ock is c|hanged b|
|00003560| 79 20 42 54 53 45 54 55 | 50 2e 45 58 45 2e 0d 0a |y BTSETU|P.EXE...|
|00003570| 1a | |. | |
+--------+-------------------------+-------------------------+--------+--------+