2020-05-22 16:18:41 +03:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2013-2020, The PurpleI2P Project
|
|
|
|
*
|
|
|
|
* This file is part of Purple i2pd project and licensed under BSD3
|
|
|
|
*
|
|
|
|
* See full license text in LICENSE file at top of project tree
|
|
|
|
*/
|
|
|
|
|
2016-06-17 18:25:28 +03:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include "Daemon.h"
|
2014-02-05 04:28:18 +04:00
|
|
|
|
2016-06-17 18:25:28 +03:00
|
|
|
#if defined(QT_GUI_LIB)
|
|
|
|
namespace i2p
|
|
|
|
{
|
|
|
|
namespace qt
|
|
|
|
{
|
2020-04-29 16:55:25 +03:00
|
|
|
int RunQT (int argc, char* argv[]);
|
2016-06-17 18:25:28 +03:00
|
|
|
}
|
|
|
|
}
|
2020-03-01 13:25:50 +03:00
|
|
|
|
2014-01-30 04:56:48 +04:00
|
|
|
int main( int argc, char* argv[] )
|
2013-12-10 17:05:42 +04:00
|
|
|
{
|
2020-04-29 16:55:25 +03:00
|
|
|
return i2p::qt::RunQT (argc, argv);
|
2016-06-17 18:25:28 +03:00
|
|
|
}
|
2016-06-17 16:49:49 +03:00
|
|
|
#else
|
2016-06-17 18:25:28 +03:00
|
|
|
int main( int argc, char* argv[] )
|
|
|
|
{
|
2020-04-29 16:55:25 +03:00
|
|
|
if (Daemon.init(argc, argv))
|
2016-03-10 09:12:46 +03:00
|
|
|
{
|
|
|
|
if (Daemon.start())
|
|
|
|
Daemon.run ();
|
2018-01-23 19:01:50 +03:00
|
|
|
else
|
|
|
|
return EXIT_FAILURE;
|
2016-03-10 09:12:46 +03:00
|
|
|
Daemon.stop();
|
|
|
|
}
|
2014-12-10 20:10:07 +03:00
|
|
|
return EXIT_SUCCESS;
|
2013-12-10 17:05:42 +04:00
|
|
|
}
|
2016-06-17 18:25:28 +03:00
|
|
|
#endif
|
2015-11-03 17:15:49 +03:00
|
|
|
|
2016-03-10 09:12:46 +03:00
|
|
|
#ifdef _WIN32
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
int CALLBACK WinMain(
|
|
|
|
_In_ HINSTANCE hInstance,
|
|
|
|
_In_ HINSTANCE hPrevInstance,
|
|
|
|
_In_ LPSTR lpCmdLine,
|
|
|
|
_In_ int nCmdShow
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return main(__argc, __argv);
|
|
|
|
}
|
|
|
|
#endif
|