plan 9 kernel history: overview | file list | diff list

1991/0710/gnot/main.c (diff list | history)

1991/0705/sys/src/9/gnot/main.c:203,2741991/0710/sys/src/9/gnot/main.c:203,208 (short | long | prev | next)
1991/0608    
	firmware(); 
1990/03091    
} 
 
/* 
 * Insert new into list after where 
 */ 
void 
insert(List **head, List *where, List *new) 
{ 
	if(where == 0){ 
		new->next = *head; 
		*head = new; 
	}else{ 
		new->next = where->next; 
		where->next = new; 
	} 
		                 
} 
                 
/* 
 * Insert new into list at end 
 */ 
void 
append(List **head, List *new) 
{ 
	List *where; 
                 
	where = *head; 
	if(where == 0) 
		*head = new; 
	else{ 
		while(where->next) 
			where = where->next; 
		where->next = new; 
	} 
	new->next = 0; 
} 
                 
/* 
 * Delete old from list 
 */ 
void 
delete0(List **head, List *old) 
{ 
	List *l; 
                 
	l = *head; 
	if(l == old){ 
		*head = old->next; 
		return; 
	} 
	while(l->next != old) 
		l = l->next; 
	l->next = old->next; 
} 
                 
/* 
 * Delete old from list.  where->next is known to be old. 
 */ 
void 
delete(List **head, List *where, List *old) 
{ 
	if(where == 0){ 
		*head = old->next; 
		return; 
	} 
	where->next = old->next; 
} 
                 
1990/06021    
banksize(int base) 
{ 
	ulong va; 


source code copyright © 1990-2005 Lucent Technologies; see license
Plan 9 distribution
comments to russ cox (rsc@swtch.com)