/* Code generated by cmd/cgo; DO NOT EDIT. */

/* package command-line-arguments */


#line 1 "cgo-builtin-export-prolog"

#include <stddef.h>

#ifndef GO_CGO_EXPORT_PROLOGUE_H
#define GO_CGO_EXPORT_PROLOGUE_H

#ifndef GO_CGO_GOSTRING_TYPEDEF
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
extern size_t _GoStringLen(_GoString_ s);
extern const char *_GoStringPtr(_GoString_ s);
#endif

#endif

/* Start of preamble from import "C" comments.  */



#line 3 "im.go"

#include <stdint.h>

#line 1 "cgo-generated-wrapper"






#line 3 "bench.go"

#include <stdint.h>

#line 1 "cgo-generated-wrapper"


/* End of preamble from import "C" comments.  */


/* Start of boilerplate cgo prologue.  */
#line 1 "cgo-gcc-export-header-prolog"

#ifndef GO_CGO_PROLOGUE_H
#define GO_CGO_PROLOGUE_H

typedef signed char GoInt8;
typedef unsigned char GoUint8;
typedef short GoInt16;
typedef unsigned short GoUint16;
typedef int GoInt32;
typedef unsigned int GoUint32;
typedef long long GoInt64;
typedef unsigned long long GoUint64;
typedef GoInt64 GoInt;
typedef GoUint64 GoUint;
typedef size_t GoUintptr;
typedef float GoFloat32;
typedef double GoFloat64;
#ifdef _MSC_VER
#if !defined(__cplusplus) || _MSVC_LANG <= 201402L
#include <complex.h>
typedef _Fcomplex GoComplex64;
typedef _Dcomplex GoComplex128;
#else
#include <complex>
typedef std::complex<float> GoComplex64;
typedef std::complex<double> GoComplex128;
#endif
#else
typedef float _Complex GoComplex64;
typedef double _Complex GoComplex128;
#endif

/*
  static assertion to make sure the file is being used on architecture
  at least with matching size of GoInt.
*/
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1];

#ifndef GO_CGO_GOSTRING_TYPEDEF
typedef _GoString_ GoString;
#endif
typedef void *GoMap;
typedef void *GoChan;
typedef struct { void *t; void *v; } GoInterface;
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice;

#endif

/* End of boilerplate cgo prologue.  */

