[dhcp-agent-commits] dhcp-agent dhcp-agent.h,1.72,1.73 dhcp-list.c,1.5,1.6
Status: Alpha
Brought to you by:
actmodern
From: <act...@us...> - 2002-10-25 17:23:41
|
Update of /cvsroot/dhcp-agent/dhcp-agent In directory usw-pr-cvs1:/tmp/cvs-serv8932 Modified Files: dhcp-agent.h dhcp-list.c Log Message: added list sifting routine Index: dhcp-agent.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-agent.h,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** dhcp-agent.h 23 Oct 2002 23:43:34 -0000 1.72 --- dhcp-agent.h 25 Oct 2002 12:52:19 -0000 1.73 *************** *** 788,791 **** --- 788,792 ---- extern void purge_list_internal(void *head); extern list_t *join_lists(list_t *first_list, list_t *second_list); + extern list_t *find_datum_by(list_t *first, int (*find_func(void *)), void *arg); /* Logging functions. */ Index: dhcp-list.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-list.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dhcp-list.c 12 Oct 2002 22:54:50 -0000 1.5 --- dhcp-list.c 25 Oct 2002 12:52:19 -0000 1.6 *************** *** 126,127 **** --- 126,141 ---- return first_list; } + + list_t *find_datum_by(list_t *first, int (*find_func(void *)), void *arg) + { + list_t *ptr; + + for(ptr = list; ptr; ptr = ptr->next) { + if(find_func(ptr, arg)) + return ptr; + } + + return NULL; + } + + |