home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c006 / 2.ddi / BTPARALL.C < prev    next >
DOS BACKUP file  |  1987-11-04  |  2.0 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: BTPARALL.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\PROGRAMS\BTPARALL.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 50 52 4f |.....\CB|TREE\PRO|
|00000010| 47 52 41 4d 53 5c 42 54 | 50 41 52 41 4c 4c 2e 43 |GRAMS\BT|PARALL.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 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| 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 2a 2f 0d 0a 0d 0a 2f |served | */..../|
|000000d0| 2a 20 54 48 49 53 20 50 | 52 4f 47 52 41 4d 20 42 |* THIS P|ROGRAM B|
|000000e0| 45 4c 4f 4e 47 53 20 54 | 4f 20 57 41 4c 54 45 52 |ELONGS T|O WALTER|
|000000f0| 20 4c 2e 20 50 45 41 43 | 4f 43 4b 2e 20 20 49 54 | L. PEAC|OCK. IT|
|00000100| 20 49 53 20 43 4f 4e 53 | 49 44 45 52 45 44 20 41 | IS CONS|IDERED A|
|00000110| 20 54 52 41 44 45 20 2a | 2f 0d 0a 2f 2a 20 53 45 | TRADE *|/../* SE|
|00000120| 43 52 45 54 20 41 4e 44 | 20 49 53 20 4e 4f 54 20 |CRET AND| IS NOT |
|00000130| 54 4f 20 42 45 20 44 49 | 56 55 4c 47 45 44 20 4f |TO BE DI|VULGED O|
|00000140| 52 20 55 53 45 44 20 42 | 59 20 50 41 52 54 49 45 |R USED B|Y PARTIE|
|00000150| 53 20 57 48 4f 20 48 41 | 56 45 20 4e 4f 54 20 20 |S WHO HA|VE NOT |
|00000160| 20 2a 2f 0d 0a 2f 2a 20 | 52 45 43 45 49 56 45 44 | */../* |RECEIVED|
|00000170| 20 57 52 49 54 54 45 4e | 20 41 55 54 48 4f 52 49 | WRITTEN| AUTHORI|
|00000180| 5a 41 54 49 4f 4e 20 46 | 52 4f 4d 20 54 48 45 20 |ZATION F|ROM THE |
|00000190| 4f 57 4e 45 52 2e 20 20 | 20 20 20 20 20 20 20 20 |OWNER. | |
|000001a0| 20 20 20 20 20 20 20 20 | 2a 2f 0d 0a 0d 0a 2f 2a | |*/..../*|
|000001b0| 20 62 20 74 20 72 20 70 | 20 61 20 72 20 61 20 6c | b t r p| a r a l|
|000001c0| 20 6c 20 2e 20 63 20 20 | 20 20 20 20 6c 61 73 74 | l . c | last|
|000001d0| 20 6d 6f 64 3a 20 31 31 | 2f 32 33 2f 38 34 20 20 | mod: 11|/23/84 |
|000001e0| 20 2a 2f 0d 0a 2f 2a 20 | 20 70 61 72 73 65 20 62 | */../* | parse b|
|000001f0| 74 72 65 65 20 61 6e 64 | 20 70 72 69 6e 74 20 6b |tree and| print k|
|00000200| 65 79 73 20 61 6e 64 20 | 72 65 63 6f 72 64 20 6c |eys and |record l|
|00000210| 6f 63 61 74 69 6f 6e 73 | 20 6f 6e 20 74 68 65 20 |ocations| on the |
|00000220| 70 72 69 6e 74 65 72 2e | 20 20 20 20 20 20 2a 2f |printer.| */|
|00000230| 0d 0a 0d 0a 23 69 6e 63 | 6c 75 64 65 20 3c 73 74 |....#inc|lude <st|
|00000240| 64 69 6f 2e 68 3e 0d 0a | 23 69 6e 63 6c 75 64 65 |dio.h>..|#include|
|00000250| 20 22 63 62 74 72 65 65 | 2e 68 22 0d 0a 2f 2a 20 | "cbtree|.h"../* |
|00000260| 62 74 66 69 6f 2e 68 20 | 2a 6d 75 73 74 2a 20 62 |btfio.h |*must* b|
|00000270| 65 20 69 6e 63 6c 75 64 | 65 64 20 77 68 65 6e 20 |e includ|ed when |
|00000280| 62 74 5f 6f 70 65 6e 28 | 29 20 69 73 20 75 73 65 |bt_open(|) is use|
|00000290| 64 20 2a 2f 0d 0a 23 69 | 6e 63 6c 75 64 65 20 22 |d */..#i|nclude "|
|000002a0| 62 74 66 69 6f 2e 68 22 | 0d 0a 0d 0a 76 6f 69 64 |btfio.h"|....void|
|000002b0| 20 6d 61 69 6e 28 61 72 | 67 63 2c 20 61 72 67 76 | main(ar|gc, argv|
|000002c0| 29 0d 0a 69 6e 74 20 61 | 72 67 63 3b 0d 0a 63 68 |)..int a|rgc;..ch|
|000002d0| 61 72 20 2a 2a 61 72 67 | 76 3b 0d 0a 7b 0d 0a 20 |ar **arg|v;..{.. |
|000002e0| 20 20 65 78 74 65 72 6e | 20 6c 6f 6e 67 20 67 65 | extern| long ge|
|000002f0| 74 72 6f 6f 74 28 29 2c | 20 61 74 6f 6c 28 29 3b |troot(),| atol();|
|00000300| 0d 0a 20 20 20 65 78 74 | 65 72 6e 20 69 6e 74 20 |.. ext|ern int |
|00000310| 20 20 62 74 5f 6c 74 6f | 61 28 29 3b 20 20 20 20 | bt_lto|a(); |
|00000320| 20 20 2f 2a 20 63 75 73 | 74 6f 6d 20 63 62 74 72 | /* cus|tom cbtr|
|00000330| 65 65 20 72 6f 75 74 69 | 6e 65 3a 20 73 65 65 20 |ee routi|ne: see |
|00000340| 6c 74 6f 61 2e 63 20 2a | 2f 0d 0a 20 20 20 65 78 |ltoa.c *|/.. ex|
|00000350| 74 65 72 6e 20 63 68 61 | 72 20 2a 73 74 72 63 70 |tern cha|r *strcp|
|00000360| 79 28 29 2c 20 2a 63 61 | 6c 6c 6f 63 28 29 3b 0d |y(), *ca|lloc();.|
|00000370| 0a 20 20 20 65 78 74 65 | 72 6e 20 76 6f 69 64 20 |. exte|rn void |
|00000380| 20 66 72 65 65 28 29 3b | 0d 0a 20 20 20 65 78 74 | free();|.. ext|
|00000390| 65 72 6e 20 46 49 4c 45 | 20 2a 66 6f 70 65 6e 28 |ern FILE| *fopen(|
|000003a0| 29 3b 0d 0a 20 20 20 6c | 6f 6e 67 20 72 6f 6f 74 |);.. l|ong root|
|000003b0| 70 74 72 3b 0d 0a 20 20 | 20 73 74 72 75 63 74 20 |ptr;.. | struct |
|000003c0| 62 74 63 6f 6d 6d 6f 20 | 62 74 69 6e 64 65 78 3b |btcommo |btindex;|
|000003d0| 0d 0a 20 20 20 46 49 4c | 45 20 20 2a 66 70 72 6e |.. FIL|E *fprn|
|000003e0| 3b 0d 0a 20 20 20 69 6e | 74 20 66 64 69 64 78 2c |;.. in|t fdidx,|
|000003f0| 20 70 77 69 64 74 68 3b | 0d 0a 20 20 20 63 68 61 | pwidth;|.. cha|
|00000400| 72 20 69 6e 70 63 5b 38 | 5d 3b 0d 0a 0d 0a 20 20 |r inpc[8|];.... |
|00000410| 20 69 66 28 20 28 66 70 | 72 6e 20 3d 20 66 6f 70 | if( (fp|rn = fop|
|00000420| 65 6e 28 50 52 49 4e 54 | 45 52 2c 22 77 22 29 20 |en(PRINT|ER,"w") |
|00000430| 29 20 3d 3d 20 4e 55 4c | 4c 29 20 20 20 20 2f 2a |) == NUL|L) /*|
|00000440| 20 73 65 65 20 63 62 74 | 72 64 65 66 2e 68 20 2a | see cbt|rdef.h *|
|00000450| 2f 0d 0a 20 20 20 7b 0d | 0a 20 20 20 20 20 20 70 |/.. {.|. p|
|00000460| 75 74 73 28 22 43 61 6e | 27 74 20 66 6f 70 65 6e |uts("Can|'t fopen|
|00000470| 20 70 72 69 6e 74 65 72 | 22 29 3b 0d 0a 20 20 20 | printer|");.. |
|00000480| 20 20 20 65 78 69 74 28 | 45 52 52 29 3b 0d 0a 20 | exit(|ERR);.. |
|00000490| 20 20 7d 0d 0a 20 20 20 | 73 63 72 5f 63 6c 72 28 | }.. |scr_clr(|
|000004a0| 29 3b 0d 0a 20 20 20 73 | 63 72 5f 63 75 72 73 28 |);.. s|cr_curs(|
|000004b0| 35 2c 20 32 30 29 3b 0d | 0a 20 20 20 70 72 69 6e |5, 20);.|. prin|
|000004c0| 74 66 28 22 20 20 20 20 | 50 61 72 73 69 6e 67 20 |tf(" |Parsing |
|000004d0| 20 42 2d 54 72 65 65 2e | 2e 2e 20 22 29 3b 0d 0a | B-Tree.|.. ");..|
|000004e0| 0d 0a 20 20 20 20 20 20 | 20 20 20 2f 2a 20 20 4d |.. | /* M|
|000004f0| 20 41 20 49 20 4e 20 20 | 43 20 4f 20 4e 20 54 20 | A I N |C O N T |
|00000500| 52 20 4f 20 4c 20 20 50 | 20 52 20 4f 20 47 20 52 |R O L P| R O G R|
|00000510| 20 41 20 4d 20 2a 2f 0d | 0a 0d 0a 20 20 20 67 65 | A M */.|... ge|
|00000520| 74 62 6e 61 6d 65 28 61 | 72 67 63 2c 20 61 72 67 |tbname(a|rgc, arg|
|00000530| 76 2c 20 26 62 74 69 6e | 64 65 78 29 3b 0d 0a 0d |v, &btin|dex);...|
|00000540| 0a 20 20 20 69 66 28 28 | 66 64 69 64 78 20 3d 20 |. if((|fdidx = |
|00000550| 62 74 5f 6f 70 65 6e 28 | 62 74 69 6e 64 65 78 2e |bt_open(|btindex.|
|00000560| 69 64 78 6e 61 6d 65 2c | 4f 5f 52 44 57 52 29 29 |idxname,|O_RDWR))|
|00000570| 20 3d 3d 20 45 52 52 29 | 0d 0a 20 20 20 7b 0d 0a | == ERR)|.. {..|
|00000580| 20 20 20 20 20 20 70 72 | 69 6e 74 66 28 22 5c 6e | pr|intf("\n|
|00000590| 42 54 50 41 52 41 4c 4c | 3a 20 63 61 6e 27 74 20 |BTPARALL|: can't |
|000005a0| 6f 70 65 6e 20 66 69 6c | 65 20 27 25 73 27 22 2c |open fil|e '%s'",|
|000005b0| 20 62 74 69 6e 64 65 78 | 2e 69 64 78 6e 61 6d 65 | btindex|.idxname|
|000005c0| 29 3b 0d 0a 20 20 20 20 | 20 20 70 72 69 6e 74 66 |);.. | printf|
|000005d0| 28 22 5c 6e 42 54 50 41 | 52 41 4c 4c 3a 20 72 65 |("\nBTPA|RALL: re|
|000005e0| 2d 72 75 6e 20 42 54 53 | 45 54 55 50 2e 45 58 45 |-run BTS|ETUP.EXE|
|000005f0| 5c 6e 22 29 3b 0d 0a 20 | 20 20 20 20 20 65 78 69 |\n");.. | exi|
|00000600| 74 28 30 29 3b 0d 0a 20 | 20 20 7d 0d 0a 0d 0a 20 |t(0);.. | }.... |
|00000610| 20 20 70 72 69 6e 74 66 | 28 22 5c 6e 42 2b 74 72 | printf|("\nB+tr|
|00000620| 65 65 20 4e 61 6d 65 20 | 3a 20 25 73 20 22 2c 20 |ee Name |: %s ", |
|00000630| 62 74 69 6e 64 65 78 2e | 62 74 6e 61 6d 65 29 3b |btindex.|btname);|
|00000640| 0d 0a 20 20 20 70 72 69 | 6e 74 66 28 22 5c 6e 49 |.. pri|ntf("\nI|
|00000650| 6e 64 65 78 20 46 69 6c | 65 20 4e 61 6d 65 20 3a |ndex Fil|e Name :|
|00000660| 20 25 73 20 22 2c 20 62 | 74 69 6e 64 65 78 2e 69 | %s ", b|tindex.i|
|00000670| 64 78 6e 61 6d 65 29 3b | 0d 0a 0d 0a 20 20 20 72 |dxname);|.... r|
|00000680| 65 70 65 61 74 0d 0a 20 | 20 20 7b 0d 0a 20 20 20 |epeat.. | {.. |
|00000690| 20 20 20 70 72 69 6e 74 | 66 28 22 5c 6e 5c 6e 45 | print|f("\n\nE|
|000006a0| 6e 74 65 72 20 74 68 65 | 20 77 69 64 74 68 20 6f |nter the| width o|
|000006b0| 66 20 79 6f 75 72 20 70 | 61 70 65 72 20 3d 3d 3e |f your p|aper ==>|
|000006c0| 22 29 3b 0d 0a 20 20 20 | 20 20 20 67 65 74 73 28 |");.. | gets(|
|000006d0| 69 6e 70 63 29 3b 0d 0a | 20 20 20 20 20 20 70 77 |inpc);..| pw|
|000006e0| 69 64 74 68 20 3d 20 61 | 74 6f 69 28 69 6e 70 63 |idth = a|toi(inpc|
|000006f0| 29 3b 0d 0a 20 20 20 7d | 0d 0a 20 20 20 75 6e 74 |);.. }|.. unt|
|00000700| 69 6c 28 20 70 77 69 64 | 74 68 20 3e 3d 20 34 30 |il( pwid|th >= 40|
|00000710| 20 20 26 26 20 20 70 77 | 69 64 74 68 20 3c 20 32 | && pw|idth < 2|
|00000720| 35 36 20 29 3b 0d 0a 0d | 0a 20 20 20 72 6f 6f 74 |56 );...|. root|
|00000730| 70 74 72 20 3d 20 67 65 | 74 72 6f 6f 74 28 66 64 |ptr = ge|troot(fd|
|00000740| 69 64 78 2c 20 62 74 69 | 6e 64 65 78 2e 66 69 6e |idx, bti|ndex.fin|
|00000750| 64 72 6f 6f 74 29 3b 20 | 20 20 2f 2a 20 67 65 74 |droot); | /* get|
|00000760| 20 70 74 72 20 74 6f 20 | 69 64 78 20 72 6f 6f 74 | ptr to |idx root|
|00000770| 20 6e 6f 64 65 20 2a 2f | 0d 0a 0d 0a 20 20 20 62 | node */|.... b|
|00000780| 74 70 72 69 6e 74 28 66 | 64 69 64 78 2c 20 66 70 |tprint(f|didx, fp|
|00000790| 72 6e 2c 20 72 6f 6f 74 | 70 74 72 2c 20 70 77 69 |rn, root|ptr, pwi|
|000007a0| 64 74 68 2c 20 26 62 74 | 69 6e 64 65 78 2c 20 31 |dth, &bt|index, 1|
|000007b0| 29 3b 0d 0a 0d 0a 20 20 | 20 63 6c 6f 73 65 28 66 |);.... | close(f|
|000007c0| 64 69 64 78 29 3b 0d 0a | 20 20 20 62 74 72 74 65 |didx);..| btrte|
|000007d0| 72 6d 28 26 62 74 69 6e | 64 65 78 29 3b 0d 0a 20 |rm(&btin|dex);.. |
|000007e0| 20 20 66 70 72 69 6e 74 | 66 28 66 70 72 6e 2c 22 | fprint|f(fprn,"|
|000007f0| 5c 6e 22 29 3b 0d 0a 20 | 20 20 66 63 6c 6f 73 65 |\n");.. | fclose|
|00000800| 28 66 70 72 6e 29 3b 0d | 0a 20 20 20 70 72 69 6e |(fprn);.|. prin|
|00000810| 74 66 28 22 5c 6e 22 29 | 3b 0d 0a 7d 0d 0a 0d 0a |tf("\n")|;..}....|
+--------+-------------------------+-------------------------+--------+--------+