Skip to content

Commit 0faf704

Browse files
Separate hstypes
1 parent 5ce12d5 commit 0faf704

File tree

240 files changed

+62970
-65597
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+62970
-65597
lines changed

hs-bindgen/examples/golden/binding_spec_simple.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ version:
22
hs_bindgen: 0.1.0
33
binding_specification: '1.0'
44
hsmodule: Example
5-
types:
5+
ctypes:
66
- omit:
77
headers: binding_spec_simple.h
88
cname: struct pt
99
- headers: binding_spec_simple.h
1010
cname: sym
11-
module: Generated
1211
hsname: Sym
12+
hstypes:
13+
- hsname: Sym
1314
instances:
1415
- Bits
1516
- Bounded

hs-bindgen/examples/golden/program_slicing_simple.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@ version:
22
hs_bindgen: 0.1.0
33
binding_specification: '1.0'
44
hsmodule: Foreign
5-
types:
5+
ctypes:
66
- headers: program_slicing_simple.h
77
cname: uint64_t
8-
module: Foreign
98
hsname: Int64
9+
hstypes:
10+
- hsname: Int64
1011
instances:
1112
- Bits
1213
- Bounded

hs-bindgen/fixtures/adios/bindingspec.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@ version:
22
hs_bindgen: 0.1.0
33
binding_specification: '1.0'
44
hsmodule: Example
5-
types:
5+
ctypes:
66
- headers: adios.h
77
cname: adiós
88
hsname: Adio'0301s
9+
- headers: adios.h
10+
cname: 数字
11+
hsname: C数字
12+
hstypes:
13+
- hsname: Adio'0301s
914
instances:
1015
- Bits
1116
- Bounded
@@ -20,9 +25,7 @@ types:
2025
- Real
2126
- Show
2227
- Storable
23-
- headers: adios.h
24-
cname: 数字
25-
hsname: C数字
28+
- hsname: C数字
2629
instances:
2730
- Bits
2831
- Bounded

hs-bindgen/fixtures/adios/decls.hs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,9 @@
4141
"un_Adio'0301s"},
4242
typedefType = TypePrim
4343
(PrimIntegral PrimInt Signed)},
44-
declSpec = DeclSpec
45-
CTypeSpec {
46-
cTypeSpecIdentifier = Nothing,
47-
cTypeSpecInstances =
48-
Map.fromList []}},
44+
declSpec = DeclSpec {
45+
declSpecC = Nothing,
46+
declSpecHs = Nothing}},
4947
newtypeInstances = Set.fromList
5048
[
5149
Bits,
@@ -284,11 +282,9 @@
284282
"un_C\25968\23383"},
285283
typedefType = TypePrim
286284
(PrimIntegral PrimInt Signed)},
287-
declSpec = DeclSpec
288-
CTypeSpec {
289-
cTypeSpecIdentifier = Nothing,
290-
cTypeSpecInstances =
291-
Map.fromList []}},
285+
declSpec = DeclSpec {
286+
declSpecC = Nothing,
287+
declSpecHs = Nothing}},
292288
newtypeInstances = Set.fromList
293289
[
294290
Bits,

hs-bindgen/fixtures/adios/tree-diff.txt

Lines changed: 21 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ TranslationUnit {
2626
"un_Adio'0301s"},
2727
typedefType = TypePrim
2828
(PrimIntegral PrimInt Signed)},
29-
declSpec = DeclSpec
30-
CTypeSpec {
31-
cTypeSpecIdentifier = Nothing,
32-
cTypeSpecInstances =
33-
Map.fromList []}},
29+
declSpec = DeclSpec {
30+
declSpecC = Nothing,
31+
declSpecHs = Nothing}},
3432
Decl {
3533
declInfo = DeclInfo {
3634
declLoc = "adios.h:12:13",
@@ -57,11 +55,9 @@ TranslationUnit {
5755
"un_C\25968\23383"},
5856
typedefType = TypePrim
5957
(PrimIntegral PrimInt Signed)},
60-
declSpec = DeclSpec
61-
CTypeSpec {
62-
cTypeSpecIdentifier = Nothing,
63-
cTypeSpecInstances =
64-
Map.fromList []}},
58+
declSpec = DeclSpec {
59+
declSpecC = Nothing,
60+
declSpecHs = Nothing}},
6561
Decl {
6662
declInfo = DeclInfo {
6763
declLoc = "adios.h:18:6",
@@ -84,11 +80,9 @@ TranslationUnit {
8480
FunctionAttributes
8581
ImpureFunction,
8682
functionRes = TypeVoid},
87-
declSpec = DeclSpec
88-
CTypeSpec {
89-
cTypeSpecIdentifier = Nothing,
90-
cTypeSpecInstances =
91-
Map.fromList []}},
83+
declSpec = DeclSpec {
84+
declSpecC = Nothing,
85+
declSpecHs = Nothing}},
9286
Decl {
9387
declInfo = DeclInfo {
9488
declLoc = "adios.h:21:12",
@@ -107,11 +101,9 @@ TranslationUnit {
107101
declKind = DeclGlobal
108102
(TypePrim
109103
(PrimIntegral PrimInt Signed)),
110-
declSpec = DeclSpec
111-
CTypeSpec {
112-
cTypeSpecIdentifier = Nothing,
113-
cTypeSpecInstances =
114-
Map.fromList []}},
104+
declSpec = DeclSpec {
105+
declSpecC = Nothing,
106+
declSpecHs = Nothing}},
115107
Decl {
116108
declInfo = DeclInfo {
117109
declLoc = "adios.h:24:18",
@@ -132,11 +124,9 @@ TranslationUnit {
132124
TypeQualifierConst
133125
(TypePrim
134126
(PrimIntegral PrimInt Signed))),
135-
declSpec = DeclSpec
136-
CTypeSpec {
137-
cTypeSpecIdentifier = Nothing,
138-
cTypeSpecInstances =
139-
Map.fromList []}},
127+
declSpec = DeclSpec {
128+
declSpecC = Nothing,
129+
declSpecHs = Nothing}},
140130
Decl {
141131
declInfo = DeclInfo {
142132
declLoc = "adios.h:27:6",
@@ -159,11 +149,9 @@ TranslationUnit {
159149
FunctionAttributes
160150
ImpureFunction,
161151
functionRes = TypeVoid},
162-
declSpec = DeclSpec
163-
CTypeSpec {
164-
cTypeSpecIdentifier = Nothing,
165-
cTypeSpecInstances =
166-
Map.fromList []}},
152+
declSpec = DeclSpec {
153+
declSpecC = Nothing,
154+
declSpecHs = Nothing}},
167155
Decl {
168156
declInfo = DeclInfo {
169157
declLoc = "adios.h:31:6",
@@ -186,9 +174,7 @@ TranslationUnit {
186174
FunctionAttributes
187175
ImpureFunction,
188176
functionRes = TypeVoid},
189-
declSpec = DeclSpec
190-
CTypeSpec {
191-
cTypeSpecIdentifier = Nothing,
192-
cTypeSpecInstances =
193-
Map.fromList []}}],
177+
declSpec = DeclSpec {
178+
declSpecC = Nothing,
179+
declSpecHs = Nothing}}],
194180
unitDeps = ["adios"]}

