当前位置: 首页>>代码示例>>C++>>正文


C++ CFBundleGetFunctionPointerForName函数代码示例

本文整理汇总了C++中CFBundleGetFunctionPointerForName函数的典型用法代码示例。如果您正苦于以下问题:C++ CFBundleGetFunctionPointerForName函数的具体用法?C++ CFBundleGetFunctionPointerForName怎么用?C++ CFBundleGetFunctionPointerForName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CFBundleGetFunctionPointerForName函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: uv__set_process_title

int uv__set_process_title(const char* title) {
#if TARGET_OS_IPHONE
  return -1;
#else
  typedef CFTypeRef (*LSGetCurrentApplicationASNType)(void);
  typedef OSStatus (*LSSetApplicationInformationItemType)(int,
                                                          CFTypeRef,
                                                          CFStringRef,
                                                          CFStringRef,
                                                          CFDictionaryRef*);
  CFBundleRef launch_services_bundle;
  LSGetCurrentApplicationASNType ls_get_current_application_asn;
  LSSetApplicationInformationItemType ls_set_application_information_item;
  CFStringRef* display_name_key;
  ProcessSerialNumber psn;
  CFTypeRef asn;
  CFStringRef display_name;
  OSStatus err;

  launch_services_bundle =
      CFBundleGetBundleWithIdentifier(CFSTR("com.apple.LaunchServices"));

  if (launch_services_bundle == NULL)
    return -1;

  ls_get_current_application_asn = (LSGetCurrentApplicationASNType)
      CFBundleGetFunctionPointerForName(launch_services_bundle,
                                        CFSTR("_LSGetCurrentApplicationASN"));

  if (ls_get_current_application_asn == NULL)
    return -1;

  ls_set_application_information_item = (LSSetApplicationInformationItemType)
      CFBundleGetFunctionPointerForName(launch_services_bundle,
                                        CFSTR("_LSSetApplicationInformationItem"));

  if (ls_set_application_information_item == NULL)
    return -1;

  display_name_key = CFBundleGetDataPointerForName(launch_services_bundle,
                                                   CFSTR("_kLSDisplayNameKey"));

  if (display_name_key == NULL || *display_name_key == NULL)
    return -1;

  /* Force the process manager to initialize. */
  GetCurrentProcess(&psn);

  display_name = CFStringCreateWithCString(NULL, title, kCFStringEncodingUTF8);
  asn = ls_get_current_application_asn();
  err = ls_set_application_information_item(-2,  /* Magic value. */
                                            asn,
                                            *display_name_key,
                                            display_name,
                                            NULL);

  return (err == noErr) ? 0 : -1;
#endif  /* !TARGET_OS_IPHONE */
}
开发者ID:2saki,项目名称:node,代码行数:59,代码来源:darwin-proctitle.c

示例2: path

