ZE-Standard-Libraries/list/list.c
2018-06-12 17:03:31 +08:00

44 lines
2.1 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* ********************************************************
* This file is used to test the header file(list.h).
* When the project is finished, this file will be deleted.
* This file create by saturneric at 20:04 on Feb 7th.
* *******************************************************/
#include "./list_expand.h"
int list(void){
rand_init();
safeMode(1);
List *t_list = initList();
/*for(int i = 0; i < 9; i++){
Node *t_node = initNode();
int *t_i = (int *)malloc(sizeof(int));
*t_i = i;
initMallocValue(t_node,"int",(void *)t_i);
insertInTail(t_list,t_node);
}*/
/*Node *t_node = initNode();
insertInTail(t_list,t_node);
initMalllocValue(t_node,(void *)"there");*/
for(int i = 0; i < 12; i++){
insertInHead(t_list, nodeWithInt(i));
insertInTail(t_list, nodeWithInt(i));
}
printListInfo(t_list,0);
printList(t_list);
List *m_list;
m_list = m_findByInt(t_list, 5);
printList(m_list);
printf("\n");
releaseAll();
return 0;
}