group some functions under the same ifdef/endif

This commit is contained in:
jani 2003-11-05 09:07:46 +00:00
parent 1d61ebaa36
commit 4c4fd7e408

View File

@ -985,6 +985,7 @@ tcp_arg(struct tcp_pcb *pcb, void *arg)
{ {
pcb->callback_arg = arg; pcb->callback_arg = arg;
} }
#if LWIP_CALLBACK_API
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
/* /*
* tcp_recv(): * tcp_recv():
@ -994,14 +995,12 @@ tcp_arg(struct tcp_pcb *pcb, void *arg)
* *
*/ */
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
#if LWIP_CALLBACK_API
void void
tcp_recv(struct tcp_pcb *pcb, tcp_recv(struct tcp_pcb *pcb,
err_t (* recv)(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err)) err_t (* recv)(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err))
{ {
pcb->recv = recv; pcb->recv = recv;
} }
#endif /* LWIP_CALLBACK_API */
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
/* /*
* tcp_sent(): * tcp_sent():
@ -1011,14 +1010,12 @@ tcp_recv(struct tcp_pcb *pcb,
* *
*/ */
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
#if LWIP_CALLBACK_API
void void
tcp_sent(struct tcp_pcb *pcb, tcp_sent(struct tcp_pcb *pcb,
err_t (* sent)(void *arg, struct tcp_pcb *tpcb, u16_t len)) err_t (* sent)(void *arg, struct tcp_pcb *tpcb, u16_t len))
{ {
pcb->sent = sent; pcb->sent = sent;
} }
#endif /* LWIP_CALLBACK_API */
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
/* /*
* tcp_err(): * tcp_err():
@ -1028,14 +1025,29 @@ tcp_sent(struct tcp_pcb *pcb,
* *
*/ */
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
#if LWIP_CALLBACK_API
void void
tcp_err(struct tcp_pcb *pcb, tcp_err(struct tcp_pcb *pcb,
void (* errf)(void *arg, err_t err)) void (* errf)(void *arg, err_t err))
{ {
pcb->errf = errf; pcb->errf = errf;
} }
/*-----------------------------------------------------------------------------------*/
/*
* tcp_accept():
*
* Used for specifying the function that should be called when a
* LISTENing connection has been connected to another host.
*
*/
/*-----------------------------------------------------------------------------------*/
void
tcp_accept(struct tcp_pcb *pcb,
err_t (* accept)(void *arg, struct tcp_pcb *newpcb, err_t err))
{
((struct tcp_pcb_listen *)pcb)->accept = accept;
}
#endif /* LWIP_CALLBACK_API */ #endif /* LWIP_CALLBACK_API */
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
/* /*
* tcp_poll(): * tcp_poll():
@ -1056,23 +1068,6 @@ tcp_poll(struct tcp_pcb *pcb,
pcb->pollinterval = interval; pcb->pollinterval = interval;
} }
/*-----------------------------------------------------------------------------------*/ /*-----------------------------------------------------------------------------------*/
/*
* tcp_accept():
*
* Used for specifying the function that should be called when a
* LISTENing connection has been connected to another host.
*
*/
/*-----------------------------------------------------------------------------------*/
#if LWIP_CALLBACK_API
void
tcp_accept(struct tcp_pcb *pcb,
err_t (* accept)(void *arg, struct tcp_pcb *newpcb, err_t err))
{
((struct tcp_pcb_listen *)pcb)->accept = accept;
}
#endif /* LWIP_CALLBACK_API */
/*-----------------------------------------------------------------------------------*/
/* /*
* tcp_pcb_purge(): * tcp_pcb_purge():
* *