Skip to content

Commit afb610c

Browse files
authored
feat(gogensig):normal refer func pointer instead (#437)
1 parent 75c07c0 commit afb610c

12 files changed

Lines changed: 93 additions & 99 deletions

File tree

_cmptest/testdata/libxml2/2.13.6/libxml2/debugXML.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ type X_xmlShellCtxt struct {
7070
Pctxt XPathContextPtr
7171
Loaded c.Int
7272
Output *c.FILE
73-
Input c.Pointer
73+
Input ShellReadlineFunc
7474
}
7575
type ShellCtxt X_xmlShellCtxt
7676
type ShellCtxtPtr *ShellCtxt

_cmptest/testdata/libxml2/2.13.6/libxml2/encoding.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ type CharEncodingOutputFunc func(*c.Char, *c.Int, *c.Char, *c.Int) c.Int
5353

5454
type X_xmlCharEncodingHandler struct {
5555
Name *c.Char
56-
Input c.Pointer
57-
Output c.Pointer
56+
Input CharEncodingInputFunc
57+
Output CharEncodingOutputFunc
5858
}
5959
type CharEncodingHandler X_xmlCharEncodingHandler
6060
type CharEncodingHandlerPtr *CharEncodingHandler

_cmptest/testdata/libxml2/2.13.6/libxml2/parser.go

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -172,33 +172,33 @@ type StartElementNsSAX2Func func(c.Pointer, *Char, *Char, *Char, c.Int, **Char,
172172
type EndElementNsSAX2Func func(c.Pointer, *Char, *Char, *Char)
173173

174174
type X_xmlSAXHandlerV1 struct {
175-
InternalSubset c.Pointer
176-
IsStandalone c.Pointer
177-
HasInternalSubset c.Pointer
178-
HasExternalSubset c.Pointer
179-
ResolveEntity c.Pointer
180-
GetEntity c.Pointer
181-
EntityDecl c.Pointer
182-
NotationDecl c.Pointer
183-
AttributeDecl c.Pointer
184-
ElementDecl c.Pointer
185-
UnparsedEntityDecl c.Pointer
186-
SetDocumentLocator c.Pointer
187-
StartDocument c.Pointer
188-
EndDocument c.Pointer
189-
StartElement c.Pointer
190-
EndElement c.Pointer
191-
Reference c.Pointer
192-
Characters c.Pointer
193-
IgnorableWhitespace c.Pointer
194-
ProcessingInstruction c.Pointer
195-
Comment c.Pointer
196-
Warning c.Pointer
197-
Error c.Pointer
198-
FatalError c.Pointer
199-
GetParameterEntity c.Pointer
200-
CdataBlock c.Pointer
201-
ExternalSubset c.Pointer
175+
InternalSubset InternalSubsetSAXFunc
176+
IsStandalone IsStandaloneSAXFunc
177+
HasInternalSubset HasInternalSubsetSAXFunc
178+
HasExternalSubset HasExternalSubsetSAXFunc
179+
ResolveEntity ResolveEntitySAXFunc
180+
GetEntity GetEntitySAXFunc
181+
EntityDecl EntityDeclSAXFunc
182+
NotationDecl NotationDeclSAXFunc
183+
AttributeDecl AttributeDeclSAXFunc
184+
ElementDecl ElementDeclSAXFunc
185+
UnparsedEntityDecl UnparsedEntityDeclSAXFunc
186+
SetDocumentLocator SetDocumentLocatorSAXFunc
187+
StartDocument StartDocumentSAXFunc
188+
EndDocument EndDocumentSAXFunc
189+
StartElement StartElementSAXFunc
190+
EndElement EndElementSAXFunc
191+
Reference ReferenceSAXFunc
192+
Characters CharactersSAXFunc
193+
IgnorableWhitespace IgnorableWhitespaceSAXFunc
194+
ProcessingInstruction ProcessingInstructionSAXFunc
195+
Comment CommentSAXFunc
196+
Warning WarningSAXFunc
197+
Error ErrorSAXFunc
198+
FatalError FatalErrorSAXFunc
199+
GetParameterEntity GetParameterEntitySAXFunc
200+
CdataBlock CdataBlockSAXFunc
201+
ExternalSubset ExternalSubsetSAXFunc
202202
Initialized c.Uint
203203
}
204204
type SAXHandlerV1 X_xmlSAXHandlerV1

_cmptest/testdata/libxml2/2.13.6/libxml2/tree.go

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const DOCB_DOCUMENT_NODE = 21
1010

1111
type X_xmlParserInputBuffer struct {
1212
Context c.Pointer
13-
Readcallback c.Pointer
14-
Closecallback c.Pointer
13+
Readcallback InputReadCallback
14+
Closecallback InputCloseCallback
1515
Encoder CharEncodingHandlerPtr
1616
Buffer BufPtr
1717
Raw BufPtr
@@ -24,8 +24,8 @@ type ParserInputBufferPtr *ParserInputBuffer
2424

2525
type X_xmlOutputBuffer struct {
2626
Context c.Pointer
27-
Writecallback c.Pointer
28-
Closecallback c.Pointer
27+
Writecallback OutputWriteCallback
28+
Closecallback OutputCloseCallback
2929
Encoder CharEncodingHandlerPtr
3030
Buffer BufPtr
3131
Conv BufPtr
@@ -46,7 +46,7 @@ type X_xmlParserInput struct {
4646
Line c.Int
4747
Col c.Int
4848
Consumed c.Ulong
49-
Free c.Pointer
49+
Free ParserInputDeallocate
5050
Encoding *Char
5151
Version *Char
5252
Flags c.Int
@@ -154,7 +154,7 @@ type X_xmlParserCtxt struct {
154154
Nsdb *ParserNsData
155155
AttrHashMax c.Uint
156156
AttrHash *AttrHashBucket
157-
ErrorHandler c.Pointer
157+
ErrorHandler StructuredErrorFunc
158158
ErrorCtxt c.Pointer
159159
}
160160
type ParserCtxt X_xmlParserCtxt
@@ -170,38 +170,38 @@ type SAXLocator X_xmlSAXLocator
170170
type SAXLocatorPtr *SAXLocator
171171

172172
type X_xmlSAXHandler struct {
173-
InternalSubset c.Pointer
174-
IsStandalone c.Pointer
175-
HasInternalSubset c.Pointer
176-
HasExternalSubset c.Pointer
177-
ResolveEntity c.Pointer
178-
GetEntity c.Pointer
179-
EntityDecl c.Pointer
180-
NotationDecl c.Pointer
181-
AttributeDecl c.Pointer
182-
ElementDecl c.Pointer
183-
UnparsedEntityDecl c.Pointer
184-
SetDocumentLocator c.Pointer
185-
StartDocument c.Pointer
186-
EndDocument c.Pointer
187-
StartElement c.Pointer
188-
EndElement c.Pointer
189-
Reference c.Pointer
190-
Characters c.Pointer
191-
IgnorableWhitespace c.Pointer
192-
ProcessingInstruction c.Pointer
193-
Comment c.Pointer
194-
Warning c.Pointer
195-
Error c.Pointer
196-
FatalError c.Pointer
197-
GetParameterEntity c.Pointer
198-
CdataBlock c.Pointer
199-
ExternalSubset c.Pointer
173+
InternalSubset InternalSubsetSAXFunc
174+
IsStandalone IsStandaloneSAXFunc
175+
HasInternalSubset HasInternalSubsetSAXFunc
176+
HasExternalSubset HasExternalSubsetSAXFunc
177+
ResolveEntity ResolveEntitySAXFunc
178+
GetEntity GetEntitySAXFunc
179+
EntityDecl EntityDeclSAXFunc
180+
NotationDecl NotationDeclSAXFunc
181+
AttributeDecl AttributeDeclSAXFunc
182+
ElementDecl ElementDeclSAXFunc
183+
UnparsedEntityDecl UnparsedEntityDeclSAXFunc
184+
SetDocumentLocator SetDocumentLocatorSAXFunc
185+
StartDocument StartDocumentSAXFunc
186+
EndDocument EndDocumentSAXFunc
187+
StartElement StartElementSAXFunc
188+
EndElement EndElementSAXFunc
189+
Reference ReferenceSAXFunc
190+
Characters CharactersSAXFunc
191+
IgnorableWhitespace IgnorableWhitespaceSAXFunc
192+
ProcessingInstruction ProcessingInstructionSAXFunc
193+
Comment CommentSAXFunc
194+
Warning WarningSAXFunc
195+
Error ErrorSAXFunc
196+
FatalError FatalErrorSAXFunc
197+
GetParameterEntity GetParameterEntitySAXFunc
198+
CdataBlock CdataBlockSAXFunc
199+
ExternalSubset ExternalSubsetSAXFunc
200200
Initialized c.Uint
201201
X_private c.Pointer
202-
StartElementNs c.Pointer
203-
EndElementNs c.Pointer
204-
Serror c.Pointer
202+
StartElementNs StartElementNsSAX2Func
203+
EndElementNs EndElementNsSAX2Func
204+
Serror StructuredErrorFunc
205205
}
206206
type SAXHandler X_xmlSAXHandler
207207
type SAXHandlerPtr *SAXHandler
@@ -559,7 +559,7 @@ type X_xmlDOMWrapCtxt struct {
559559
X_private c.Pointer
560560
Type c.Int
561561
NamespaceMap c.Pointer
562-
GetNsForNodeFunc c.Pointer
562+
GetNsForNodeFunc DOMWrapAcquireNsFunction
563563
}
564564
type DOMWrapCtxt X_xmlDOMWrapCtxt
565565
type DOMWrapCtxtPtr *DOMWrapCtxt

_cmptest/testdata/libxml2/2.13.6/libxml2/valid.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ type ValidityWarningFunc func(__llgo_arg_0 c.Pointer, __llgo_arg_1 *c.Char, __ll
1919

2020
type X_xmlValidCtxt struct {
2121
UserData c.Pointer
22-
Error c.Pointer
23-
Warning c.Pointer
22+
Error ValidityErrorFunc
23+
Warning ValidityWarningFunc
2424
Node NodePtr
2525
NodeNr c.Int
2626
NodeMax c.Int

_cmptest/testdata/libxml2/2.13.6/libxml2/xlink.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ type XlinkExtendedLinkFunk func(c.Pointer, NodePtr, c.Int, *XlinkHRef, *XlinkRol
4747
type XlinkExtendedLinkSetFunk func(c.Pointer, NodePtr, c.Int, *XlinkHRef, *XlinkRole, c.Int, *XlinkTitle, **Char)
4848

4949
type X_xlinkHandler struct {
50-
Simple c.Pointer
51-
Extended c.Pointer
52-
Set c.Pointer
50+
Simple XlinkSimpleLinkFunk
51+
Extended XlinkExtendedLinkFunk
52+
Set XlinkExtendedLinkSetFunk
5353
}
5454
type XlinkHandler X_xlinkHandler
5555
type XlinkHandlerPtr *XlinkHandler

_cmptest/testdata/libxml2/2.13.6/libxml2/xpath.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,17 @@ type X_xmlXPathContext struct {
3333
Here NodePtr
3434
Origin NodePtr
3535
NsHash HashTablePtr
36-
VarLookupFunc c.Pointer
36+
VarLookupFunc XPathVariableLookupFunc
3737
VarLookupData c.Pointer
3838
Extra c.Pointer
3939
Function *Char
4040
FunctionURI *Char
41-
FuncLookupFunc c.Pointer
41+
FuncLookupFunc XPathFuncLookupFunc
4242
FuncLookupData c.Pointer
4343
TmpNsList *NsPtr
4444
TmpNsNr c.Int
4545
UserData c.Pointer
46-
Error c.Pointer
46+
Error StructuredErrorFunc
4747
LastError Error
4848
DebugNode NodePtr
4949
Dict DictPtr
@@ -142,7 +142,7 @@ type XPathConvertFunc func(XPathObjectPtr, c.Int) c.Int
142142

143143
type X_xmlXPathType struct {
144144
Name *Char
145-
Func c.Pointer
145+
Func XPathConvertFunc
146146
}
147147
type XPathType X_xmlXPathType
148148
type XPathTypePtr *XPathType
@@ -159,7 +159,7 @@ type XPathEvalFunc func(XPathParserContextPtr, c.Int)
159159

160160
type X_xmlXPathFunct struct {
161161
Name *Char
162-
Func c.Pointer
162+
Func XPathEvalFunc
163163
}
164164
type XPathFunct X_xmlXPathFunct
165165
type XPathFuncPtr *XPathFunct
@@ -169,7 +169,7 @@ type XPathAxisFunc func(XPathParserContextPtr, XPathObjectPtr) XPathObjectPtr
169169

170170
type X_xmlXPathAxis struct {
171171
Name *Char
172-
Func c.Pointer
172+
Func XPathAxisFunc
173173
}
174174
type XPathAxis X_xmlXPathAxis
175175
type XPathAxisPtr *XPathAxis

_cmptest/testdata/libxslt/1.1.42/libxslt/xsltInternals.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const MAX_SORT = 15
1010

1111
type X_xsltRuntimeExtra struct {
1212
Info c.Pointer
13-
Deallocate c.Pointer
13+
Deallocate libxml2.FreeFunc
1414
Val struct {
1515
Ptr c.Pointer
1616
}
@@ -200,9 +200,9 @@ type X_xsltTransformContext struct {
200200
Extras RuntimeExtraPtr
201201
StyleList DocumentPtr
202202
Sec c.Pointer
203-
Error c.Pointer
203+
Error libxml2.GenericErrorFunc
204204
Errctx c.Pointer
205-
Sortfunc c.Pointer
205+
Sortfunc SortFunc
206206
TmpRVT libxml2.DocPtr
207207
PersistRVT libxml2.DocPtr
208208
Ctxtflags c.Int
@@ -232,19 +232,19 @@ type X_xsltTransformContext struct {
232232
OpCount c.Ulong
233233
SourceDocDirty c.Int
234234
CurrentId c.Ulong
235-
NewLocale c.Pointer
236-
FreeLocale c.Pointer
237-
GenSortKey c.Pointer
235+
NewLocale NewLocaleFunc
236+
FreeLocale FreeLocaleFunc
237+
GenSortKey GenSortKeyFunc
238238
}
239239
type TransformContext X_xsltTransformContext
240240
type TransformContextPtr *TransformContext
241241

242242
type X_xsltElemPreComp struct {
243243
Next ElemPreCompPtr
244244
Type StyleType
245-
Func c.Pointer
245+
Func TransformFunction
246246
Inst libxml2.NodePtr
247-
Free c.Pointer
247+
Free ElemPreCompDeallocator
248248
}
249249
type ElemPreComp X_xsltElemPreComp
250250
type ElemPreCompPtr *ElemPreComp
@@ -287,7 +287,7 @@ type ElemPreCompDeallocator func(ElemPreCompPtr)
287287
type X_xsltStylePreComp struct {
288288
Next ElemPreCompPtr
289289
Type StyleType
290-
Func c.Pointer
290+
Func TransformFunction
291291
Inst libxml2.NodePtr
292292
Stype *libxml2.Char
293293
HasStype c.Int

_cmptest/testdata/zlib/1.3.1/zlib/zlib.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ type ZStreamS struct {
5555
TotalOut ULong
5656
Msg *c.Char
5757
State *InternalState
58-
Zalloc c.Pointer
59-
Zfree c.Pointer
58+
Zalloc AllocFunc
59+
Zfree FreeFunc
6060
Opaque Voidpf
6161
DataType c.Int
6262
Adler ULong

cl/internal/convert/_testdata/funcrefer/gogensig.expect

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type Hooks struct {
2929

3030
type Stream struct {
3131
F *c.FILE
32-
Cb c.Pointer
32+
Cb CallBack
3333
}
3434

3535
// llgo:type C

0 commit comments

Comments
 (0)