--- trunk/gr2lib/CoreTypes.cs 2010/07/14 06:18:44 7 +++ trunk/gr2lib/CoreTypes.cs 2010/07/14 06:19:08 8 @@ -2,12 +2,115 @@ using System.Collections.Generic; using System.Text; + namespace gr2lib { namespace core { namespace coretypes { + #region typedefs + using granny_uint32 = System.UInt32; + using granny_uint16 = System.UInt16; + using granny_uint8 = System.Byte; + + using granny_int32 = System.Int32; + using granny_int16 = System.Int16; + using granny_int8 = System.SByte; + + using granny_bool32 = System.Int32; + using granny_real32 = System.Single; + + using granny_real16 = System.UInt16; + using granny_uint32x = System.UInt32; + using granny_uint16x = System.UInt32; + using granny_uint8x = System.UInt32; + + using granny_int32x = System.Int32; + using granny_int16x = System.Int32; + using granny_int8x = System.Int32; + using granny_bool32x = System.Int32; + + using granny_real64x = System.Double; + + using granny_real32x = System.Single; + + using granny_triple = System.Single;//[3]; // declare type -> unsafe fixed + using granny_quad = System.Single;//[4]; // declare type -> unsafe fixed + using granny_matrix_3x3 = System.Single;//[3][3]; // declare type -> unsafe fixed + using granny_matrix_4x4 = System.Single;//[4][4]; // declare type -> unsafe fixed + using granny_matrix_3x4 = System.Single;//[3][4]; // declare type -> unsafe fixed + #endregion + + #region struct granny_file + /// <summary> + /// granny_file: update + /// </summary> + public struct granny_file + { +#pragma warning disable 0169 + bool IsByteReversed; + unsafe granny_grn_file_header* Header; + unsafe granny_grn_file_magic_value* SourceMagicValue; + granny_int32x SectionCount; + unsafe void** Sections; + unsafe bool* Marshalled; + unsafe bool* IsUserMemory; + unsafe void* ConversionBuffer; +#pragma warning restore 0169 + }; + #endregion + + #region struct granny_grn_reference + /// <summary> + /// granny_grn_reference: update + /// </summary> + public struct granny_grn_reference + { +#pragma warning disable 0169 + granny_uint32 SectionIndex; + granny_uint32 Offset; +#pragma warning restore 0169 + };// GrannyAlignAttribute; + #endregion + + #region struct granny_grn_file_header + /// <summary> + /// granny_grn_file_header: update + /// </summary> + public struct granny_grn_file_header + { +#pragma warning disable 0169 + granny_uint32 Version; + granny_uint32 TotalSize; + granny_uint32 CRC; + granny_uint32 SectionArrayOffset; + granny_uint32 SectionArrayCount; + granny_grn_reference RootObjectTypeDefinition; + granny_grn_reference RootObject; + granny_uint32 TypeTag; + private const int GrannyGRNExtraTagCount = 4; + unsafe fixed granny_uint32 ExtraTags[GrannyGRNExtraTagCount]; + granny_uint32 StringDatabaseCRC; + unsafe fixed granny_uint32 ReservedUnused[3]; +#pragma warning restore 0169 + };// GrannyAlignAttribute; + #endregion + + #region struct granny_grn_file_magic_value + /// <summary> + /// granny_grn_file_magic_value: update + /// </summary> + public struct granny_grn_file_magic_value + { +#pragma warning disable 0169 + unsafe fixed granny_uint32 MagicValue[4]; + granny_uint32 HeaderSize; + granny_uint32 HeaderFormat; + unsafe fixed granny_uint32 Reserved[2]; +#pragma warning restore 0169 + };// GrannyAlignAttribute; + #endregion } } } |