symlist.c

changeset 62
aae5facf9fc5
parent 60
a4033700e35c
child 88
308dfa54da3e
--- a/symlist.c	Mon Feb 16 18:09:03 2004 +0100
+++ b/symlist.c	Mon Feb 16 18:50:28 2004 +0100
@@ -16,49 +16,49 @@
 
 static void free_node(Symlist **symlist, Symlist *node)
 {
-	UNLINK_ITEM(*symlist, node, next, prev);
-	free(node);
+    UNLINK_ITEM(*symlist, node, next, prev);
+    free(node);
 }
 
 
 bool symlist_insert(Symlist **symlist, void *symbol)
 {
-	Symlist *node;
-	
-	if(symbol==NULL)
-		return FALSE;
-	
-	node=ALLOC(Symlist);
-	
-	if(node==NULL)
-		return FALSE;
-		
-	node->symbol=symbol;
-	
-	LINK_ITEM_FIRST(*symlist, node, next, prev);
-	
-	return TRUE;
+    Symlist *node;
+    
+    if(symbol==NULL)
+        return FALSE;
+    
+    node=ALLOC(Symlist);
+    
+    if(node==NULL)
+        return FALSE;
+        
+    node->symbol=symbol;
+    
+    LINK_ITEM_FIRST(*symlist, node, next, prev);
+    
+    return TRUE;
 }
 
 
 void symlist_remove(Symlist **symlist, void *symbol)
 {
-	Symlist *node=*symlist;
-	
-	while(node!=NULL){
-		if(node->symbol==symbol){
-			free_node(symlist, node);
-			return;
-		}
-		node=node->next;
-	}
+    Symlist *node=*symlist;
+    
+    while(node!=NULL){
+        if(node->symbol==symbol){
+            free_node(symlist, node);
+            return;
+        }
+        node=node->next;
+    }
 }
 
 
 void symlist_clear(Symlist **symlist)
 {
-	while(*symlist!=NULL)
-		free_node(symlist, *symlist);
+    while(*symlist!=NULL)
+        free_node(symlist, *symlist);
 }
 
 
@@ -70,26 +70,26 @@
 
 void *symlist_init_iter(Symlist *symlist)
 {
-	if(symlist==NULL){
-		iter_next=NULL;
-		return NULL;
-	}
-	
-	iter_next=symlist->next;
-	return symlist->symbol;
+    if(symlist==NULL){
+        iter_next=NULL;
+        return NULL;
+    }
+    
+    iter_next=symlist->next;
+    return symlist->symbol;
 }
 
 
 void *symlist_iter()
 {
-	Symlist *ret;
-	
-	if(iter_next==NULL)
-		return NULL;
-	
-	ret=iter_next;
-	iter_next=iter_next->next;
-	
-	return ret->symbol;
+    Symlist *ret;
+    
+    if(iter_next==NULL)
+        return NULL;
+    
+    ret=iter_next;
+    iter_next=iter_next->next;
+    
+    return ret->symbol;
 }
 

mercurial