您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ AddDevice函数代码示例

51自学网 2021-06-01 19:40:45
  C++
这篇教程C++ AddDevice函数代码示例写得很实用,希望能帮到您。

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

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

示例1: EXIDevice_Create

void CEXIChannel::DoState(PointerWrap &p){	p.Do(m_Status);	p.Do(m_DMAMemoryAddress);	p.Do(m_DMALength);	p.Do(m_Control);	p.Do(m_ImmData);	for (int d = 0; d < NUM_DEVICES; ++d)	{		IEXIDevice* pDevice = m_pDevices[d];		TEXIDevices type = pDevice->m_deviceType;		p.Do(type);		IEXIDevice* pSaveDevice = (type == pDevice->m_deviceType) ? pDevice : EXIDevice_Create(type, m_ChannelId);		pSaveDevice->DoState(p);		if(pSaveDevice != pDevice)		{			// if we had to create a temporary device, discard it if we're not loading.			// also, if no movie is active, we'll assume the user wants to keep their current devices			// instead of the ones they had when the savestate was created,			// unless the device is NONE (since ChangeDevice sets that temporarily).			if(p.GetMode() != PointerWrap::MODE_READ)			{				delete pSaveDevice;			}			else			{				AddDevice(pSaveDevice, d, false);			}		}	}}
开发者ID:Everscent,项目名称:dolphin-emu,代码行数:32,


示例2: RemoveDevice

void FDeviceSDL::IgnoreGameControllers(bool bIgnore){	if (bIgnore && !bIgnoreGameControllers)	{		bIgnoreGameControllers = true;		for (auto &Device : Devices)		{			if (DeviceMapping.Contains(Device.Value.InstanceId) && SDL_IsGameController(Device.Value.DeviceIndex.value))			{				RemoveDevice(Device.Key);			}		}	}	else if (!bIgnore && bIgnoreGameControllers)	{		bIgnoreGameControllers = false;		int Joysticks = SDL_NumJoysticks();		for (int i = 0; i < Joysticks; i++)		{			if (SDL_IsGameController(i))			{				AddDevice(FDeviceIndex(i));			}		}	}}
开发者ID:Deepfreeze32,项目名称:UEJoystickPlugin,代码行数:26,


示例3: AddDevice

IDevice* CDeviceList::AddDevice(voidinstancefunc InstanceFunction, const int ID, void* MainWindow){    instancefunc initializer=(instancefunc)InstanceFunction;    IDevice* D=initializer();    D->Init(ID,MainWindow);    return AddDevice(D);}
开发者ID:vemod-,项目名称:Object-Studio,代码行数:7,


示例4: switch

INT_PTR CALLBACK BtrfsDeviceAdd::DeviceAddDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {    try {        switch (uMsg) {            case WM_INITDIALOG:            {                EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);                populate_device_tree(GetDlgItem(hwndDlg, IDC_DEVICE_TREE));                EnableWindow(GetDlgItem(hwndDlg, IDOK), false);                break;            }            case WM_COMMAND:                switch (HIWORD(wParam)) {                    case BN_CLICKED:                        switch (LOWORD(wParam)) {                            case IDOK:                                AddDevice(hwndDlg);                            return true;                            case IDCANCEL:                                EndDialog(hwndDlg, 0);                            return true;                        }                    break;                }            break;            case WM_NOTIFY:                switch (((LPNMHDR)lParam)->code) {                    case TVN_SELCHANGEDW:                    {                        NMTREEVIEWW* nmtv = (NMTREEVIEWW*)lParam;                        TVITEMW tvi;                        bool enable = false;                        RtlZeroMemory(&tvi, sizeof(TVITEMW));                        tvi.hItem = nmtv->itemNew.hItem;                        tvi.mask = TVIF_PARAM | TVIF_HANDLE;                        if (SendMessageW(GetDlgItem(hwndDlg, IDC_DEVICE_TREE), TVM_GETITEMW, 0, (LPARAM)&tvi))                            sel = tvi.lParam == 0 ? nullptr : (device*)tvi.lParam;                        else                            sel = nullptr;                        if (sel)                            enable = (!sel->is_disk || !sel->has_parts) && !sel->multi_device;                        EnableWindow(GetDlgItem(hwndDlg, IDOK), enable);                        break;                    }                }            break;        }    } catch (const exception& e) {        error_message(hwndDlg, e.what());    }    return false;}
开发者ID:HeisSpiter,项目名称:btrfs,代码行数:59,


示例5: nitroFSInit

//Figure out if its gba or ds, setup stuffint nitroFSInit(const char *ndsfile) {	unsigned int pos=0;	char romstr[0x10];	chdirpathid=NITROROOT;	ndsFileLastpos=0;	ndsFile=NULL;	REG_EXMEMCNT &= ~ARM7_OWNS_CARD; //give us gba slot ownership	if(strncmp(((const char *)GBAROM)+LOADERSTROFFSET,LOADERSTR,strlen(LOADERSTR))==0) {	// We has gba rahm		if(strncmp(((const char *)GBAROM)+LOADERSTROFFSET+LOADEROFFSET,LOADERSTR,strlen(LOADERSTR))==0) { //Look for second magic string, if found its a sc.nds or nds.gba			fntOffset=((u32)*(u32*)(((const char *)GBAROM)+FNTOFFSET+LOADEROFFSET))+LOADEROFFSET;				fatOffset=((u32)*(u32*)(((const char *)GBAROM)+FATOFFSET+LOADEROFFSET))+LOADEROFFSET;			hasLoader=true;			AddDevice(&nitroFSdevoptab);			return(1);		} else {	//Ok, its not a .gba build, so must be emulator			fntOffset=((u32)*(u32*)(((const char *)GBAROM)+FNTOFFSET));				fatOffset=((u32)*(u32*)(((const char *)GBAROM)+FATOFFSET));			hasLoader=false;			AddDevice(&nitroFSdevoptab);			return(1);		}	} else {	//okay then try something else ~_~ (like dldi)		if((ndsFile=fopen(ndsfile,"rb"))) {			nitroSubRead(&pos,romstr,strlen(LOADERSTR));			if(strncmp(romstr,LOADERSTR,strlen(LOADERSTR))==0) {					nitroSubSeek(&pos,LOADEROFFSET+FNTOFFSET,SEEK_SET);				nitroSubRead(&pos,&fntOffset,sizeof(fntOffset));				nitroSubSeek(&pos,LOADEROFFSET+FATOFFSET,SEEK_SET);				nitroSubRead(&pos,&fatOffset,sizeof(fatOffset));				fatOffset+=LOADEROFFSET;				fntOffset+=LOADEROFFSET;				hasLoader=true;			} else {				nitroSubSeek(&pos,FNTOFFSET,SEEK_SET);				nitroSubRead(&pos,&fntOffset,sizeof(fntOffset));				nitroSubSeek(&pos,FATOFFSET,SEEK_SET);				nitroSubRead(&pos,&fatOffset,sizeof(fatOffset));				hasLoader=false;			}			setvbuf(ndsFile,NULL,_IONBF,0);		//we dont need double buffs u_u			AddDevice(&nitroFSdevoptab);			return(1);		} 	}	return(0);}
开发者ID:kusma,项目名称:nds,代码行数:47,


示例6: GOptimizer

void GOptimizingBench::CreateOptimizer(){	if(m_pOpt)		delete m_pOpt;	m_pOpt = new GOptimizer(this);	GDeviceWidget* pDevWid = AddDevice(m_pOpt);	setCentralWidget(pDevWid);}
开发者ID:GaelReinaudi,项目名称:LabExe,代码行数:8,


示例7: AddDevice

int CEnumerator::OnEnumFindDevice(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, PSP_DEVICE_INTERFACE_DETAIL_DATA DeviceInterfaceDetailData, int a5){	if(PowerUp(0, DeviceInfoData->DevInst))	{		return 1;	}	return AddDevice(DeviceInfoSet, DeviceInfoData, DeviceInterfaceDetailData, a5);}
开发者ID:jte,项目名称:logitech-rce,代码行数:8,


示例8: cd_init

int cd_init (void *elf){	KPRINTF ("cd_init()");	elf_header = elf;	AddDevice (&cd_device);		return 0;}
开发者ID:cod5,项目名称:kielder,代码行数:9,


示例9: AddDevice

GBenchDockWidget* GWorkBench::AddDeviceInNewDock( GDevice* pTheDevice, bool putOnStack /*= true*/ ){    GDeviceWidget* pDevWid = AddDevice(pTheDevice);    if(!pDevWid)        return 0;    GBenchDockWidget* pNewDock = new GBenchDockWidget(this, Qt::AllDockWidgetAreas);    pNewDock->InsertDeviceWidget(pDevWid);    return pNewDock;}
开发者ID:GaelReinaudi,项目名称:LabExe,代码行数:9,


示例10: NS_ENSURE_ARG_POINTER

NS_IMETHODIMPsbCDDeviceMarshall::OnMediaInserted(sbICDDevice *aDevice){  NS_ENSURE_ARG_POINTER(aDevice);  nsresult rv = AddDevice(aDevice);  NS_ENSURE_SUCCESS(rv, rv);  return NS_OK;}
开发者ID:AntoineTurmel,项目名称:nightingale-hacking,代码行数:10,


示例11: MODULE_INIT

MODULE_INIT(const char *opt){	devRandom = AddDevice("random", NULL, openRandom, 0);	if (devRandom == NULL)	{		kprintf("could not add the random device!/n");		return 1;	};	return 0;};
开发者ID:osstudy,项目名称:glidix,代码行数:10,


示例12: MOZ_ASSERT

// nsIDNSServiceResolveListenerNS_IMETHODIMPLegacyMDNSDeviceProvider::OnServiceResolved(nsIDNSServiceInfo* aServiceInfo){  MOZ_ASSERT(NS_IsMainThread());  if (NS_WARN_IF(!aServiceInfo)) {    return NS_ERROR_INVALID_ARG;  }  nsresult rv;  nsAutoCString serviceName;  if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceName(serviceName)))) {    return rv;  }  LOG_I("OnServiceResolved: %s", serviceName.get());  nsAutoCString host;  if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetHost(host)))) {    return rv;  }  nsAutoCString address;  if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetAddress(address)))) {    return rv;  }  uint16_t port;  if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetPort(&port)))) {    return rv;  }  nsAutoCString serviceType;  if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceType(serviceType)))) {    return rv;  }  uint32_t index;  if (FindDeviceById(host, index)) {    return UpdateDevice(index,                        serviceName,                        serviceType,                        address,                        port);  } else {    return AddDevice(host,                     serviceName,                     serviceType,                     address,                     port);  }  return NS_OK;}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:56,


示例13: AddDevice

/** * Fetch a list of all FTDI widgets and create a new device for each of them. */bool FtdiDmxPlugin::StartHook() {  typedef vector<FtdiWidgetInfo> FtdiWidgetInfoVector;  FtdiWidgetInfoVector widgets;  FtdiWidget::Widgets(&widgets);  FtdiWidgetInfoVector::const_iterator iter;  for (iter = widgets.begin(); iter != widgets.end(); ++iter) {    AddDevice(new FtdiDmxDevice(this, *iter, GetFrequency()));  }  return true;}
开发者ID:basileus,项目名称:ola,代码行数:14,


示例14: CreateDeviceList

static void CreateDeviceList(IXMLDOMDocument* pDoc,IXMLDOMElement* pParent,const DEVICELIST& l){	HRESULT hr;	for(size_t n=0;n<l.size();n++)	{		IXMLDOMElementPtr device;		CreateElement(pDoc,L"device",&device);		AddDevice(pDoc,device,l[n]);		AppendChild(device,pParent);	}}
开发者ID:jensvaaben,项目名称:mfcbdainf,代码行数:11,


示例15: InitialiseOpenNI

OpenNi2Video::OpenNi2Video(const std::string& device_uri){    InitialiseOpenNI();    const int dev_id = AddDevice(device_uri);    AddStream(OpenNiStreamMode( OpenNiDepth_1mm, ImageDim(), 30, dev_id) );    AddStream(OpenNiStreamMode( OpenNiRgb,   ImageDim(), 30, dev_id) );    SetupStreamModes();    Start();}
开发者ID:mp3guy,项目名称:Pangolin,代码行数:11,


示例16: ramdiskFS_Mount

//---------------------------------------------------------------------------------int ramdiskFS_Mount(const char *mountpoint, void *handle) {//---------------------------------------------------------------------------------	devoptab_t* devops;	char* nameCopy;	RAMDISK_PARTITION** partition;	char Mountpoint[100];	char *cptr;	strlcpy(Mountpoint, mountpoint, sizeof(Mountpoint));	int len = strlen(Mountpoint);	cptr = strchr(Mountpoint, ':');	if(cptr)	{		len = cptr-Mountpoint;		*++cptr = 0;	}	else		strlcat(Mountpoint, ":", sizeof(Mountpoint));	ramdiskFS_Unmount(Mountpoint);	if(handle) ramdiskFS_Unmount(((RAMDISK_PARTITION*)handle)->name);		devops = (devoptab_t*)malloc(sizeof(devoptab_t) + sizeof(RAMDISK_PARTITION*) + len + 1);	if (!devops)		return false;	partition = (RAMDISK_PARTITION**)(devops+1);	// Use the space allocated at the end of the devoptab struct											// for storing the partition	nameCopy = (char*)( partition+1);				// Use the space allocated at the end of the partition struct											// for storing the name		memcpy (devops, &ramdiskFS_devoptab, sizeof(ramdiskFS_devoptab)); // Add an entry for this device to the devoptab table	strlcpy (nameCopy, Mountpoint, len + 1);	devops->name = nameCopy;		if(handle)	{		*partition = (RAMDISK_PARTITION*)handle;		(*partition)->Rename(Mountpoint);	}	else		*partition = new RAMDISK_PARTITION(Mountpoint, true);	devops->deviceData			= partition; 	if(AddDevice(devops)<0)	{		free(devops);		return false;	}	return true;}
开发者ID:gnils,项目名称:usbloader-gx,代码行数:54,


示例17: Q_UNUSED

void RegEdit::OnSocItemActivated(QTreeWidgetItem *current, int column){    Q_UNUSED(column);    if(current == 0)        return;    if(current->type() == SocTreeNewDevType)        AddDevice(current);    else if(current->type() == SocTreeNewRegType)        AddRegister(current);    else if(current->type() == SocTreeNewFieldType)        AddField(current);}
开发者ID:Cortexelus,项目名称:rockbox,代码行数:12,


示例18: BlockAllCategories

FVisualLogger::FVisualLogger(){	BlockAllCategories(false);	AddDevice(&FVisualLoggerBinaryFileDevice::Get());	SetIsRecording(GEngine ? !!GEngine->bEnableVisualLogRecordingOnStart : false);	SetIsRecordingOnServer(false);	if (FParse::Param(FCommandLine::Get(), TEXT("EnableAILogging")))	{		SetIsRecording(true);		SetIsRecordingToFile(true);	}}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:13,


示例19: FSDrvInit

void FSDrvInit(FSClient* client, FSCmdBlock* cmdBlock) {    if(client == NULL || cmdBlock == NULL || (fsClient != NULL && fsCmdBlock != NULL)) {        return;    }    fsClient = client;    fsCmdBlock = cmdBlock;    int dev = AddDevice(&fsDrvOpTab);    if(dev != -1) {        setDefaultDevice(dev);    }}
开发者ID:xhp-creations,项目名称:Hello-World-using-libcafe,代码行数:13,


示例20: qWarning

void GWorkBench::AddDeviceInDock( GDevice* pTheDevice, GBenchDockWidget* pDock, bool putOnStack /*= true*/ ){    if(!pTheDevice)        return;    if(!pDock) {        qWarning() << "GWorkBench::AddDeviceInDock : The GBenchDockWidget* pointer is 0! 875494";        return;    }    GDeviceWidget* pDevWid = AddDevice(pTheDevice);    if(!pDevWid)        return;    pDock->InsertDeviceWidget(pDevWid);}
开发者ID:GaelReinaudi,项目名称:LabExe,代码行数:14,


示例21: QWidget

DeviceWidget::DeviceWidget(QWidget* Parent): QWidget(Parent), ui(new Ui::DeviceWidget){	ui->setupUi(this);	ui->devicesLayout->setAlignment(Qt::AlignTop);	Dialog = new DeviceDialog(-1, this);	for (const auto& Data: AppCore::getInstance()->GetDevices()) AddDevice(Data);	connect(Dialog, &DeviceDialog::onDialogAccept, this, &DeviceWidget::AddDevice);	connect(ui->addButton, &QPushButton::clicked, Dialog, &DeviceDialog::open);}
开发者ID:Kuszki,项目名称:AVR-Monitor,代码行数:14,


示例22: ProcessPnPMsgQueue

// this routine reads device notifications from a message queue and updates// the PM's internal tables appropriately.BOOLProcessPnPMsgQueue(HANDLE hMsgQ){    BOOL fOk = FALSE;    UCHAR deviceBuf[PNP_QUEUE_SIZE];    DWORD iBytesInQueue = 0;    DWORD dwFlags = 0;    SETFNAME(_T("ProcessPnPMsgQueue"));    // read a message from the message queue -- it should be a device advertisement    memset(deviceBuf, 0, PNP_QUEUE_SIZE);    if ( !ReadMsgQueue(hMsgQ, deviceBuf, PNP_QUEUE_SIZE, &iBytesInQueue, 0, &dwFlags)) {        // nothing in the queue        PMLOGMSG(ZONE_WARN, (_T("%s: ReadMsgQueue() failed %d/r/n"), pszFname,            GetLastError()));    } else if(iBytesInQueue >= sizeof(DEVDETAIL)) {        // process the message        PDEVDETAIL pDevDetail = (PDEVDETAIL) deviceBuf;        DWORD dwMessageSize = sizeof(DEVDETAIL) + pDevDetail->cbName;                // check for overlarge names        if(pDevDetail->cbName > ((PNP_MAX_NAMELEN - 1) * sizeof(pDevDetail->szName[0]))) {            PMLOGMSG(ZONE_WARN, (_T("%s: device name longer than %d characters/r/n"),                 pszFname, PNP_MAX_NAMELEN - 1));        } else {            // convert the device name to lower case            int i;            for(i = 0; i < (PNP_MAX_NAMELEN - 1) && pDevDetail->szName[i] != 0; i++) {                pDevDetail->szName[i] = _totlower(pDevDetail->szName[i]);            }            pDevDetail->szName[i] = 0;                        // add or remove the device -- note that a particular interface may be            // advertised more than once, so these routines must handle that possibility.            if(pDevDetail->fAttached) {                AddDevice(&pDevDetail->guidDevClass, pDevDetail->szName, NULL, NULL);            } else {                RemoveDevice(&pDevDetail->guidDevClass, pDevDetail->szName);            }            fOk = TRUE;        }    } else {        // not enough bytes for a message        PMLOGMSG(ZONE_WARN, (_T("%s: got runt message (%d bytes)/r/n"), pszFname,             iBytesInQueue));    }    return fOk;}
开发者ID:hibive,项目名称:sjmt6410pm090728,代码行数:51,


示例23: libusb_get_device_list

bool USBHost::AddNewDevices(std::set<u64>& new_devices, DeviceChangeHooks& hooks,                            const bool always_add_hooks){#ifdef __LIBUSB__  if (SConfig::GetInstance().m_usb_passthrough_devices.empty())    return true;  if (m_libusb_context)  {    libusb_device** list;    const ssize_t count = libusb_get_device_list(m_libusb_context, &list);    if (count < 0)    {      WARN_LOG(IOS_USB, "Failed to get device list: %s",               libusb_error_name(static_cast<int>(count)));      return false;    }    for (ssize_t i = 0; i < count; ++i)    {      libusb_device* device = list[i];      libusb_device_descriptor descriptor;      libusb_get_device_descriptor(device, &descriptor);      if (!SConfig::GetInstance().IsUSBDeviceWhitelisted(              {descriptor.idVendor, descriptor.idProduct}))      {        libusb_unref_device(device);        continue;      }      auto usb_device = std::make_unique<USB::LibusbDevice>(m_ios, device, descriptor);      if (!ShouldAddDevice(*usb_device))      {        libusb_unref_device(device);        continue;      }      const u64 id = usb_device->GetId();      new_devices.insert(id);      if (AddDevice(std::move(usb_device)) || always_add_hooks)        hooks.emplace(GetDeviceById(id), ChangeEvent::Inserted);      else        libusb_unref_device(device);    }    libusb_free_device_list(list, 0);  }#endif  return true;}
开发者ID:Anti-Ultimate,项目名称:dolphin,代码行数:48,


示例24: CMIOObjectCreate

	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------	// DeviceArrived()	//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------	void PlugIn::DeviceArrived(UInt64 guid, const io_string_t registryPath)	{		try		{				// Instantiate a new CMIODevice object in the DAL			CMIODeviceID deviceID = 0;			OSStatus err = CMIOObjectCreate(GetInterface(), kCMIOObjectSystemObject, kCMIODeviceClassID, &deviceID);			ThrowIfError(err, CAException(err), "CMIO::DP::Sample::PlugIn::DeviceArrived: couldn't instantiate the CMIODevice object");			// Make a device object			Device* device = new Device(*this, deviceID, mAssistantPort, guid, registryPath);			try			{				// Initialize the device				device->Initialize();								// Restore its settings if necessary				if (DALA::System::IsMaster())				{					DP::DeviceSettings::RestoreFromPrefs(*device, DP::DeviceSettings::sStandardControlsToSave, DP::DeviceSettings::kStandardNumberControlsToSave);				}								// Set the object state mutex				Object::SetObjectStateMutexForID(deviceID, device->GetObjectStateMutex());								// Add it to the device list				AddDevice(*device);				// Unlock the mutex since CMIOObjectsPublishedAndDied() can callout to property listeners				CAMutex::Unlocker unlocker(GetStateMutex());				// Tell the DAL about the device				err = CMIOObjectsPublishedAndDied(GetInterface(), kCMIOObjectSystemObject, 1, &deviceID, 0, 0);				ThrowIfError(err, err, "CMIO::DP::Sample::PlugIn::DeviceArrived: couldn't tell the DAL about a new device");			}			catch (...)			{				// Remove it from the device list (which is always safe to attempt) and delete it				RemoveDevice(*device);				delete device;			}		}		catch (...)		{		}	}
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:50,


示例25: vlc_savecancel

/***************************************************************************** * Run: main thread *****************************************************************************/static void *Run( void *data ){    LIBMTP_raw_device_t *p_rawdevices;    int i_numrawdevices;    int i_ret;    int i_status = 0;    services_discovery_t *p_sd = data;    for(;;)    {        int canc = vlc_savecancel();        i_ret = LIBMTP_Detect_Raw_Devices( &p_rawdevices, &i_numrawdevices );        if ( i_ret == 0 && i_numrawdevices > 0 && p_rawdevices != NULL &&             i_status == 0 )        {            /* Found a new device, add it */            msg_Dbg( p_sd, "New device found" );            if( AddDevice( p_sd, &p_rawdevices[0] ) == VLC_SUCCESS )                i_status = 1;            else                i_status = 2;        }        else        {            if ( ( i_ret != 0 || i_numrawdevices == 0 || p_rawdevices == NULL )                 && i_status == 1)            {                /* The device is not connected anymore, delete it */                msg_Info( p_sd, "Device disconnected" );                CloseDevice( p_sd );                i_status = 0;            }        }        free( p_rawdevices );        vlc_restorecancel(canc);        if( i_status == 2 )        {            msleep( 5000000 );            i_status = 0;        }        else            msleep( 500000 );    }    return NULL;}
开发者ID:etix,项目名称:vlc,代码行数:48,


示例26: fatMount

bool fatMount (const char* name, const DISC_INTERFACE* interface, sec_t startSector, uint32_t cacheSize, uint32_t SectorsPerPage) {	PARTITION* partition;	devoptab_t* devops;	char* nameCopy;	if(!name || strlen(name) > 8 || !interface)		return false;	if(!interface->startup())		return false;	if(!interface->isInserted())		return false;	char devname[10];	strcpy(devname, name);	strcat(devname, ":");	if(FindDevice(devname) >= 0)		return true;	devops = _FAT_mem_allocate (sizeof(devoptab_t) + strlen(name) + 1);	if (!devops) {		return false;	}	// Use the space allocated at the end of the devoptab struct for storing the name	nameCopy = (char*)(devops+1);	// Initialize the file system	partition = _FAT_partition_constructor (interface, cacheSize, SectorsPerPage, startSector);	if (!partition) {		_FAT_mem_free (devops);		return false;	}	// Add an entry for this device to the devoptab table	memcpy (devops, &dotab_fat, sizeof(dotab_fat));	strcpy (nameCopy, name);	devops->name = nameCopy;	devops->deviceData = partition;	AddDevice (devops);	return true;}
开发者ID:AdmiralCurtiss,项目名称:swiss-gc,代码行数:44,



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


C++ AddDialogItem函数代码示例
C++ AddDebugLogLineN函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。