ZE-Standard-Libraries/list/list.c

34 lines
850 B
C
Raw Normal View History

2018-02-07 12:09:44 +00:00
/* ********************************************************
* 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.
* *******************************************************/
2018-02-07 12:09:44 +00:00
#include "list.h"
int main(int argc, char **argv){
rand_init();
2018-02-11 01:20:19 +00:00
safeMode(1);
List *t_list = init_list();
2018-02-07 12:09:44 +00:00
for(int i = 0; i < 9; i++){
Node *t_node = init_node();
int *t_i = (int *)malloc(sizeof(int));
*t_i = i;
2018-02-11 01:20:19 +00:00
init_value(t_node,"int",(void *)t_i);
insertInTail(t_list,t_node);
}
2018-02-11 01:20:19 +00:00
/*Node *t_node = init_node();
insertInTail(t_list,t_node);
init_value(t_node,(void *)"there");*/
int *f_i = (int *)malloc(sizeof(int));
*f_i = 3;
2018-02-11 01:20:19 +00:00
char *f_s = "there";
Node *f_node = findByValue(t_list,"int",(void *)f_i);
2018-02-11 01:20:19 +00:00
releaseAll();
2018-02-07 12:09:44 +00:00
return 0;
}