home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_100 / 155_01 / beeprot.h < prev    next >
Text File  |  1990-10-09  |  2KB  |  109 lines

  1. /* btree function prototype        */
  2.  
  3. FILE *open_keyfile(
  4.     char *filename, 
  5.     struct keyinfo *fileinfo
  6.     );   /* used to open keyfile */
  7.  
  8. void close_keyfile(
  9.     struct keyinfo *fileinfo
  10.     );   /* write out header information and close file */
  11.  
  12. int write_node(
  13.     long nbr, 
  14.     struct node *nodeinfo, 
  15.     struct keyinfo *fileinfo
  16.     );   /* write a node's info to file */
  17.  
  18. void print_node(
  19.     struct node *node1
  20.     );  /* display contents of a node on screen (debug) */
  21.  
  22. void push_left_stack(
  23.     long nbr
  24.     );  /* moved left in tree - record this in stack */
  25.  
  26. void push_right_stack(
  27.     long nbr
  28.     );  /* moved right in tree - record this in stack */
  29.  
  30. long pop_right_stack();
  31.  
  32. long pop_left_stack();
  33.  
  34. void get_node(
  35.     long nbr, 
  36.     struct node *nodeinfo, 
  37.     struct keyinfo *fileinfo
  38.     );  /* read the info stored in node NBR */
  39.  
  40. int insert(
  41.     char *argkey, 
  42.     long recnbr, 
  43.     struct keyinfo *fileinfo
  44.     );  /* insert key (argkey) into tree */
  45.  
  46. void link(
  47.     int alpha1, 
  48.     struct node *node1, 
  49.     int alpha2, 
  50.     struct node *node2
  51.     );
  52.  
  53. void nbr_link(
  54.     long *nbr, 
  55.     int alpha, 
  56.     struct node *node1
  57.     );  /* set a record number according to alpha */
  58.  
  59. void link_nbr(
  60.     int alpha, 
  61.     struct node *node1, 
  62.     long nbr
  63.     ); /* set a link according to alpha */
  64.  
  65. void node_bal(
  66.     int alpha, 
  67.     struct node *node1, 
  68.     struct node *node2, 
  69.     struct node *node3
  70.     );  /* node balancing in Step A9 */
  71.  
  72. void delete_key(
  73.     long node_nbr, 
  74.     struct node *current_node, 
  75.     struct keyinfo *fileinfo
  76.     );
  77.  
  78. int get_next(
  79.     long *node_nbr, 
  80.     struct node *current_node, 
  81.     struct keyinfo *fileinfo
  82.     );  /* retrieve next higher node */
  83.  
  84. int find_key(
  85.     char *key1,
  86.     long *node_nbr, 
  87.     struct node *current_node, 
  88.     struct keyinfo *fileinfo
  89.     ); /* locate a key */
  90.  
  91. int get_last(
  92.     long *node_nbr, 
  93.     struct node *current_node, 
  94.     struct keyinfo *fileinfo
  95.     ); /* get a last record */
  96.  
  97. int get_first(
  98.     long *node_nbr, 
  99.     struct node *current_node, 
  100.     struct keyinfo *fileinfo
  101.     ); /* get a first record */
  102.  
  103. int get_previous(
  104.     long *node_nbr, 
  105.     struct node *current_node, 
  106.     struct keyinfo *fileinfo
  107.     );
  108. /*-------- end of beeprot.h -------------*/
  109.