2021-06-08 23:25:45 +03:00
|
|
|
/*
|
2022-02-18 09:20:06 +03:00
|
|
|
* Copyright (c) 2021-2022, The PurpleI2P Project
|
2021-06-08 23:25:45 +03: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 21:21:18 +03:00
|
|
|
#include "../libi2pd/api.h"
|
2021-06-08 23:25:45 +03:00
|
|
|
#include "capi.h"
|
2021-06-23 18:18:53 +03:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
|
2021-06-08 23:25:45 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2022-02-13 21:21:18 +03:00
|
|
|
void C_InitI2P (int argc, char *argv[], const char * appName)
|
2021-06-08 23:25:45 +03:00
|
|
|
{
|
2021-06-23 18:18:53 +03:00
|
|
|
std::cout << argv;
|
2022-02-13 21:21:18 +03:00
|
|
|
return i2p::api::InitI2P(argc, argv, appName);
|
2021-06-08 23:25:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void C_TerminateI2P ()
|
|
|
|
{
|
|
|
|
return i2p::api::TerminateI2P();
|
|
|
|
}
|
|
|
|
|
2021-07-02 17:47:55 +03:00
|
|
|
void C_StartI2P ()
|
2021-06-08 23:25:45 +03:00
|
|
|
{
|
2021-06-18 06:12:22 +03:00
|
|
|
std::shared_ptr<std::ostream> logStream;
|
|
|
|
return i2p::api::StartI2P(logStream);
|
2021-06-08 23:25:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void C_StopI2P ()
|
|
|
|
{
|
|
|
|
return i2p::api::StopI2P();
|
|
|
|
}
|
|
|
|
|
|
|
|
void C_RunPeerTest ()
|
|
|
|
{
|
|
|
|
return i2p::api::RunPeerTest();
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|