#ifdef __cplusplus
extern "C" {
#endif


// 向SDK设置自定义的CoinType 和 前缀
//
extern __declspec(dllexport) void SetCoinTypeCustom(long long int coinType, char* addrPre);

// 初始化设置生成配置文件，addpre等等
//
extern __declspec(dllexport) char* InitV2(char* conf, char* addrpre, char* pwd, char* impwd);
extern __declspec(dllexport) char* InitV3(char* conf, char* addrpre, char* prk);

// 检查是否升级CoinType
//
extern __declspec(dllexport) char* CheckUpgradePreAndCoinType(char* conf, char* addrpre);

// 升级CoinType
//
extern __declspec(dllexport) char* UpgradePreAndCoinType(char* conf, char* newaddrpre, long long int newcoinType, char* pwd, char* imprik);

// 设置im日志等级 0-7, 3 error 4 waring 6 info 7 debug
//
extern __declspec(dllexport) void SetLogLevel(long int level);

// 检查钱包密码是否正确
//
extern __declspec(dllexport) char* CheckPassword(char* password);

// 导出助记词
//
extern __declspec(dllexport) char* ExportMnemonic(char* pwd);

// 导入助记词
//
extern __declspec(dllexport) char* ImportMnemonicV2(char* pwd, char* impwd, char* minerpwd, char* word);

// 创建新的钱包地址
//
extern __declspec(dllexport) char* CreateNewAddrV1(char* password, long int walletIndex);

// 获取所有钱包地址
//
extern __declspec(dllexport) char* GetAllAddr(long int walletIndex);

// 关闭本次area链接（IM使用）
//
extern __declspec(dllexport) void Close(void);

// 获取本节点信息
//
extern __declspec(dllexport) char* GetNodeId(void);
extern __declspec(dllexport) char* GetHash(char* str);

// 检查当前area是否在线
//
extern __declspec(dllexport) char* CheckOnline(void);

// 重连P2P
//
extern __declspec(dllexport) char* ReConnect(void);

// 获取当前版本（这个地方是写死的，没啥用）
//
extern __declspec(dllexport) char* Version(void);
extern __declspec(dllexport) char* GetPukBase58StrByAddr(char* addr, char* pwd, long int walletIndex);
extern __declspec(dllexport) char* GetPukBase58StrByPrikIndex(char* pwd, long int prikIndex);
extern __declspec(dllexport) char* ResetWalletPassword(char* oldPwd, char* newPwd);
extern __declspec(dllexport) char* BuildNetAddrByMnemonic(char* word);
extern __declspec(dllexport) char* GetUserAuth(void);

// 生成DH密钥对
//
extern __declspec(dllexport) char* GenerateDHPair(void);

// 获取HTTP加密DH客户端公钥
//
extern __declspec(dllexport) char* GetHTTPDHKeyPublicKey(void);

// HTTP加密
//
extern __declspec(dllexport) void EncryptHTTPData(long long int port, char* data);

// HTTP解密
//
extern __declspec(dllexport) void DecryptHTTPData(long long int port, char* data);

/*
//export RunServer
func RunServer() *C.char {
	engine.Log.Error("RunServer")
	return C.CString(im.RunServer())
}
*/
extern __declspec(dllexport) char* SetP2pPort(char* port);
extern __declspec(dllexport) void RunP2p(long long int port, char* remoteaddr, char* nodeAddr, char* devName, char* runEnv);
extern __declspec(dllexport) char* RunP2pByPrk(char* conf, char* remoteaddr, char* prk);
extern __declspec(dllexport) char* GroupId(void);
extern __declspec(dllexport) char* GetMegHash(long int msgid, char* tonodeid, char* msgstr);
extern __declspec(dllexport) char* GetTime(void);
extern __declspec(dllexport) char* UpdateIsAllRead(long int needRead);
extern __declspec(dllexport) char* GetMachineId(char* content);
extern __declspec(dllexport) char* GetServerTime(char* content);
extern __declspec(dllexport) char* GetGroupPasswd(char* content);
extern __declspec(dllexport) char* SetAreaName(char* content);
extern __declspec(dllexport) void UpdateGroupMemberCallback(char* gid);

/*
//export AddWhiteList
func AddWhiteList(content *C.char) {
	engine.Log.Error("AddWhiteList")
	im.AddWhiteList(C.GoString(content))
}
*/
extern __declspec(dllexport) char* CheckImPassword(char* password);
extern __declspec(dllexport) char* UpdateImPwd(char* oldpwd, char* newpwd);
extern __declspec(dllexport) char* ExportImPrivateKey(char* pwd);
extern __declspec(dllexport) char* SetServerPort(char* port);
extern __declspec(dllexport) char* SetAllProxy(char* content, char* id, char* ip, long int port);

/*//export SetAreaVerByMid
func SetAreaVerByMid(content *C.char) *C.char {
	engine.Log.Error("SetAreaVerByMid")
	return C.CString(im.SetAreaVerByMid(C.GoString(content)))
}
*/
extern __declspec(dllexport) char* SetAllProxy2(char* content, char* id, char* ip, long int port);
extern __declspec(dllexport) void SetWSMessagePort(long int port);
extern __declspec(dllexport) void StartWSMessageServer(void);
extern __declspec(dllexport) void StartGetMessage(void);
extern __declspec(dllexport) char* LoadInitData(char* content);

/*
//export MessageDataRecv
func MessageDataRecv(content *C.char) *C.char {
	engine.Log.Error("MessageDataRecv")
	return C.CString(im.MessageDataRecv(C.GoString(content)))
}
*/
extern __declspec(dllexport) void InitDartApi(void* api);
extern __declspec(dllexport) void SetMsgSendPort(GoInt64 port);
extern __declspec(dllexport) void CleanMessageStructMemory(GoInt64 ptrAddr);
extern __declspec(dllexport) void CleanMessageStructMemoryByPort(GoInt64 ptrAddr);
extern __declspec(dllexport) char* StatMessageStructMemory(void);
extern __declspec(dllexport) char* CgoHandleStat(void);
extern __declspec(dllexport) char* GetMsgByCgoHandle(GoUintptr handleVal);
extern __declspec(dllexport) void CleanCgoHandleByPort(long long int port);
extern __declspec(dllexport) char* ClearLoginInfo(void);
extern __declspec(dllexport) char* SetAreaConnType(char* connType);

/*
//export SetReadMsgDelVersion
func SetReadMsgDelVersion(connType *C.char) *C.char {
	engine.Log.Error("SetReadMsgDelVersion")
	return C.CString(im.SetReadMsgDelVersion(C.GoString(connType)))
}

//export SetBlockStranger
func SetBlockStranger(connType *C.char) *C.char {
	engine.Log.Error("SetBlockStranger")
	return C.CString(im.SetBlockStranger(C.GoString(connType)))
}

//export GetAllOnlineMachine
func GetAllOnlineMachine(msgid C.long, content *C.char) *C.char {
	engine.Log.Error("GetAllOnlineMachine")
	return C.CString(im.GetAllOnlineMachine(int64(msgid), C.GoString(content)))
}

//export CloseOnlineMachine
func CloseOnlineMachine(msgid C.long, addr *C.char, machine *C.char) *C.char {
	engine.Log.Error("CloseOnlineMachine")
	return C.CString(im.CloseOnlineMachine(int64(msgid), C.GoString(addr), C.GoString(machine)))
}

//export CloseOnlineMachineV2
func CloseOnlineMachineV2(msgid C.long, machine *C.char, cType C.long, version C.long, isDel *C.char) *C.char {
	engine.Log.Error("CloseOnlineMachineV2")
	return C.CString(im.CloseOnlineMachineV2(int64(msgid), C.GoString(machine), int64(cType), int64(version), C.GoString(isDel)))
}

//export OnlineMachineRcv
func OnlineMachineRcv(cmd C.long, hash *C.char) *C.char {
	engine.Log.Error("OnlineMachineRcv")
	return C.CString(im.OnlineMachineRcv(int64(cmd), C.GoString(hash)))
}

//export OnlineMachineRcvV2
func OnlineMachineRcvV2(cmd C.long, hash *C.char, isDel *C.char) *C.char {
	engine.Log.Error("OnlineMachineRcvV2")
	return C.CString(im.OnlineMachineRcvV2(int64(cmd), C.GoString(hash), C.GoString(isDel)))
}
*/
extern __declspec(dllexport) char* AddressCoinToEvmAddress(char* addr);
extern __declspec(dllexport) char* EvmAddressToAddressCoin(char* addr);

////export AuthLogin
//func AuthLogin(toAddr *C.char, toCurPuk *C.char, P2pProxyId *C.char, P2pMachineId *C.char, devName *C.char, body *C.char, method C.long, closeMachineId *C.char) *C.char {
//	return C.CString(im.AuthLogin(C.GoString(toAddr), C.GoString(toCurPuk), C.GoString(P2pProxyId), C.GoString(P2pMachineId), C.GoString(devName), C.GoString(body), int32(method), C.GoString(closeMachineId)))
//}
/*
//export AuthLogin
func AuthLogin(proxy *C.char, toCurPuk *C.char) *C.char {
	engine.Log.Error("AuthLogin")
	return C.CString(im.AuthLogin(C.GoString(proxy), C.GoString(toCurPuk)))
}

//export SetMainDevice
func SetMainDevice(proxy *C.char) *C.char {
	engine.Log.Error("SetMainDevice")
	return C.CString(im.SetMainDevice(C.GoString(proxy)))
}
*/
extern __declspec(dllexport) char* SignatureStr(char* str);
extern __declspec(dllexport) char* SignVerificationStr(char* edpuk, char* msg, char* sigMsg);

/*
//export SaveDeviceData
func SaveDeviceData(port C.longlong, proxy *C.char) {
	engine.Log.Error("SaveDeviceData")
	callback := func(port int64, msg string) {
		engine.Log.Error("SaveDeviceData SendToPort port: %d, msg: %v", port, msg)
		SendToPort(port, msg)
	}
	go func() {
		result := im.SaveDeviceData(C.GoString(proxy))
		callback(int64(port), result)
	}()
}

//export BindTempDev
func BindTempDev(proxy *C.char) *C.char {
	engine.Log.Error("BindTempDev")
	return C.CString(im.BindTempDev(C.GoString(proxy)))
}

//export SendP2pMsgToNode
func SendP2pMsgToNode(port C.longlong, recvId *C.char, machineId *C.char, data *C.char) {
	engine.Log.Error("SendP2pMsgToNode")
	go func() {
		result := im.SendP2pMsgToNode(C.GoString(recvId), C.GoString(machineId), C.GoString(data))
		SendToPort(int64(port), result)
	}()
	//return C.CString(im.SendP2pMsgToNode(C.GoString(recvId), C.GoString(machineId), C.GoString(data)))
}

//export SendMediaMsgToNode
func SendMediaMsgToNode(port C.longlong, data *C.char) {
	engine.Log.Error("SendP2pMsgToNode")
	go func() {
		result := im.SendMediaMsgToNode(C.GoString(data))
		SendToPort(int64(port), result)
	}()
	//return C.CString(im.SendMediaMsgToNode(C.GoString(data)))
}
*/
extern __declspec(dllexport) char* GetCurProxy(void);
extern __declspec(dllexport) char* CreateQR(char* gid);
extern __declspec(dllexport) char* EncryptQR(char* str, char* gid, long int gidVer);
extern __declspec(dllexport) char* DeleteAppGs(char* gid);
extern __declspec(dllexport) char* SetEncryptData(char* key, char* pwd, char* value);
extern __declspec(dllexport) char* GetEncryptData(char* key, char* pwd);
extern __declspec(dllexport) char* DelEncryptData(char* key);

/*
//export GetCommonDatabase
func GetCommonDatabase(content *C.char) *C.char {
	engine.Log.Error("GetCommonDatabase")
	return C.CString(im.GetCommonDatabaseFunc(C.GoString(content)))
}

//export SetCommonDatabase
func SetCommonDatabase(content *C.char) *C.char {
	engine.Log.Error("SetCommonDatabase")
	return C.CString(im.SetCommonDatabaseFunc(C.GoString(content)))
}
*/
extern __declspec(dllexport) char* GetActivityNum(char* req, char* addr);
extern __declspec(dllexport) char* GetActivityRank(char* req, char* addr);
extern __declspec(dllexport) char* GetDatabaseToken(char* req, char* addr);
extern __declspec(dllexport) char* CommonDatabaseRequest(long int msgID, char* req, char* addr);
extern __declspec(dllexport) char* AddTransfer(char* req, char* addr);
extern __declspec(dllexport) char* GetTransfer(char* req, char* addr);
extern __declspec(dllexport) char* GetTransferEveryDayNum(char* req, char* addr);
extern __declspec(dllexport) char* GetProducts(char* addr, char* req);
extern __declspec(dllexport) char* CheckinToken(char* req, char* addr);
extern __declspec(dllexport) void InitLedisDb(char* dir);

/*
//export AddErrLog
func AddErrLog(addTime C.longlong, ver C.longlong, project *C.char, file *C.char, funcName *C.char, user *C.char, errLog *C.char, other *C.char) *C.char {
	engine.Log.Error("AddErrLog")
	ok := im.AddErrLog(int64(addTime), int64(ver), C.GoString(project), C.GoString(file), C.GoString(funcName), C.GoString(user), C.GoString(errLog), C.GoString(other))
	if ok {
		return C.CString(utils.Out(config.OutStatusOK, "ok"))
	}
	return C.CString(utils.Out(config.OutStatusFail, "fail"))
}
*/
/*
//export GetErrLog
func GetErrLog() *C.char {
	engine.Log.Error("GetErrLog")
	data, err := im.GetErrLog()
	if err != nil {
		return C.CString(utils.Out(config.OutStatusFail, "fail"))
	}
	bs, _ := json.Marshal(data)
	return C.CString(utils.Out(config.OutStatusOK, string(bs)))
}
*/
extern __declspec(dllexport) char* DelErrLog(long long int min, long long int max);
extern __declspec(dllexport) char* UnzipErrLog(char* str);
extern __declspec(dllexport) void Ping(long long int port, char* str, long int waitNum);
extern __declspec(dllexport) char* SavePriInfo(char* str);
extern __declspec(dllexport) char* GetPriInfo(char* str);
extern __declspec(dllexport) char* DelPriInfo(void);

/*
//export GetGroupMemberList
func GetGroupMemberList(str *C.char) *C.char {
	engine.Log.Error("GetGroupMemberList")
	return C.CString(im.GetGroupMemberList(C.GoString(str)))
}

//export RecoveryMsgByFileContent
func RecoveryMsgByFileContent(str *C.char) *C.char {
	engine.Log.Error("RecoveryMsgByFileContent")
	return C.CString(im.RecoveryMsgByFileContent(C.GoString(str)))
}
*/
extern __declspec(dllexport) char* EncryptContent(char* key, char* content);
extern __declspec(dllexport) char* DecryptContent(char* key, char* content);

/*
//export AddImCommonData
func AddImCommonData(key, value, dataType *C.char, version C.long) *C.char {
	engine.Log.Error("AddImCommonData")
	return C.CString(im.AddCommonData(C.GoString(key), C.GoString(value), C.GoString(dataType), int64(version)))
}

//export DelImCommonData
func DelImCommonData(key *C.char, version C.long) *C.char {
	engine.Log.Error("DelImCommonData")
	return C.CString(im.DelCommonData(C.GoString(key), int64(version)))
}

//export GetImCommonData
func GetImCommonData(key *C.char) *C.char {
	engine.Log.Error("GetCommonData")
	return C.CString(im.GetCommonData(C.GoString(key)))
}

//export NoticeConfig
func NoticeConfig(port C.longlong, data *C.char) {
	engine.Log.Error("NoticeConfig")
	callback := func(port int64, msg string) {
		engine.Log.Error("NoticeConfig SendToPort port: %d, msg: %v", port, msg)
		SendToPort(port, msg)
	}
	go func() {
		result := im.NoticeConfig(C.GoString(data))
		callback(int64(port), result)
	}()
	//return C.CString(im.NoticeConfig(C.GoString(data)))
}
*/
extern __declspec(dllexport) char* GetConnStatus(void);
extern __declspec(dllexport) void OssIsExit(long long int port, char* param);
extern __declspec(dllexport) void ExitAccount(void);
extern __declspec(dllexport) void SetTestFlag(void);
extern __declspec(dllexport) void MessageResp(char* key);
extern __declspec(dllexport) void UpdateUserInfoV2(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void QueryUser(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void SingleChat(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void SingleDelByid(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void SingleDelAll(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void GroupChat(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void GroupDelByid(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void GroupDelAll(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void SingleDelSection(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void SingleSend(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void SingleRead(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void SingleWithdraw(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void GetSingleChatMsg(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void AddContact(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void BlockContact(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void RemoveBlockContact(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void DeleteContact(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void RemarkContact(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void DisturbContact(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void RequestAddContact(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void QueryContactInfo(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void ReplyRequestAddContact(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void HandleRequestAddContact(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdatePinneMesList(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateContactConf(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void AddDevice(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateDevice(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void DeleteDevice(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void DeviceInfo(long long int port, uint8_t* content, long int len);

/*
//export UploadOnline
func UploadOnline(port C.longlong, content *C.uint8_t, len C.long) {
	fn := func(port int64, msg string) {
		engine.Log.Info("UploadOnline SendToPortByHandle port: %d, msg: %v", port, msg)
		SendToPortByHandle(port, msg)
	}
	val := voidToArr(content, len)

	go imV2.UploadOnline(int64(port), fn, val)
}
*/
extern __declspec(dllexport) void OutLineOtherDev(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateNoticeVoiceConfig(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void CreateGroup(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateGroupName(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateGroupHeadUrl(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateGroupIntroduction(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void AddGroupMember(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void RemoveGroupMember(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateGroupMemberName(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void DissolveGroup(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void QueryGroup(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void ApplyGroup(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateGroupMemberRole(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateGroupConf(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void GroupTransfer(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void ExitGroup(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateGroupPinneMesList(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void GroupDelSection(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void GroupWithdraw(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void GetGroupChatMsg(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void P2pMsgData(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) char* GetSingleOfflineMsgBody(uint8_t* content, long int len);
extern __declspec(dllexport) char* GetGroupOfflineMsgBody(uint8_t* content, long int len);
extern __declspec(dllexport) void AddFavoriteContent(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateFavoriteContent(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void DelFavoriteContent(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void AddFavoriteFolder(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void DelFavoriteFolder(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateFavoriteFolder(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void GetFavoriteFolders(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void GetFavoriteAllFolders(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void CreateSecretRooms(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateSecretRoomPwd(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateSecretRoomName(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void DelSecretRoom(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void SetValidityPeriod(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void AddContactToSecRoom(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void DelContactOutSecRoom(long long int port, uint8_t* content, long int len);
extern __declspec(dllexport) void UpdateSecRoomHide(long long int port, uint8_t* content, long int len);

/* Return type for GetByteByCgoHandle */
struct GetByteByCgoHandle_return {
	uint8_t* r0; /* content */
	long int r1; /* len */
};
extern __declspec(dllexport) struct GetByteByCgoHandle_return GetByteByCgoHandle(GoUintptr handleVal);
extern __declspec(dllexport) void EchoCgoByteFunc(long long int port, uint8_t* content, long int lenth, long int typed, long int min, long int max);

// 添加地址
//
extern __declspec(dllexport) char* AddWalletCoinAddress(long int port, long int walletIndex, long int addressIndex, char* pwd, char* nickName);

// 导入私钥
//
extern __declspec(dllexport) char* ImportPrivateKey(long int port, char* passwd, char* prk, char* chain, char* segwitType, char* nickName);
extern __declspec(dllexport) char* DeletePrivateKey(long int port, char* passwd, long int index);

// 添加钱包 不生成地址
//
extern __declspec(dllexport) char* AddWallet(long int port, char* pwd, char* nickName);
extern __declspec(dllexport) char* DeleteWallet(long int port, char* pwd, long int walletIndex);

// 导入助记词 不生成地址
//
extern __declspec(dllexport) char* AddWalletImportMnemonic(long int port, char* pwd, char* nickName, char* word);
extern __declspec(dllexport) char* ExportPrivateKey(long int port, char* passwd, char* chain, char* segwitType, long int walletIndex, long int addressIndex);
extern __declspec(dllexport) char* CreateAddrFromPri(char* prk, char* chain, char* segwitType);
extern __declspec(dllexport) char* GetPrivIndex(void);
extern __declspec(dllexport) char* SignTx(long int port, char* unSignTx, char* to, char* amount, char* coinType, char* fee, long int walletIndex, long int addressIndex, char* passwd, char* chain, char* segwitType, char* maxPriority, char* maxFee, long int gasLimit, long int frozenTime, char* contractAddress, long int decimals);
extern __declspec(dllexport) char* OfflineSign(long int port, char* unSignTx, long int walletIndex, long int addressIndex, char* passwd, char* chain);

// 使用USDT购买云储存空间之前的授权
//
extern __declspec(dllexport) char* ApproveUsdtForBuySpace(long int port, char* chain, char* passwd, char* amount, char* gas, long int walletIndex, long int addressIndex);

// 使用USDT兑换USR之前的授权
//
extern __declspec(dllexport) char* ApproveUsdtForSwapUsr(long int port, char* chain, char* passwd, char* amount, char* gas, long int walletIndex, long int addressIndex);
extern __declspec(dllexport) char* Deposit(long int port, char* chain, char* passwd, char* amount, char* addr, char* gas, long int walletIndex, long int addressIndex);
extern __declspec(dllexport) char* BuySpace(long int port, char* chain, char* passwd, char* amount, char* gas, char* netId, char* orderId, char* packageId, long int walletIndex, long int addressIndex);
extern __declspec(dllexport) char* FreezeTrx(long int port, char* fromAddr, char* passwd, char* resource, char* amount, long int walletIndex, long int addressIndex);
extern __declspec(dllexport) char* UnfreezeTrx(long int port, char* fromAddr, char* passwd, char* resource, char* amount, long int walletIndex, long int addressIndex);
extern __declspec(dllexport) char* WithdrawExpireUnfreezeTrx(long int port, char* fromAddr, char* passwd, long int walletIndex, long int addressIndex);
extern __declspec(dllexport) char* ExportWalletMnemonic(long int port, long int walletIndex, char* pwd);
extern __declspec(dllexport) char* InitWallet(char* jsonStr);
extern __declspec(dllexport) char* SwitchNetwork(long int network);
extern __declspec(dllexport) void UsdtWithdraw(long int port, long int walletIndex, long int addressIndex, char* passwd, char* chain, char* amount, char* toAddr, char* orderId, char* walletAddr, char* gas);
extern __declspec(dllexport) void WithdrawApprove(long int port, long int walletIndex, long int addressIndex, char* passwd, char* amount, char* walletAddr, char* gas);
extern __declspec(dllexport) void StartWsClient(char* serverServer, char* cloudServer);
extern __declspec(dllexport) char* SendMsgOfWs(char* data);
extern __declspec(dllexport) void ReceiveMsgOfWs(void);
extern __declspec(dllexport) void InitCallBack(GoInt64 port);
extern __declspec(dllexport) char* StartWalletConn(char* walletServer);
extern __declspec(dllexport) char* StartExchangeConn(char* exchangeServer);
extern __declspec(dllexport) char* CloseWalletConn(void);
extern __declspec(dllexport) char* CloseCloudConn(void);
extern __declspec(dllexport) char* CloseExchangeConn(void);
extern __declspec(dllexport) char* CheckWsConnState(void);
extern __declspec(dllexport) char* CreateOfflineContractTx(char* keyStorePath, long int walletIndex, char* srcaddress, char* address, char* pwd, char* comment, char* amount, char* gas, char* frozenHeight, char* gasPrice, char* nonce, char* currentHeight, char* domain, char* domainType, char* abi, char* source);
extern __declspec(dllexport) char* CreateOfflineContractTxWithGasPay(char* keyStorePath, long int walletIndex, char* srcaddress, char* address, char* pwd, char* comment, char* amount, char* gas, char* frozenHeight, char* gasPrice, char* nonce, char* currentHeight, char* domain, char* domainType, char* abi, char* source, char* gasPayAddress);

// 针对移动端的构建交易（包含普通交易和合约交易）
//
extern __declspec(dllexport) char* BuildOfflineTx(char* keyStorePath, long int walletIndex, char* pwd, char* nonce, char* currentHeight, char* frozenHeight, char* domainType, char* domain, char* tag, char* jsonData);
extern __declspec(dllexport) char* BuildOfflineTxByPirkIndex(char* keyStorePath, long int prikIndex, char* pwd, char* nonce, char* currentHeight, char* frozenHeight, char* domainType, char* domain, char* tag, char* jsonData);

// 检查钱包地址是否合法
//
extern __declspec(dllexport) char* CheckWalletIsLegality(char* addr);

// 授权 取消授权
//
extern __declspec(dllexport) char* CreateOfflineTxBuildAddressBind(char* keyStorePath, long int walletIndex, char* srcaddress, char* bindaddress, char* bindType, char* gas, char* frozenHeight, char* nonceInt, char* currentHeight, char* pwd, char* domain, char* domainType, char* comment);

/*
//export Offer
func Offer(content *C.char) *C.char {
	return C.CString(multi_media.OfferV2(C.GoString(content)))
}

//export Answer
func Answer(content *C.char) *C.char {
	return C.CString(multi_media.AnswerV2(C.GoString(content)))
}

//export Candidate
func Candidate(content *C.char) *C.char {
	return C.CString(multi_media.CandidateV2(C.GoString(content)))
}

//export CloseCall
func CloseCall(content *C.char) *C.char {
	defer func() {
		if x := recover(); x != nil {
			utils.Log.Info("CloseCall(content *C.char)33333333333")
		}
	}()
	utils.Log.Info("CloseCall(content *C.char)1111111111")
	s := C.GoString(content)
	utils.Log.Info("CloseCall(content *C.char)22222222222")
	return C.CString(multi_media.CloseCallV2(s))
}

//export GetCallTime
func GetCallTime() *C.char {
	return C.CString(multi_media.GetCallTime())
}

//export TurnInfo
func TurnInfo(content *C.char) *C.char {
	return C.CString(multi_media.TurnInfo(C.GoString(content)))
}

//export GetRealIpByTurn
func GetRealIpByTurn() *C.char {
	return C.CString(multi_media.GetRealIpByTurn())
}
*/
extern __declspec(dllexport) void LkGenerateToken(long long int port, char* param);
extern __declspec(dllexport) void UpdateUserState(char* param);
extern __declspec(dllexport) void LkDeleteRoom(char* param);
extern __declspec(dllexport) void SetLkUrl(char* url);
extern __declspec(dllexport) void InitiateCall(long long int port, char* param);
extern __declspec(dllexport) void InviteToJoin(char* param);
extern __declspec(dllexport) void CancelDialing(void);
extern __declspec(dllexport) void LkRoomInfo(long long int port, char* param);
extern __declspec(dllexport) void LkRoomParticipants(long long int port, char* param);
extern __declspec(dllexport) void LkLeaveRoom(char* param);
extern __declspec(dllexport) char* RunCloudStoreP2p(char* ip, char* netId, char* confStr, long long int port);
extern __declspec(dllexport) char* CheckCloudP2p(void);
extern __declspec(dllexport) char* GetStorageConf(void);
extern __declspec(dllexport) char* SetCloudProxy(char* ip);
extern __declspec(dllexport) void UploadFileTaskByPlatform(char* path, char* extend, char* thumb, char* pwd, char* taskID, char* platform);
extern __declspec(dllexport) void UploadFileTaskByPlatformV2(char* path, char* extend, char* thumb, char* pwd, char* taskID, char* folderID, char* videoResolution, int platform);
extern __declspec(dllexport) char* DownloadFile(char* hash, char* rePath, char* taskID, char* absPath, char* pwd, long long int port);
extern __declspec(dllexport) char* GetFileInfo(char* hash, long long int port);
extern __declspec(dllexport) char* SetKeyValue(char* key, char* value, long long int port);
extern __declspec(dllexport) char* AsyncSetKeyValue(char* content);
extern __declspec(dllexport) char* GetKeyValue(char* key, long long int port);
extern __declspec(dllexport) char* AsyncGetKeyValue(char* content);
extern __declspec(dllexport) char* SetKeyValueByCategory(char* category, char* key, char* value);
extern __declspec(dllexport) char* GetKeyValueByCategory(char* category, char* key, long long int port);
extern __declspec(dllexport) void GetAllDownloadProcessTask(char* taskID);
extern __declspec(dllexport) char* MoveFile(char* oldCategory, char* newCategory, char* key);
extern __declspec(dllexport) char* DelFile(char* category, char* hash);
extern __declspec(dllexport) char* RenameFile(char* category, char* name, char* hash, long long int port);
extern __declspec(dllexport) char* StopDownloadFile(char* taskID);
extern __declspec(dllexport) char* DelProcess(char* hash);
extern __declspec(dllexport) char* ReUpload(char* hash);
extern __declspec(dllexport) char* StopUpload(char* hash);
extern __declspec(dllexport) char* SetDownloadFileNum(int num);
extern __declspec(dllexport) char* CreateThumbImage(char* path);
extern __declspec(dllexport) char* DeleteDownloadFile(char* hash);
extern __declspec(dllexport) char* DepositSpaceOfflineSign(char* param);
extern __declspec(dllexport) char* GetUserSpaceV2(long long int port);
extern __declspec(dllexport) char* GetUserSign(char* fileHash);
extern __declspec(dllexport) char* TransferCoin(long long int index, long long int gas, long long int gaslimit, char* amount, char* to, char* contractAddress);
extern __declspec(dllexport) char* CheckFilePwd(char* hash, char* pwd, long long int port);
extern __declspec(dllexport) char* CheckFileOwner(char* hash);
extern __declspec(dllexport) char* FileCollectionV1(char* hash, char* filePwd, char* userPwd, short int platform, char* describe, long long int port);
extern __declspec(dllexport) char* GetUploadFileInfo(short int platform, long long int port);
extern __declspec(dllexport) char* DelUploadFileV1(char* hash, char* unique, short int platform, long long int port);
extern __declspec(dllexport) char* GetDelFileSign(char* hash, char* unique, short int platform);
extern __declspec(dllexport) char* AddDownloadProcessHash(char* hash);
extern __declspec(dllexport) char* DelDownloadProcessHash(char* hash);
extern __declspec(dllexport) char* AddUploadProcessHash(char* hash);
extern __declspec(dllexport) char* DelUploadProcessHash(char* hash);
extern __declspec(dllexport) char* SetUploadLimit(char* eventData);
extern __declspec(dllexport) char* ResetFilePassword(char* hash, char* pwd, long long int port);
extern __declspec(dllexport) char* GenSharingLink(char* content, long long int port);
extern __declspec(dllexport) char* GetSharedInfo(char* link, long long int port);
extern __declspec(dllexport) char* HashSharing(char* content, long long int port);
extern __declspec(dllexport) void SetKeyValueByCloudChannel(char* key, char* value, char* taskId);
extern __declspec(dllexport) void GetKeyValueByCloudChannel(char* key, char* taskId);
extern __declspec(dllexport) void DeleteKeyValueByCloudChannel(char* key, char* taskId);
extern __declspec(dllexport) void FileCollectionV1ByCloudChannel(char* hash, char* filePwd, char* userPwd, short int platform, char* describe, char* taskId);
extern __declspec(dllexport) void UploadSinFileByCloudChannel(char* path, char* thumb, short int isEncrypt, short int isOrigin, short int quality, char* taskId);
extern __declspec(dllexport) void GetThumbnailByCloudChannel(char* hash, char* password, char* absPath, char* taskId);
extern __declspec(dllexport) void GenSharingLinkByCloudChannel(char* content, char* taskId);
extern __declspec(dllexport) void GetSharedInfoByCloudChannel(char* link, char* taskId);
extern __declspec(dllexport) void DecodeDownloadFile(long long int port, char* domain, char* fileHash, char* fPath, char* outDir, char* uPwd);
extern __declspec(dllexport) void InitHttpUploadWithCallBack(long long int port, char* domain, char* thumbPath, char* fPath, char* outDir, short int isEncrypt, short int platform, char* callBackUrl);
extern __declspec(dllexport) void UploadFileTaskByPlatformV3(char* path, char* extend, char* thumb, char* pwd, char* taskID, short int platform, char* callback);
extern __declspec(dllexport) void InitHttpUploadWithCallBackV1(long long int port, char* domain, char* thumbPath, char* fPath, char* outDir, char* pwd, short int platform, char* callBackUrl, char* extend);
extern __declspec(dllexport) void InitHttpSocialfiUpload(long long int port, char* domain, char* thumbPath, char* fPath, char* outDir, char* pwd, short int platform, char* callBackUrl, char* extend, short int isTranscode, char* transcodeCallback);
extern __declspec(dllexport) char* UploadOssFileV2(long long int port, char* localFilePath, char* dir, long int isForever, char* encryptFileName);
extern __declspec(dllexport) void UploadPreSign(long long int port, char* localFilePath, char* dir, long int isForever, char* encryptFileName);
extern __declspec(dllexport) void DownloadOssFile(long long int port, char* localFile, char* targetFile);

/*
//export ReportData
func ReportData(port C.longlong, messageId C.long, data *C.char) *C.char {
	callback := func(port int64, msg string) {
		engine.Log.Error("ReportData SendToPort port: %d, msg: %v", port, msg)
		//SendToPort(port, msg)
		SendToPortByHandle(port, msg)
	}
	return C.CString(im.ReportData(int(port), int(messageId), C.GoString(data), callback))
}
*/
extern __declspec(dllexport) void DeCryptFile(long long int port, char* filePath, char* targetPath);
extern __declspec(dllexport) char* InitV2Bench(char* dir, char* remoteAddr);
extern __declspec(dllexport) char* BenchUpdateUserInfoV2(char* netId, uint8_t* content, long int len);
extern __declspec(dllexport) char* BenchAddDevice(char* netId, uint8_t* content, long int len);
extern __declspec(dllexport) char* BenchSingleChat(char* netId, uint8_t* content, long int len);
extern __declspec(dllexport) char* BenchGroupChat(char* netId, uint8_t* content, long int len);
extern __declspec(dllexport) char* BenchCreateGroup(char* netId, uint8_t* content, long int len);

#ifdef __cplusplus
}
#endif
