1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 04:22:22 +00:00
advanced-go-programming-book/images/ch2-5-call-c-sum-v1.plantuml
2019-11-13 10:12:55 +08:00

49 lines
696 B
Plaintext

' Copyright 2017 <chaishushan{AT}gmail.com>. All rights reserved.
' Use of this source code is governed by a Apache
' license that can be found in the LICENSE file.
@startuml
title C.sum(2, 3)
|main.go|
:func main() {
C.sum(2, 3))
};
|#AntiqueWhite|main.cgo1.go|
:func main() {
_Cfunc_sum(2, 3))
};
|#AntiqueWhite|_cgo_types.go|
:func _Cfunc_sum(2, 3) double {
_cgo_runtime_cgocall(...)
return
};
|runtime.cgocall|
:_cgo_runtime_cgocall(...);
fork
|#AntiqueWhite|main.cgo2.c|
: double _cgo_xxx_Cfunc_sum(2, 3) {
return sum(2, 3)
};
|#AntiqueWhite|main.cgo2.c|
: int sum(int a, int b) {
return a+b
};
endfork
|runtime.cgocall|
:_cgo_runtime_cgocall(...);
|main.go|
stop
@enduml