summaryrefslogtreecommitdiff
path: root/libtnsl/src/reflect/type.tnsl
blob: b36dfc55bf903880b551182e074d0a2738edbbd9 (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/##
	Copyright 2021 Kyle Gunger

	Dual licensed under the CDDL 1.0 and BSD 3-Clause licenses.

	This file may only be used in accordance with one of the two
	licenses.  You should have received a copy of each license with
	the source code.  In the event that you did not recieve a copy
	of the licenses, they may be found at the following URLs:

	CDDL 1.0:
	https://opensource.org/licenses/CDDL-1.0

	BSD 3-Clause:
	https://opensource.org/licenses/BSD-3-Clause

	THIS SOFTWARE/SOURCE CODE IS PROVIDED "AS IS" WITH NO
	WARRANTY, GUARANTEE, OR CLAIM OF FITNESS FOR ANY PURPOSE
	EXPRESS OR IMPLIED
#/

/## tnsl.reflect._type
	Header data which prefixes all non-raw structs.
	Upper limits for classes and libs defined here:
	- Max 2^32 libraries
	- Max 2^16 classes per library
	- Max 2^8 Generics per class
#/
; raw struct _type(uint8 N) {
	uint32
		_lib_index,
	uint16
		_type_index,
	
	{N}_type
		_generic_list
}

/## tnsl.reflect._method
	Metadata for methods (can be decoded from library
	symbol tables).  Limits for methods defined here:
	- Max 2^8 inputs
	- Max 2^8 outputs
#/
; raw struct _method(uint8 I, O) {
	~{}charp
		name,
	
	{I}_type
		inputs,
	{O}_type
		outputs,

	~void
		address
}

/## tnsl.reflect._member
	Metadata about struct members
#/
; raw struct _member {
	~{}charp
		name,
	
	uint
		offset,

	_type
		_member_type
}

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

/; method _type

	/; _is (_type_header base)
	;/

	/; _get_method ()
	;/
;/