bool PluginPackage::load()
{
    if (m_isLoaded) {
        m_loadCount++;
        return true;
    }

    WTF::RetainPtr<CFStringRef> path(AdoptCF, m_path.createCFString());
    WTF::RetainPtr<CFURLRef> url(AdoptCF, CFURLCreateWithFileSystemPath(kCFAllocatorDefault, path.get(),
                                                                        kCFURLPOSIXPathStyle, false));
    m_module = CFBundleCreate(NULL, url.get());
    if (!m_module || !CFBundleLoadExecutable(m_module)) {
        LOG(Plugins, "%s not loaded", m_path.utf8().data());
        return false;
    }

    m_isLoaded = true;

    NP_GetEntryPointsFuncPtr NP_GetEntryPoints = 0;
    NP_InitializeFuncPtr NP_Initialize;
    NPError npErr;

    NP_Initialize = (NP_InitializeFuncPtr)CFBundleGetFunctionPointerForName(m_module, CFSTR("NP_Initialize"));
    NP_GetEntryPoints = (NP_GetEntryPointsFuncPtr)CFBundleGetFunctionPointerForName(m_module, CFSTR("NP_GetEntryPoints"));
    m_NPP_Shutdown = (NPP_ShutdownProcPtr)CFBundleGetFunctionPointerForName(m_module, CFSTR("NP_Shutdown"));

    if (!NP_Initialize || !NP_GetEntryPoints || !m_NPP_Shutdown)
        goto abort;

    memset(&m_pluginFuncs, 0, sizeof(m_pluginFuncs));
    m_pluginFuncs.size = sizeof(m_pluginFuncs);

    initializeBrowserFuncs();

    npErr = NP_Initialize(&m_browserFuncs);
    LOG_NPERROR(npErr);
    if (npErr != NPERR_NO_ERROR)
        goto abort;

    npErr = NP_GetEntryPoints(&m_pluginFuncs);
    LOG_NPERROR(npErr);
    if (npErr != NPERR_NO_ERROR)
        goto abort;

    m_loadCount++;
    return true;

abort:
    unloadWithoutShutdown();
    return false;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:51,代码来源:PluginPackageMac.cpp

示例3: getMainEntry

	PluginEntryProc getMainEntry ()
	{
		PluginEntryProc mainProc = 0;
	#if _WIN32
		mainProc = (PluginEntryProc)GetProcAddress ((HMODULE)module, "VSTPluginMain");
		if (!mainProc)
			mainProc = (PluginEntryProc)GetProcAddress ((HMODULE)module, "main");
	#elif TARGET_API_MAC_CARBON
		mainProc = (PluginEntryProc)CFBundleGetFunctionPointerForName ((CFBundleRef)module, CFSTR("VSTPluginMain"));
		if (!mainProc)
			mainProc = (PluginEntryProc)CFBundleGetFunctionPointerForName ((CFBundleRef)module, CFSTR("main_macho"));
	#endif
		return mainProc;
	}
开发者ID:oliviermohsen,项目名称:eiosisTest,代码行数:14,代码来源:minihost.cpp

示例4: LoadGlxBundle

/*
 * LoadGlxBundle
 *  The Quartz mode X server needs to dynamically load the appropriate
 *  bundle before initializing GLX.
 */
static void LoadGlxBundle(void)
{
    CFBundleRef mainBundle;
    CFStringRef bundleName;
    CFURLRef    bundleURL;
    CFBundleRef glxBundle;

    // Get the main bundle for the application
    mainBundle = CFBundleGetMainBundle();

    // Choose the bundle to load
    ErrorF("Loading GLX bundle ");
    if (quartzUseAGL) {
        bundleName = CFSTR("glxAGL.bundle");
        ErrorF("glxAGL.bundle (using Apple's OpenGL)\n");
    } else {
        bundleName = CFSTR("glxMesa.bundle");
        ErrorF("glxMesa.bundle (using Mesa)\n");
    }

    // Look for the appropriate GLX bundle in the main bundle by name
    bundleURL = CFBundleCopyResourceURL(mainBundle, bundleName,
                                        NULL, NULL);
    if (!bundleURL) {
        FatalError("Could not find GLX bundle.");
    }

    // Make a bundle instance using the URLRef
    glxBundle = CFBundleCreate(kCFAllocatorDefault, bundleURL);

    if (!CFBundleLoadExecutable(glxBundle)) {
        FatalError("Could not load GLX bundle.");
    }

    // Find the GLX init functions
    GlxExtensionInit = (void *) CFBundleGetFunctionPointerForName(
                                glxBundle, CFSTR("GlxExtensionInit"));

    GlxWrapInitVisuals = (void *) CFBundleGetFunctionPointerForName(
                                glxBundle, CFSTR("GlxWrapInitVisuals"));

    if (!GlxExtensionInit || !GlxWrapInitVisuals) {
        FatalError("Could not initialize GLX bundle.");
    }

    // Release the CF objects
    CFRelease(mainBundle);
    CFRelease(bundleURL);
}
开发者ID:dikerex,项目名称:theqvd,代码行数:54,代码来源:quartzStartup.c

示例5: GetMissingQTFunctionPointers

static void GetMissingQTFunctionPointers()
{
	OSErr 				err;
	CFBundleRef 		sysBundle;
    
	err = LoadFrameworkBundle(CFSTR("QuickTime.framework"), &sysBundle);
	if (err == noErr)
	{
		mNewQTNextPtr = (NewQTNextTaskPtr) CFBundleGetFunctionPointerForName( sysBundle, CFSTR("NewQTNextTaskNeededSoonerCallbackUPP") );
		mQTInstallNextPtr = (QTInstallNextTaskPtr) CFBundleGetFunctionPointerForName( sysBundle, CFSTR("QTInstallNextTaskNeededSoonerCallback") );
		mQTGetTimeUntilNextTaskPtr = (QTGetTimeUntilNextTaskPtr) CFBundleGetFunctionPointerForName( sysBundle, CFSTR("QTGetTimeUntilNextTask") );
		mDisposeQTNextTaskPtr = (DisposeQTNextTaskPtr)CFBundleGetFunctionPointerForName( sysBundle, CFSTR("DisposeQTNextTaskNeededSoonerCallbackUPP") );
		mQTUninstallNextTaskPtr = (QTUninstallNextTaskPtr)CFBundleGetFunctionPointerForName( sysBundle, CFSTR("QTUninstallNextTaskNeededSoonerCallback") );;
	}
}
开发者ID:fruitsamples,项目名称:VideoProcessing,代码行数:15,代码来源:PlayMovieFile.c

示例6: readPListFile

static WTF::RetainPtr<CFDictionaryRef> readPListFile(CFStringRef fileName, bool createFile, CFBundleRef bundle)
{
    if (createFile) {
        BP_CreatePluginMIMETypesPreferencesFuncPtr funcPtr =
            (BP_CreatePluginMIMETypesPreferencesFuncPtr)CFBundleGetFunctionPointerForName(bundle, CFSTR("BP_CreatePluginMIMETypesPreferences"));
        if (funcPtr)
            funcPtr();
    }

    WTF::RetainPtr<CFDictionaryRef> map;
    WTF::RetainPtr<CFURLRef> url =
        CFURLCreateWithFileSystemPath(kCFAllocatorDefault, fileName, kCFURLPOSIXPathStyle, false);

    CFDataRef resource = 0;
    SInt32 code;
    if (!CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault, url.get(), &resource, 0, 0, &code))
        return map;

    WTF::RetainPtr<CFPropertyListRef> propertyList =
            CFPropertyListCreateFromXMLData(kCFAllocatorDefault, resource, kCFPropertyListImmutable, 0);

    CFRelease(resource);

    if (!propertyList)
        return map;

    if (CFGetTypeID(propertyList.get()) != CFDictionaryGetTypeID())
        return map;

    map = static_cast<CFDictionaryRef>(static_cast<CFPropertyListRef>(propertyList.get()));
    return map;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:32,代码来源:PluginPackageMac.cpp

示例7: CFStringCreateWithCString

 void *mac_getBundleSym(CFBundleRef bundle, const char *name) 
 {
     CFStringRef nameRef = CFStringCreateWithCString(NULL, name, kCFStringEncodingASCII);
     void *sym = CFBundleGetFunctionPointerForName(bundle, nameRef);
     CFRelease(nameRef);
     return sym;
 }
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:7,代码来源:MacUtils.cpp

示例8: _CFBundlePlugInLoaded

__private_extern__ void _CFBundlePlugInLoaded(CFBundleRef bundle) {
    CFDictionaryRef infoDict = CFBundleGetInfoDictionary(bundle);
    CFStringRef tempStr;
    CFPlugInDynamicRegisterFunction func = NULL;

    if (!__CFBundleGetPlugInData(bundle)->_isPlugIn || __CFBundleGetPlugInData(bundle)->_isDoingDynamicRegistration || !infoDict || !CFBundleIsExecutableLoaded(bundle)) return;

    tempStr = (CFStringRef)CFDictionaryGetValue(infoDict, CFSTR("CFPlugInNeedsDynamicRegistration"));
    if (tempStr && CFGetTypeID(tempStr) == CFStringGetTypeID() && CFStringCompare(tempStr, CFSTR("YES"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {
        CFDictionaryRemoveValue((CFMutableDictionaryRef)infoDict, CFSTR("CFPlugInNeedsDynamicRegistration"));
        tempStr = (CFStringRef)CFDictionaryGetValue(infoDict, kCFPlugInDynamicRegisterFunctionKey);
        if (!tempStr || CFGetTypeID(tempStr) != CFStringGetTypeID() || CFStringGetLength(tempStr) <= 0) tempStr = CFSTR("CFPlugInDynamicRegister");
        __CFBundleGetPlugInData(bundle)->_loadOnDemand = false;
        __CFBundleGetPlugInData(bundle)->_isDoingDynamicRegistration = true;

        /* Find the symbol and call it. */
        func = (CFPlugInDynamicRegisterFunction)CFBundleGetFunctionPointerForName(bundle, tempStr);
        if (func) {
            func(bundle);
            // MF:!!! Unload function is never called.  Need to deal with this!
        }

        __CFBundleGetPlugInData(bundle)->_isDoingDynamicRegistration = false;
        if (__CFBundleGetPlugInData(bundle)->_loadOnDemand && __CFBundleGetPlugInData(bundle)->_instanceCount == 0) CFBundleUnloadExecutable(bundle);   // Unload now if we can/should.
    } else {
        CFDictionaryRemoveValue((CFMutableDictionaryRef)infoDict, CFSTR("CFPlugInNeedsDynamicRegistration"));
    }
}
开发者ID:Ashod,项目名称:WinCairoRequirements,代码行数:28,代码来源:CFPlugIn_PlugIn.c

示例9: CFBundleGetBundleWithIdentifier

void HeadlessView::loadExtensions() {
    if (extensionsLoaded) {
        return;
    }

#ifdef MBGL_USE_CGL
    gl::InitializeExtensions([](const char * name) {
        static CFBundleRef framework = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.opengl"));
        if (!framework) {
            throw std::runtime_error("Failed to load OpenGL framework.");
        }

        CFStringRef str = CFStringCreateWithCString(kCFAllocatorDefault, name, kCFStringEncodingASCII);
        void* symbol = CFBundleGetFunctionPointerForName(framework, str);
        CFRelease(str);

        return reinterpret_cast<gl::glProc>(symbol);
    });
#endif

#ifdef MBGL_USE_GLX
    gl::InitializeExtensions([](const char * name) {
        return glXGetProcAddress(reinterpret_cast<const GLubyte *>(name));
    });
#endif

    extensionsLoaded = true;
}
开发者ID:Dyziorek,项目名称:mapbox-gl-native,代码行数:28,代码来源:headless_view.cpp

示例10: defined

//-----------------------------------------------------------------------------
void *DynamicLibrary::getProcAddress( const char *function )
{
	OSErr err = noErr;
	void *fnAddress = NULL;
#if defined(TORQUE_OS_MAC_CARB)
	if (platState.osX)
	{
		CFStringRef str = CFStringCreateWithCString(NULL, function, kCFStringEncodingMacRoman);
		fnAddress = CFBundleGetFunctionPointerForName( (CFBundleRef)hInst, str );
		if (fnAddress == NULL)
			err = cfragNoSymbolErr;
		CFRelease(str);
	}
	else
#endif
	{
		err = FindSymbol((CFragConnectionID)hInst, str2p(function), (char**)&fnAddress, NULL);
	}

	if (!fnAddress) {
		if (mErrorReport)
			Con::errorf("DynamicLibrary: function '%s' not found!", function);
		mError = true;		
	}
	return fnAddress;
}
开发者ID:jamesu,项目名称:torque-stuff,代码行数:27,代码来源:macCarbDynamicLibrary.cpp

示例11: defined

void*   OSCodeFragment::GetSymbol(const char* inSymbolName)
{
    if (fFragmentP == NULL)
        return NULL;
        
#if defined(HPUX) || defined(HPUX10)
    void *symaddr = NULL;
    int status;

    errno = 0;
    status = shl_findsym((shl_t *)&fFragmentP, symname, TYPE_PROCEDURE, &symaddr);
    if (status == -1 && errno == 0) /* try TYPE_DATA instead */
        status = shl_findsym((shl_t *)&fFragmentP, inSymbolName, TYPE_DATA, &symaddr);
    return (status == -1 ? NULL : symaddr);
#elif defined(DLSYM_NEEDS_UNDERSCORE)
    char *symbol = (char*)malloc(sizeof(char)*(strlen(inSymbolName)+2));
    void *retval;
    qtss_sprintf(symbol, "_%s", inSymbolName);
    retval = dlsym(fFragmentP, symbol);
    free(symbol);
    return retval;
#elif defined(__Win32__)
    return ::GetProcAddress(fFragmentP, inSymbolName);
#elif defined(__MacOSX__)
    CFStringRef theString = CFStringCreateWithCString( kCFAllocatorDefault, inSymbolName, kCFStringEncodingASCII);
    void* theSymbol = (void*)CFBundleGetFunctionPointerForName( fFragmentP, theString );
    CFRelease(theString);
    return theSymbol;
#else
    return dlsym(fFragmentP, inSymbolName);
#endif  
}
开发者ID:12307,项目名称:EasyDarwin,代码行数:32,代码来源:OSCodeFragment.cpp

示例12: CFBundleGetFunctionPointersForNames

void CFBundleGetFunctionPointersForNames(CFBundleRef bundle, CFArrayRef functionNames, void *ftbl[]) {
    SInt32 i, c;
    
    if (!ftbl) return;
    
    c = CFArrayGetCount(functionNames);
    for (i = 0; i < c; i++) ftbl[i] = CFBundleGetFunctionPointerForName(bundle, (CFStringRef)CFArrayGetValueAtIndex(functionNames, i));
}
开发者ID:parkera,项目名称:swift-corelibs-foundation,代码行数:8,代码来源:CFBundle_Binary.c

示例13: InitBMDStreamingAPI

void InitBMDStreamingAPI(void)
{
	CFURLRef bundleURL;

	bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR(kBMDStreamingAPI_BundlePath), kCFURLPOSIXPathStyle, true);
	if (bundleURL != NULL)
	{
		gBMDStreamingAPIBundleRef = CFBundleCreate(kCFAllocatorDefault, bundleURL);
		if (gBMDStreamingAPIBundleRef != NULL)
		{
			gCreateDiscoveryFunc = (CreateDiscoveryFunc)CFBundleGetFunctionPointerForName(gBMDStreamingAPIBundleRef, CFSTR("CreateBMDStreamingDiscoveryInstance_0002"));
			gCreateNALParserFunc = (CreateNALParserFunc)CFBundleGetFunctionPointerForName(gBMDStreamingAPIBundleRef, CFSTR("CreateBMDStreamingH264NALParser_0001"));
		}

		CFRelease(bundleURL);
	}
}
开发者ID:Dead133,项目名称:obs-studio,代码行数:17,代码来源:DeckLinkAPIDispatch.cpp

示例14: LoadRadioEffectComponent

static CFBundleRef LoadRadioEffectComponent()
{
	bool bLoaded = false;
	CFBundleRef Bundle = NULL;

	CFBundleRef MainBundleRef = CFBundleGetMainBundle();
	if( MainBundleRef )
	{
		CFURLRef ComponentURLRef = CFBundleCopyResourceURL( MainBundleRef, CFSTR("RadioEffectUnit"), CFSTR("component"), 0 );
		if( ComponentURLRef )
		{
			Bundle = CFBundleCreate(kCFAllocatorDefault, ComponentURLRef);
			if(Bundle)
			{
				CFArrayRef Components = (CFArrayRef)CFBundleGetValueForInfoDictionaryKey(Bundle, CFSTR("AudioComponents"));
				if ( Components && CFArrayGetCount(Components) )
				{
					CFDictionaryRef ComponentInfo = (CFDictionaryRef)CFArrayGetValueAtIndex(Components, 0);
					CFNumberRef ComponentVersion = (CFNumberRef)CFDictionaryGetValue(ComponentInfo, CFSTR("version"));
					CFStringRef ComponentFactoryFunction = (CFStringRef)CFDictionaryGetValue(ComponentInfo, CFSTR("factoryFunction"));
					if( ComponentVersion && ComponentFactoryFunction )
					{
						int32 Version = 0;
						CFNumberGetValue(ComponentVersion, kCFNumberSInt32Type, &Version);
						
						AudioComponentFactoryFunction Factory = (AudioComponentFactoryFunction)CFBundleGetFunctionPointerForName(Bundle, ComponentFactoryFunction);
						if(Factory)
						{
							//	fill out the AudioComponentDescription
							AudioComponentDescription theDescription;
							theDescription.componentType = kAudioUnitType_Effect;
							theDescription.componentSubType = 'Rdio';
							theDescription.componentManufacturer = 'Epic';
							theDescription.componentFlagsMask = 0;
							
							AudioComponent RadioComponent = AudioComponentFindNext(nullptr, &theDescription);
							if ( !RadioComponent )
							{
								RadioComponent = AudioComponentRegister(&theDescription, CFSTR("Epic Games: RadioEffectUnit"), Version, Factory);
								check(RadioComponent);
							}
							bLoaded = (RadioComponent != NULL);
						}
					}
				}
				if(!bLoaded)
				{
					CFRelease(Bundle);
					Bundle = NULL;
				}
			}

			CFRelease( ComponentURLRef );
		}
	}

	return Bundle;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:58,代码来源:CoreAudioEffects.cpp

示例15: InitDeckLinkAPI_v7_6

void	InitDeckLinkAPI_v7_6 (void)
{
	CFURLRef		bundleURL;

	bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR(kDeckLinkAPI_BundlePath), kCFURLPOSIXPathStyle, true);
	if (bundleURL != NULL)
	{
		gBundleRef = CFBundleCreate(kCFAllocatorDefault, bundleURL);
		if (gBundleRef != NULL)
		{
			gCreateIteratorFunc = (CreateIteratorFunc_v7_6)CFBundleGetFunctionPointerForName(gBundleRef, CFSTR("CreateDeckLinkIteratorInstance"));
			gCreateOpenGLPreviewFunc = (CreateOpenGLScreenPreviewHelperFunc_v7_6)CFBundleGetFunctionPointerForName(gBundleRef, CFSTR("CreateOpenGLScreenPreviewHelper"));
			gCreateCocoaPreviewFunc = (CreateCocoaScreenPreviewFunc_v7_6)CFBundleGetFunctionPointerForName(gBundleRef, CFSTR("CreateCocoaScreenPreview"));
			gCreateVideoConversionFunc = (CreateVideoConversionInstanceFunc_v7_6)CFBundleGetFunctionPointerForName(gBundleRef, CFSTR("CreateVideoConversionInstance"));
		}
		CFRelease(bundleURL);
	}
}
开发者ID:AmesianX,项目名称:obs-studio,代码行数:18,代码来源:DeckLinkAPIDispatch_v7_6.cpp


注:本文中的CFBundleGetFunctionPointerForName函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。