home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c006 / 1.ddi / UPDILVL.C < prev    next >
DOS BACKUP file  |  1987-11-04  |  2.1 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: UPDILVL.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\UPDILVL.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 55 50 44 | 49 4c 56 4c 2e 43 00 00 |RARY\UPD|ILVL.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 1a 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 75 20 70 20 64 20 69 | 20 6c 20 76 20 6c 20 2e | u p d i| l v l .|
|000000e0| 20 63 20 20 39 2f 31 39 | 2f 38 37 20 20 20 20 20 | c 9/19|/87 |
|000000f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000100| 2a 2f 0d 0a 2f 2a 20 54 | 48 49 53 20 50 52 4f 47 |*/../* T|HIS PROG|
|00000110| 52 41 4d 20 42 45 4c 4f | 4e 47 53 20 54 4f 20 57 |RAM BELO|NGS TO W|
|00000120| 41 4c 54 45 52 20 4c 2e | 20 50 45 41 43 4f 43 4b |ALTER L.| PEACOCK|
|00000130| 2e 20 20 49 54 20 49 53 | 20 43 4f 4e 53 49 44 45 |. IT IS| CONSIDE|
|00000140| 52 45 44 20 41 20 54 52 | 41 44 45 20 2a 2f 0d 0a |RED A TR|ADE */..|
|00000150| 2f 2a 20 53 45 43 52 45 | 54 20 41 4e 44 20 49 53 |/* SECRE|T AND IS|
|00000160| 20 4e 4f 54 20 54 4f 20 | 42 45 20 44 49 56 55 4c | NOT TO |BE DIVUL|
|00000170| 47 45 44 20 4f 52 20 55 | 53 45 44 20 42 59 20 50 |GED OR U|SED BY P|
|00000180| 41 52 54 49 45 53 20 57 | 48 4f 20 48 41 56 45 20 |ARTIES W|HO HAVE |
|00000190| 4e 4f 54 20 20 20 20 2a | 2f 0d 0a 2f 2a 20 52 45 |NOT *|/../* RE|
|000001a0| 43 45 49 56 45 44 20 57 | 52 49 54 54 45 4e 20 41 |CEIVED W|RITTEN A|
|000001b0| 55 54 48 4f 52 49 5a 41 | 54 49 4f 4e 20 46 52 4f |UTHORIZA|TION FRO|
|000001c0| 4d 20 54 48 45 20 4f 57 | 4e 45 52 2e 20 20 20 20 |M THE OW|NER. |
|000001d0| 20 20 20 20 20 20 2a 2f | 0d 0a 2f 2a 2d 2d 2d 2d | */|../*----|
|000001e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000001f0| 2d 2d 2d 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 | 20 0d 0a 20 2a 20 75 70 |--------| .. * up|
|00000230| 64 69 6c 76 6c 28 29 20 | 77 69 6c 6c 20 75 70 64 |dilvl() |will upd|
|00000240| 61 74 65 20 74 68 65 20 | 75 70 70 65 72 20 6c 65 |ate the |upper le|
|00000250| 76 65 6c 20 69 6e 64 65 | 78 20 6e 6f 64 65 20 77 |vel inde|x node w|
|00000260| 68 65 6e 20 74 68 65 20 | 45 4e 44 20 4b 45 59 0d |hen the |END KEY.|
|00000270| 0a 20 2a 20 6f 66 20 61 | 20 6c 6f 77 65 72 20 6c |. * of a| lower l|
|00000280| 65 76 65 6c 20 6e 6f 64 | 65 20 69 73 20 64 65 6c |evel nod|e is del|
|00000290| 65 74 65 64 2e 20 20 54 | 68 65 20 6e 65 77 20 65 |eted. T|he new e|
|000002a0| 6e 64 20 6b 65 79 20 69 | 73 20 63 6f 70 69 65 64 |nd key i|s copied|
|000002b0| 20 69 6e 74 6f 20 74 68 | 65 20 0d 0a 20 2a 20 75 | into th|e .. * u|
|000002c0| 70 70 65 72 20 6c 65 76 | 65 6c 20 69 6e 64 65 78 |pper lev|el index|
|000002d0| 20 6e 6f 64 65 20 61 6e | 64 20 72 65 70 65 61 74 | node an|d repeat|
|000002e0| 65 64 20 61 73 20 6e 65 | 65 64 65 64 20 66 6f 72 |ed as ne|eded for|
|000002f0| 20 65 61 63 68 20 75 70 | 70 65 72 20 6c 65 76 65 | each up|per leve|
|00000300| 6c 2e 0d 0a 20 2a 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |l... *--|--------|
|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 2d 2d 2d 2d 2d |--------|--------|
|00000350| 2d 2a 2f 0d 0a 0d 0a 23 | 69 6e 63 6c 75 64 65 20 |-*/....#|include |
|00000360| 22 63 62 74 72 65 65 2e | 68 22 0d 0a 0d 0a 69 6e |"cbtree.|h"....in|
|00000370| 74 20 75 70 64 69 6c 76 | 6c 28 66 64 69 64 78 2c |t updilv|l(fdidx,|
|00000380| 20 6e 6f 64 65 2c 20 6b | 65 79 73 74 72 2c 20 62 | node, k|eystr, b|
|00000390| 74 70 61 72 6d 73 74 29 | 0d 0a 69 6e 74 20 66 64 |tparmst)|..int fd|
|000003a0| 69 64 78 3b 0d 0a 6c 6f | 6e 67 20 6e 6f 64 65 3b |idx;..lo|ng node;|
|000003b0| 20 20 20 20 20 2f 2a 20 | 6f 72 69 67 69 6e 61 6c | /* |original|
|000003c0| 20 6e 6f 64 65 20 2a 2f | 0d 0a 63 68 61 72 20 2a | node */|..char *|
|000003d0| 6b 65 79 73 74 72 3b 20 | 20 2f 2a 20 74 68 61 74 |keystr; | /* that|
|000003e0| 20 6e 6f 64 65 27 73 20 | 65 6e 64 20 6b 65 79 20 | node's |end key |
|000003f0| 2a 2f 0d 0a 73 74 72 75 | 63 74 20 62 74 63 6f 6d |*/..stru|ct btcom|
|00000400| 6d 6f 20 2a 62 74 70 61 | 72 6d 73 74 3b 0d 0a 7b |mo *btpa|rmst;..{|
|00000410| 0d 0a 20 20 20 65 78 74 | 65 72 6e 20 6c 6f 6e 67 |.. ext|ern long|
|00000420| 20 70 6f 70 74 6f 70 28 | 29 3b 0d 0a 20 20 20 65 | poptop(|);.. e|
|00000430| 78 74 65 72 6e 20 63 68 | 61 72 20 2a 63 61 6c 6c |xtern ch|ar *call|
|00000440| 6f 63 28 29 3b 0d 0a 20 | 20 20 65 78 74 65 72 6e |oc();.. | extern|
|00000450| 20 69 6e 74 20 73 74 72 | 63 6d 70 28 29 3b 0d 0a | int str|cmp();..|
|00000460| 20 20 20 65 78 74 65 72 | 6e 20 76 6f 69 64 20 66 | exter|n void f|
|00000470| 72 65 65 28 29 3b 0d 0a | 20 20 20 65 78 74 65 72 |ree();..| exter|
|00000480| 6e 20 69 6e 74 20 73 70 | 3b 0d 0a 20 20 20 73 74 |n int sp|;.. st|
|00000490| 61 74 69 63 20 42 54 49 | 44 58 42 4c 4b 20 2a 6c |atic BTI|DXBLK *l|
|000004a0| 76 6c 62 6c 6b 3b 0d 0a | 20 20 20 6c 6f 6e 67 20 |vlblk;..| long |
|000004b0| 69 6e 74 20 6c 76 6c 6e | 6f 64 65 3b 0d 0a 20 20 |int lvln|ode;.. |
|000004c0| 20 69 6e 74 20 73 61 76 | 73 70 3b 0d 0a 20 20 20 | int sav|sp;.. |
|000004d0| 72 65 67 69 73 74 65 72 | 20 69 6e 74 20 69 3b 0d |register| int i;.|
|000004e0| 0a 0d 0a 20 20 20 2f 2a | 20 61 6c 6c 6f 63 61 74 |... /*| allocat|
|000004f0| 65 20 73 70 61 63 65 20 | 66 6f 72 20 74 68 65 20 |e space |for the |
|00000500| 70 61 72 65 6e 74 20 6e | 6f 64 65 20 2a 2f 0d 0a |parent n|ode */..|
|00000510| 20 20 20 69 20 3d 20 73 | 69 7a 65 6f 66 28 42 54 | i = s|izeof(BT|
|00000520| 49 44 58 42 4c 4b 29 20 | 2b 20 62 74 70 61 72 6d |IDXBLK) |+ btparm|
|00000530| 73 74 2d 3e 62 74 63 65 | 6c 6c 73 20 2a 20 73 69 |st->btce|lls * si|
|00000540| 7a 65 6f 66 28 42 54 49 | 44 58 29 3b 0d 0a 20 20 |zeof(BTI|DX);.. |
|00000550| 20 69 66 28 20 21 28 6c | 76 6c 62 6c 6b 20 3d 20 | if( !(l|vlblk = |
|00000560| 28 42 54 49 44 58 42 4c | 4b 20 2a 29 20 63 61 6c |(BTIDXBL|K *) cal|
|00000570| 6c 6f 63 28 69 2c 20 53 | 5a 43 48 41 52 29 20 29 |loc(i, S|ZCHAR) )|
|00000580| 29 0d 0a 20 20 20 20 20 | 20 63 6b 65 72 72 6f 72 |).. | ckerror|
|00000590| 28 2d 20 43 4b 5f 4e 4f | 4d 45 4d 2c 20 22 39 39 |(- CK_NO|MEM, "99|
|000005a0| 22 29 3b 0d 0a 0d 0a 20 | 20 20 73 61 76 73 70 20 |");.... | savsp |
|000005b0| 3d 20 73 70 3b 20 20 20 | 20 20 2f 2a 20 73 61 76 |= sp; | /* sav|
|000005c0| 65 20 74 68 65 20 73 74 | 61 63 6b 20 70 6f 69 6e |e the st|ack poin|
|000005d0| 74 65 72 20 2a 2f 0d 0a | 0d 0a 20 20 20 77 68 69 |ter */..|.. whi|
|000005e0| 6c 65 28 20 28 6c 76 6c | 6e 6f 64 65 20 3d 20 70 |le( (lvl|node = p|
|000005f0| 6f 70 74 6f 70 28 29 20 | 29 20 21 3d 20 30 4c 29 |optop() |) != 0L)|
|00000600| 7b 0d 0a 20 20 20 20 20 | 20 67 65 74 69 64 78 72 |{.. | getidxr|
|00000610| 28 66 64 69 64 78 2c 20 | 6c 76 6c 6e 6f 64 65 2c |(fdidx, |lvlnode,|
|00000620| 20 6c 76 6c 62 6c 6b 2c | 20 62 74 70 61 72 6d 73 | lvlblk,| btparms|
|00000630| 74 2d 3e 62 74 69 64 78 | 6c 65 6e 2c 20 62 74 70 |t->btidx|len, btp|
|00000640| 61 72 6d 73 74 2d 3e 62 | 74 6b 65 79 6c 65 6e 29 |armst->b|tkeylen)|
|00000650| 3b 0d 0a 20 20 20 20 20 | 20 69 20 3d 20 30 3b 0d |;.. | i = 0;.|
|00000660| 0a 20 20 20 20 20 20 0d | 0a 20 20 20 20 20 20 77 |. .|. w|
|00000670| 68 69 6c 65 20 28 6c 76 | 6c 62 6c 6b 2d 3e 62 74 |hile (lv|lblk->bt|
|00000680| 70 61 67 65 5b 69 2b 2b | 5d 2e 62 74 70 74 72 20 |page[i++|].btptr |
|00000690| 21 3d 20 6e 6f 64 65 29 | 7b 20 20 20 2f 2a 20 6c |!= node)|{ /* l|
|000006a0| 6f 63 20 6c 6f 77 65 72 | 20 6e 6f 64 65 20 70 74 |oc lower| node pt|
|000006b0| 72 20 2a 2f 0d 0a 20 20 | 20 20 20 20 20 20 20 69 |r */.. | i|
|000006c0| 66 28 69 20 3e 3d 20 6c | 76 6c 62 6c 6b 2d 3e 63 |f(i >= l|vlblk->c|
|000006d0| 65 6c 6c 69 63 6e 74 29 | 0d 0a 20 20 20 20 20 20 |ellicnt)|.. |
|000006e0| 20 20 20 20 20 20 63 6b | 65 72 72 6f 72 28 2d 20 | ck|error(- |
|000006f0| 43 4b 5f 49 4e 44 58 2c | 20 22 31 30 30 22 29 3b |CK_INDX,| "100");|
|00000700| 0d 0a 20 20 20 20 20 20 | 7d 0d 0a 20 20 20 20 20 |.. |}.. |
|00000710| 20 69 2d 2d 3b 0d 0a 0d | 0a 20 20 20 20 20 20 73 | i--;...|. s|
|00000720| 74 72 63 70 79 28 6c 76 | 6c 62 6c 6b 2d 3e 62 74 |trcpy(lv|lblk->bt|
|00000730| 70 61 67 65 5b 69 5d 2e | 73 6b 65 79 6e 6d 65 2c |page[i].|skeynme,|
|00000740| 20 6b 65 79 73 74 72 29 | 3b 0d 0a 20 20 20 20 20 | keystr)|;.. |
|00000750| 20 70 75 74 69 64 78 72 | 28 66 64 69 64 78 2c 20 | putidxr|(fdidx, |
|00000760| 6c 76 6c 6e 6f 64 65 2c | 20 6c 76 6c 62 6c 6b 2c |lvlnode,| lvlblk,|
|00000770| 20 62 74 70 61 72 6d 73 | 74 29 3b 0d 0a 0d 0a 20 | btparms|t);.... |
|00000780| 20 20 20 20 20 69 66 20 | 28 69 20 3c 20 6c 76 6c | if |(i < lvl|
|00000790| 62 6c 6b 2d 3e 63 65 6c | 6c 69 63 6e 74 20 2d 31 |blk->cel|licnt -1|
|000007a0| 29 20 20 20 2f 2a 20 74 | 68 65 6e 20 6e 6f 74 20 |) /* t|hen not |
|000007b0| 61 6e 20 65 6e 64 20 70 | 6f 69 6e 74 20 2a 2f 0d |an end p|oint */.|
|000007c0| 0a 20 20 20 20 20 20 20 | 20 20 62 72 65 61 6b 3b |. | break;|
|000007d0| 0d 0a 0d 0a 20 20 20 20 | 20 20 6e 6f 64 65 20 3d |.... | node =|
|000007e0| 20 6c 76 6c 6e 6f 64 65 | 3b 20 20 20 2f 2a 20 63 | lvlnode|; /* c|
|000007f0| 6f 6e 74 69 6e 75 65 20 | 62 61 63 6b 20 75 70 20 |ontinue |back up |
|00000800| 74 68 65 20 74 72 65 65 | 20 2a 2f 0d 0a 20 20 20 |the tree| */.. |
|00000810| 7d 0d 0a 0d 0a 20 20 20 | 66 72 65 65 6b 65 79 73 |}.... |freekeys|
|00000820| 28 6c 76 6c 62 6c 6b 29 | 3b 0d 0a 20 20 20 46 52 |(lvlblk)|;.. FR|
|00000830| 45 45 28 6c 76 6c 62 6c | 6b 29 3b 0d 0a 20 20 20 |EE(lvlbl|k);.. |
|00000840| 0d 0a 20 20 20 73 70 20 | 3d 20 73 61 76 73 70 3b |.. sp |= savsp;|
|00000850| 20 20 20 20 20 2f 2a 20 | 72 65 73 74 6f 72 65 20 | /* |restore |
|00000860| 74 68 65 20 73 74 61 63 | 6b 20 2a 2f 0d 0a 0d 0a |the stac|k */....|
|00000870| 20 20 20 72 65 74 75 72 | 6e 28 42 54 43 41 4c 4c | retur|n(BTCALL|
|00000880| 4f 4b 29 3b 0d 0a 7d 0d | 0a 0d 0a |OK);..}.|... |
+--------+-------------------------+-------------------------+--------+--------+