-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconverter.go
161 lines (159 loc) · 3.27 KB
/
converter.go
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
package main
import (
"fmt"
)
// ConvertToGoType converts the c datatype to a golang datatype.
func ConvertToGoType(cType string) (string, error) {
switch cType {
case "...":
return "...any", nil
case "AudioCallback":
return cType, nil
case "AudioStream":
return cType, nil
case "AutomationEvent":
return cType, nil
case "AutomationEventList":
return cType, nil
case "AutomationEventList *":
return "*AutomationEventList", nil
case "BoundingBox":
return cType, nil
case "Camera":
return cType, nil
case "Camera *":
return "*Camera", nil
case "Camera2D":
return cType, nil
case "Camera3D":
return cType, nil
case "Color":
return "color.RGBA", nil
case "Color *":
return "*color.RGBA", nil
case "FilePathList":
return cType, nil
case "Font":
return cType, nil
case "GlyphInfo":
return cType, nil
case "GlyphInfo *":
return "*GlyphInfo", nil
case "Image":
return cType, nil
case "Image *":
return "*Image", nil
case "LoadFileDataCallback":
return cType, nil
case "LoadFileTextCallback":
return cType, nil
case "Material":
return cType, nil
case "Material *":
return "*Material", nil
case "Matrix":
return cType, nil
case "Mesh":
return cType, nil
case "Mesh *":
return "*Mesh", nil
case "Model":
return cType, nil
case "Model *":
return "*Model", nil
case "ModelAnimation":
return cType, nil
case "ModelAnimation *":
return "*ModelAnimation", nil
case "Music":
return cType, nil
case "NPatchInfo":
return cType, nil
case "Ray":
return cType, nil
case "RayCollision":
return cType, nil
case "Rectangle":
return cType, nil
case "Rectangle **":
return "[]*Rectangle", nil
case "RenderTexture2D":
return cType, nil
case "SaveFileDataCallback":
return cType, nil
case "SaveFileTextCallback":
return cType, nil
case "Shader":
return cType, nil
case "Sound":
return cType, nil
case "Texture2D":
return cType, nil
case "Texture2D *":
return "*Texture2D", nil
case "TextureCubemap":
return cType, nil
case "TraceLogCallback":
return cType, nil
case "Vector2":
return cType, nil
case "Vector2 *":
return "*Vector2", nil
case "Vector3":
return cType, nil
case "Vector3 *":
return "*Vector3", nil
case "Vector4":
return cType, nil
case "VrDeviceInfo":
return cType, nil
case "VrStereoConfig":
return cType, nil
case "Wave":
return cType, nil
case "Wave *":
return "*Wave", nil
case "bool":
return cType, nil
case "char":
return "int8", nil
case "char *":
return "string", nil
case "const GlyphInfo *":
return "*GlyphInfo", nil
case "const Matrix *":
return "*Matrix", nil
case "const char *":
return "string", nil
case "const char **":
return "[]string", nil
case "const int *":
return "[]int32", nil
case "const unsigned char *":
return "[]byte", nil
case "const void *":
return "unsafe.Pointer", nil
case "double":
return "float64", nil
case "float":
return "float32", nil
case "float *":
return "[]float32", nil
case "int":
return "int32", nil
case "int *":
return "[]int32", nil
case "long":
return "int64", nil
case "unsigned char *":
return "[]byte", nil
case "unsigned int":
return "uint32", nil
case "void":
return "", nil
case "void *":
return "unsafe.Pointer", nil
default:
return "", fmt.Errorf("unknown type %s", cType)
}
}