hs-bindgen/fixtures/anonymous/bindingspec.yaml

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,52 +2,60 @@ version:
22
hs_bindgen: 0.1.0
33
binding_specification: '1.0'
44
hsmodule: Example
5-
types:
5+
ctypes:
66
- headers: anonymous.h
77
cname: struct S1
88
hsname: S1
9+
- headers: anonymous.h
10+
cname: S1_c
11+
hsname: S1_c
12+
- headers: anonymous.h
13+
cname: struct S2
14+
hsname: S2
15+
- headers: anonymous.h
16+
cname: S2_inner
17+
hsname: S2_inner
18+
- headers: anonymous.h
19+
cname: S2_inner_deep
20+
hsname: S2_inner_deep
21+
- headers: anonymous.h
22+
cname: struct S3
23+
hsname: S3
24+
- headers: anonymous.h
25+
cname: S3_c
26+
hsname: S3_c
27+
hstypes:
28+
- hsname: S1
929
instances:
1030
- Eq
1131
- Show
1232
- Storable
13-
- headers: anonymous.h
14-
cname: S1_c
15-
hsname: S1_c
33+
- hsname: S1_c
1634
instances:
1735
- Eq
1836
- Show
1937
- Storable
20-
- headers: anonymous.h
21-
cname: struct S2
22-
hsname: S2
38+
- hsname: S2
2339
instances:
2440
- Eq
2541
- Show
2642
- Storable
27-
- headers: anonymous.h
28-
cname: S2_inner
29-
hsname: S2_inner
43+
- hsname: S2_inner
3044
instances:
3145
- Eq
3246
- Show
3347
- Storable
34-
- headers: anonymous.h
35-
cname: S2_inner_deep
36-
hsname: S2_inner_deep
48+
- hsname: S2_inner_deep
3749
instances:
3850
- Eq
3951
- Show
4052
- Storable
41-
- headers: anonymous.h
42-
cname: struct S3
43-
hsname: S3
53+
- hsname: S3
4454
instances:
4555
- Eq
4656
- Show
4757
- Storable
48-
- headers: anonymous.h
49-
cname: S3_c
50-
hsname: S3_c
58+
- hsname: S3_c
5159
instances:
5260
- Eq
5361
- Show

0 commit comments

Comments
 (0)