Using typedefs for function prototypes and -pointers throughout the stack for clarity
This commit is contained in:
@@ -90,10 +90,7 @@ struct netif *netif_default;
|
||||
*/
|
||||
struct netif *
|
||||
netif_add(struct netif *netif, struct ip_addr *ipaddr, struct ip_addr *netmask,
|
||||
struct ip_addr *gw,
|
||||
void *state,
|
||||
err_t (* init)(struct netif *netif),
|
||||
err_t (* input)(struct pbuf *p, struct netif *netif))
|
||||
struct ip_addr *gw, void *state, netif_init_fn init, netif_input_fn input)
|
||||
{
|
||||
static u8_t netifnum = 0;
|
||||
|
||||
@@ -452,7 +449,7 @@ void netif_set_down(struct netif *netif)
|
||||
/**
|
||||
* Set callback to be called when interface is brought up/down
|
||||
*/
|
||||
void netif_set_status_callback(struct netif *netif, void (* status_callback)(struct netif *netif ))
|
||||
void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback)
|
||||
{
|
||||
if (netif) {
|
||||
netif->status_callback = status_callback;
|
||||
@@ -510,7 +507,7 @@ void netif_set_link_down(struct netif *netif )
|
||||
/**
|
||||
* Set callback to be called when link is brought up/down
|
||||
*/
|
||||
void netif_set_link_callback(struct netif *netif, void (* link_callback)(struct netif *netif ))
|
||||
void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback)
|
||||
{
|
||||
if (netif) {
|
||||
netif->link_callback = link_callback;
|
||||
@@ -589,7 +586,7 @@ netif_loop_output(struct netif *netif, struct pbuf *p,
|
||||
|
||||
#if LWIP_NETIF_LOOPBACK_MULTITHREADING
|
||||
/* For multithreading environment, schedule a call to netif_poll */
|
||||
tcpip_callback((void (*)(void *))(netif_poll), netif);
|
||||
tcpip_callback((tcpip_callback_fn)netif_poll, netif);
|
||||
#endif /* LWIP_NETIF_LOOPBACK_MULTITHREADING */
|
||||
|
||||
return ERR_OK;
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/stats.h"
|
||||
#include "lwip/snmp.h"
|
||||
#include "arch/perf.h"
|
||||
|
||||
#include <string.h>
|
||||
@@ -182,10 +181,7 @@ raw_connect(struct raw_pcb *pcb, struct ip_addr *ipaddr)
|
||||
* available for others.
|
||||
*/
|
||||
void
|
||||
raw_recv(struct raw_pcb *pcb,
|
||||
u8_t (* recv)(void *arg, struct raw_pcb *upcb, struct pbuf *p,
|
||||
struct ip_addr *addr),
|
||||
void *recv_arg)
|
||||
raw_recv(struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg)
|
||||
{
|
||||
/* remember recv() callback and user data */
|
||||
pcb->recv = recv;
|
||||
|
||||
@@ -218,7 +218,7 @@ tcp_abandon(struct tcp_pcb *pcb, int reset)
|
||||
u16_t remote_port, local_port;
|
||||
struct ip_addr remote_ip, local_ip;
|
||||
#if LWIP_CALLBACK_API
|
||||
void (* errf)(void *arg, err_t err);
|
||||
tcp_err_fn errf;
|
||||
#endif /* LWIP_CALLBACK_API */
|
||||
void *errf_arg;
|
||||
|
||||
@@ -516,7 +516,7 @@ tcp_new_port(void)
|
||||
*/
|
||||
err_t
|
||||
tcp_connect(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port,
|
||||
err_t (* connected)(void *arg, struct tcp_pcb *tpcb, err_t err))
|
||||
tcp_connected_fn connected)
|
||||
{
|
||||
err_t ret;
|
||||
u32_t iss;
|
||||
@@ -1118,8 +1118,7 @@ tcp_arg(struct tcp_pcb *pcb, void *arg)
|
||||
* @param recv callback function to call for this pcb when data is received
|
||||
*/
|
||||
void
|
||||
tcp_recv(struct tcp_pcb *pcb,
|
||||
err_t (* recv)(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err))
|
||||
tcp_recv(struct tcp_pcb *pcb, tcp_recv_fn recv)
|
||||
{
|
||||
pcb->recv = recv;
|
||||
}
|
||||
@@ -1132,8 +1131,7 @@ tcp_recv(struct tcp_pcb *pcb,
|
||||
* @param sent callback function to call for this pcb when data is successfully sent
|
||||
*/
|
||||
void
|
||||
tcp_sent(struct tcp_pcb *pcb,
|
||||
err_t (* sent)(void *arg, struct tcp_pcb *tpcb, u16_t len))
|
||||
tcp_sent(struct tcp_pcb *pcb, tcp_sent_fn sent)
|
||||
{
|
||||
pcb->sent = sent;
|
||||
}
|
||||
@@ -1143,14 +1141,13 @@ tcp_sent(struct tcp_pcb *pcb,
|
||||
* has occured on the connection.
|
||||
*
|
||||
* @param pcb tcp_pcb to set the err callback
|
||||
* @param errf callback function to call for this pcb when a fatal error
|
||||
* @param err callback function to call for this pcb when a fatal error
|
||||
* has occured on the connection
|
||||
*/
|
||||
void
|
||||
tcp_err(struct tcp_pcb *pcb,
|
||||
void (* errf)(void *arg, err_t err))
|
||||
tcp_err(struct tcp_pcb *pcb, tcp_err_fn err)
|
||||
{
|
||||
pcb->errf = errf;
|
||||
pcb->errf = err;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1162,8 +1159,7 @@ tcp_err(struct tcp_pcb *pcb,
|
||||
* 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))
|
||||
tcp_accept(struct tcp_pcb *pcb, tcp_accept_fn accept)
|
||||
{
|
||||
pcb->accept = accept;
|
||||
}
|
||||
@@ -1177,8 +1173,7 @@ tcp_accept(struct tcp_pcb *pcb,
|
||||
*
|
||||
*/
|
||||
void
|
||||
tcp_poll(struct tcp_pcb *pcb,
|
||||
err_t (* poll)(void *arg, struct tcp_pcb *tpcb), u8_t interval)
|
||||
tcp_poll(struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval)
|
||||
{
|
||||
#if LWIP_CALLBACK_API
|
||||
pcb->poll = poll;
|
||||
|
||||
@@ -759,10 +759,7 @@ udp_disconnect(struct udp_pcb *pcb)
|
||||
* @param recv_arg additional argument to pass to the callback function
|
||||
*/
|
||||
void
|
||||
udp_recv(struct udp_pcb *pcb,
|
||||
void (* recv)(void *arg, struct udp_pcb *upcb, struct pbuf *p,
|
||||
struct ip_addr *addr, u16_t port),
|
||||
void *recv_arg)
|
||||
udp_recv(struct udp_pcb *pcb, udp_recv_fn recv, void *recv_arg)
|
||||
{
|
||||
/* remember recv() callback and user data */
|
||||
pcb->recv = recv;
|
||||
|
||||
Reference in New Issue
Block a user