本文整理匯總了C++中DeleteList函數的典型用法代碼示例。如果您正苦於以下問題:C++ DeleteList函數的具體用法?C++ DeleteList怎麽用?C++ DeleteList使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了DeleteList函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: DeletePermanent
void DeletePermanent(Permanent* permanent) {
if (permanent->equipment)
DeleteList(permanent->equipment);
if (permanent->abilities)
DeleteList(permanent->abilities);
free(permanent);
}
示例2: MTGPlayer_tap
bool MTGPlayer_tap(MTGPlayer* player,Permanent* permanent) {
List* options = InitList();
char buffer[256];
char* c = buffer;
for (unsigned int i=0;i<permanent->abilities->size;i++) {
char* s = c;
Ability* a = permanent->abilities->entries[i];
for (unsigned int j=0;j<a->manaCost->size;j++) {
Manacost* m = a->manaCost->entries[j];
char color;
switch (m->color1) {
case WHITE:
color = 'W';
break;
case BLUE:
color = 'U';
break;
case BLACK:
color = 'B';
break;
case RED:
color = 'R';
break;
case GREEN:
color = 'G';
break;
case COLORLESS:
color = ' ';
break;
}
c += sprintf(c,"{%d%c}",m->num,color);
}
c += sprintf(c,"%s",a->needs_tap?"{T}":"") + 1;
AppendToList(options, s);
}
if (permanent->subtypes.is_land) {
if (permanent->subtypes.is_plains) AppendToList(options, "W");
if (permanent->subtypes.is_island) AppendToList(options, "U");
if (permanent->subtypes.is_swamp) AppendToList(options, "B");
if (permanent->subtypes.is_mountain) AppendToList(options, "R");
if (permanent->subtypes.is_forest) AppendToList(options, "G");
if (permanent->source == cd.DarksteelCitadel) AppendToList(options, "C");
permanent->is_tapped = true;
}
if (options->size > 1) {
if (player == player1)
selectAbility(permanent,options);
else
AI_selectAbility(permanent,options);
DeleteList(options);
return false;
} else {
permanent->selectedAbility = 1;
DeleteList(options);
return true;
}
}
示例3: main
void main()
{
struct node* a = PushAtHead(10);
PrintList(a);
struct node* b = PushAtHead(5);
PrintList(b);
Append(&a, &b);
PrintList(a);
PrintList(b);
DeleteList(&a);
DeleteList(&b);
}
示例4: while
bool OperCFThread::DeleteDir( FS* fs, FSPath& path )
{
if ( Info()->Stopped() ) { return false; }
FSList list;
while ( true )
{
int ret_err;
int ret = fs->ReadDir( &list, path, &ret_err, Info() );
if ( ret == -2 ) { return false; }
if ( !ret ) { break; }
switch ( RedMessage( _LT( "Can`t open directory:\n" ), fs->Uri( path ).GetUtf8(), bRetrySkipCancel, fs->StrError( ret_err ).GetUtf8() ) )
{
case CMD_SKIP:
return true;
case CMD_RETRY:
continue;
default:
return false;
}
}
return DeleteList( fs, path, list );
}
示例5: InsertNthTest
// 5 — InsertNth()
void InsertNthTest() {
struct node* head = NULL; // start with the empty list
InsertNth(&head, 0, 13); // build {13)
InsertNth(&head, 1, 42); // build {13, 42}
InsertNth(&head, 1, 5); // build {13, 5, 42}
DeleteList(&head); // clean up after ourselves
}
示例6: main
main()
{
struct node *head = malloc(sizeof(struct node));
head = Build(); // {1,2,3}
len(head);
DeleteList(&head);
}
示例7: ReverseTest
// 17 — Reverse()
void ReverseTest() {
struct node* head;
head = BuildOneTwoThree();
Reverse(&head);
// head now points to the list {3, 2, 1}
DeleteList(&head); // clean up after ourselves
}
示例8: cancelDownloadCallback
static void cancelDownloadCallback(GtkWidget *button, BrowserDownloadDialog *dialog)
{
GtkTreeModel * model;
GtkTreeIter iter;
WebKitDownload *wkDownload;
if (gtk_tree_selection_get_selected(GTK_TREE_SELECTION(dialog->select), &model, &iter))
{
gtk_tree_model_get (GTK_TREE_MODEL(dialog->model), &iter, 7, &wkDownload, -1);
if(wkDownload)
{
webkit_download_cancel(WEBKIT_DOWNLOAD(wkDownload));
gtk_list_store_remove(dialog->model, &iter);
return;
}
char *treeviewIndex = g_strdup_printf("%s", gtk_tree_model_get_string_from_iter(GTK_TREE_MODEL(dialog->model), &iter));
if(treeviewIndex)
{
size_t listIndex = atoi(treeviewIndex);
DeleteList(dialog->download,listIndex);
}
g_printerr("store_remove\n");
gtk_list_store_remove(dialog->model, &iter);
}
}
示例9: DeleteList
CDialogList::~CDialogList()
{
DeleteList();
if(m_pMalloc)
m_pMalloc->Release();
}
示例10: DeleteList
// CreateList assumes the pointer is at the head of the list.
// Only pass m_head through here!!!
void EndpointAddrlist::CreateList( struct addrinfo* list )
{
int count = 1;
DeleteList();
// curList_addr = current node in 'list'
// EndpointAddress *curList_addr = (EndpointAddress*) list;
addrinfo *curList_addr = list;
// curM_addr = current node in our class' vector
EndpointAddress curM_addr;
if( !list ) {
return;
}
while( curList_addr != NULL ) {
count++;
curM_addr = *curList_addr;
// explicitly set ai_next = 0 since the vector iterators are used instead.
curM_addr.ai_next = 0;
//finalize
m_addrlist.push_back(curM_addr);
curList_addr = (EndpointAddress*) curList_addr->ai_next;
}
m_addrs = m_addrlist.begin();
return;
}
示例11: main
int main()
{
List L;
Position P;
int X;
L = (Position) malloc(sizeof(struct Node));
L->Next = NULL;
L->Element = -1;
initList(L);
printf("print list:\n");
PrintList(L);
return 0;
printf("input a num:");
scanf("%d", &X);
P = FindPrevious(X, L);
if(P == NULL)
printf("can't find the num:%d previous num\n", X);
else
printf("Previous num is:%d, address is :0x%p\n", P->Element, P->Next);
DeleteList(L);
return 0;
}
示例12: CheckAce
void CheckAce(char *type, char *name, Bool verbose)
{
char *args[2], buf[BUFSIZ];
int status;
if (strcmp(type, "LIST"))
return; /* If the ace is not a list the ignore it. */
args[0] = type;
args[1] = name;
status = do_mr_query("get_ace_use", 2, args, NULL, NULL);
if (status != MR_NO_MATCH)
return; /* If this query fails the ace will
not be deleted even if it is empty. */
if (verbose)
{
sprintf(buf, "Delete the unused Access Control Entity (ACE) %s? ", name);
if (YesNoQuestion(buf, FALSE) != TRUE)
{
Put_message("Aborting Deletion!");
return;
}
}
/*
* Delete the ACE.
*
* NOTE: Delete list expects only the name of the list to delete in argv[1].
* since, 'args' already satisfies this, there is no need to create
* a special argument list.
*/
DeleteList(2, args);
}
示例13: DeleteUserGroup
int DeleteUserGroup(char *name, Bool verbose)
{
int status, ans;
char buf[BUFSIZ], *args[10];
status = do_mr_query("get_list_info", 1, &name, NULL, NULL);
if (!status)
{
if (verbose)
{
sprintf(buf, "There is also a list named %s, delete it?", name);
ans = YesNoQuestion(buf, FALSE);
if (ans == FALSE)
{
Put_message("Leaving group alone.");
return SUB_NORMAL;
}
if (ans < 0)
{
Put_message("Aborting...");
return SUB_ERROR;
}
}
/* ans == TRUE || ~verbose */
args[0] = "foo"; /* not used. */
args[1] = name;
DeleteList(2, args);
}
else if (status != MR_NO_MATCH)
{
com_err(program_name, status, " Aborting Delete User.");
return SUB_ERROR;
}
return SUB_NORMAL;
}
示例14: main
void main()
{
struct node* head = AddAtTail();
printf("List len = %d\n", ListLen(head));
PrintList(head);
DeleteList(head);
}
示例15: main
int main()
{
char ch[10],num[5];
LinkList head;
head=CreatList();
printlist(head);
printf(" Delete node (y/n):");
scanf("%s",num);
if(strcmp(num,"y")==0||strcmp(num,"Y")==0)
{
printf("Please input Delete_data:");
scanf("%s",ch);
DeleteList(head,ch);
printlist(head);
}
printf("Add node ? (y/n): ");
scanf("%s",ch);
if(strcmp(ch,"y")==0||strcmp(ch,"Y")==0)
{
head=AddNode(head);
}
printlist(head);
system("pause");
DeleteAll(head);
}