Fix some faults.
This commit is contained in:
parent
23db1b897c
commit
656658a0ef
12
list/list.h
12
list/list.h
@ -1,15 +1,15 @@
|
||||
typedef struct Node{
|
||||
unsigned long int id;//what's this?
|
||||
unsigned long int id;
|
||||
void *value;
|
||||
Node *next;
|
||||
Node *last;
|
||||
};
|
||||
struct Node *next;
|
||||
struct Node *last;
|
||||
}Node;
|
||||
|
||||
typedef struct List{
|
||||
Node *head;
|
||||
Node *tail;
|
||||
unsigned long int length;
|
||||
};
|
||||
}List;
|
||||
|
||||
List *init_list();
|
||||
Node *init_node();
|
||||
@ -29,6 +29,7 @@ int insertInHead(List *p_list, Node *p_node){
|
||||
//p_node->last = NULL;
|
||||
p_node->next = p_list->head;
|
||||
p_list->head = p_node;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int insertInTail(List *p_list, Node *p_node){
|
||||
@ -36,4 +37,5 @@ int insertInTail(List *p_list, Node *p_node){
|
||||
//p_node->next = NULL;
|
||||
p_node->last = p_list->tail;
|
||||
p_list->tail = p_node;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user