|
From: Andre R. <and...@us...> - 2005-01-15 16:43:19
|
Update of /cvsroot/frontierkernel/Frontier/Common/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22793/Common/source Modified Files: CallMachOFrameWork.c Log Message: Added getframeworkfuncptr() for obtaining a callable function pointer to a framework-based function, for Mach-O and CFM callers. Index: CallMachOFrameWork.c =================================================================== RCS file: /cvsroot/frontierkernel/Frontier/Common/source/CallMachOFrameWork.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CallMachOFrameWork.c 11 Jan 2005 22:48:04 -0000 1.6 --- CallMachOFrameWork.c 15 Jan 2005 16:43:10 -0000 1.7 *************** *** 183,186 **** --- 183,202 ---- + void *getframeworkfuncptr (CFStringRef framework, CFStringRef functionname) { + + /* + 2005-01-15 aradke: give us the name of a framework and the name of a function + in the framework and we will retrieve a callable pointer to that function. + */ + + CFBundleRef bundlePtr; + + if (LoadFrameworkBundle (framework, &bundlePtr) != noErr) + return (nil); + + return (CFBundleGetFunctionPointerForName (bundlePtr, functionname)); + } /*getframeworkfuncptr*/ + + static UInt32 gluetemplate[6] = {0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420}; |