summaryrefslogtreecommitdiff
path: root/libtnsl/reflect/_type.tnsl
blob: 410120f55be83a8b8190f120f72d2ce1ba5fd6e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/#
  This Source Code Form is subject to the terms of the Mozilla Public
  License, v. 2.0. If a copy of the MPL was not distributed with this
  file, You can obtain one at http://mozilla.org/MPL/2.0/.
#/

/## tnsl.reflect._type
	Header data which non-raw structs point to.
	Upper limits for classes and libs defined here:
	- Max 2^16 libraries
	- Max 2^16 modules/sub-modules per library
	- Max 2^16 classes per module
	- Max 2^8 Generics per class
#/
; raw struct _type() {
	uint16
		_library_id,
		_module_id,
		_type_id,
	
	{uint8}_type
		_generics
}

/## tnsl.reflect._type_addresses
	Metadata about where things are stored
	in a class
#/
; raw struct _type_addresses {
	~{}_type
		_supers,

	~{}uint
		_super_offsets,
	
	~{}_method
		_methods,

	~{}_member
		_members
}

/; method _type

	/; _is (_type base) [bool]
	;/

	/; inline _get (_type t, ~void s, _member m) [~void]
	;/

	/; inline raw _call (_type t, ~void s, _method m, ~void p)
	;/

	/; _offset (_type cast) [uint]
	;/
;/