/******************************************************************************* * * Project: seft (search engine for text) * * File: tst.h * * Author: Owen de Kretser (oldk@cs.mu.oz.au) * * Organisation: Dept. of CS&SE, University of Melbourne * * Date: April 1999 * * Purpose: ternary search tree functions * * Notes: adapted from Bentley & Sedgewick * *******************************************************************************/ #ifndef __TST #define __TST /***** #includes **************************************************************/ #include #include #include #include "types.h" /***** #defines ***************************************************************/ #define NOT_FOUND -1 /***** Data Structures ********************************************************/ typedef struct tnode *Tptr; typedef struct tnode { char splitchar; Tptr lokid, eqkid, hikid; int term_index; } Tnode; Tptr root; /***** Function Prototypes ****************************************************/ Tptr tst_insert(Tptr p, char *s, int); void cleanup(Tptr p); int tst_search(Tptr root, char *s); /******************************************************************************/ #endif