michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef nsXPCOMGlue_h__ michael@0: #define nsXPCOMGlue_h__ michael@0: michael@0: #include "nscore.h" michael@0: michael@0: #ifdef XPCOM_GLUE michael@0: michael@0: /** michael@0: * The following functions are only available in the standalone glue. michael@0: */ michael@0: michael@0: /** michael@0: * Enabled preloading of dynamically loaded libraries michael@0: */ michael@0: extern "C" NS_HIDDEN_(void) michael@0: XPCOMGlueEnablePreload(); michael@0: michael@0: /** michael@0: * Initialize the XPCOM glue by dynamically linking against the XPCOM michael@0: * shared library indicated by xpcomFile. michael@0: */ michael@0: extern "C" NS_HIDDEN_(nsresult) michael@0: XPCOMGlueStartup(const char* xpcomFile); michael@0: michael@0: typedef void (*NSFuncPtr)(); michael@0: michael@0: struct nsDynamicFunctionLoad michael@0: { michael@0: const char *functionName; michael@0: NSFuncPtr *function; michael@0: }; michael@0: michael@0: /** michael@0: * Dynamically load functions from libxul. michael@0: * michael@0: * @throws NS_ERROR_NOT_INITIALIZED if XPCOMGlueStartup() was not called or michael@0: * if the libxul DLL was not found. michael@0: * @throws NS_ERROR_LOSS_OF_SIGNIFICANT_DATA if only some of the required michael@0: * functions were found. michael@0: */ michael@0: extern "C" NS_HIDDEN_(nsresult) michael@0: XPCOMGlueLoadXULFunctions(const nsDynamicFunctionLoad *symbols); michael@0: michael@0: #endif // XPCOM_GLUE michael@0: #endif // nsXPCOMGlue_h__