home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c006 / 1.ddi / CPYLTBRO.C < prev    next >
DOS BACKUP file  |  1988-03-14  |  3.8 KB

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: CPYLTBRO.C

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert DOS BACKUP file (archive/dosBackupFile) magic Supported
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
100% file DOS 2.0-3.2 backed up file \CBTREE\LIBRARY\CPYLTBRO.C 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 4c 49 42 |.....\CB|TREE\LIB|
|00000010| 52 41 52 59 5c 43 50 59 | 4c 54 42 52 4f 2e 43 00 |RARY\CPY|LTBRO.C.|
|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 1b 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| 2f 2a 20 28 43 29 20 43 | 6f 70 79 72 69 67 68 74 |/* (C) C|opyright|
|00000090| 20 31 39 38 34 2c 38 35 | 2c 38 36 2c 38 37 20 57 | 1984,85|,86,87 W|
|000000a0| 61 6c 74 65 72 20 4c 2e | 20 50 65 61 63 6f 63 6b |alter L.| Peacock|
|000000b0| 20 20 20 41 6c 6c 20 52 | 69 67 68 74 73 20 52 65 | All R|ights Re|
|000000c0| 73 65 72 76 65 64 20 20 | 20 20 2a 2f 0d 0a 2f 2a |served | */../*|
|000000d0| 20 20 43 20 50 20 59 20 | 4c 20 54 20 42 20 52 20 | C P Y |L T B R |
|000000e0| 4f 20 2e 20 43 20 20 20 | 20 20 20 20 20 20 20 20 |O . C | |
|000000f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000100| 20 20 20 20 20 20 20 20 | 20 20 20 2a 2f 0d 0a 2f | | */../|
|00000110| 2a 20 54 48 49 53 20 50 | 52 4f 47 52 41 4d 20 42 |* THIS P|ROGRAM B|
|00000120| 45 4c 4f 4e 47 53 20 54 | 4f 20 57 41 4c 54 45 52 |ELONGS T|O WALTER|
|00000130| 20 4c 2e 20 50 45 41 43 | 4f 43 4b 2e 20 20 49 54 | L. PEAC|OCK. IT|
|00000140| 20 49 53 20 43 4f 4e 53 | 49 44 45 52 45 44 20 41 | IS CONS|IDERED A|
|00000150| 20 54 52 41 44 45 20 2a | 2f 0d 0a 2f 2a 20 53 45 | TRADE *|/../* SE|
|00000160| 43 52 45 54 20 41 4e 44 | 20 49 53 20 4e 4f 54 20 |CRET AND| IS NOT |
|00000170| 54 4f 20 42 45 20 44 49 | 56 55 4c 47 45 44 20 4f |TO BE DI|VULGED O|
|00000180| 52 20 55 53 45 44 20 42 | 59 20 50 41 52 54 49 45 |R USED B|Y PARTIE|
|00000190| 53 20 57 48 4f 20 48 41 | 56 45 20 4e 4f 54 20 20 |S WHO HA|VE NOT |
|000001a0| 20 20 20 20 20 2a 2f 0d | 0a 2f 2a 20 52 45 43 45 | */.|./* RECE|
|000001b0| 49 56 45 44 20 57 52 49 | 54 54 45 4e 20 41 55 54 |IVED WRI|TTEN AUT|
|000001c0| 48 4f 52 49 5a 41 54 49 | 4f 4e 20 46 52 4f 4d 20 |HORIZATI|ON FROM |
|000001d0| 54 48 45 20 4f 57 4e 45 | 52 2e 20 20 20 20 20 20 |THE OWNE|R. |
|000001e0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 2a 2f 0d | | */.|
|000001f0| 0a 2f 2a 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |./*-----|--------|
|00000200| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000210| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000220| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000230| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 20 |--------|------- |
|00000240| 0d 0a 20 2a 20 63 70 79 | 6c 74 62 72 6f 28 29 20 |.. * cpy|ltbro() |
|00000250| 77 69 6c 6c 20 61 74 74 | 65 6d 70 74 20 74 6f 20 |will att|empt to |
|00000260| 63 6f 70 79 20 61 20 63 | 65 6c 6c 20 66 72 6f 6d |copy a c|ell from|
|00000270| 20 74 68 65 20 6c 65 66 | 74 20 62 72 6f 74 68 65 | the lef|t brothe|
|00000280| 72 20 69 6e 64 65 78 20 | 6e 6f 64 65 20 0d 0a 20 |r index |node .. |
|00000290| 2a 20 77 68 65 6e 20 74 | 68 65 20 63 75 72 72 65 |* when t|he curre|
|000002a0| 6e 74 20 69 6e 64 65 78 | 20 6e 6f 64 65 20 75 6e |nt index| node un|
|000002b0| 64 65 72 66 6c 6f 77 73 | 20 28 69 2e 65 2e 20 63 |derflows| (i.e. c|
|000002c0| 6f 6e 74 61 69 6e 73 20 | 6c 65 73 73 20 74 68 61 |ontains |less tha|
|000002d0| 6e 20 4d 41 58 43 45 4c | 4c 53 2f 32 20 0d 0a 20 |n MAXCEL|LS/2 .. |
|000002e0| 2a 20 6b 65 79 73 29 20 | 64 75 72 69 6e 67 20 61 |* keys) |during a|
|000002f0| 20 64 65 6c 65 74 65 20 | 6b 65 79 2e 0d 0a 20 2a | delete |key... *|
|00000300| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000310| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000320| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000330| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000340| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2a 2f 0d 0a 0d |--------|---*/...|
|00000350| 0a 23 69 6e 63 6c 75 64 | 65 20 22 63 62 74 72 65 |.#includ|e "cbtre|
|00000360| 65 2e 68 22 0d 0a 0d 0a | 63 70 79 6c 74 62 72 6f |e.h"....|cpyltbro|
|00000370| 28 66 64 69 64 78 2c 20 | 70 62 6c 6b 2c 20 62 74 |(fdidx, |pblk, bt|
|00000380| 70 61 72 6d 73 74 29 0d | 0a 69 6e 74 20 66 64 69 |parmst).|.int fdi|
|00000390| 64 78 3b 0d 0a 73 74 72 | 75 63 74 20 62 74 69 64 |dx;..str|uct btid|
|000003a0| 78 62 6c 6b 20 2a 70 62 | 6c 6b 3b 0d 0a 73 74 72 |xblk *pb|lk;..str|
|000003b0| 75 63 74 20 62 74 63 6f | 6d 6d 6f 20 2a 62 74 70 |uct btco|mmo *btp|
|000003c0| 61 72 6d 73 74 3b 0d 0a | 7b 0d 0a 20 20 20 65 78 |armst;..|{.. ex|
|000003d0| 74 65 72 6e 20 6c 6f 6e | 67 20 70 6f 70 74 6f 70 |tern lon|g poptop|
|000003e0| 28 29 3b 0d 0a 20 20 20 | 65 78 74 65 72 6e 20 69 |();.. |extern i|
|000003f0| 6e 74 20 73 74 72 6c 65 | 6e 28 29 3b 0d 0a 20 20 |nt strle|n();.. |
|00000400| 20 65 78 74 65 72 6e 20 | 76 6f 69 64 20 66 72 65 | extern |void fre|
|00000410| 65 28 29 3b 0d 0a 20 20 | 20 65 78 74 65 72 6e 20 |e();.. | extern |
|00000420| 63 68 61 72 20 2a 63 61 | 6c 6c 6f 63 28 29 2c 20 |char *ca|lloc(), |
|00000430| 2a 73 74 72 73 61 76 65 | 28 29 3b 0d 0a 20 20 20 |*strsave|();.. |
|00000440| 42 54 49 44 58 42 4c 4b | 20 2a 62 72 6f 62 6c 6b |BTIDXBLK| *broblk|
|00000450| 3b 0d 0a 20 20 20 6c 6f | 6e 67 20 69 6e 74 20 6c |;.. lo|ng int l|
|00000460| 76 6c 6e 6f 64 65 2c 20 | 63 70 79 6c 6f 63 2c 20 |vlnode, |cpyloc, |
|00000470| 70 6f 73 3b 0d 0a 20 20 | 20 63 68 61 72 20 2a 65 |pos;.. | char *e|
|00000480| 6e 64 62 72 6f 6b 79 3b | 0d 0a 20 20 20 72 65 67 |ndbroky;|.. reg|
|00000490| 69 73 74 65 72 20 69 6e | 74 20 69 3b 0d 0a 0d 0a |ister in|t i;....|
|000004a0| 20 20 20 69 66 28 70 62 | 6c 6b 2d 3e 62 77 64 70 | if(pb|lk->bwdp|
|000004b0| 61 67 65 20 3c 20 32 29 | 20 20 20 20 20 20 2f 2a |age < 2)| /*|
|000004c0| 20 74 68 65 72 65 20 69 | 73 20 6e 6f 20 6c 65 66 | there i|s no lef|
|000004d0| 74 20 62 72 6f 74 68 65 | 72 20 20 20 2a 2f 0d 0a |t brothe|r */..|
|000004e0| 20 20 20 20 20 20 72 65 | 74 75 72 6e 28 2d 31 29 | re|turn(-1)|
|000004f0| 3b 0d 0a 0d 0a 20 20 20 | 70 6f 73 20 3d 20 28 6c |;.... |pos = (l|
|00000500| 6f 6e 67 29 20 28 28 70 | 62 6c 6b 2d 3e 62 77 64 |ong) ((p|blk->bwd|
|00000510| 70 61 67 65 20 2d 20 31 | 4c 29 20 2a 20 62 74 70 |page - 1|L) * btp|
|00000520| 61 72 6d 73 74 2d 3e 62 | 74 69 64 78 6c 65 6e 29 |armst->b|tidxlen)|
|00000530| 3b 0d 0a 0d 0a 20 20 20 | 69 20 3d 20 30 3b 20 20 |;.... |i = 0; |
|00000540| 20 20 20 2f 2a 20 6c 6f | 63 6b 20 74 68 65 20 72 | /* lo|ck the r|
|00000550| 65 63 6f 72 64 20 77 65 | 20 61 72 65 20 61 62 6f |ecord we| are abo|
|00000560| 75 74 20 74 6f 20 6d 6f | 64 69 66 79 20 2a 2f 0d |ut to mo|dify */.|
|00000570| 0a 20 20 20 77 68 69 6c | 65 20 28 6c 6f 63 6b 75 |. whil|e (locku|
|00000580| 6e 6c 6b 28 66 64 69 64 | 78 2c 20 28 6c 6f 6e 67 |nlk(fdid|x, (long|
|00000590| 29 20 70 6f 73 2c 20 62 | 74 70 61 72 6d 73 74 2d |) pos, b|tparmst-|
|000005a0| 3e 62 74 69 64 78 6c 65 | 6e 2c 20 4c 4f 43 4b 52 |>btidxle|n, LOCKR|
|000005b0| 29 20 21 3d 20 31 29 0d | 0a 20 20 20 20 20 20 69 |) != 1).|. i|
|000005c0| 66 20 28 2b 2b 69 20 3e | 20 48 44 52 54 52 59 53 |f (++i >| HDRTRYS|
|000005d0| 29 0d 0a 20 20 20 20 20 | 20 20 20 20 72 65 74 75 |).. | retu|
|000005e0| 72 6e 28 2d 31 29 3b 20 | 09 2f 2a 20 69 2e 65 2e |rn(-1); |./* i.e.|
|000005f0| 20 75 6e 61 62 6c 65 20 | 74 6f 20 6c 6f 63 6b 20 | unable |to lock |
|00000600| 6c 69 6e 6b 65 64 20 6c | 69 73 74 20 72 65 63 6f |linked l|ist reco|
|00000610| 72 64 20 2a 2f 0d 0a 0d | 0a 20 20 20 2f 2a 20 62 |rd */...|. /* b|
|00000620| 75 66 66 65 72 20 66 6f | 72 20 6c 65 66 74 20 62 |uffer fo|r left b|
|00000630| 72 6f 74 68 65 72 20 2a | 2f 0d 0a 20 20 20 69 66 |rother *|/.. if|
|00000640| 28 20 21 28 62 72 6f 62 | 6c 6b 20 3d 20 28 42 54 |( !(brob|lk = (BT|
|00000650| 49 44 58 42 4c 4b 20 2a | 29 63 61 6c 6c 6f 63 28 |IDXBLK *|)calloc(|
|00000660| 0d 0a 20 20 20 20 20 20 | 20 20 20 73 69 7a 65 6f |.. | sizeo|
|00000670| 66 28 42 54 49 44 58 42 | 4c 4b 29 20 2b 20 62 74 |f(BTIDXB|LK) + bt|
|00000680| 70 61 72 6d 73 74 2d 3e | 62 74 63 65 6c 6c 73 20 |parmst->|btcells |
|00000690| 2a 20 53 5a 42 54 49 44 | 58 2c 20 53 5a 43 48 41 |* SZBTID|X, SZCHA|
|000006a0| 52 29 20 29 29 0d 0a 20 | 20 20 20 20 20 63 6b 65 |R) )).. | cke|
|000006b0| 72 72 6f 72 28 2d 20 43 | 4b 5f 4e 4f 4d 45 4d 2c |rror(- C|K_NOMEM,|
|000006c0| 20 22 36 30 22 29 3b 0d | 0a 0d 0a 20 20 20 67 65 | "60");.|... ge|
|000006d0| 74 69 64 78 72 28 66 64 | 69 64 78 2c 20 70 62 6c |tidxr(fd|idx, pbl|
|000006e0| 6b 2d 3e 62 77 64 70 61 | 67 65 2c 20 62 72 6f 62 |k->bwdpa|ge, brob|
|000006f0| 6c 6b 2c 20 62 74 70 61 | 72 6d 73 74 2d 3e 62 74 |lk, btpa|rmst->bt|
|00000700| 69 64 78 6c 65 6e 2c 20 | 62 74 70 61 72 6d 73 74 |idxlen, |btparmst|
|00000710| 2d 3e 62 74 6b 65 79 6c | 65 6e 29 3b 0d 0a 0d 0a |->btkeyl|en);....|
|00000720| 20 20 20 69 66 20 28 62 | 72 6f 62 6c 6b 2d 3e 63 | if (b|roblk->c|
|00000730| 65 6c 6c 69 63 6e 74 20 | 3c 3d 20 28 62 74 70 61 |ellicnt |<= (btpa|
|00000740| 72 6d 73 74 2d 3e 62 74 | 63 65 6c 6c 73 20 3e 3e |rmst->bt|cells >>|
|00000750| 20 31 29 20 29 7b 20 20 | 20 20 2f 2a 20 75 6e 64 | 1) ){ | /* und|
|00000760| 65 72 66 6c 6f 77 20 20 | 20 2a 2f 0d 0a 20 20 20 |erflow | */.. |
|00000770| 20 20 20 6c 6f 63 6b 75 | 6e 6c 6b 28 66 64 69 64 | locku|nlk(fdid|
|00000780| 78 2c 20 70 6f 73 2c 20 | 62 74 70 61 72 6d 73 74 |x, pos, |btparmst|
|00000790| 2d 3e 62 74 69 64 78 6c | 65 6e 2c 20 55 4e 4c 4f |->btidxl|en, UNLO|
|000007a0| 43 4b 52 29 3b 0d 0a 20 | 20 20 20 20 20 66 72 65 |CKR);.. | fre|
|000007b0| 65 6b 65 79 73 28 62 72 | 6f 62 6c 6b 29 3b 0d 0a |ekeys(br|oblk);..|
|000007c0| 20 20 20 20 20 20 46 52 | 45 45 28 62 72 6f 62 6c | FR|EE(brobl|
|000007d0| 6b 29 3b 0d 0a 20 20 20 | 20 20 20 72 65 74 75 72 |k);.. | retur|
|000007e0| 6e 28 2d 31 29 3b 0d 0a | 20 20 20 7d 0d 0a 0d 0a |n(-1);..| }....|
|000007f0| 20 20 20 2f 2a 20 63 6f | 70 79 20 4c 41 53 54 20 | /* co|py LAST |
|00000800| 63 65 6c 6c 20 66 72 6f | 6d 20 6c 65 66 74 20 62 |cell fro|m left b|
|00000810| 72 6f 74 68 65 72 20 74 | 6f 20 46 49 52 53 54 20 |rother t|o FIRST |
|00000820| 70 6f 73 69 74 69 6f 6e | 20 6f 66 20 70 62 6c 6b |position| of pblk|
|00000830| 20 2a 2f 0d 0a 0d 0a 20 | 20 20 2f 2a 20 6f 70 65 | */.... | /* ope|
|00000840| 6e 20 75 70 20 73 70 61 | 63 65 20 74 6f 20 73 68 |n up spa|ce to sh|
|00000850| 69 66 74 20 69 6e 74 6f | 20 2a 2f 0d 0a 20 20 20 |ift into| */.. |
|00000860| 69 66 20 28 70 62 6c 6b | 2d 3e 62 6c 6b 61 6c 6c |if (pblk|->blkall|
|00000870| 6f 63 20 3e 20 70 62 6c | 6b 2d 3e 63 65 6c 6c 69 |oc > pbl|k->celli|
|00000880| 63 6e 74 29 0d 0a 20 20 | 20 20 20 20 46 52 45 45 |cnt).. | FREE|
|00000890| 28 70 62 6c 6b 2d 3e 62 | 74 70 61 67 65 5b 70 62 |(pblk->b|tpage[pb|
|000008a0| 6c 6b 2d 3e 63 65 6c 6c | 69 63 6e 74 5d 2e 73 6b |lk->cell|icnt].sk|
|000008b0| 65 79 6e 6d 65 29 3b 0d | 0a 20 20 20 65 6c 73 65 |eynme);.|. else|
|000008c0| 0d 0a 20 20 20 20 20 20 | 2b 2b 70 62 6c 6b 2d 3e |.. |++pblk->|
|000008d0| 62 6c 6b 61 6c 6c 6f 63 | 3b 20 2f 2a 20 77 65 27 |blkalloc|; /* we'|
|000008e0| 72 65 20 67 6f 69 6e 67 | 20 74 6f 20 61 64 64 20 |re going| to add |
|000008f0| 61 6e 20 61 6c 6c 6f 63 | 61 74 69 6f 6e 20 66 72 |an alloc|ation fr|
|00000900| 6f 6d 20 6c 65 66 74 20 | 62 72 6f 20 2a 2f 0d 0a |om left |bro */..|
|00000910| 0d 0a 20 20 20 2f 2a 20 | 73 68 69 66 74 20 74 6f |.. /* |shift to|
|00000920| 20 6d 61 6b 65 20 72 6f | 6f 6d 20 66 6f 72 20 63 | make ro|om for c|
|00000930| 65 6c 6c 20 66 72 6f 6d | 20 6c 65 66 74 20 62 72 |ell from| left br|
|00000940| 6f 74 68 65 72 20 2a 2f | 0d 0a 20 20 20 62 6c 6b |other */|.. blk|
|00000950| 73 68 66 74 28 70 62 6c | 6b 2d 3e 62 74 70 61 67 |shft(pbl|k->btpag|
|00000960| 65 20 2b 20 31 2c 20 70 | 62 6c 6b 2d 3e 62 74 70 |e + 1, p|blk->btp|
|00000970| 61 67 65 2c 20 70 62 6c | 6b 2d 3e 63 65 6c 6c 69 |age, pbl|k->celli|
|00000980| 63 6e 74 2b 2b 2c 20 53 | 5a 42 54 49 44 58 29 3b |cnt++, S|ZBTIDX);|
|00000990| 0d 0a 0d 0a 20 20 20 2f | 2a 20 63 6f 70 79 20 6c |.... /|* copy l|
|000009a0| 61 73 74 20 63 65 6c 6c | 20 66 72 6f 6d 20 6c 65 |ast cell| from le|
|000009b0| 66 74 20 62 72 6f 74 68 | 65 72 20 74 6f 20 6f 75 |ft broth|er to ou|
|000009c0| 72 20 66 69 72 73 74 20 | 70 6f 73 69 74 69 6f 6e |r first |position|
|000009d0| 20 2a 2f 0d 0a 20 20 20 | 62 6c 6b 73 68 66 74 28 | */.. |blkshft(|
|000009e0| 70 62 6c 6b 2d 3e 62 74 | 70 61 67 65 2c 20 62 72 |pblk->bt|page, br|
|000009f0| 6f 62 6c 6b 2d 3e 62 74 | 70 61 67 65 20 2b 20 2d |oblk->bt|page + -|
|00000a00| 2d 62 72 6f 62 6c 6b 2d | 3e 63 65 6c 6c 69 63 6e |-broblk-|>cellicn|
|00000a10| 74 2c 20 31 2c 20 53 5a | 42 54 49 44 58 29 3b 0d |t, 1, SZ|BTIDX);.|
|00000a20| 0a 20 20 20 2d 2d 62 72 | 6f 62 6c 6b 2d 3e 62 6c |. --br|oblk->bl|
|00000a30| 6b 61 6c 6c 6f 63 3b 0d | 0a 0d 0a 20 20 20 2f 2a |kalloc;.|... /*|
|00000a40| 20 63 6f 6d 70 72 65 73 | 73 20 65 78 63 65 73 73 | compres|s excess|
|00000a50| 20 75 6e 75 73 65 64 20 | 62 6c 6f 63 6b 73 20 6f | unused |blocks o|
|00000a60| 76 65 72 20 74 68 65 20 | 6f 6e 65 20 6a 75 73 74 |ver the |one just|
|00000a70| 20 63 6f 70 69 65 64 20 | 2a 2f 0d 0a 20 20 20 62 | copied |*/.. b|
|00000a80| 6c 6b 73 68 66 74 28 62 | 72 6f 62 6c 6b 2d 3e 62 |lkshft(b|roblk->b|
|00000a90| 74 70 61 67 65 20 2b 20 | 62 72 6f 62 6c 6b 2d 3e |tpage + |broblk->|
|00000aa0| 63 65 6c 6c 69 63 6e 74 | 2c 20 62 72 6f 62 6c 6b |cellicnt|, broblk|
|00000ab0| 2d 3e 62 74 70 61 67 65 | 20 2b 0d 0a 20 20 20 20 |->btpage| +.. |
|00000ac0| 20 20 20 20 20 62 72 6f | 62 6c 6b 2d 3e 63 65 6c | bro|blk->cel|
|00000ad0| 6c 69 63 6e 74 20 2b 20 | 31 2c 20 62 72 6f 62 6c |licnt + |1, brobl|
|00000ae0| 6b 2d 3e 62 6c 6b 61 6c | 6c 6f 63 20 2d 20 62 72 |k->blkal|loc - br|
|00000af0| 6f 62 6c 6b 2d 3e 63 65 | 6c 6c 69 63 6e 74 2c 0d |oblk->ce|llicnt,.|
|00000b00| 0a 20 20 20 20 20 20 20 | 20 20 53 5a 42 54 49 44 |. | SZBTID|
|00000b10| 58 29 3b 0d 0a 0d 0a 20 | 20 20 70 75 74 69 64 78 |X);.... | putidx|
|00000b20| 72 28 66 64 69 64 78 2c | 20 62 72 6f 62 6c 6b 2d |r(fdidx,| broblk-|
|00000b30| 3e 66 77 64 70 61 67 65 | 2c 20 70 62 6c 6b 2c 20 |>fwdpage|, pblk, |
|00000b40| 62 74 70 61 72 6d 73 74 | 29 3b 0d 0a 20 20 20 70 |btparmst|);.. p|
|00000b50| 75 74 69 64 78 72 28 66 | 64 69 64 78 2c 20 70 62 |utidxr(f|didx, pb|
|00000b60| 6c 6b 2d 3e 62 77 64 70 | 61 67 65 2c 20 62 72 6f |lk->bwdp|age, bro|
|00000b70| 62 6c 6b 2c 20 62 74 70 | 61 72 6d 73 74 29 3b 0d |blk, btp|armst);.|
|00000b80| 0a 0d 0a 20 20 20 6c 6f | 63 6b 75 6e 6c 6b 28 66 |... lo|ckunlk(f|
|00000b90| 64 69 64 78 2c 20 70 6f | 73 2c 20 62 74 70 61 72 |didx, po|s, btpar|
|00000ba0| 6d 73 74 2d 3e 62 74 69 | 64 78 6c 65 6e 2c 20 55 |mst->bti|dxlen, U|
|00000bb0| 4e 4c 4f 43 4b 52 29 3b | 0d 0a 0d 0a 20 20 20 65 |NLOCKR);|.... e|
|00000bc0| 6e 64 62 72 6f 6b 79 20 | 3d 20 73 74 72 73 61 76 |ndbroky |= strsav|
|00000bd0| 65 28 62 72 6f 62 6c 6b | 2d 3e 62 74 70 61 67 65 |e(broblk|->btpage|
|00000be0| 5b 62 72 6f 62 6c 6b 2d | 3e 63 65 6c 6c 69 63 6e |[broblk-|>cellicn|
|00000bf0| 74 2d 31 5d 2e 73 6b 65 | 79 6e 6d 65 2c 0d 0a 20 |t-1].ske|ynme,.. |
|00000c00| 20 20 20 20 20 20 20 20 | 62 74 70 61 72 6d 73 74 | |btparmst|
|00000c10| 2d 3e 62 74 6b 65 79 6c | 65 6e 20 2b 20 31 29 3b |->btkeyl|en + 1);|
|00000c20| 0d 0a 0d 0a 20 20 20 63 | 70 79 6c 6f 63 20 3d 20 |.... c|pyloc = |
|00000c30| 70 62 6c 6b 2d 3e 62 77 | 64 70 61 67 65 3b 0d 0a |pblk->bw|dpage;..|
|00000c40| 0d 0a 20 20 20 77 68 69 | 6c 65 20 28 20 28 6c 76 |.. whi|le ( (lv|
|00000c50| 6c 6e 6f 64 65 20 3d 20 | 70 6f 70 74 6f 70 28 29 |lnode = |poptop()|
|00000c60| 20 29 20 21 3d 20 28 6c | 6f 6e 67 29 20 4e 55 4c | ) != (l|ong) NUL|
|00000c70| 4c 29 7b 0d 0a 20 20 20 | 20 20 20 67 65 74 69 64 |L){.. | getid|
|00000c80| 78 72 28 66 64 69 64 78 | 2c 20 6c 76 6c 6e 6f 64 |xr(fdidx|, lvlnod|
|00000c90| 65 2c 20 62 72 6f 62 6c | 6b 2c 20 62 74 70 61 72 |e, brobl|k, btpar|
|00000ca0| 6d 73 74 2d 3e 62 74 69 | 64 78 6c 65 6e 2c 20 62 |mst->bti|dxlen, b|
|00000cb0| 74 70 61 72 6d 73 74 2d | 3e 62 74 6b 65 79 6c 65 |tparmst-|>btkeyle|
|00000cc0| 6e 29 3b 0d 0a 20 20 20 | 20 20 20 69 20 3d 20 30 |n);.. | i = 0|
|00000cd0| 3b 0d 0a 0d 0a 20 20 20 | 20 20 20 77 68 69 6c 65 |;.... | while|
|00000ce0| 20 28 62 72 6f 62 6c 6b | 2d 3e 62 74 70 61 67 65 | (broblk|->btpage|
|00000cf0| 5b 69 2b 2b 5d 2e 62 74 | 70 74 72 20 21 3d 20 63 |[i++].bt|ptr != c|
|00000d00| 70 79 6c 6f 63 29 7b 0d | 0a 20 20 20 20 20 20 20 |pyloc){.|. |
|00000d10| 20 20 2f 2a 20 74 68 65 | 6e 20 63 6f 70 69 65 64 | /* the|n copied|
|00000d20| 20 66 72 6f 6d 20 6c 65 | 66 74 20 74 72 65 65 20 | from le|ft tree |
|00000d30| 62 72 61 6e 63 68 2c 20 | 75 70 64 61 74 65 20 75 |branch, |update u|
|00000d40| 70 70 65 72 20 6c 65 76 | 65 6c 20 2a 2f 0d 0a 20 |pper lev|el */.. |
|00000d50| 20 20 20 20 20 20 20 20 | 69 66 28 69 20 3e 3d 20 | |if(i >= |
|00000d60| 62 72 6f 62 6c 6b 2d 3e | 63 65 6c 6c 69 63 6e 74 |broblk->|cellicnt|
|00000d70| 29 7b 0d 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |){.. | |
|00000d80| 6c 76 6c 6e 6f 64 65 20 | 3d 20 62 72 6f 62 6c 6b |lvlnode |= broblk|
|00000d90| 2d 3e 62 77 64 70 61 67 | 65 3b 0d 0a 20 20 20 20 |->bwdpag|e;.. |
|00000da0| 20 20 20 20 20 20 20 20 | 67 65 74 69 64 78 72 28 | |getidxr(|
|00000db0| 66 64 69 64 78 2c 20 6c | 76 6c 6e 6f 64 65 2c 20 |fdidx, l|vlnode, |
|00000dc0| 62 72 6f 62 6c 6b 2c 20 | 62 74 70 61 72 6d 73 74 |broblk, |btparmst|
|00000dd0| 2d 3e 62 74 69 64 78 6c | 65 6e 2c 20 62 74 70 61 |->btidxl|en, btpa|
|00000de0| 72 6d 73 74 2d 3e 62 74 | 6b 65 79 6c 65 6e 29 3b |rmst->bt|keylen);|
|00000df0| 0d 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 69 20 |.. | i |
|00000e00| 3d 20 30 3b 0d 0a 20 20 | 20 20 20 20 20 20 20 7d |= 0;.. | }|
|00000e10| 0d 0a 20 20 20 20 20 20 | 7d 0d 0a 0d 0a 20 20 20 |.. |}.... |
|00000e20| 20 20 20 73 74 72 63 70 | 79 28 62 72 6f 62 6c 6b | strcp|y(broblk|
|00000e30| 2d 3e 62 74 70 61 67 65 | 5b 2d 2d 69 5d 2e 73 6b |->btpage|[--i].sk|
|00000e40| 65 79 6e 6d 65 2c 20 65 | 6e 64 62 72 6f 6b 79 29 |eynme, e|ndbroky)|
|00000e50| 3b 0d 0a 0d 0a 20 20 20 | 20 20 20 70 75 74 69 64 |;.... | putid|
|00000e60| 78 72 28 66 64 69 64 78 | 2c 20 6c 76 6c 6e 6f 64 |xr(fdidx|, lvlnod|
|00000e70| 65 2c 20 62 72 6f 62 6c | 6b 2c 20 62 74 70 61 72 |e, brobl|k, btpar|
|00000e80| 6d 73 74 29 3b 0d 0a 20 | 20 20 20 20 20 63 70 79 |mst);.. | cpy|
|00000e90| 6c 6f 63 20 3d 20 6c 76 | 6c 6e 6f 64 65 3b 0d 0a |loc = lv|lnode;..|
|00000ea0| 20 20 20 20 20 20 73 74 | 72 63 70 79 28 65 6e 64 | st|rcpy(end|
|00000eb0| 62 72 6f 6b 79 2c 20 62 | 72 6f 62 6c 6b 2d 3e 62 |broky, b|roblk->b|
|00000ec0| 74 70 61 67 65 5b 62 72 | 6f 62 6c 6b 2d 3e 63 65 |tpage[br|oblk->ce|
|00000ed0| 6c 6c 69 63 6e 74 20 2d | 20 31 5d 2e 73 6b 65 79 |llicnt -| 1].skey|
|00000ee0| 6e 6d 65 29 3b 0d 0a 20 | 20 20 7d 0d 0a 0d 0a 20 |nme);.. | }.... |
|00000ef0| 20 20 66 72 65 65 6b 65 | 79 73 28 62 72 6f 62 6c | freeke|ys(brobl|
|00000f00| 6b 29 3b 0d 0a 20 20 20 | 46 52 45 45 28 62 72 6f |k);.. |FREE(bro|
|00000f10| 62 6c 6b 29 3b 0d 0a 20 | 20 20 46 52 45 45 28 65 |blk);.. | FREE(e|
|00000f20| 6e 64 62 72 6f 6b 79 29 | 3b 0d 0a 0d 0a 20 20 20 |ndbroky)|;.... |
|00000f30| 72 65 74 75 72 6e 28 31 | 29 3b 0d 0a 7d 0d 0a 0d |return(1|);..}...|
|00000f40| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+