From: hackbard Date: Tue, 2 Nov 2004 18:30:24 +0000 (+0000) Subject: added list_del_current and network_receive_chan function X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d7ea5e1dbee48000fdeac0bbc8bd11d6edb733b;p=my-code%2Fapi.git added list_del_current and network_receive_chan function --- diff --git a/list/list.c b/list/list.c index 895cf26..664dd00 100644 --- a/list/list.c +++ b/list/list.c @@ -58,6 +58,11 @@ int list_del_element(t_list *list,t_list_element *element) { return L_SUCCESS; } +int list_del_current(t_list *list) { + + return(list_del_element(list,list->current)); +} + int list_destroy(t_list *list) { if(list->start==NULL) { diff --git a/list/list.h b/list/list.h index 5355a16..5d63af9 100644 --- a/list/list.h +++ b/list/list.h @@ -33,6 +33,7 @@ int list_shutdown(t_list *list); int list_reset(t_list *list); int list_next(t_list *list); int list_del_element(t_list *list,t_list_element *element); +int list_del_current(t_list *list); int list_destroy(t_list *list); int list_search_data(t_list *list,void *data,int first_bytes); int list_add_element(t_list *list,void *data,int data_len); diff --git a/network/network.c b/network/network.c index 7df2597..ebdbc83 100644 --- a/network/network.c +++ b/network/network.c @@ -283,6 +283,11 @@ int network_receive(int fd,unsigned char *data,int datasize) { return datasize; } +int network_receive_chan(t_net *net,int chan,unsigned char *data,int datasize) { + + return(network_receive(net->connection[chan].fd,data,datasize)); +} + int network_udp_listen_init(t_net *net) { struct sockaddr_in addr; diff --git a/network/network.h b/network/network.h index bfb4ab4..a52d498 100644 --- a/network/network.h +++ b/network/network.h @@ -82,6 +82,7 @@ int network_deselect(t_net *net,int channel); int network_manage_incoming(t_net *net); int network_send(int fd,unsigned char *data,int datasize); int network_receive(int fd,unsigned char *data,int datasize); +int network_receive_chan(t_net *net,int chan,unsigned char *data,int datasize); int network_udp_listen_init(t_net *net); int network_udp_receive(t_net *net,int channel, unsigned char *data,int count); int network_udp_send(t_net *net,int channel, unsigned char *data,int size);