typefile.inc 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {
  2. $Id$
  3. This file is part of the Free Pascal Run time library.
  4. Copyright (c) 1993,97 by the Free Pascal development team
  5. See the File COPYING.FPC, included in this distribution,
  6. for details about the copyright.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. **********************************************************************}
  11. {****************************************************************************
  12. subroutines for typed file handling
  13. ****************************************************************************}
  14. Procedure assign(var f:TypedFile;const Name:string);
  15. Begin
  16. FillChar(f,SizeOF(FileRec),0);
  17. FileRec(f).Handle:=UnusedHandle;
  18. FileRec(f).mode:=fmClosed;
  19. Move(Name[1],FileRec(f).Name,Length(Name));
  20. End;
  21. Procedure Int_Typed_Reset(var f : TypedFile;Size : Longint);[Public,IOCheck, Alias: 'RESET_TYPED'];
  22. Begin
  23. Reset(UnTypedFile(f),Size);
  24. End;
  25. Procedure Int_Typed_Rewrite(var f : TypedFile;Size : Longint);[Public,IOCheck, Alias: 'REWRITE_TYPED'];
  26. Begin
  27. Rewrite(UnTypedFile(f),Size);
  28. End;
  29. Procedure Int_Typed_Write(TypeSize : Longint;var f : TypedFile;var Buf);[IOCheck, Public, Alias : 'TYPED_WRITE'];
  30. Begin
  31. Do_Write(FileRec(f).Handle,Longint(@Buf),TypeSize);
  32. End;
  33. Procedure Int_Typed_Read(TypeSize : Longint;var f : TypedFile;var Buf);[IOCheck, Public, Alias : 'TYPED_READ'];
  34. var
  35. Result : Longint;
  36. Begin
  37. Result:=Do_Read(FileRec(f).Handle,Longint(@Buf),TypeSize);
  38. If Result<TypeSize Then
  39. InOutRes:=100;
  40. End;
  41. {
  42. $Log$
  43. Revision 1.2 1998-05-12 10:42:45 peter
  44. * moved getopts to inc/, all supported OS's need argc,argv exported
  45. + strpas, strlen are now exported in the systemunit
  46. * removed logs
  47. * removed $ifdef ver_above
  48. }