2014-04-03 15:58:00 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set ts=8 sts=4 et sw=4 tw=99: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
2012-05-21 15:12:37 +04:00
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-04-10 10:51:01 +04:00
|
|
|
|
|
|
|
/* XPConnect JavaScript interactive shell. */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2011-10-11 10:00:28 +04:00
|
|
|
|
2013-11-12 17:31:32 +04:00
|
|
|
#include "mozilla/WindowsDllBlocklist.h"
|
2011-10-11 10:00:28 +04:00
|
|
|
|
2009-01-20 22:56:44 +03:00
|
|
|
#include "nsXULAppAPI.h"
|
2008-06-03 14:56:09 +04:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
#include "xpcshellMacUtils.h"
|
|
|
|
#endif
|
2009-01-18 20:01:15 +03:00
|
|
|
#ifdef XP_WIN
|
|
|
|
#include <windows.h>
|
2012-05-22 18:50:04 +04:00
|
|
|
#include <shlobj.h>
|
2012-09-30 20:45:05 +04:00
|
|
|
|
|
|
|
// we want a wmain entry point
|
|
|
|
#define XRE_DONT_PROTECT_DLL_LOAD
|
2014-08-28 06:53:38 +04:00
|
|
|
#define XRE_DONT_SUPPORT_XPSP2 // xpcshell does not ship
|
2012-09-30 20:45:05 +04:00
|
|
|
#define XRE_WANT_ENVIRON
|
|
|
|
#include "nsWindowsWMain.cpp"
|
2009-01-18 20:01:15 +03:00
|
|
|
#endif
|
1999-04-10 10:51:01 +04:00
|
|
|
|
|
|
|
int
|
2013-10-01 00:09:28 +04:00
|
|
|
main(int argc, char** argv, char** envp)
|
1999-04-10 10:51:01 +04:00
|
|
|
{
|
2008-06-03 14:56:09 +04:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
InitAutoreleasePool();
|
|
|
|
#endif
|
1999-04-10 10:51:01 +04:00
|
|
|
|
2007-02-14 00:16:09 +03:00
|
|
|
// unbuffer stdout so that output is in the correct order; note that stderr
|
|
|
|
// is unbuffered by default
|
|
|
|
setbuf(stdout, 0);
|
|
|
|
|
2013-11-12 17:31:32 +04:00
|
|
|
#ifdef HAS_DLL_BLOCKLIST
|
|
|
|
DllBlocklist_Initialize();
|
2012-02-23 03:05:28 +04:00
|
|
|
#endif
|
|
|
|
|
2013-10-01 00:09:28 +04:00
|
|
|
int result = XRE_XPCShellMain(argc, argv, envp);
|
2009-01-20 22:56:44 +03:00
|
|
|
|
2008-06-03 14:56:09 +04:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
FinishAutoreleasePool();
|
|
|
|
#endif
|
|
|
|
|
1999-04-10 10:51:01 +04:00
|
|
|
return result;
|
|
|
|
}
|