mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-06-08 07:06:52 +02:00
Get it to build from go build
This commit is contained in:
parent
5013ce5649
commit
7bc2e74683
7 changed files with 53 additions and 38 deletions
|
@ -28,10 +28,6 @@
|
|||
#include "Datagram.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace client
|
||||
|
@ -316,8 +312,4 @@ namespace client
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -20,10 +20,6 @@
|
|||
#include "Signature.h"
|
||||
#include "CryptoKey.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
namespace i2p
|
||||
{
|
||||
namespace data
|
||||
|
@ -248,8 +244,4 @@ namespace data
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
10
libi2pd/api.go
Normal file
10
libi2pd/api.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package api
|
||||
|
||||
/*
|
||||
//void Go_InitI2P (int argc, char argv[], const char * appName){
|
||||
|
||||
//}
|
||||
#cgo CPPFLAGS: -I${SRCDIR}/../i18n -I${SRCDIR}/../libi2pd_client -g -Wall -Wextra -Wno-unused-parameter -pedantic -Wno-psabi -fPIC -D__AES__ -maes
|
||||
#cgo LDFLAGS: -latomic -lcrypto -lssl -lz -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread -lstdc++
|
||||
*/
|
||||
import "C"
|
|
@ -2,14 +2,14 @@
|
|||
// e.g. map std::string to Go string
|
||||
|
||||
%{
|
||||
#include "api.h"
|
||||
#include "capi.h"
|
||||
//#include "Streaming.h"
|
||||
#include "Destination.h"
|
||||
//#include "Destination.h"
|
||||
//#include "Identity.h"
|
||||
//#include "Tag.h"
|
||||
%}
|
||||
|
||||
%include "api.h"
|
||||
%include "capi.h"
|
||||
//%include "Streaming.h"
|
||||
//%include "Destination.h"
|
||||
//%include "Identity.h"
|
||||
|
|
|
@ -13,9 +13,9 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
void C_InitI2P (int argc, char* argv[], const char * appName)
|
||||
void C_InitI2P (int argc, char argv[], const char * appName)
|
||||
{
|
||||
return i2p::api::InitI2P(argc, argv, appName);
|
||||
return i2p::api::InitI2P(argc, &argv, appName);
|
||||
}
|
||||
|
||||
void C_TerminateI2P ()
|
||||
|
@ -25,8 +25,9 @@ void C_TerminateI2P ()
|
|||
|
||||
void C_StartI2P ()//std::ostream *logStream)
|
||||
{
|
||||
// std::shared_ptr<std::ostream> cppLogStream(logStream);
|
||||
return i2p::api::StartI2P(nullptr);
|
||||
std::shared_ptr<std::ostream> logStream;
|
||||
//cppLogStream(&out);
|
||||
return i2p::api::StartI2P(logStream);
|
||||
}
|
||||
|
||||
void C_StopI2P ()
|
||||
|
|
|
@ -9,16 +9,17 @@
|
|||
#ifndef CAPI_H__
|
||||
#define CAPI_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "Identity.h"
|
||||
#include "Destination.h"
|
||||
#include "Streaming.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// initialization start and stop
|
||||
void C_InitI2P (int argc, char* argv[], const char * appName);
|
||||
void C_InitI2P (int argc, char argv[], const char * appName);
|
||||
//void C_InitI2P (int argc, char** argv, const char * appName);
|
||||
void C_TerminateI2P ();
|
||||
void C_StartI2P (); //std::ostream *logStream = nullptr);
|
||||
// write system log to logStream, if not specified to <appName>.log in application's folder
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue