2021-06-08 20:25:45 +00:00
|
|
|
/*
|
2022-02-18 06:20:06 +00:00
|
|
|
* Copyright (c) 2021-2022, The PurpleI2P Project
|
2021-06-08 20:25:45 +00:00
|
|
|
*
|
|
|
|
* This file is part of Purple i2pd project and licensed under BSD3
|
|
|
|
*
|
|
|
|
* See full license text in LICENSE file at top of project tree
|
|
|
|
*/
|
|
|
|
|
2022-02-13 18:21:18 +00:00
|
|
|
#include "../libi2pd/api.h"
|
2021-06-08 20:25:45 +00:00
|
|
|
#include "capi.h"
|
2021-06-23 15:18:53 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
|
2021-06-08 20:25:45 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-02-13 18:21:18 +00:00
|
|
|
void C_InitI2P (int argc, char *argv[], const char * appName)
|
2021-06-08 20:25:45 +00:00
|
|
|
{
|
2021-06-23 15:18:53 +00:00
|
|
|
std::cout << argv;
|
2022-02-13 18:21:18 +00:00
|
|
|
return i2p::api::InitI2P(argc, argv, appName);
|
2021-06-08 20:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void C_TerminateI2P ()
|
|
|
|
{
|
|
|
|
return i2p::api::TerminateI2P();
|
|
|
|
}
|
|
|
|
|
2021-07-02 14:47:55 +00:00
|
|
|
void C_StartI2P ()
|
2021-06-08 20:25:45 +00:00
|
|
|
{
|
2021-06-18 03:12:22 +00:00
|
|
|
std::shared_ptr<std::ostream> logStream;
|
|
|
|
return i2p::api::StartI2P(logStream);
|
2021-06-08 20:25:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void C_StopI2P ()
|
|
|
|
{
|
|
|
|
return i2p::api::StopI2P();
|
|
|
|
}
|
|
|
|
|
|
|
|
void C_RunPeerTest ()
|
|
|
|
{
|
|
|
|
return i2p::api::RunPeerTest();
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|