Category : C Source Code
Archive   : BTREE2.ZIP
Filename : BTREE.H
Output of file : BTREE.H contained in archive : BTREE2.ZIP
/* Author: Ray Swartz
* P.O. Box 2528
* Santa Cruz, Calif. 95063
* Last Modified: 4/28/85
*
* ANY USE OF THESE LIBRARY ROUTINES EITHER PERSONAL OR COMMERCIAL
* IS ALLOWED UPON THE CONDITION THAT THE USER IDENTIFY THEM
* AS BEING USED IN THE PROGRAM. IDENTIFYING INFORMATION MUST
* APPEAR IN THE PROGRAM DOCUMENTATION OR ON THE TERMINAL SCREEN.
*
* #################################
* # UNATTRIBUTED USE IS FORBIDDEN #
* #################################
*
*/
#define NOT_FOUND -1
#define AT_END -2
#define YES 1
#define NO 0
#define TOP -1 /* flag to show if top of list = rotate node */
#define END 0 /* end pointer in a node */
#define QUIT 0 /* menu options */
#define FIND 1
#define INSERT 2
#define NEXT 3
#define PREVIOUS 4
#define DELETE 5
#define CLEAR_END_OF_PAGE printf("%cY",27); /* for televideo 925 */
#define BELL putchar(7);
#define DATA_LENGTH 19 /* characters in first record of key file */
#define MAX_NODES 100000 /* maximum nodes allowed in a keyfile */
struct keyinfo { /* Header information on each open keyfile */
FILE *file; /* file pointer to keyfile */
int keylength; /* Length of file key */
long next_avail; /* Next free node in tree (nbr_in_list + 1) */
long list_head; /* Node number at the head of the list */
long nbr_in_list; /* Number of (active) nodes in the tree */
};
struct node { /* The composition of a tree-node */
long rec_nbr; /* The pointer to the data file record */
long left_link; /* The node to this one's immediate left */
long right_link; /* The node to this one's immediate right */
char *key; /* Pointer to this record's key */
int delete_flag; /* 1 if deleted, 0 if live */
int balance; /* -1 left subtree longer, 0 even, +1 right bigger */
};
#define STACK_LENGTH 50 /* length of history stacks */
struct stack { /* tree traversal stack */
long element[STACK_LENGTH]; /* Node number pushed onto history stack */
int level[STACK_LENGTH]; /* Stack level of this element */
int stack_cntr; /* Top of stack */
} right_history, left_history;
int stack_level; /* tree level at present */
char instr[256]; /* general string input */
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/