NDXTYPES.MOD 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. IMPLEMENTATION MODULE NdxTypes;
  2. (*
  3. * REPERTOIRE
  4. * Release 1.6
  5. * By Charles Bradford and Cole Brecheen
  6. * (c) Copyright 1985-1992 PMI
  7. * Green Bay, Wisconsin
  8. * All rights reserved
  9. * (414) 468-6040
  10. *
  11. * $Header: D:/logfiles/mods/ndxtypes.mov 1.5 10 Mar 1991 15:30:48 coleb $
  12. *
  13. *)
  14. IMPORT ErrorNames;
  15. IMPORT GenLists;
  16. IMPORT VStorage;
  17. IMPORT Numbers;
  18. FROM SYSTEM IMPORT TSIZE;
  19. VAR
  20. Initialized : BOOLEAN;
  21. PROCEDURE Init();
  22. BEGIN
  23. IF Initialized THEN
  24. RETURN;
  25. ELSE
  26. Initialized := TRUE;
  27. END;
  28. ErrorNames.Init();
  29. GenLists.Init();
  30. Numbers.Init();
  31. VStorage.Init();
  32. END Init;
  33. CONST
  34. InitKey = 46102;
  35. (*Arbitrary value.*)
  36. PROCEDURE CheckInit( NdxFile: NdxFileType );
  37. BEGIN
  38. IF (NdxFile = NIL) OR
  39. (NdxFile^.InitCheck # InitKey) THEN
  40. ErrorNames.WarningName('BadNdx');
  41. END;
  42. END CheckInit;
  43. PROCEDURE InitNdxFile( VAR NdxFile: NdxFileType );
  44. BEGIN
  45. VStorage.DosAlloc( NdxFile, TSIZE(NdxRecord) );
  46. NdxFile^.name := '';
  47. NdxFile^.handle := 0;
  48. NdxFile^.SafetyOn := FALSE;
  49. NdxFile^.InitCheck := InitKey;
  50. NdxFile^.NdxFilePtr := Numbers.Lc( 0 );
  51. NdxFile^.UpdateNeeded := FALSE;
  52. NdxFile^.BufRecName := '';
  53. GenLists.NilList( NdxFile^.Ndx );
  54. GenLists.NilList( NdxFile^.AltKeys );
  55. GenLists.NilList( NdxFile^.ListBuf );
  56. GenLists.NilList( NdxFile^.StructLst );
  57. NdxFile^.FileBufPtr := NIL;
  58. NdxFile^.BufSizeNow := 0;
  59. END InitNdxFile;
  60. BEGIN
  61. Initialized := FALSE;
  62. Init();
  63. END NdxTypes.