/*============================================================================ * * ESPSEARCH.H - 15 Jan. 1998 - Dave Humphrey - aj589@freenet.carleton.ca * *==========================================================================*/ #ifndef __ESPSEARCH_H #define __ESPSEARCH_H /* Standard include files */ #include #include #include #include #include #include #include #include "../common/gencgi.h" #include "../common/output.h" /* Set to 0 if you're not debugging and don't want all * kinds of messy stuff coming out */ #define DEBUG 0 /* Hmm...I shouldn't have to tell you what this is... */ #define ESP_VERSION "0.40 - 9 February 1999" /* How large of a search string array, ie, how many strings can we * search for at a time */ #define MAX_STR_ARRAY 10 /* Size of any input buffer or temp strings */ #define MAX_STRING_LENGTH 256 /* The maximum number of bytes that will loaded from a file * being searched. Used to allocate the file buffer */ #define MAX_FILE_SIZE 100000l /* How many files can be loaded into the files[] and titles[] arrays */ #define MAX_FILES 500 /* What character separates the command line parameters (CLPS) */ #define CLP_CHAR '&' /* What character separates the search strings */ #define SEARCH_CHAR "+" /* Define the root path which is prepended to each file name in the * data file. The WWW_PATH is the home path for the HTML files * as seen in the browser window. */ #if (DISTRIBUTION == LINUX) #define ROOT_PATH "/httpd/htdocs/" #define FILE_DATA "/httpd/htdocs/docs/espfiles.dat" #define ESP_SEARCH_FORM "/httpd/htdocs/docs/findform.html" #define ESP_SEARCH_OUTPUT "/httpd/htdocs/docs/find.out" #define ESP_SEARCH_HTML "/httpd/htdocs/docs/findrec.html" #define WWW_PATH "/" #elif (DISTRIBUTION == MOUSE) #define ROOT_PATH "/usr/home/uesp/html/" #define ESP_SEARCH_FORM "/usr/home/uesp/html/docs/findform.html" #define ESP_SEARCH_HTML "/usr/home/uesp/html/docs/findrec.html" #define ESP_SEARCH_OUTPUT "/usr/home/uesp/html/docs/find.out" #define FILE_DATA "/usr/home/uesp/html/docs/espfiles.dat" #define WWW_PATH "/~uesp/" #endif /* Shortcut for outputting form options */ #define PathSelect(str) (!stricmp(search_path,str)?"SELECTED":"") /*========== The Structure for holding all the search results =============*/ typedef struct { unsigned int score[MAX_STR_ARRAY]; /* How good/bad of a match - total */ unsigned int best_match[MAX_STR_ARRAY]; /* What was the best match score */ long fpos[MAX_STR_ARRAY]; /* Where in the file was the best match */ } MATCH; /*========== End of structure MATCH definition ============================*/ /*=========================================================================== * * Function and Procedure Prototypes * *=========================================================================*/ char *msg_score (const int i); /*=========================================================================== * End of Function Prototypes *=========================================================================*/ #endif /*=========================================================================== * End of File ESPSEARCH.H *=========================================================================*/