You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
526 B
35 lines
526 B
package main
|
|
|
|
/*
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
*/
|
|
import "C"
|
|
|
|
import (
|
|
"encoding/json"
|
|
"strconv"
|
|
"unsafe"
|
|
)
|
|
|
|
func parseBool(b int) bool {
|
|
if b == 1 {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
|
|
func StructToJsonString(param interface{}) string {
|
|
dataType, _ := json.Marshal(param)
|
|
dataString := string(dataType)
|
|
return dataString
|
|
}
|
|
|
|
func FreeCString(strList ...*C.char) {
|
|
for _, str := range strList {
|
|
C.free(unsafe.Pointer(str))
|
|
}
|
|
}
|
|
func Int32ToString(intValue int32) string {
|
|
return strconv.Itoa(int(intValue))
|
|
}
|
|
|