3 Programmer: Br. David Carlson
7 This header file sets up the constants, types, and function prototypes used by the
17 // Comment off the following line if you do not want to see debugging information.
20 enum { MaxString = 32, BufSize = 2048, _MAX_PATH = 64 };
23 typedef char StringType[MaxString];
25 typedef StringType BufType[BufSize]; // A buffer will hold 2048 strings, for a total of 64K bytes.
27 typedef char PathType[_MAX_PATH];
30 void Error(const string & Msg);
32 void Error(const string & MsgA, const string & MsgB);
34 int MakeSortedRuns(fstream & DataFile, PathType FileName);
36 bool LessThan(StringType First, StringType Second);
38 void QuickSort(BufType Buf, int Lower, int Upper);
40 void Swap(StringType First, StringType Second);
42 int Partition(BufType Buf, int Lower, int Upper);
44 void Merge(StringType InFileName1, StringType InFileName2, StringType OutFileName);
46 int FillBuffer(fstream & InFile, BufType Buffer, bool & HaveData, StringType NextWord);
48 void Copy(StringType Word, BufType Buffer, int & Index, fstream & OutFile);
50 void HandleMerges(int NumFiles, PathType FileName);