Changeset 101861 in vbox for trunk/src/libs/xpcom18a4/xpcom/build
- Timestamp:
- Nov 6, 2023 11:34:15 AM (15 months ago)
- Location:
- trunk/src/libs/xpcom18a4/xpcom/build
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/build/nsXPCOMPrivate.h
r101859 r101861 47 47 48 48 #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP 49 #define NS_GetFrozenFunctions VBoxNsxpNS_GetFrozenFunctions50 49 #define NS_RegisterXPCOMExitRoutine VBoxNsxpNS_RegisterXPCOMExitRoutine 51 50 #define NS_UnregisterXPCOMExitRoutine VBoxNsxpNS_UnregisterXPCOMExitRoutine … … 81 80 NS_UnregisterXPCOMExitRoutine(XPCOMExitRoutine exitRoutine); 82 81 83 84 // PUBLIC85 typedef nsresult (* InitFunc)(nsIServiceManager* *result, nsIFile* binDirectory, nsIDirectoryServiceProvider* appFileLocationProvider);86 typedef nsresult (* ShutdownFunc)(nsIServiceManager* servMgr);87 typedef nsresult (* GetServiceManagerFunc)(nsIServiceManager* *result);88 typedef nsresult (* GetComponentManagerFunc)(nsIComponentManager* *result);89 typedef nsresult (* GetComponentRegistrarFunc)(nsIComponentRegistrar* *result);90 typedef nsresult (* NewLocalFileFunc)(const nsAString &path, PRBool followLinks, nsILocalFile* *result);91 typedef nsresult (* NewNativeLocalFileFunc)(const nsACString &path, PRBool followLinks, nsILocalFile* *result);92 93 typedef nsresult (* GetDebugFunc)(nsIDebug* *result);94 typedef nsresult (* GetTraceRefcntFunc)(nsITraceRefcnt* *result);95 96 typedef nsresult (* StringContainerInitFunc)(nsStringContainer&);97 typedef void (* StringContainerFinishFunc)(nsStringContainer&);98 typedef PRUint32 (* StringGetDataFunc)(const nsAString&, const PRUnichar**, PRBool*);99 typedef PRUnichar* (* StringCloneDataFunc)(const nsAString&);100 typedef nsresult (* StringSetDataFunc)(nsAString&, const PRUnichar*, PRUint32);101 typedef nsresult (* StringSetDataRangeFunc)(nsAString&, PRUint32, PRUint32, const PRUnichar*, PRUint32);102 typedef nsresult (* StringCopyFunc)(nsAString &, const nsAString &);103 104 typedef nsresult (* CStringContainerInitFunc)(nsCStringContainer&);105 typedef void (* CStringContainerFinishFunc)(nsCStringContainer&);106 typedef PRUint32 (* CStringGetDataFunc)(const nsACString&, const char**, PRBool*);107 typedef char* (* CStringCloneDataFunc)(const nsACString&);108 typedef nsresult (* CStringSetDataFunc)(nsACString&, const char*, PRUint32);109 typedef nsresult (* CStringSetDataRangeFunc)(nsACString&, PRUint32, PRUint32, const char*, PRUint32);110 typedef nsresult (* CStringCopyFunc)(nsACString &, const nsACString &);111 112 typedef nsresult (* CStringToUTF16)(const nsACString &, PRUint32, const nsAString &);113 typedef nsresult (* UTF16ToCString)(const nsAString &, PRUint32, const nsACString &);114 115 // PRIVATE116 typedef nsresult (* RegisterXPCOMExitRoutineFunc)(XPCOMExitRoutine exitRoutine, PRUint32 priority);117 typedef nsresult (* UnregisterXPCOMExitRoutineFunc)(XPCOMExitRoutine exitRoutine);118 119 typedef struct XPCOMFunctions{120 PRUint32 version;121 PRUint32 size;122 123 InitFunc init;124 ShutdownFunc shutdown;125 GetServiceManagerFunc getServiceManager;126 GetComponentManagerFunc getComponentManager;127 GetComponentRegistrarFunc getComponentRegistrar;128 NewLocalFileFunc newLocalFile;129 NewNativeLocalFileFunc newNativeLocalFile;130 131 RegisterXPCOMExitRoutineFunc registerExitRoutine;132 UnregisterXPCOMExitRoutineFunc unregisterExitRoutine;133 134 // Added for Mozilla 1.5135 GetDebugFunc getDebug;136 GetTraceRefcntFunc getTraceRefcnt;137 138 // Added for Mozilla 1.7139 StringContainerInitFunc stringContainerInit;140 StringContainerFinishFunc stringContainerFinish;141 StringGetDataFunc stringGetData;142 StringSetDataFunc stringSetData;143 StringSetDataRangeFunc stringSetDataRange;144 StringCopyFunc stringCopy;145 CStringContainerInitFunc cstringContainerInit;146 CStringContainerFinishFunc cstringContainerFinish;147 CStringGetDataFunc cstringGetData;148 CStringSetDataFunc cstringSetData;149 CStringSetDataRangeFunc cstringSetDataRange;150 CStringCopyFunc cstringCopy;151 CStringToUTF16 cstringToUTF16;152 UTF16ToCString utf16ToCString;153 StringCloneDataFunc stringCloneData;154 CStringCloneDataFunc cstringCloneData;155 156 } XPCOMFunctions;157 158 typedef nsresult (PR_CALLBACK *GetFrozenFunctionsFunc)(XPCOMFunctions *entryPoints, const char* libraryPath);159 extern "C" NS_COM nsresult160 NS_GetFrozenFunctions(XPCOMFunctions *entryPoints, const char* libraryPath);161 82 162 83 // think hard before changing this -
trunk/src/libs/xpcom18a4/xpcom/build/nsXPComInit.cpp
r101860 r101861 901 901 } 902 902 903 #define GET_FUNC(_tag, _decl, _name) \904 functions->_tag = (_decl) PR_FindSymbol(xpcomLib, _name); \905 if (!functions->_tag) goto end906 907 nsresult NS_COM PR_CALLBACK908 NS_GetFrozenFunctions(XPCOMFunctions *functions, const char* libraryPath)909 {910 if (!functions)911 return NS_ERROR_OUT_OF_MEMORY;912 913 if (functions->version != XPCOM_GLUE_VERSION)914 return NS_ERROR_FAILURE;915 916 PRLibrary *xpcomLib = PR_LoadLibrary(libraryPath);917 if (!xpcomLib)918 return NS_ERROR_FAILURE;919 920 nsresult rv = NS_ERROR_FAILURE;921 922 #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP923 GET_FUNC(init, InitFunc, "VBoxNsxpNS_InitXPCOM2");924 GET_FUNC(shutdown, ShutdownFunc, "VBoxNsxpNS_ShutdownXPCOM");925 GET_FUNC(getServiceManager, GetServiceManagerFunc, "VBoxNsxpNS_GetServiceManager");926 GET_FUNC(getComponentManager, GetComponentManagerFunc, "VBoxNsxpNS_GetComponentManager");927 GET_FUNC(getComponentRegistrar, GetComponentRegistrarFunc, "VBoxNsxpNS_GetComponentRegistrar");928 GET_FUNC(newLocalFile, NewLocalFileFunc, "VBoxNsxpNS_NewLocalFile");929 GET_FUNC(newNativeLocalFile, NewNativeLocalFileFunc, "VBoxNsxpNS_NewNativeLocalFile");930 GET_FUNC(registerExitRoutine, RegisterXPCOMExitRoutineFunc, "VBoxNsxpNS_RegisterXPCOMExitRoutine");931 GET_FUNC(unregisterExitRoutine, UnregisterXPCOMExitRoutineFunc, "VBoxNsxpNS_UnregisterXPCOMExitRoutine");932 #else /* !VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */933 GET_FUNC(init, InitFunc, "NS_InitXPCOM2");934 GET_FUNC(shutdown, ShutdownFunc, "NS_ShutdownXPCOM");935 GET_FUNC(getServiceManager, GetServiceManagerFunc, "NS_GetServiceManager");936 GET_FUNC(getComponentManager, GetComponentManagerFunc, "NS_GetComponentManager");937 GET_FUNC(getComponentRegistrar, GetComponentRegistrarFunc, "NS_GetComponentRegistrar");938 GET_FUNC(newLocalFile, NewLocalFileFunc, "NS_NewLocalFile");939 GET_FUNC(newNativeLocalFile, NewNativeLocalFileFunc, "NS_NewNativeLocalFile");940 GET_FUNC(registerExitRoutine, RegisterXPCOMExitRoutineFunc, "NS_RegisterXPCOMExitRoutine");941 GET_FUNC(unregisterExitRoutine, UnregisterXPCOMExitRoutineFunc, "NS_UnregisterXPCOMExitRoutine");942 #endif /* !VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */943 944 // these functions were added post 1.4 (need to check size of |functions|)945 if (functions->size > offsetof(XPCOMFunctions, getTraceRefcnt)) {946 #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP947 GET_FUNC(getDebug, GetDebugFunc, "VBoxNsxpNS_GetDebug");948 GET_FUNC(getTraceRefcnt, GetTraceRefcntFunc, "VBoxNsxpNS_GetTraceRefcnt");949 #else /* !VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */950 GET_FUNC(getDebug, GetDebugFunc, "NS_GetDebug");951 GET_FUNC(getTraceRefcnt, GetTraceRefcntFunc, "NS_GetTraceRefcnt");952 #endif /* !VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */953 }954 955 // these functions were added post 1.6 (need to check size of |functions|)956 if (functions->size > offsetof(XPCOMFunctions, cstringCloneData)) {957 #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP958 GET_FUNC(stringContainerInit, StringContainerInitFunc, "VBoxNsxpNS_StringContainerInit");959 GET_FUNC(stringContainerFinish, StringContainerFinishFunc, "VBoxNsxpNS_StringContainerFinish");960 GET_FUNC(stringGetData, StringGetDataFunc, "VBoxNsxpNS_StringGetData");961 GET_FUNC(stringSetData, StringSetDataFunc, "VBoxNsxpNS_StringSetData");962 GET_FUNC(stringSetDataRange, StringSetDataRangeFunc, "VBoxNsxpNS_StringSetDataRange");963 GET_FUNC(stringCopy, StringCopyFunc, "VBoxNsxpNS_StringCopy");964 GET_FUNC(cstringContainerInit, CStringContainerInitFunc, "VBoxNsxpNS_CStringContainerInit");965 GET_FUNC(cstringContainerFinish, CStringContainerFinishFunc, "VBoxNsxpNS_CStringContainerFinish");966 GET_FUNC(cstringGetData, CStringGetDataFunc, "VBoxNsxpNS_CStringGetData");967 GET_FUNC(cstringSetData, CStringSetDataFunc, "VBoxNsxpNS_CStringSetData");968 GET_FUNC(cstringSetDataRange, CStringSetDataRangeFunc, "VBoxNsxpNS_CStringSetDataRange");969 GET_FUNC(cstringCopy, CStringCopyFunc, "VBoxNsxpNS_CStringCopy");970 GET_FUNC(cstringToUTF16, CStringToUTF16, "VBoxNsxpNS_CStringToUTF16");971 GET_FUNC(utf16ToCString, UTF16ToCString, "VBoxNsxpNS_UTF16ToCString");972 GET_FUNC(stringCloneData, StringCloneDataFunc, "VBoxNsxpNS_StringCloneData");973 GET_FUNC(cstringCloneData, CStringCloneDataFunc, "VBoxNsxpNS_CStringCloneData");974 #else /* !VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */975 GET_FUNC(stringContainerInit, StringContainerInitFunc, "NS_StringContainerInit");976 GET_FUNC(stringContainerFinish, StringContainerFinishFunc, "NS_StringContainerFinish");977 GET_FUNC(stringGetData, StringGetDataFunc, "NS_StringGetData");978 GET_FUNC(stringSetData, StringSetDataFunc, "NS_StringSetData");979 GET_FUNC(stringSetDataRange, StringSetDataRangeFunc, "NS_StringSetDataRange");980 GET_FUNC(stringCopy, StringCopyFunc, "NS_StringCopy");981 GET_FUNC(cstringContainerInit, CStringContainerInitFunc, "NS_CStringContainerInit");982 GET_FUNC(cstringContainerFinish, CStringContainerFinishFunc, "NS_CStringContainerFinish");983 GET_FUNC(cstringGetData, CStringGetDataFunc, "NS_CStringGetData");984 GET_FUNC(cstringSetData, CStringSetDataFunc, "NS_CStringSetData");985 GET_FUNC(cstringSetDataRange, CStringSetDataRangeFunc, "NS_CStringSetDataRange");986 GET_FUNC(cstringCopy, CStringCopyFunc, "NS_CStringCopy");987 GET_FUNC(cstringToUTF16, CStringToUTF16, "NS_CStringToUTF16");988 GET_FUNC(utf16ToCString, UTF16ToCString, "NS_UTF16ToCString");989 GET_FUNC(stringCloneData, StringCloneDataFunc, "NS_StringCloneData");990 GET_FUNC(cstringCloneData, CStringCloneDataFunc, "NS_CStringCloneData");991 #endif /* !VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */992 }993 994 rv = NS_OK;995 end:996 PR_UnloadLibrary(xpcomLib); // the library is refcnt'ed above by the caller.997 return rv;998 }
Note:
See TracChangeset
for help on using the changeset viewer.