dynarrh.inc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. {
  2. This file is part of the Free Pascal Run time library.
  3. Copyright (c) 1999-2005 by the Free Pascal development team
  4. This file contains type declarations necessary for the dynamic
  5. array routine helpers in syshelp.inc
  6. See the File COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. type
  13. tdynarrayindex = sizeint;
  14. pdynarrayindex = ^tdynarrayindex;
  15. pdynarraytypeinfo = ^tdynarraytypeinfo;
  16. ppdynarraytypeinfo = ^pdynarraytypeinfo;
  17. tdynarraytypeinfo = packed record
  18. kind : TTypeKind;
  19. namelen : byte;
  20. { here the chars follow, we've to skip them }
  21. elesize : sizeint;
  22. {$ifdef VER3_0}
  23. eletype : pdynarraytypeinfo;
  24. {$else}
  25. eletype : ppdynarraytypeinfo;
  26. {$endif}
  27. vartype : longint;
  28. end;
  29. procedure DynArraySetLength(var a: Pointer; typeInfo: Pointer; dimCnt: SizeInt; lengthVec: PSizeInt);
  30. function DynArraySize(a : pointer): tdynarrayindex;
  31. procedure DynArrayClear(var a: Pointer; typeInfo: Pointer);
  32. function DynArrayDim(typeInfo: Pointer): Integer;
  33. function DynArrayBounds(a: Pointer; typeInfo: Pointer): TBoundArray;
  34. function IsDynArrayRectangular(a: Pointer; typeInfo: Pointer): Boolean;
  35. function DynArrayIndex(a: Pointer; const indices: array of SizeInt; typeInfo: Pointer): Pointer;
  36. procedure fpc_dynarray_rangecheck(p : pointer;i : tdynarrayindex); compilerproc;