rtti.inc 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by Michael Van Canneyt
  5. member of the Free Pascal development team
  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. { Run-Time type information routines }
  13. { The RTTI is implemented through a series of constants : }
  14. Const
  15. tkLString = 10;
  16. tkWString = 11;
  17. tkVariant = 12;
  18. tkArray = 13;
  19. tkRecord = 14;
  20. { A record is designed as follows :
  21. 1 : tkrecord
  22. 2 : Length of name string (n);
  23. 3 : name string;
  24. 3+n : record size;
  25. 7+n : number of elements (N)
  26. 11+n : N times : Pointer to type info
  27. Offset in record
  28. }
  29. Type
  30. TRecElem = Record
  31. Info : Pointer;
  32. Offset : Longint;
  33. end;
  34. TRecElemArray = Array[1..Maxint] of TRecElem;
  35. PRecRec = ^TRecRec;
  36. TRecRec = record
  37. Size,Count : Longint;
  38. Elements : TRecElemArray;
  39. end;
  40. { An array is designed as follows :
  41. 1 : tkArray;
  42. 2 : length of name string (n);
  43. 3 : NAme string
  44. 3+n : Element Size
  45. 7+n : Number of elements
  46. 11+n : Pointer to type of elements
  47. }
  48. PArrayRec = ^TArrayRec;
  49. TArrayRec = record
  50. Size,Count : Longint;
  51. Info : Pointer;
  52. end;
  53. { The actual Routines are implemented per processor. }
  54. {$i rttip.inc}
  55. {
  56. $Log$
  57. Revision 1.5 2000-01-07 16:41:36 daniel
  58. * copyright 2000
  59. Revision 1.4 1998/07/20 18:42:51 florian
  60. *** empty log message ***
  61. Revision 1.3 1998/07/13 21:19:11 florian
  62. * some problems with ansi string support fixed
  63. Revision 1.2 1998/06/08 15:32:15 michael
  64. + Split rtti according to processor. Implemented optimized i386 code.
  65. }