17 META_TABLE_INTERFACEIMPL,
20 META_TABLE_CUSTOMATTRIBUTE,
21 META_TABLE_FIELDMARSHAL,
22 META_TABLE_DECLSECURITY,
23 META_TABLE_CLASSLAYOUT,
24 META_TABLE_FIELDLAYOUT,
25 META_TABLE_STANDALONESIG,
29 META_TABLE_PROPERTYMAP,
32 META_TABLE_METHODSEMANTICS,
33 META_TABLE_METHODIMPL,
41 META_TABLE_ASSEMBLYPROCESSOR,
42 META_TABLE_ASSEMBLYOS,
43 META_TABLE_ASSEMBLYREF,
44 META_TABLE_ASSEMBLYREFPROCESSOR,
45 META_TABLE_ASSEMBLYREFOS,
47 META_TABLE_EXPORTEDTYPE,
48 META_TABLE_MANIFESTRESOURCE,
49 META_TABLE_NESTEDCLASS,
51 #define META_TABLE_LAST META_TABLE_NESTEDCLASS
55 guint32 rows, row_size;
59 * Tables contain up to 9 rows and the possible sizes of the
60 * fields in the documentation are 1, 2 and 4 bytes. So we
61 * can encode in 2 bits the size.
63 * A 32 bit value can encode the resulting size
65 * The top eight bits encode the number of columns in the table.
66 * we only need 4, but 8 is aligned no shift required.
68 guint32 size_bitfield;
69 } metadata_tableinfo_t;
72 * This macro is used to extract the size of the table encoded in
73 * the size_bitfield of metadata_tableinfo_t.
75 #define meta_table_size(bitfield,table) ((((bitfield) >> ((table)*2)) & 0x3) + 1)
76 #define meta_table_count(bitfield) ((bitfield) >> 24)
81 gboolean idx_string_wide, idx_guid_wide, idx_blob_wide;
83 stream_header_t heap_strings;
84 stream_header_t heap_us;
85 stream_header_t heap_blob;
86 stream_header_t heap_guid;
87 stream_header_t heap_tables;
91 metadata_tableinfo_t tables [64];
95 * This enumeration is used to describe the data types in the metadata
106 /* Index into Blob heap */
109 /* Index into String heap */
115 /* Pointer into a table */
118 /* HasConstant:Parent pointer (Param, Field or Property) */
121 /* HasCustomAttribute index. Indexes any table except CustomAttribute */
124 /* CustomAttributeType encoded index */
127 /* HasDeclSecurity index: TypeDef Method or Assembly */
130 /* Implementation coded index: File, Export AssemblyRef */
133 /* HasFieldMarshal coded index: Field or Param table */
136 /* MemberForwardedIndex: Field or Method */
139 /* TypeDefOrRef coded index: typedef, typeref, typespec */
142 /* MemberRefParent coded index: typeref, moduleref, method, memberref, typesepc, typedef */
145 /* MethodDefOrRef coded index: Method or Member Ref table */
148 /* HasSemantic coded index: Event or Property */
151 /* ResolutionScope coded index: Module, ModuleRef, AssemblytRef, TypeRef */
160 const char *mono_meta_table_name (int table);
162 /* Internal functions */
163 void mono_metadata_compute_table_bases (metadata_t *meta);
165 MonoMetaTable *mono_metadata_get_table (MetaTableEnum table);
170 char *mono_metadata_locate (metadata_t *meta, int table, int idx);
171 char *mono_metadata_locate_token (metadata_t *meta, guint32 token);
173 const char *mono_metadata_string_heap (metadata_t *meta, guint32 index);
174 const char *mono_metadata_blob_heap (metadata_t *meta, guint32 index);
177 MONO_META_EXCEPTION_CLAUSE_NONE,
178 MONO_META_EXCEPTION_CLAUSE_FILTER,
179 MONO_META_EXCEPTION_CLAUSE_FINALLY,
180 MONO_META_EXCEPTION_CLAUSE_FAULT
181 } MonoMetaExceptionEnum;
185 MonoMetaExceptionEnum kind;
188 } MonoMetaExceptionHandler;
194 guint32 local_var_sig_tok;
196 /* if local_var_sig_tok != 0, then the following apply: */
197 unsigned int init_locals : 1;
199 GList *exception_handler_list;
200 } MonoMetaMethodHeader;
202 MonoMetaMethodHeader *mono_metadata_parse_mh (const char *ptr);
203 void mono_metadata_free_mh (MonoMetaMethodHeader *mh);