这篇教程C++ CloseAll函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CloseAll函数的典型用法代码示例。如果您正苦于以下问题:C++ CloseAll函数的具体用法?C++ CloseAll怎么用?C++ CloseAll使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CloseAll函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: InitListeningSocketstatic int InitListeningSocket(ChatDetails* _chat, char* _ip){ int optval = 1; struct ip_mreq mreq; mreq.imr_multiaddr.s_addr = inet_addr(_ip); mreq.imr_interface.s_addr = htonl(INADDR_ANY); if ((_chat->m_listeningSocket = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { perror("socket failed1/n"); free(_chat); return -1; } if (setsockopt(_chat->m_listeningSocket, SOL_SOCKET, SO_REUSEADDR, &optval, sizeof(optval)) < 0) { perror("setsockopt failed1/n"); CloseAll(_chat); return -1; } if (bind(_chat->m_listeningSocket, (struct sockaddr*)&_chat->m_recvAddr, sizeof(_chat->m_recvAddr)) < 0) { perror("bind failed/n"); CloseAll(_chat); return -1; } if (setsockopt(_chat->m_listeningSocket, IPPROTO_IP, IP_ADD_MEMBERSHIP, (char*)&mreq, sizeof(mreq)) < 0) { perror("setsockopt failed2/n"); CloseAll(_chat); return -1; } return 0;}
开发者ID:yonathanPodolak,项目名称:c_chatServer,代码行数:34,
示例2: InitSelectGroupvoid InitSelectGroup (struct MCMap *SelectGroup, gint start){ gulong i,j; errormsg(MAPDEBUG1,"InitSelectGroup: Entered"); SelectGroup->mm_MapSize.x = SELXSIZE; SelectGroup->mm_MapSize.y = SELYSIZE; SelectGroup->mm_MapSize.l = 2; SelectGroup->mm_Copy = FALSE; SelectGroup->mm_Size = sizeof(struct MCMap); SelectGroup->mm_NextLayer = NULL; SelectGroup->mm_Columns = g_malloc0(sizeof(gulong)*SELYSIZE); if (!SelectGroup->mm_Columns) { printf("Could not allocate memory for SelectGroup/n"); CloseAll(); exit(20); }#if DEBUGLEV > 2 errormsg(MAPDEBUG3,"InitSelectGroup: SelectGroup->mm_Columns=%x, ", SelectGroup->mm_Columns);#endif for(i=0;i<SELYSIZE;i++) { SelectGroup->mm_Rows = g_malloc0(sizeof(struct MapPiece)*SELXSIZE);#if DEBUGLEV > 5 errormsg(MAPDEBUG3,"InitSelectGroup: i=%d, SelectGroup->mm_Rows=%x",i, SelectGroup->mm_Rows);#endif if (!SelectGroup->mm_Rows) { printf("Could not allocate memory for SelectGroup/n"); CloseAll(); exit(20); } SelectGroup->mm_Columns[i] = (gulong)SelectGroup->mm_Rows; for(j=0;j<SELXSIZE;j++) {#if DEBUGLEV > 5 errormsg(MAPDEBUG6,"InitSelectGroup: j=%d",j);#endif SelectGroup->mm_Rows[j].mp_Coordinates.x = j * 37; SelectGroup->mm_Rows[j].mp_Coordinates.y = i * 13; SelectGroup->mm_Rows[j].mp_Coordinates.l = 1; SelectGroup->mm_Rows[j].mp_PixbufNumber = start+i*SELYSIZE+j; SelectGroup->mm_Rows[j].mp_Size = sizeof(struct MapPiece); } } errormsg(MAPDEBUG1,"InitSelectGroup: Finished succesfully");}
开发者ID:BackupTheBerlios,项目名称:pertergrin-svn,代码行数:54,
示例3: mainint main( int argc, char **argv ){#ifdef DELLOG { FILE *fh; fh=fopen(getLogfile(),"w"); fclose(fh); }#endif gtk_init(&argc, &argv);#if DEBUGLEV > 4 errormsg(MAPMSG,"/nmain: Trying to load MapPieces Pixbuf...");#endif if (!MapPicLoad()) { printf("Could not load MapPieces Bitmap./n"); CloseAll(); exit(20); }#if DEBUGLEV > 4 errormsg(MAPMSG,".Done/nmain: Trying to initialize window..");#endif if (!(WO_Window=InitTestMEdWindow())) { printf("Did not get a Window pointer. Continuing anyway../n"); //CloseAll(); //exit(20); }#if DEBUGLEV > 4 errormsg(MAPMSG,".Done/nMain Loop/n");#endif /* Main Loop */ gtk_main();#if DEBUGLEV > 4 errormsg(MAPMSG,"Exiting..");#endif CloseAll();#if DEBUGLEV > 4 errormsg(MAPMSG,".Done/n");#endif exit(0);}
开发者ID:BackupTheBerlios,项目名称:pertergrin-svn,代码行数:48,
示例4: MaybeShutdownvoidMessagePortService::CloseAll(const nsID& aUUID){ MessagePortServiceData* data; if (!mPorts.Get(aUUID, &data)) { MaybeShutdown(); return; } if (data->mParent) { data->mParent->Close(); } for (const MessagePortServiceData::NextParent& parent : data->mNextParents) { parent.mParent->CloseAndDelete(); } nsID destinationUUID = data->mDestinationUUID; mPorts.Remove(aUUID); CloseAll(destinationUUID); // CloseAll calls itself recursively and it can happen that it deletes // itself. Before continuing we must check if we are still alive. if (!gInstance) { return; }#ifdef DEBUG mPorts.EnumerateRead(CloseAllDebugCheck, const_cast<nsID*>(&aUUID));#endif MaybeShutdown();}
开发者ID:Manishearth,项目名称:gecko-dev,代码行数:34,
示例5: MOZ_ASSERTboolMessagePortService::ClosePort(MessagePortParent* aParent){ MessagePortServiceData* data; if (!mPorts.Get(aParent->ID(), &data)) { MOZ_ASSERT(false, "Unknown MessagePortParent should not happend."); return false; } if (data->mParent != aParent) { MOZ_ASSERT(false, "ClosePort() should be called just from the correct parent."); return false; } if (!data->mNextParents.IsEmpty()) { MOZ_ASSERT(false, "ClosePort() should be called when there are not next parents."); return false; } // We don't want to send a message to this parent. data->mParent = nullptr; CloseAll(aParent->ID()); return true;}
开发者ID:Manishearth,项目名称:gecko-dev,代码行数:25,
示例6: CloseAll// DestructorCHtmlHelpControl::~CHtmlHelpControl(){ // Shut down the help control CloseAll(); // Unload the control if we have it loaded. Unload();}
开发者ID:jimmccurdy,项目名称:ArchiveGit,代码行数:8,
示例7: OnClosevoid wxGenericMDIParentFrame::OnClose(wxCloseEvent& event){ if ( !CloseAll() ) event.Veto(); else event.Skip();}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:7,
示例8: CloseAllvoid MainBook::RestoreSession(SessionEntry& session){ if(session.GetTabInfoArr().empty()) return; // nothing to restore CloseAll(false); size_t sel = session.GetSelectedTab(); const std::vector<TabInfo>& vTabInfoArr = session.GetTabInfoArr(); for(size_t i = 0; i < vTabInfoArr.size(); i++) { const TabInfo& ti = vTabInfoArr[i]; m_reloadingDoRaise = (i == vTabInfoArr.size() - 1); // Raise() when opening only the last editor LEditor* editor = OpenFile(ti.GetFileName()); if(!editor) { if(i < sel) { // have to adjust selected tab number because couldn't open tab sel--; } continue; } editor->SetFirstVisibleLine(ti.GetFirstVisibleLine()); editor->SetEnsureCaretIsVisible(editor->PositionFromLine(ti.GetCurrentLine())); editor->LoadMarkersFromArray(ti.GetBookmarks()); editor->LoadCollapsedFoldsFromArray(ti.GetCollapsedFolds()); } m_book->SetSelection(sel);}
开发者ID:fmestrone,项目名称:codelite,代码行数:26,
示例9: CloseAllvoid BattleScene::CleanupBattle(){ stage = 0; scroll_timer = 0; for (int i = 0; i < 6; i++) { if (opponent[i] != 0) { delete opponent[i]; opponent[i] = 0; } } if (opponent_image) { //delete opponent_image; //opponent_image = 0; } if (party_status) { delete party_status; party_status = 0; } CloseAll(); //close all textboxes}
开发者ID:Lin20,项目名称:projectpmr,代码行数:27,
示例10: LOGbool MediaSourceV4L2::CloseGrabDevice(){ bool tResult = false; LOG(LOG_VERBOSE, "Going to close"); if (mMediaType == MEDIA_AUDIO) { LOG(LOG_ERROR, "Wrong media type"); return false; } if (mMediaSourceOpened) { CloseAll(); // Free the frames av_free(mRGBFrame); av_free(mSourceFrame); tResult = true; }else LOG(LOG_INFO, "...wasn't open"); mGrabbingStopped = false; mSupportsMultipleInputChannels = false; mMediaType = MEDIA_UNKNOWN; ResetPacketStatistic(); return tResult;}
开发者ID:nolines,项目名称:Homer-Conferencing,代码行数:32,
示例11: switchvoid wxGenericMDIParentFrame::OnWindowMenu(wxCommandEvent &event){ switch ( event.GetId() ) { case wxWINDOWCLOSE: if ( m_currentChild ) m_currentChild->Close(); break; case wxWINDOWCLOSEALL: CloseAll(); break; case wxWINDOWNEXT: ActivateNext(); break; case wxWINDOWPREV: ActivatePrevious(); break; default: event.Skip(); }}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:25,
示例12: ASSERTbool CTaiKlineHistorySelect::OpenAll(){ ASSERT(FALSE); return false; CloseAll(); CTime tm = CTime::GetCurrentTime (); CString sTm = tm.Format ("%Y%m%d"); bool bToday = false; for(int i=0;i<m_fileNameArray.GetSize ();i++) { CString sPathSh; CString sPathSz; CString filename ; CString sTitle = m_fileNameArray[i]; CString title = sTitle+".hst"; sPathSh = "data//historysh//"; sPathSz = "data//historysz//"; CTaiKlineFileHS* pFile; if(m_fileNameArray[i]>=sTm) { if(bToday == false) { sPathSh = "data//historysh//"; sPathSz = "data//historysz//"; title = "buysell.dat"; sTitle = "buysell"; bToday = true; } else continue; } pFile = new CTaiKlineFileHS(true); filename =sPathSh + title; if(!pFile->Open (filename,0)) { delete pFile; continue; } m_fileHsShArray[sTitle] = (pFile); pFile = new CTaiKlineFileHS(false); filename =sPathSz + title; if(!pFile->Open (filename,0)) { delete pFile; continue; } m_fileHsSzArray[sTitle] = (pFile); } return true;}
开发者ID:ifzz,项目名称:yinhustock,代码行数:58,
示例13: CloseAllvoid MainBook::OnWorkspaceClosed(wxCommandEvent& e){ e.Skip(); CloseAll(false); // make sure no unsaved files clStatusBar* sb = clGetManager()->GetStatusBar(); if(sb) { sb->SetSourceControlBitmap(wxNullBitmap, "", ""); }}
开发者ID:huan5765,项目名称:codelite-translate2chinese,代码行数:9,
示例14: Check////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////Tests macros and functions.//If (!aValue) then the test will be panicked, the test data files will be deleted.static void Check(TInt aValue, TInt aLine) { if(!aValue) { CloseAll(); DeleteFile(TheDatabaseFileName); TheTest(EFalse, aLine); } }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:13,
示例15: CloseAllvoid CloseAll (int in, int out, struct pipefdlist ** list){ if (*list == NULL) return; if (((*list)->fd)[0] != in) close (((*list)->fd)[0]); if (((*list)->fd)[1] != out) close (((*list)->fd)[1]); CloseAll (in, out, &((*list)->next));}
开发者ID:abashkirtsev,项目名称:Shell,代码行数:10,
示例16: lockbool V4LHelper::Stop(){ CSingleLock lock(m_lock); CloseAll(); m_lastFreq = ""; m_tuningState = DvbTuner::TUNING_STATE_IDLE; return true;}
开发者ID:Kr0nZ,项目名称:boxee,代码行数:10,
示例17: lockvoid COutput::Close(){ CAutoLock lock(&m_csecDevice); if (!m_fDoubleBuf) { CloseAll(); return; } Reset();}
开发者ID:v-zaburdaev,项目名称:Gsplayer2,代码行数:11,
示例18: CloseAllvoid DirectoryFileSystem::DoState(PointerWrap &p) { auto s = p.Section("DirectoryFileSystem", 0, 2); if (!s) return; // Savestate layout: // u32: number of entries // per-entry: // u32: handle number // std::string filename (in guest's terms, untranslated) // enum FileAccess file access mode // u32 seek position // s64 current truncate position (v2+ only) u32 num = (u32) entries.size(); p.Do(num); if (p.mode == p.MODE_READ) { CloseAll(); u32 key; OpenFileEntry entry; for (u32 i = 0; i < num; i++) { p.Do(key); p.Do(entry.guestFilename); p.Do(entry.access); u32 err; if (!entry.hFile.Open(basePath,entry.guestFilename,entry.access, err)) { ERROR_LOG(FILESYS, "Failed to reopen file while loading state: %s", entry.guestFilename.c_str()); continue; } u32 position; p.Do(position); if (position != entry.hFile.Seek(position, FILEMOVE_BEGIN)) { ERROR_LOG(FILESYS, "Failed to restore seek position while loading state: %s", entry.guestFilename.c_str()); continue; } if (s >= 2) { p.Do(entry.hFile.needsTrunc_); } entries[key] = entry; } } else { for (auto iter = entries.begin(); iter != entries.end(); ++iter) { u32 key = iter->first; p.Do(key); p.Do(iter->second.guestFilename); p.Do(iter->second.access); u32 position = (u32)iter->second.hFile.Seek(0, FILEMOVE_CURRENT); p.Do(position); p.Do(iter->second.hFile.needsTrunc_); } }}
开发者ID:VOID001,项目名称:ppsspp,代码行数:53,
|