rtti.inc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1993,97 by xxxx
  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. { Some useful types }
  21. Type
  22. PByte = ^Byte;
  23. { A record is designed as follows :
  24. 1 : tkrecord
  25. 2 : Length of name string (n);
  26. 3 : name string;
  27. 3+n : record size;
  28. 7+n : number of elements (N)
  29. 11+n : N times : Pointer to type info
  30. Offset in record
  31. }
  32. TRecElem = Record
  33. Info : Pointer;
  34. Offset : Longint;
  35. end;
  36. TRecElemArray = Array[1..Maxint] of TRecElem;
  37. PRecRec = ^TRecRec;
  38. TRecRec = record
  39. Size,Count : Longint;
  40. Elements : TRecElemArray;
  41. end;
  42. { An array is designed as follows :
  43. 1 : tkArray;
  44. 2 : length of name string (n);
  45. 3 : NAme string
  46. 3+n : Element Size
  47. 7+n : Number of elements
  48. 11+n : Pointer to type of elements
  49. }
  50. PArrayRec = ^TArrayRec;
  51. TArrayRec = record
  52. Size,Count : Longint;
  53. Info : Pointer;
  54. end;
  55. { The actual Routines are implemented per processor. }
  56. {$i rttip.inc}
  57. {
  58. $Log$
  59. Revision 1.2 1998-06-08 15:32:15 michael
  60. + Split rtti according to processor. Implemented optimized i386 code.
  61. }