Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions
nsXPCOMPrivate.h File Reference
#include "nscore.h"
#include "nsXPCOM.h"
#include "nsStringAPI.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  XPCOMFunctions

Defines

#define XPCOM_GLUE_VERSION   1
#define XPCOM_DLL   "libxpcom"MOZ_DLL_SUFFIX
#define XPCOM_SEARCH_KEY   "LD_LIBRARY_PATH"
#define XUL_DLL   "libxul"MOZ_DLL_SUFFIX
#define GRE_CONF_NAME   ".gre.config"
#define GRE_CONF_PATH   "/etc/gre.conf"
#define GRE_CONF_DIR   "/etc/gre.d"
#define GRE_USER_CONF_DIR   ".gre.d"
#define MAXPATHLEN   1024

Typedefs

typedef NS_CALLBACKXPCOMExitRoutine )(void)
 Private Method to register an exit routine.
typedef nsresult(* InitFunc )(nsIServiceManager **result, nsIFile *binDirectory, nsIDirectoryServiceProvider *appFileLocationProvider)
typedef nsresult(* Init3Func )(nsIServiceManager **result, nsIFile *binDirectory, nsIDirectoryServiceProvider *appFileLocationProvider, nsStaticModuleInfo const *staticComponents, PRUint32 componentCount)
typedef nsresult(* ShutdownFunc )(nsIServiceManager *servMgr)
typedef nsresult(* GetServiceManagerFunc )(nsIServiceManager **result)
typedef nsresult(* GetComponentManagerFunc )(nsIComponentManager **result)
typedef nsresult(* GetComponentRegistrarFunc )(nsIComponentRegistrar **result)
typedef nsresult(* GetMemoryManagerFunc )(nsIMemory **result)
typedef nsresult(* NewLocalFileFunc )(const nsAString &path, PRBool followLinks, nsILocalFile **result)
typedef nsresult(* NewNativeLocalFileFunc )(const nsACString &path, PRBool followLinks, nsILocalFile **result)
typedef nsresult(* GetDebugFunc )(nsIDebug **result)
typedef nsresult(* GetTraceRefcntFunc )(nsITraceRefcnt **result)
typedef nsresult(* StringContainerInitFunc )(nsStringContainer &)
typedef nsresult(* StringContainerInit2Func )(nsStringContainer &, const PRUnichar *, PRUint32, PRUint32)
typedef void(* StringContainerFinishFunc )(nsStringContainer &)
typedef PRUint32(* StringGetDataFunc )(const nsAString &, const PRUnichar **, PRBool *)
typedef PRUint32(* StringGetMutableDataFunc )(nsAString &, PRUint32, PRUnichar **)
typedef PRUnichar *(* StringCloneDataFunc )(const nsAString &)
typedef nsresult(* StringSetDataFunc )(nsAString &, const PRUnichar *, PRUint32)
typedef nsresult(* StringSetDataRangeFunc )(nsAString &, PRUint32, PRUint32, const PRUnichar *, PRUint32)
typedef nsresult(* StringCopyFunc )(nsAString &, const nsAString &)
typedef nsresult(* CStringContainerInitFunc )(nsCStringContainer &)
typedef nsresult(* CStringContainerInit2Func )(nsCStringContainer &, const char *, PRUint32, PRUint32)
typedef void(* CStringContainerFinishFunc )(nsCStringContainer &)
typedef PRUint32(* CStringGetDataFunc )(const nsACString &, const char **, PRBool *)
typedef PRUint32(* CStringGetMutableDataFunc )(nsACString &, PRUint32, char **)
typedef char *(* CStringCloneDataFunc )(const nsACString &)
typedef nsresult(* CStringSetDataFunc )(nsACString &, const char *, PRUint32)
typedef nsresult(* CStringSetDataRangeFunc )(nsACString &, PRUint32, PRUint32, const char *, PRUint32)
typedef nsresult(* CStringCopyFunc )(nsACString &, const nsACString &)
typedef nsresult(* CStringToUTF16 )(const nsACString &, nsCStringEncoding, nsAString &)
typedef nsresult(* UTF16ToCString )(const nsAString &, nsCStringEncoding, nsACString &)
typedef void *(* AllocFunc )(PRSize size)
typedef void *(* ReallocFunc )(void *ptr, PRSize size)
typedef void(* FreeFunc )(void *ptr)
typedef nsresult(* RegisterXPCOMExitRoutineFunc )(XPCOMExitRoutine exitRoutine, PRUint32 priority)
typedef nsresult(* UnregisterXPCOMExitRoutineFunc )(XPCOMExitRoutine exitRoutine)
typedef struct XPCOMFunctions XPCOMFunctions
typedef nsresult(PR_CALLBACKGetFrozenFunctionsFunc )(XPCOMFunctions *entryPoints, const char *libraryPath)

