From b880db8491271b4bd4aa87c2dd79b5e3c3dde6cf Mon Sep 17 00:00:00 2001 From: watcherhd Date: Thu, 17 Nov 2011 18:46:23 +0000 Subject: added: ieview, imo2sproxy, skype git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@175 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- imo2sproxy/src/imo2skype/main.c | 197 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 197 insertions(+) create mode 100644 imo2sproxy/src/imo2skype/main.c (limited to 'imo2sproxy/src/imo2skype/main.c') diff --git a/imo2sproxy/src/imo2skype/main.c b/imo2sproxy/src/imo2skype/main.c new file mode 100644 index 0000000..2b3ece3 --- /dev/null +++ b/imo2sproxy/src/imo2skype/main.c @@ -0,0 +1,197 @@ +/* Module: main.c + Purpose: Main commandline dispatcher for imo.im Skypeproxy + Author: leecher + Date: 07.11.2009 +*/ +#include +#include +#include "imo2sproxy.h" +#include "socksproxy.h" +#ifdef WIN32 +#include "w32skypeemu.h" +#define WIN32_LEAN_AND_MEAN +#include +#include +#define Daemonize FreeConsole() +#ifdef _DEBUG +#define LOG(_args_) printf _args_ +#ifndef _WIN64 +#include "crash.c" +#endif +#endif +#else +#define Daemonize daemon(0, 0) +#endif + +// ----------------------------------------------------------------------------- +// EIP +// ----------------------------------------------------------------------------- +int main(int argc, char **argv) +{ + int i, j=0, bDaemon = 0; + char cMode='s'; + IMO2SPROXY_CFG stCfg; + SOCKSPROXY_CFG stSocksCfg; +#ifdef WIN32 + W32SKYPEEMU_CFG stSypeEmuCfg; +#endif + IMO2SPROXY *pProxy; + +#ifdef _DEBUG + Crash_Init(); +#endif + + Imo2sproxy_Defaults (&stCfg); + SocksProxy_Defaults (&stSocksCfg); +#ifdef WIN32 + W32SkypeEmu_Defaults(&stSypeEmuCfg); +#endif + if (argc<3) + { + printf ("imo.im Skypeproxy V1.11 - (c) by leecher 2009-2011\n\n" + "%s [-d] [-v [-l ]] [-t] [-i]\n" + "[-m] [-h ] [-p ] \n\n" + "-d\t- Daemonize (detach from console)\n" + "-v\t- Verbose mode, log commands to console\n" + "-l\t- Set logfile to redirect verbose log to.\n" + "-t\t- Ignore server timestamp and use current time for messages\n" + "-i\t- Use interactive mode (starts imo.im flash app upon call)\n" + "-m\t- Specify connection mode to use:\n" + "\t\ts\tSocket mode (SkypeProxy protocol) [default]\n" +#ifdef WIN32 + "\t\ta\tSkype API Emulation via Window messages (real Skype API)\n" +#endif + "\tParameters for socket mode:\n" + "-h\t- Bind to a specific IP, not to all interfaces (default)\n" + "-p\t- Bind to another port (default: 1401)\n" + "Default: Bind to any interface, Use Port %d\n", argv[0], stSocksCfg.sPort); + return EXIT_FAILURE; + } + + for (i=1; iOpen(pProxy) == 0) + pProxy->Loop(pProxy); + pProxy->Exit(pProxy); + + if (stCfg.fpLog && stCfg.fpLog != stdout && stCfg.fpLog != stderr) + { + fclose(stCfg.fpLog); + stCfg.fpLog = NULL; + } + + return EXIT_SUCCESS; +} + -- cgit v1.2.3