LSO_Struct.cs 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /*
  2. * Copyright (c) Contributors, http://opensimulator.org/
  3. * See CONTRIBUTORS.TXT for a full list of copyright holders.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. * * Redistributions of source code must retain the above copyright
  8. * notice, this list of conditions and the following disclaimer.
  9. * * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * * Neither the name of the OpenSim Project nor the
  13. * names of its contributors may be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
  17. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  18. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  19. * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
  20. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  21. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  22. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  23. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  24. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  25. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. /* Original code: Tedd Hansen */
  28. using System;
  29. using System.Collections;
  30. using System.Collections.Generic;
  31. namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSO
  32. {
  33. internal static class LSO_Struct
  34. {
  35. public struct Header
  36. {
  37. public UInt32 TM;
  38. public UInt32 IP;
  39. public UInt32 VN;
  40. public UInt32 BP;
  41. public UInt32 SP;
  42. public UInt32 HR;
  43. public UInt32 HP;
  44. public UInt32 CS;
  45. public UInt32 NS;
  46. public UInt32 CE;
  47. public UInt32 IE;
  48. public UInt32 ER;
  49. public UInt32 FR;
  50. public UInt32 SLR;
  51. public UInt32 GVR;
  52. public UInt32 GFR;
  53. public UInt32 PR;
  54. public UInt32 ESR;
  55. public UInt32 SR;
  56. public UInt64 NCE;
  57. public UInt64 NIE;
  58. public UInt64 NER;
  59. }
  60. public struct StaticBlock
  61. {
  62. public UInt32 Static_Chunk_Header_Size;
  63. public byte ObjectType;
  64. public byte Unknown;
  65. public byte[] BlockVariable;
  66. }
  67. /* Not actually a structure
  68. public struct StaticBlockVariable
  69. {
  70. public UInt32 Integer1;
  71. public UInt32 Float1;
  72. public UInt32 HeapPointer_String;
  73. public UInt32 HeapPointer_Key;
  74. public byte[] Vector_12;
  75. public byte[] Rotation_16;
  76. public UInt32 Pointer_List_Structure;
  77. } */
  78. public struct HeapBlock
  79. {
  80. public Int32 DataBlockSize;
  81. public byte ObjectType;
  82. public UInt16 ReferenceCount;
  83. public byte[] Data;
  84. }
  85. public struct StateFrameBlock
  86. {
  87. public UInt32 StateCount;
  88. public StatePointerBlock[] StatePointer;
  89. }
  90. public struct StatePointerBlock
  91. {
  92. public UInt32 Location;
  93. public BitArray EventMask;
  94. public StateBlock StateBlock;
  95. }
  96. public struct StateBlock
  97. {
  98. public UInt32 StartPos;
  99. public UInt32 EndPos;
  100. public UInt32 HeaderSize;
  101. public byte Unknown;
  102. public StateBlockHandler[] StateBlockHandlers;
  103. }
  104. public struct StateBlockHandler
  105. {
  106. public UInt32 CodeChunkPointer;
  107. public UInt32 CallFrameSize;
  108. }
  109. public struct FunctionBlock
  110. {
  111. public UInt32 FunctionCount;
  112. public UInt32[] CodeChunkPointer;
  113. }
  114. public struct CodeChunk
  115. {
  116. public UInt32 CodeChunkHeaderSize;
  117. public string Comment;
  118. public List<CodeChunkArgument> CodeChunkArguments;
  119. public byte EndMarker;
  120. public byte ReturnTypePos;
  121. public StaticBlock ReturnType;
  122. }
  123. public struct CodeChunkArgument
  124. {
  125. public byte FunctionReturnTypePos;
  126. public byte NullString;
  127. public StaticBlock FunctionReturnType;
  128. }
  129. }
  130. }