Functions

NS_COM nsresult NS_RegisterXPCOMExitRoutine (XPCOMExitRoutine exitRoutine, PRUint32 priority)
NS_COM nsresult NS_UnregisterXPCOMExitRoutine (XPCOMExitRoutine exitRoutine)
NS_COM nsresult NS_GetFrozenFunctions (XPCOMFunctions *entryPoints, const char *libraryPath)
nsresult NewStaticComponentLoader (nsStaticModuleInfo const *aStaticModules, PRUint32 aStaticModuleCount, nsIComponentLoader **retval)

Class Documentation

struct XPCOMFunctions

Definition at line 131 of file nsXPCOMPrivate.h.

Collaboration diagram for XPCOMFunctions:
Class Members
AllocFunc allocFunc
CStringCloneDataFunc cstringCloneData
CStringContainerFinishFunc cstringContainerFinish
CStringContainerInitFunc cstringContainerInit
CStringContainerInit2Func cstringContainerInit2
CStringCopyFunc cstringCopy
CStringGetDataFunc cstringGetData
CStringGetMutableDataFunc cstringGetMutableData
CStringSetDataFunc cstringSetData
CStringSetDataRangeFunc cstringSetDataRange
CStringToUTF16 cstringToUTF16
FreeFunc freeFunc
GetComponentManagerFunc getComponentManager
GetComponentRegistrarFunc getComponentRegistrar
GetDebugFunc getDebug
GetMemoryManagerFunc getMemoryManager
GetServiceManagerFunc getServiceManager
GetTraceRefcntFunc getTraceRefcnt
InitFunc init
Init3Func init3
NewLocalFileFunc newLocalFile
NewNativeLocalFileFunc newNativeLocalFile
ReallocFunc reallocFunc
RegisterXPCOMExitRoutineFunc registerExitRoutine
ShutdownFunc shutdown
PRUint32 size
StringCloneDataFunc stringCloneData
StringContainerFinishFunc stringContainerFinish
StringContainerInitFunc stringContainerInit
StringContainerInit2Func stringContainerInit2
StringCopyFunc stringCopy
StringGetDataFunc stringGetData
StringGetMutableDataFunc stringGetMutableData
StringSetDataFunc stringSetData
StringSetDataRangeFunc stringSetDataRange
UnregisterXPCOMExitRoutineFunc unregisterExitRoutine
UTF16ToCString utf16ToCString
PRUint32 version

Define Documentation

#define GRE_CONF_DIR   "/etc/gre.d"

Definition at line 229 of file nsXPCOMPrivate.h.

#define GRE_CONF_NAME   ".gre.config"

Definition at line 227 of file nsXPCOMPrivate.h.

#define GRE_CONF_PATH   "/etc/gre.conf"

Definition at line 228 of file nsXPCOMPrivate.h.

#define GRE_USER_CONF_DIR   ".gre.d"

Definition at line 230 of file nsXPCOMPrivate.h.

#define MAXPATHLEN   1024

Definition at line 255 of file nsXPCOMPrivate.h.

