127 lines
4.4 KiB
C
127 lines
4.4 KiB
C
/****************************************************************************
|
|
Copyright (c) 2011-2013,WebJet Business Division,CYOU
|
|
|
|
http://www.genesis-3d.com.cn
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in
|
|
all copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
THE SOFTWARE.
|
|
****************************************************************************/
|
|
|
|
#ifndef __MONOTYPES_H__
|
|
#define __MONOTYPES_H__
|
|
|
|
#include "core/types.h"
|
|
|
|
// - forward declare
|
|
struct MonoClass;
|
|
struct MonoDomain;
|
|
struct MonoMethod;
|
|
struct MonoThread;
|
|
struct MonoObject;
|
|
struct MonoMethodDesc;
|
|
struct MonoString;
|
|
struct MonoImage;
|
|
struct MonoAssembly;
|
|
struct MonoArray;
|
|
struct MonoClassField;
|
|
struct MonoType;
|
|
|
|
// - make typedefs to fit mono
|
|
typedef void* gconstpointer;
|
|
typedef void* gpointer;
|
|
|
|
typedef uint16 uint16_t;
|
|
typedef uint16_t mono_unichar2;
|
|
typedef int32 int32_t;
|
|
typedef uint32 uint32_t;
|
|
typedef uint32 guint32;
|
|
#if ( __WIN32__ || __ANDROID )
|
|
typedef unsigned int uintptr_t;
|
|
#endif
|
|
typedef int MonoDebugFormat;
|
|
typedef int mono_bool;
|
|
typedef int gboolean;
|
|
|
|
// - define these parameters to make program easy
|
|
const mono_bool c_iMonoBool_False = 0;
|
|
const mono_bool c_iMonoBool_True = 1;
|
|
const uint32 c_iInvalidMonoRefID = 0;
|
|
|
|
// - monotypes,copy from mono source code,do not edit!
|
|
/*
|
|
* Encoding for type signatures used in the Metadata
|
|
*/
|
|
|
|
typedef enum {
|
|
MONO_TYPE_END = 0x00, /* End of List */
|
|
MONO_TYPE_VOID = 0x01,
|
|
MONO_TYPE_BOOLEAN = 0x02,
|
|
MONO_TYPE_CHAR = 0x03,
|
|
MONO_TYPE_I1 = 0x04,
|
|
MONO_TYPE_U1 = 0x05,
|
|
MONO_TYPE_I2 = 0x06,
|
|
MONO_TYPE_U2 = 0x07,
|
|
MONO_TYPE_I4 = 0x08,
|
|
MONO_TYPE_U4 = 0x09,
|
|
MONO_TYPE_I8 = 0x0a,
|
|
MONO_TYPE_U8 = 0x0b,
|
|
MONO_TYPE_R4 = 0x0c,
|
|
MONO_TYPE_R8 = 0x0d,
|
|
MONO_TYPE_STRING = 0x0e,
|
|
MONO_TYPE_PTR = 0x0f, /* arg: <type> token */
|
|
MONO_TYPE_BYREF = 0x10, /* arg: <type> token */
|
|
MONO_TYPE_VALUETYPE = 0x11, /* arg: <type> token */
|
|
MONO_TYPE_CLASS = 0x12, /* arg: <type> token */
|
|
MONO_TYPE_VAR = 0x13, /* number */
|
|
MONO_TYPE_ARRAY = 0x14, /* type, rank, boundsCount, bound1, loCount, lo1 */
|
|
MONO_TYPE_GENERICINST= 0x15, /* <type> <type-arg-count> <type-1> \x{2026} <type-n> */
|
|
MONO_TYPE_TYPEDBYREF = 0x16,
|
|
MONO_TYPE_I = 0x18,
|
|
MONO_TYPE_U = 0x19,
|
|
MONO_TYPE_FNPTR = 0x1b, /* arg: full method signature */
|
|
MONO_TYPE_OBJECT = 0x1c,
|
|
MONO_TYPE_SZARRAY = 0x1d, /* 0-based one-dim-array */
|
|
MONO_TYPE_MVAR = 0x1e, /* number */
|
|
MONO_TYPE_CMOD_REQD = 0x1f, /* arg: typedef or typeref token */
|
|
MONO_TYPE_CMOD_OPT = 0x20, /* optional arg: typedef or typref token */
|
|
MONO_TYPE_INTERNAL = 0x21, /* CLR internal type */
|
|
|
|
MONO_TYPE_MODIFIER = 0x40, /* Or with the following types */
|
|
MONO_TYPE_SENTINEL = 0x41, /* Sentinel for varargs method signature */
|
|
MONO_TYPE_PINNED = 0x45, /* Local var that points to pinned object */
|
|
|
|
MONO_TYPE_ENUM = 0x55 /* an enumeration */
|
|
} MonoTypeEnum;
|
|
|
|
// - invalid mono type
|
|
const int c_iInvalidMonoType = MONO_TYPE_END;
|
|
|
|
#define FIELD_ATTRIBUTE_PUBLIC 0x0006
|
|
|
|
#define FIELD_ATTRIBUTE_STATIC 0x0010
|
|
#define FIELD_ATTRIBUTE_INIT_ONLY 0x0020
|
|
#define FIELD_ATTRIBUTE_LITERAL 0x0040
|
|
#define FIELD_ATTRIBUTE_NOT_SERIALIZED 0x0080
|
|
#define FIELD_ATTRIBUTE_SPECIAL_NAME 0x0200
|
|
#define FIELD_ATTRIBUTE_PINVOKE_IMPL 0x2000
|
|
|
|
|
|
|
|
#endif // -__MONOTYPES_H__
|
|
|