LSO_Struct.cs 4.7 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. */
  28. /* Original code: Tedd Hansen */
  29. using System;
  30. using System.Collections;
  31. using System.Collections.Generic;
  32. namespace OpenSim.Grid.ScriptEngine.DotNetEngine.Compiler.LSO
  33. {
  34. internal static class LSO_Struct
  35. {
  36. public struct Header
  37. {
  38. public UInt32 TM;
  39. public UInt32 IP;
  40. public UInt32 VN;
  41. public UInt32 BP;
  42. public UInt32 SP;
  43. public UInt32 HR;
  44. public UInt32 HP;
  45. public UInt32 CS;
  46. public UInt32 NS;
  47. public UInt32 CE;
  48. public UInt32 IE;
  49. public UInt32 ER;
  50. public UInt32 FR;
  51. public UInt32 SLR;
  52. public UInt32 GVR;
  53. public UInt32 GFR;
  54. public UInt32 PR;
  55. public UInt32 ESR;
  56. public UInt32 SR;
  57. public UInt64 NCE;
  58. public UInt64 NIE;
  59. public UInt64 NER;
  60. }
  61. public struct StaticBlock
  62. {
  63. public UInt32 Static_Chunk_Header_Size;
  64. public byte ObjectType;
  65. public byte Unknown;
  66. public byte[] BlockVariable;
  67. }
  68. /* Not actually a structure
  69. public struct StaticBlockVariable
  70. {
  71. public UInt32 Integer1;
  72. public UInt32 Float1;
  73. public UInt32 HeapPointer_String;
  74. public UInt32 HeapPointer_Key;
  75. public byte[] Vector_12;
  76. public byte[] Rotation_16;
  77. public UInt32 Pointer_List_Structure;
  78. } */
  79. public struct HeapBlock
  80. {
  81. public Int32 DataBlockSize;
  82. public byte ObjectType;
  83. public UInt16 ReferenceCount;
  84. public byte[] Data;
  85. }
  86. public struct StateFrameBlock
  87. {
  88. public UInt32 StateCount;
  89. public StatePointerBlock[] StatePointer;
  90. }
  91. public struct StatePointerBlock
  92. {
  93. public UInt32 Location;
  94. public BitArray EventMask;
  95. public StateBlock StateBlock;
  96. }
  97. public struct StateBlock
  98. {
  99. public UInt32 StartPos;
  100. public UInt32 EndPos;
  101. public UInt32 HeaderSize;
  102. public byte Unknown;
  103. public StateBlockHandler[] StateBlockHandlers;
  104. }
  105. public struct StateBlockHandler
  106. {
  107. public UInt32 CodeChunkPointer;
  108. public UInt32 CallFrameSize;
  109. }
  110. public struct FunctionBlock
  111. {
  112. public UInt32 FunctionCount;
  113. public UInt32[] CodeChunkPointer;
  114. }
  115. public struct CodeChunk
  116. {
  117. public UInt32 CodeChunkHeaderSize;
  118. public string Comment;
  119. public List<CodeChunkArgument> CodeChunkArguments;
  120. public byte EndMarker;
  121. public byte ReturnTypePos;
  122. public StaticBlock ReturnType;
  123. }
  124. public struct CodeChunkArgument
  125. {
  126. public byte FunctionReturnTypePos;
  127. public byte NullString;
  128. public StaticBlock FunctionReturnType;
  129. }
  130. }
  131. }