#define XPCOM_DLL   "libxpcom"MOZ_DLL_SUFFIX

Definition at line 215 of file nsXPCOMPrivate.h.

Definition at line 185 of file nsXPCOMPrivate.h.

#define XPCOM_SEARCH_KEY   "LD_LIBRARY_PATH"

Definition at line 223 of file nsXPCOMPrivate.h.

#define XUL_DLL   "libxul"MOZ_DLL_SUFFIX

Definition at line 224 of file nsXPCOMPrivate.h.


Typedef Documentation

typedef void*(* AllocFunc)(PRSize size)

Definition at line 123 of file nsXPCOMPrivate.h.

typedef char*(* CStringCloneDataFunc)(const nsACString &)

Definition at line 115 of file nsXPCOMPrivate.h.

Definition at line 112 of file nsXPCOMPrivate.h.

Definition at line 111 of file nsXPCOMPrivate.h.

Definition at line 110 of file nsXPCOMPrivate.h.

typedef nsresult(* CStringCopyFunc)(nsACString &, const nsACString &)

Definition at line 118 of file nsXPCOMPrivate.h.

typedef PRUint32(* CStringGetDataFunc)(const nsACString &, const char **, PRBool *)

Definition at line 113 of file nsXPCOMPrivate.h.

typedef PRUint32(* CStringGetMutableDataFunc)(nsACString &, PRUint32, char **)

Definition at line 114 of file nsXPCOMPrivate.h.

typedef nsresult(* CStringSetDataFunc)(nsACString &, const char *, PRUint32)

Definition at line 116 of file nsXPCOMPrivate.h.

typedef nsresult(* CStringSetDataRangeFunc)(nsACString &, PRUint32, PRUint32, const char *, PRUint32)

Definition at line 117 of file nsXPCOMPrivate.h.

typedef nsresult(* CStringToUTF16)(const nsACString &, nsCStringEncoding, nsAString &)

Definition at line 120 of file nsXPCOMPrivate.h.

typedef void(* FreeFunc)(void *ptr)

Definition at line 125 of file nsXPCOMPrivate.h.

Definition at line 91 of file nsXPCOMPrivate.h.

Definition at line 92 of file nsXPCOMPrivate.h.

Definition at line 97 of file nsXPCOMPrivate.h.

typedef nsresult(PR_CALLBACK * GetFrozenFunctionsFunc)(XPCOMFunctions *entryPoints, const char *libraryPath)

Definition at line 180 of file nsXPCOMPrivate.h.

Definition at line 93 of file nsXPCOMPrivate.h.

Definition at line 90 of file nsXPCOMPrivate.h.

Definition at line 98 of file nsXPCOMPrivate.h.

typedef nsresult(* Init3Func)(nsIServiceManager **result, nsIFile *binDirectory, nsIDirectoryServiceProvider *appFileLocationProvider, nsStaticModuleInfo const *staticComponents, PRUint32 componentCount)

Definition at line 88 of file nsXPCOMPrivate.h.

typedef nsresult(* InitFunc)(nsIServiceManager **result, nsIFile *binDirectory, nsIDirectoryServiceProvider *appFileLocationProvider)

Definition at line 87 of file nsXPCOMPrivate.h.

typedef nsresult(* NewLocalFileFunc)(const nsAString &path, PRBool followLinks, nsILocalFile **result)

Definition at line 94 of file nsXPCOMPrivate.h.

typedef nsresult(* NewNativeLocalFileFunc)(const nsACString &path, PRBool followLinks, nsILocalFile **result)

Definition at line 95 of file nsXPCOMPrivate.h.

typedef void*(* ReallocFunc)(void *ptr, PRSize size)

Definition at line 124 of file nsXPCOMPrivate.h.

Definition at line 128 of file nsXPCOMPrivate.h.

Definition at line 89 of file nsXPCOMPrivate.h.

typedef PRUnichar*(* StringCloneDataFunc)(const nsAString &)

Definition at line 105 of file nsXPCOMPrivate.h.

