2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
* vim: set ts=2 sw=4 et tw=80:
|
|
|
|
*
|
2012-05-21 04:12:37 -07:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* 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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/* XPConnect JavaScript interactive shell. */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2011-10-10 23:00:28 -07:00
|
|
|
|
2013-11-12 05:31:32 -08:00
|
|
|
#include "mozilla/WindowsDllBlocklist.h"
|
2011-10-10 23:00:28 -07:00
|
|
|
|
2009-01-20 11:56:44 -08:00
|
|
|
#include "nsXULAppAPI.h"
|
2008-06-03 03:56:09 -07:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
#include "xpcshellMacUtils.h"
|
|
|
|
#endif
|
2009-01-18 09:01:15 -08:00
|
|
|
#ifdef XP_WIN
|
|
|
|
#include <windows.h>
|
2012-05-22 07:50:04 -07:00
|
|
|
#include <shlobj.h>
|
2012-09-30 09:45:05 -07:00
|
|
|
|
|
|
|
// we want a wmain entry point
|
|
|
|
#define XRE_DONT_PROTECT_DLL_LOAD
|
|
|
|
#define XRE_WANT_ENVIRON
|
|
|
|
#include "nsWindowsWMain.cpp"
|
2009-01-18 09:01:15 -08:00
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
int
|
2013-09-30 13:09:28 -07:00
|
|
|
main(int argc, char** argv, char** envp)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2008-06-03 03:56:09 -07:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
InitAutoreleasePool();
|
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// unbuffer stdout so that output is in the correct order; note that stderr
|
|
|
|
// is unbuffered by default
|
|
|
|
setbuf(stdout, 0);
|
|
|
|
|
2013-11-12 05:31:32 -08:00
|
|
|
#ifdef HAS_DLL_BLOCKLIST
|
|
|
|
DllBlocklist_Initialize();
|
2012-02-22 15:05:28 -08:00
|
|
|
#endif
|
|
|
|
|
2013-09-30 13:09:28 -07:00
|
|
|
int result = XRE_XPCShellMain(argc, argv, envp);
|
2009-01-20 11:56:44 -08:00
|
|
|
|
2008-06-03 03:56:09 -07:00
|
|
|
#ifdef XP_MACOSX
|
|
|
|
FinishAutoreleasePool();
|
|
|
|
#endif
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
return result;
|
|
|
|
}
|