void CSettings::LoadDefaults() { // jenksta: HACKY, find another way #ifdef _SERVER AddString("logfile", "ivmp-svr.log"); AddInteger("port", 9999, 1024, 65535); AddInteger("httpport", 9998, 80, 65535); AddString("httpserver", ""); AddInteger("maxplayers", MAX_PLAYERS, 1, MAX_PLAYERS); AddInteger("maxvehicles", MAX_VEHICLES, 0, MAX_VEHICLES); AddString("password", ""); AddBool("query", true); AddBool("listed", false); AddBool("guinametags",false); AddBool("vehicledamage", false); AddBool("vehiclewaterdeath", true); AddBool("headmovement",true); AddBool("checkGTAFiles",true); AddString("hostname", VERSION_IDENTIFIER_2 " Server"); AddString("hostaddress", ""); AddBool("frequentevents", false); AddBool("kickoldplayers", true); AddBool("paynspray", true); AddBool("autoaim", true); AddInteger("weather", 1, 1, 10); AddFloat("wind",0.0,0.0,50.0); AddBool("silent", false); AddBool("timestamp", true); AddList("script"); AddList("clientscript"); AddList("clientresource"); AddList("module"); AddList("config"); AddString("masterlistpath", MASTERLIST_ADD_PATH); #else AddString("ip", "127.0.0.1"); AddInteger("port", 9999, 1024, 65535); AddString("currentconnect_server", "0.0.0.0"); AddInteger("currentconnect_port", 9999, 1024, 65535); AddString("nick", "player"); AddString("pass", ""); AddBool("windowed", false); AddBool("fps", false); AddString("chatfont", "tahoma-bold"); AddInteger("chatsize", 10, 1, 100); AddInteger("chatbga", 0, 0, 255); AddInteger("chatbgr", 0, 0, 255); AddInteger("chatbgg", 0, 0, 255); AddInteger("chatbgb", 0, 0, 255); AddString("masterlistpath", MASTERLIST_LIST_PATH); #endif AddString("masterlist", MASTERLIST_ADDRESS); AddInteger("masterlistport", MASTERLIST_PORT, 1, 65535); }
// Build the screen LTBOOL CScreenHostLevels::Build() { LTIntPt addPos = g_pLayoutMgr->GetScreenCustomPoint((eScreenID)m_nScreenID,"AddPos"); LTIntPt removePos = g_pLayoutMgr->GetScreenCustomPoint((eScreenID)m_nScreenID,"RemovePos"); LTIntPt commandPos = g_pLayoutMgr->GetScreenCustomPoint((eScreenID)m_nScreenID,"CommandPos"); if (g_pLayoutMgr->HasCustomValue((eScreenID)m_nScreenID,"ListFontSize")) nListFontSize = (uint8)g_pLayoutMgr->GetScreenCustomInt((eScreenID)m_nScreenID,"ListFontSize"); CreateTitle(IDS_TITLE_HOST_MISSIONS); m_pAdd = AddTextItem(IDS_HOST_ADD_MISSION, CMD_ADD_LEVEL, IDS_HELP_ADD_MISSION, addPos); m_pAddAll = AddTextItem(IDS_HOST_ADD_ALL, CMD_ADD_ALL, IDS_HELP_ADD_ALL, commandPos); m_pRemoveAll = AddTextItem(IDS_HOST_REMOVE_ALL, CMD_REMOVE_ALL, IDS_HELP_REM_ALL); m_pRemove = AddTextItem(IDS_HOST_REMOVE_MISSION, CMD_REMOVE_LEVEL, IDS_HELP_REM_MISSION, removePos); LTRect rcAvailRect = g_pLayoutMgr->GetScreenCustomRect((eScreenID)m_nScreenID,"AvailRect"); int nListHeight = (rcAvailRect.bottom - rcAvailRect.top); nAvailWidth = (rcAvailRect.right - rcAvailRect.left); m_pAvailMissions = AddList(LTIntPt(rcAvailRect.left,rcAvailRect.top),nListHeight,LTTRUE,nAvailWidth); m_pAvailMissions->SetIndent(LTIntPt(5,5)); m_pAvailMissions->SetFrameWidth(2); m_pAvailMissions->Enable(LTFALSE); LTRect rcSelRect = g_pLayoutMgr->GetScreenCustomRect((eScreenID)m_nScreenID,"SelectRect"); nListHeight = (rcSelRect.bottom - rcSelRect.top); nSelWidth = (rcSelRect.right - rcSelRect.left); m_pSelMissions = AddList(LTIntPt(rcSelRect.left,rcSelRect.top),nListHeight,LTTRUE,nSelWidth); m_pSelMissions->SetIndent(LTIntPt(5,5)); m_pSelMissions->SetFrameWidth(2); m_pSelMissions->Enable(LTFALSE); m_nextPos.y += nListHeight; uint16 nListWidth = nSelWidth-16; m_pLoopToggle = AddToggle(IDS_LOOP_MISSIONS,IDS_HELP_LOOP_MISSIONS,nListWidth,&m_bLoopMissions); m_pLoopToggle->SetOnString(LoadTempString(IDS_YES)); m_pLoopToggle->SetOffString(LoadTempString(IDS_NO)); // Make sure to call the base class if (!CBaseScreen::Build()) return LTFALSE; UseBack(LTTRUE,LTTRUE); return LTTRUE; }
void CAclApp::AddAcl(PXACL pAcl, BOOL bIsSelect, BOOL bIsEdit, int iIndex) { CString sString[ACL_APP_LIST_COUNT]; sString[0].Format("%u", pAcl->ulAclID); sString[1] = (pAcl->sApplication[0] == '*' ? "*" : GetName(pAcl->sApplication)); sString[2] = GUI_DIRECTION[pAcl->bDirection]; sString[3] = ACL_NET_TYPE[pAcl->bRemoteNetType]; sString[4].Format("%u", pAcl->uiServicePort); sString[5].Format("%u", pAcl->wLocalPort); sString[6] = GUI_ACTION[pAcl->bAction]; sString[7] = GUI_SERVICE_TYPE[pAcl->bServiceType]; sString[8] = ACL_TIME_TYPE[pAcl->bAccessTimeType]; sString[9] = pAcl->sMemo[0] == 0 ? MEMO_CONST : pAcl->sMemo; sString[10] = (pAcl->sApplication[0] == '*' ? "*" : GetPath(pAcl->sApplication)); HICON hIcon = ExtractIcon(theApp.m_hInstance, pAcl->sApplication, 0); if(hIcon == NULL) hIcon = theApp.LoadIcon(IDR_NULLAPP); int iIcon; if(bIsEdit) iIcon = m_ImageList.Replace(iIndex, hIcon); else iIcon = m_ImageList.Add(hIcon); DestroyIcon(hIcon); iIndex = AddList(&m_List, (LPCTSTR*)sString, ACL_APP_LIST_COUNT, bIsSelect, bIsEdit, iIndex, iIcon); }
BOOL TShareDlg::EvCreate(LPARAM lParam) { shareListView.AttachWnd(GetDlgItem(FILE_LIST)); char *title[] = { GetLoadStrU8(IDS_FILENAME), GetLoadStrU8(IDS_SIZE), GetLoadStrU8(IDS_LOCATION), NULL }; int size[] = { 120, 70, 180 }; int fmt[] = { LVCFMT_LEFT, LVCFMT_RIGHT, LVCFMT_LEFT, LVCFMT_LEFT }; int i; for (i=0; title[i]; i++) { shareListView.InsertColumn(i, title[i], size[i], fmt[i]); } for (i=0; i < shareInfo->fileCnt; i++) { AddList(i); } if (rect.left == CW_USEDEFAULT) { GetWindowRect(&rect); int xsize = rect.right - rect.left, ysize = rect.bottom - rect.top; int cx = ::GetSystemMetrics(SM_CXFULLSCREEN), cy = ::GetSystemMetrics(SM_CYFULLSCREEN); int x = (cx - xsize)/2; int y = (cy - ysize)/2; MoveWindow((x < 0) ? 0 : x % (cx - xsize), (y < 0) ? 0 : y % (cy - ysize), xsize, ysize, FALSE); } else MoveWindow(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, FALSE); Show(); ::SetFocus(shareListView.hWnd); return TRUE; }
int main (int argc, char **argv) { GenList A, a, b; int p; Initialize (&A); Initialize (&a); Initialize (&b); AddAtom (2, 0, &a); AddAtom (3, 1, &a); AddAtom (5, 2, &a); AddAtom (4, 0, &b); AddAtom (6, 1, &b); AddAtom (7, 2, &b); AddAtom (8, 3, &b); //Append (&a, &b); AddList (&b, 0, &A); AddAtom (4, 0, &A); AddAtom (6, 1, &A); //AddList (&b, 1, &A); //AddAtom (10, 2, &A); Traverse(&A, print, PrintLength); }
coupled_item_list_t circuit_t::GetParallelLists () { coupled_item_list_t result; item_list_t current_list; for (list<element_t*>::iterator p = elements.begin(); p != elements.end(); p++) { current_list.clear(); if ((*p)->type == E_RESISTOR || (*p)->type == E_INDUCTOR || (*p)->type == E_CAPACITOR || (*p)->type == E_IMPEDANCE || (*p)->type == E_CSRC) { item_t t_item (*p, false); current_list.push_back (t_item); for (list<element_t*>::iterator z = elements.begin(); z != elements.end(); z++) { if (*z != *p && (*z)->type == (*p)->type && SharedNodes (*p, *z) == 2) { item_t t_item (*z, false); current_list.push_back (t_item); } /* if */ } /* for */ } /* if */ } /* for */ // add all couples to main list, callee takes care of duplicates AddList (current_list, result); } /* circuit_t::get_parallel_lists */
void Node::AddList(std::string name, std::vector<int> attribute_list) { std::vector<std::string> attribute_list_strings; for(auto item : attribute_list) { attribute_list_strings.push_back(std::to_string(item)); } AddList(name, attribute_list_strings); }
void IndexGenerator::AddPrim(int prim, int vertexCount) { switch (prim) { case GE_PRIM_POINTS: AddPoints(vertexCount); break; case GE_PRIM_LINES: AddLineList(vertexCount); break; case GE_PRIM_LINE_STRIP: AddLineStrip(vertexCount); break; case GE_PRIM_TRIANGLES: AddList(vertexCount); break; case GE_PRIM_TRIANGLE_STRIP: AddStrip(vertexCount); break; case GE_PRIM_TRIANGLE_FAN: AddFan(vertexCount); break; case GE_PRIM_RECTANGLES: AddRectangles(vertexCount); break; // Same } }
iwMusicPlayer::iwMusicPlayer() : IngameWindow(CGI_MUSICPLAYER, (unsigned short) - 1, (unsigned short) - 1, 430, 330, _("Music player"), LOADER.GetImageN("resource", 41)), changed(false) { AddList(0, 20, 30, 330, 200, TC_GREEN1, NormalFont); AddText(1, 20, 240, _("Playlist:"), COLOR_YELLOW, 0, NormalFont); AddComboBox(2, 20, 260, 330, 22, TC_GREEN1, NormalFont, 200); // Playlistbuttons const unsigned short button_distance = 10; const unsigned short button_width = (330 - button_distance) / 2; ctrlButton* b1 = AddTextButton(3, 20, 290, button_width, 22, TC_GREEN2, _("Add"), NormalFont); AddTextButton(4, b1->GetX(false) + button_width + button_distance, 290, button_width, 22, TC_GREEN2, _("Remove"), NormalFont); //AddTextButton(5,b1->GetX(false),320,button_width,22,TC_GREEN2,_("Save"),NormalFont); //AddTextButton(6,b2->GetX(false),320,button_width,22,TC_GREEN2,_("Load"),NormalFont); // Buttons für die Musikstücke AddImageButton(7, 370, 30, 40, 40, TC_GREY, LOADER.GetImageN("io", 138), _("Add track")); AddImageButton(8, 370, 80, 40, 40, TC_GREY, LOADER.GetImageN("io_new", 2), _("Add directory of tracks")); AddImageButton(9, 370, 130, 40, 40, TC_RED1, LOADER.GetImageN("io", 220), _("Remove track")); AddImageButton(10, 370, 180, 40, 15, TC_GREY, LOADER.GetImageN("io", 33), _("Upwards")); AddImageButton(11, 370, 195, 40, 15, TC_GREY, LOADER.GetImageN("io", 34), _("Downwards")); AddDeepening(12, 370, 220, 40, 20, TC_GREY, "1", NormalFont, COLOR_YELLOW); AddImageButton(13, 370, 240, 20, 20, TC_RED1, LOADER.GetImageN("io", 139), _("Less repeats")); AddImageButton(14, 390, 240, 20, 20, TC_GREY, LOADER.GetImageN("io", 138), _("More repeats")); AddImageButton(15, 370, 270, 40, 40, TC_GREY, LOADER.GetImageN("io", 107), _("Playback in this order")); //225 // Mit Werten füllen MUSICPLAYER.GetPlaylist().FillMusicPlayer(this); UpdatePlaylistCombo(SETTINGS.sound.playlist); }
void RouteDetectSrc(unsigned short src){ int i; unsigned short curr,cursor_ID; fwdneigh * queue=NULL; for(i=0;i<network[src].n_customers;i++){ curr=network[src].customers[i]; network[src].FIB[curr]=1; queue=AddList(curr,queue); } while(queue!=NULL){ curr=queue->ID; queue=RemoveFirst(queue); for(i=0;i<network[curr].n_customers;i++){ cursor_ID = network[curr].customers[i]; if( network[src].FIB[cursor_ID] > 1 ){ network[src].FIB[cursor_ID]=1; queue=AddList(cursor_ID,queue); } } } for(i=0;i<network[src].n_peers;i++){ curr=network[src].peers[i]; if( network[src].FIB[curr] > 2 ){ network[src].FIB[curr]=2; queue=AddList(curr,queue); } } while(queue!=NULL){ curr=queue->ID; queue=RemoveFirst(queue); for(i=0;i<network[curr].n_customers;i++){ cursor_ID = network[curr].customers[i]; if( network[src].FIB[cursor_ID] > 2 ){ network[src].FIB[cursor_ID]=2; queue=AddList(cursor_ID,queue); } } } }
BOOL TShareDlg::EvDropFiles(HDROP hDrop) { int lastFileCnt = shareInfo->fileCnt; parent->EvDropFiles(hDrop); while (lastFileCnt < shareInfo->fileCnt) AddList(lastFileCnt++); return TRUE; }
j_void_t *CXMemPool::Alloc(j_uint32_t nSize) { TLock(m_locker); J_MEM_NODE *pNode = FindFreeNode(nSize); void *pRetVal = NULL; if (pNode != NULL) { J_MEM_NODE *pFreeNode = SplitMem(&pNode, nSize); DeleteList(&m_pFreeList, pNode); AddList(&m_pFreeList, pFreeNode); AddList(&m_pBusyList, pNode); pRetVal = pNode->p; } TUnlock(m_locker); return pRetVal; }
void CWipeFree::OnSelchangeWipeDiskCombo() { int nSel; nSel = m_WipeDiskList.GetCurSel (); nSel = m_WipeDiskList.GetItemData (nSel); m_WipeParList.DeleteAllItems(); AddList(&m_WipeParList, nSel+DISK_BASE); }
void CAclWeb::AddAcl(PXACL_WEB pAcl, BOOL bIsSelect, BOOL bIsEdit, int iIndex) { CString sString[ACL_WEB_LIST_COUNT]; sString[0].Format("%u", pAcl->dwId); sString[1] = pAcl->sWeb; sString[2] = GUI_ACTION[pAcl->bAction]; sString[3] = pAcl->sMemo[0] == 0 ? MEMO_CONST : pAcl->sMemo; AddList(&m_List, (LPCTSTR*)sString, ACL_WEB_LIST_COUNT, bIsSelect, bIsEdit, iIndex); }
void main() { LIST *Cur,*First=new LIST; First->next=NULL; srand(time(NULL)); for(int i=0;i<10;++i) { if(!First->next) { Cur=new LIST; First->next=Cur; } else { Cur->next=new LIST; Cur=Cur->next; } CreateList(Cur); } Cur=First; PrintList(Cur); int b; int n; while(1) { printf("\n\n1-add\n2-delete\n3-count\n"); scanf("%d",&b); switch(b) { case 1: printf("\nNumber of elem\n"); scanf("%d",&n); Cur=First; AddList(Cur,n); Cur=First; PrintList(Cur); break; case 2: printf("\nNumber of elem\n"); scanf("%d",&n); Cur=First; DeleteList(Cur,n); Cur=First; PrintList(Cur); break; case 3: printf("\nNumber of elem\n"); scanf("%d",&n); Cur=First; GetCount(Cur,n); break; } } }
BOOL TShareDlg::EvCommand(WORD wNotifyCode, WORD wID, LPARAM hWndCtl) { switch (wID) { case IDOK: EndDialog(TRUE); break; case IDCANCEL: EndDialog(FALSE); break; case FILE_BUTTON: { int i = shareInfo->fileCnt; if (FileAddDlg(this, shareMng, shareInfo, cfg)) for (i; i < shareInfo->fileCnt; i++) AddList(i); } break; case FOLDER_BUTTON: if (BrowseDirDlg(this, GetLoadStrU8(IDS_FOLDERATTACH), cfg->lastOpenDir, cfg->lastOpenDir)) { if (shareMng->AddFileShare(shareInfo, cfg->lastOpenDir)) { AddList(shareInfo->fileCnt -1); cfg->WriteRegistry(CFG_GENERAL); } } break; case DEL_BUTTON: { for (int i=shareInfo->fileCnt-1; i >= 0; i--) { if (!shareListView.IsSelected(i)) continue; DelList(i); } } break; default: break; } return TRUE; }
char* MakeEnableInsertPosPaperSource(cngplpData *data, int is_tabpaper) { PPDOptions *ppd_opt = data->ppd_opt; UIItemsList *item = NULL; char *ret_list = NULL; char *conf_options = NULL; char *tok = NULL; char *tmp = NULL; char *list = NULL; char *def = NULL; item = FindItemsList(ppd_opt->items_list, kPPD_Items_CNInsertInputSlot); if(item != NULL){ conf_options = GetPPDDevOptionConflict(data, ID_CNINSERTINPUTSLOT); if(conf_options) { for(tok = strtok_r(conf_options, ",", &tmp); tok != NULL; tok = strtok_r(NULL, ",", &tmp)) { char *opt = strchr(tok, '<'); if(opt){ *opt = '\0'; if(atoi(opt+1) == 0){ if( (is_tabpaper == 0) || !IsConflictBetweenFunctions(data, kPPD_Items_CNSheetForInsertion, "TAB1", kPPD_Items_CNInsertInputSlot, tok)){ list = AddList(list, tok); if(def == NULL){ def = tok; } else if(strcmp(item->default_option, tok) == 0){ def = tok; } } } } } if(def && list){ size_t mem_size = strlen(def) + strlen(list) + 2; ret_list = calloc(1, mem_size); if(ret_list){ snprintf(ret_list, mem_size, "%s:%s", def, list); } } free(conf_options); conf_options = NULL; } } if(list){ free(list); list = NULL; } return ret_list; }
void NotifyList::UpdateList(BObjectList<NotifyListItem> *newList) { while (CountItems() > 0) delete RemoveItem ((int32)0); BList updateList; // make private copy of list items otherwise things go bad for (int32 i = 0; i < newList->CountItems(); i++) updateList.AddItem (new NotifyListItem (*newList->ItemAt(i))); AddList(&updateList); }
//1. 解析配置文件函数 bool SConfig::ParseConfigFile(const char *path) { log.Log("SConfig::ParseConfigFile",COMMON,"开始解析配置文件"); int fd = open(path,O_RDONLY); if(fd == -1) { log.Log("SConfig::ParseConfigFile",ERROR,"open error"); return false; } char buf[32]={0}; char key[32]={0}; char value[32]={0}; int len; int flag = 0; int i = 0; while(1) { flag = 0; len = read(fd,&buf[i],1); if(len <= 0) { break; } if(buf[i] == '=') { strcpy(key,buf); key[i] = '\0'; memset(buf,0,sizeof(buf)); i = 0; flag = 1; } else if(buf[i] == '\n') { strcpy(value,buf); value[i] = '\0'; memset(buf,0,sizeof(buf)); i = 0; flag = 1; } if(key[0] != '\0' && value[0] != '\0') { AddList(key,value); memset(key,0,sizeof(key)); memset(value,0,sizeof(value)); } if(flag == 0) { i++; } } close(fd); log.Log("SConfig::ParseConfigFile",COMMON,"完成配置文件解析"); return true; }
void CGUIDialogVideoSettings::AddVideoStreams(std::shared_ptr<CSettingGroup> group, const std::string &settingId) { if (group == NULL || settingId.empty()) return; m_videoStream = g_application.GetAppPlayer().GetVideoStream(); if (m_videoStream < 0) m_videoStream = 0; AddList(group, settingId, 38031, SettingLevel::Basic, m_videoStream, VideoStreamsOptionFiller, 38031); }
void GOSoundScheduler::Add(GOSoundWorkItem* item) { if (!item) return; item->Clear(); GOMutexLocker lock(m_Mutex); Lock(); AddList(item, m_Work); Update(); Unlock(); }
void DomSerializer::ListValue(const char* key, std::list<ObjectRef>& value, Object& model, bool required) { if (m_deSerialize == true) { GetList(key, value, model, required); } else { AddList(key, value); } }
void vehicle::ChangeLane(int newLane) { RemList(); changingLaneFrom = lNr; changingLaneProgr = 0; lNr = newLane; AddList(); //UpdatePosition(); }
void CGUIDialogAudioSubtitleSettings::AddSubtitleStreams(CSettingGroup *group, const std::string &settingId) { if (group == NULL || settingId.empty()) return; m_subtitleStream = g_application.m_pPlayer->GetSubtitle(); if (m_subtitleStream < 0) m_subtitleStream = 0; AddList(group, settingId, 462, 0, m_subtitleStream, SubtitleStreamsOptionFiller, 462); }
void CGUIDialogSubtitleSettings::AddSubtitleStreams(std::shared_ptr<CSettingGroup> group, const std::string &settingId) { if (group == NULL || settingId.empty()) return; m_subtitleStream = g_application.GetAppPlayer().GetSubtitle(); if (m_subtitleStream < 0) m_subtitleStream = 0; m_subtitleStreamSetting = AddList(group, settingId, 462, SettingLevel::Basic, m_subtitleStream, SubtitleStreamsOptionFiller, 462); }
void CGUIDialogVideoSettings::AddVideoStreams(CSettingGroup *group, const std::string &settingId) { if (group == NULL || settingId.empty()) return; m_videoStream = g_application.m_pPlayer->GetVideoStream(); if (m_videoStream < 0) m_videoStream = 0; AddList(group, settingId, 38031, 0, m_videoStream, VideoStreamsOptionFiller, 38031); }
void CAclNnb::AddAcl(PXACL_NNB pAcl, BOOL bIsSelect, BOOL bIsEdit, int iIndex) { CString sString[ACL_NNB_LIST_COUNT]; sString[0].Format("%u", pAcl->dwId); sString[1] = pAcl->sNnb; sString[2] = GUI_DIRECTION[pAcl->bDirection]; sString[3] = ACL_TIME_TYPE[pAcl->bTimeType]; sString[4] = GUI_ACTION[pAcl->bAction]; sString[5] = pAcl->sMemo[0] == 0 ? MEMO_CONST : pAcl->sMemo; AddList(&m_List, (LPCTSTR*)sString, ACL_NNB_LIST_COUNT, bIsSelect, bIsEdit, iIndex); }
void InGameState::AddSave(int i, int j) { leave = true; for(positionIterator index = position.begin(); index != position.end(); index++) { if ((*index)->i == i && (*index)->j == j) { return; } } Position2D* position = new Position2D; position->i = i; position->j = j; AddList(position); }
j_void_t CXMemPool::Free(j_void_t *p) { if (p == NULL) return; TLock(m_locker); J_MEM_NODE *pNode = FindBusyNode(p); if (pNode != NULL) { DeleteList(&m_pBusyList, pNode); AddList(&m_pFreeList, pNode); MergerMem(); } TUnlock(m_locker); }
int CAclNet::ListAddOne(XACL_IP* pAclIp, BOOL bIsSelect, BOOL bIsEdit, int iIndex) { CString sId; sId.Format("%u", pAclIp->dwId); CString sStartIp =DIPToSIP(&pAclIp->ulStartIP); CString sEndIp =DIPToSIP(&pAclIp->ulEndIP); const TCHAR *pString[] = { sId, sStartIp, sEndIp }; AddList(&m_List, pString, sizeof(pString)/sizeof(TCHAR*), bIsSelect, bIsEdit, iIndex); return 0; }