Definition at line 102 of file nsXPCOMPrivate.h.

Definition at line 101 of file nsXPCOMPrivate.h.

Definition at line 100 of file nsXPCOMPrivate.h.

typedef nsresult(* StringCopyFunc)(nsAString &, const nsAString &)

Definition at line 108 of file nsXPCOMPrivate.h.

typedef PRUint32(* StringGetDataFunc)(const nsAString &, const PRUnichar **, PRBool *)

Definition at line 103 of file nsXPCOMPrivate.h.

typedef PRUint32(* StringGetMutableDataFunc)(nsAString &, PRUint32, PRUnichar **)

Definition at line 104 of file nsXPCOMPrivate.h.

typedef nsresult(* StringSetDataFunc)(nsAString &, const PRUnichar *, PRUint32)

Definition at line 106 of file nsXPCOMPrivate.h.

Definition at line 107 of file nsXPCOMPrivate.h.

Definition at line 129 of file nsXPCOMPrivate.h.

typedef nsresult(* UTF16ToCString)(const nsAString &, nsCStringEncoding, nsACString &)

Definition at line 121 of file nsXPCOMPrivate.h.

Private Method to register an exit routine.

This method allows you to setup a callback that will be called from the NS_ShutdownXPCOM function after all services and components have gone away.

This API is for the exclusive use of the xpcom glue library.

Note that these APIs are NOT threadsafe and must be called on the main thread.

FROZEN

Parameters:
exitRoutinepointer to user defined callback function of type XPCOMExitRoutine.
priorityhigher priorities are called before lower priorities.
Returns:
NS_OK for success; other error codes indicate a failure.

Definition at line 77 of file nsXPCOMPrivate.h.


Function Documentation

nsresult NewStaticComponentLoader ( nsStaticModuleInfo const aStaticModules,
PRUint32  aStaticModuleCount,
nsIComponentLoader **  retval 
)

Definition at line 296 of file nsStaticComponentLoader.cpp.

{
    nsCOMPtr<nsStaticComponentLoader> lthis = new nsStaticComponentLoader();
    if (!lthis)
        return NS_ERROR_OUT_OF_MEMORY;

    nsresult rv = ((nsStaticComponentLoader*) lthis)->
        Init(aStaticModules, aStaticModuleCount);

    if (NS_FAILED(rv))
        return rv;

    NS_ADDREF(*retval = lthis);
    return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_COM nsresult NS_GetFrozenFunctions ( XPCOMFunctions entryPoints,
const char *  libraryPath 
)

Definition at line 92 of file nsXPComStub.cpp.

{
    if (!functions)
        return NS_ERROR_OUT_OF_MEMORY;

    if (functions->version != XPCOM_GLUE_VERSION)
        return NS_ERROR_FAILURE;

    PRUint32 size = functions->size;
    if (size > sizeof(XPCOMFunctions))
        size = sizeof(XPCOMFunctions);

    size -= offsetof(XPCOMFunctions, init);

    memcpy(&functions->init, &kFrozenFunctions.init, size);

    return NS_OK;
}

Here is the call graph for this function:

Definition at line 751 of file nsXPComInit.cpp.

{
    // priority are not used right now.  It will need to be implemented as more
    // classes are moved into the glue library --dougt
    if (!gExitRoutines) {
        gExitRoutines = new nsVoidArray();
        if (!gExitRoutines) {
            NS_WARNING("Failed to allocate gExitRoutines");
            return NS_ERROR_FAILURE;
        }
    }

    PRBool okay = gExitRoutines->AppendElement((void*)exitRoutine);
    return okay ? NS_OK : NS_ERROR_FAILURE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 768 of file nsXPComInit.cpp.

{
    if (!gExitRoutines)
        return NS_ERROR_FAILURE;

    PRBool okay = gExitRoutines->RemoveElement((void*)exitRoutine);
    return okay ? NS_OK : NS_ERROR_FAILURE;
}