IMPLEMENTATION MODULE NdxTypes; (* * REPERTOIRE * Release 1.6 * By Charles Bradford and Cole Brecheen * (c) Copyright 1985-1992 PMI * Green Bay, Wisconsin * All rights reserved * (414) 468-6040 * * $Header: D:/logfiles/mods/ndxtypes.mov 1.5 10 Mar 1991 15:30:48 coleb $ * *) IMPORT ErrorNames; IMPORT GenLists; IMPORT VStorage; IMPORT Numbers; FROM SYSTEM IMPORT TSIZE; VAR Initialized : BOOLEAN; PROCEDURE Init(); BEGIN IF Initialized THEN RETURN; ELSE Initialized := TRUE; END; ErrorNames.Init(); GenLists.Init(); Numbers.Init(); VStorage.Init(); END Init; CONST InitKey = 46102; (*Arbitrary value.*) PROCEDURE CheckInit( NdxFile: NdxFileType ); BEGIN IF (NdxFile = NIL) OR (NdxFile^.InitCheck # InitKey) THEN ErrorNames.WarningName('BadNdx'); END; END CheckInit; PROCEDURE InitNdxFile( VAR NdxFile: NdxFileType ); BEGIN VStorage.DosAlloc( NdxFile, TSIZE(NdxRecord) ); NdxFile^.name := ''; NdxFile^.handle := 0; NdxFile^.SafetyOn := FALSE; NdxFile^.InitCheck := InitKey; NdxFile^.NdxFilePtr := Numbers.Lc( 0 ); NdxFile^.UpdateNeeded := FALSE; NdxFile^.BufRecName := ''; GenLists.NilList( NdxFile^.Ndx ); GenLists.NilList( NdxFile^.AltKeys ); GenLists.NilList( NdxFile^.ListBuf ); GenLists.NilList( NdxFile^.StructLst ); NdxFile^.FileBufPtr := NIL; NdxFile^.BufSizeNow := 0; END InitNdxFile; BEGIN Initialized := FALSE; Init(); END NdxTypes.