home *** CD-ROM | disk | FTP | other *** search
- /* (C) Copyright 1984,85,86,87 Walter L. Peacock All Rights Reserved */
-
- /* THIS PROGRAM BELONGS TO WALTER L. PEACOCK. IT IS CONSIDERED A TRADE */
- /* SECRET AND IS NOT TO BE DIVULGED OR USED BY PARTIES WHO HAVE NOT */
- /* RECEIVED WRITTEN AUTHORIZATION FROM THE OWNER. */
-
- /* b t p a r c o n . c last mod: 01/24/85 */
- /* parse btree and display keys and record locations on stdout. */
-
- #include <stdio.h>
- #include "cbtree.h"
- /* btfio.h *must* be included when bt_open() is used */
- #include "btfio.h"
-
- #if AmigaDOS & LC
- #define printf iprintf /* use fast integer printf */
- #endif
-
- void main(argc, argv)
- int argc;
- char **argv;
- {
- extern FILE *fopen();
- extern long ftell(), getroot();
- extern int strcat(), strlen(), toupper(), tolower(), open(), close();
- extern char *strcpy(), *calloc();
- extern void exit(), free();
- extern int btprint();
- BTC btindex;
- long rootptr;
- int pwidth, fdidx;
-
- wopen("CON:0/0/640/200/Btparcon");
-
- scr_clr();
- scr_curs(5, 20);
- printf(" Parsing B-Tree Index...\n");
-
- /* M A I N C O N T R O L P R O G R A M */
-
- getbname(argc, argv, &btindex);
-
- if ((fdidx = bt_open(btindex.idxname, O_RDWR)) == ERR)
- {
- printf("\nBTPARCON: can't open file '%s'", btindex.idxname);
- printf("\nBTPARCON: check BTSETUP.EXE or rebuild index.");
- exit(0);
- }
-
- printf("\nB+tree Name : %s", btindex.btname);
- printf("\nIndex File Name : %s", btindex.idxname);
-
- pwidth = 77; /* display width */
-
- rootptr = getroot(fdidx, btindex.findroot); /* get ptr to root node */
-
- btprint(fdidx, stdout, rootptr, pwidth, &btindex, argc == 3);
-
- close(fdidx);
- btrterm(&btindex);
-
- wclose(); /* close Amiga window */
-
- printf("\n");
- }
-