Initial: initial commit

This commit is contained in:
kr328
2021-05-15 00:51:08 +08:00
commit 07e8afa69a
483 changed files with 26328 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
package main
/*
#cgo LDFLAGS: -llog
#include "bridge.h"
*/
import "C"
import (
"runtime"
"cfa/config"
"cfa/core"
"cfa/tunnel"
"github.com/Dreamacro/clash/log"
)
func main() {
panic("Stub!")
}
//export coreInit
func coreInit(home, versionName C.c_string, sdkVersion C.int) {
h := C.GoString(home)
v := C.GoString(versionName)
s := int(sdkVersion)
core.Init(h, v, s)
reset()
}
//export reset
func reset() {
config.LoadDefault()
tunnel.ResetStatistic()
runtime.GC()
}
//export forceGc
func forceGc() {
go func() {
log.Infoln("[APP] request force GC")
runtime.GC()
}()
}