标签:des blog io for div 2014 c on log
/*
 * =====================================================================================
 *       Filename:  singly_link.c
 *         Author:  RollStone (rs), jealdean@outlook.com
 *      Copyright:  All Rights Reserved. Copyright(c) 2007-2014 
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  09/29/2014 21:49
 *       Revision:  none
 *       Compiler:  gcc
 *   Last_Changed:  2014-10-03 18:29:35
 * =====================================================================================
 */
typedef struct node{
	struct node *next;
}node;
typedef bool (*remove_fn)(node const *v);
void remove_if(node **header,remove_fn rm)
{
	for ( node** curr=head;*curr; )
	{
		node *entry=*curr;
		if(rm(entry))
		{
			*curr=entry->next;
			free(entry);
		}
		else
		{
			curr=&entry->next;
		}
	}
}
标签:des blog io for div 2014 c on log
原文地址:http://www.cnblogs.com/jealdean/p/4005624.html