From: Guus Sliepen Date: Mon, 21 Apr 2014 17:20:35 +0000 (+0200) Subject: Use "struct foo_t *" instead of "foo_t *" in .h files. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=722dc566a68a4d81c217a8023967cc3bda78c680;p=meshlink Use "struct foo_t *" instead of "foo_t *" in .h files. --- diff --git a/src/conf.h b/src/conf.h index 8bc9d6b3..63097c3f 100644 --- a/src/conf.h +++ b/src/conf.h @@ -30,30 +30,30 @@ typedef struct config_t { int line; } config_t; -extern splay_tree_t *config_tree; +extern struct splay_tree_t *config_tree; extern int pinginterval; extern int pingtimeout; extern int maxtimeout; extern bool bypass_security; -extern void init_configuration(splay_tree_t **); -extern void exit_configuration(splay_tree_t **); +extern void init_configuration(struct splay_tree_t **); +extern void exit_configuration(struct splay_tree_t **); extern config_t *new_config(void) __attribute__ ((__malloc__)); extern void free_config(config_t *); -extern void config_add(splay_tree_t *, config_t *); -extern config_t *lookup_config(splay_tree_t *, char *); -extern config_t *lookup_config_next(splay_tree_t *, const config_t *); +extern void config_add(struct splay_tree_t *, config_t *); +extern config_t *lookup_config(struct splay_tree_t *, char *); +extern config_t *lookup_config_next(struct splay_tree_t *, const config_t *); extern bool get_config_bool(const config_t *, bool *); extern bool get_config_int(const config_t *, int *); extern bool get_config_string(const config_t *, char **); extern bool get_config_address(const config_t *, struct addrinfo **); extern config_t *parse_config_line(char *, const char *, int); -extern bool read_config_file(splay_tree_t *, const char *); -extern void read_config_options(splay_tree_t *, const char *); +extern bool read_config_file(struct splay_tree_t *, const char *); +extern void read_config_options(struct splay_tree_t *, const char *); extern bool read_server_config(void); -extern bool read_host_config(splay_tree_t *, const char *); +extern bool read_host_config(struct splay_tree_t *, const char *); extern bool append_config_file(const char *, const char *, const char *); #endif /* __TINC_CONF_H__ */ diff --git a/src/edge.h b/src/edge.h index 752dc5a9..77f761dc 100644 --- a/src/edge.h +++ b/src/edge.h @@ -37,14 +37,14 @@ typedef struct edge_t { struct edge_t *reverse; /* edge in the opposite direction, if available */ } edge_t; -extern splay_tree_t *edge_weight_tree; /* Tree with all known edges sorted on weight */ +extern struct splay_tree_t *edge_weight_tree; /* Tree with all known edges sorted on weight */ extern void init_edges(void); extern void exit_edges(void); extern edge_t *new_edge(void) __attribute__ ((__malloc__)); extern void free_edge(edge_t *); -extern splay_tree_t *new_edge_tree(void) __attribute__ ((__malloc__)); -extern void free_edge_tree(splay_tree_t *); +extern struct splay_tree_t *new_edge_tree(void) __attribute__ ((__malloc__)); +extern void free_edge_tree(struct splay_tree_t *); extern void edge_add(edge_t *); extern void edge_del(edge_t *); extern edge_t *lookup_edge(struct node_t *, struct node_t *); diff --git a/src/event.h b/src/event.h index 1d88383d..7d52a174 100644 --- a/src/event.h +++ b/src/event.h @@ -34,21 +34,21 @@ typedef struct io_t { int flags; io_cb_t cb; void *data; - splay_node_t node; + struct splay_node_t node; } io_t; typedef struct timeout_t { struct timeval tv; timeout_cb_t cb; void *data; - splay_node_t node; + struct splay_node_t node; } timeout_t; typedef struct signal_t { int signum; signal_cb_t cb; void *data; - splay_node_t node; + struct splay_node_t node; } signal_t; extern struct timeval now; diff --git a/src/meshlink_internal.h b/src/meshlink_internal.h index 321a1f35..6e59db0e 100644 --- a/src/meshlink_internal.h +++ b/src/meshlink_internal.h @@ -41,13 +41,13 @@ struct meshlink_handle { pthread_t thread; listen_socket_t listen_socket[MAXSOCKETS]; - node_t *myself; + struct node_t *myself; - splay_tree_t *config; - splay_tree_t *edges; - splay_tree_t *nodes; + struct splay_tree_t *config; + struct splay_tree_t *edges; + struct splay_tree_t *nodes; - list_t *outgoing_connections; + struct list_t *outgoing_connections; }; /// A handle for a MeshLink node. diff --git a/src/net.h b/src/net.h index 453fa74b..4d2d48aa 100644 --- a/src/net.h +++ b/src/net.h @@ -87,8 +87,8 @@ typedef enum packet_type_t { } packet_type_t; typedef struct listen_socket_t { - io_t tcp; - io_t udp; + struct io_t tcp; + struct io_t udp; sockaddr_t sa; bool bindto; } listen_socket_t; @@ -99,7 +99,7 @@ typedef struct listen_socket_t { typedef struct outgoing_t { char *name; int timeout; - splay_tree_t *config_tree; + struct splay_tree_t *config_tree; struct config_t *cfg; struct addrinfo *ai; struct addrinfo *aip; @@ -157,9 +157,9 @@ extern int setup_listen_socket(const sockaddr_t *); extern int setup_vpn_in_socket(const sockaddr_t *); extern bool send_sptps_data(void *handle, uint8_t type, const char *data, size_t len); extern bool receive_sptps_record(void *handle, uint8_t type, const char *data, uint16_t len); -extern void send_packet(struct node_t *, vpn_packet_t *); +extern void send_packet(struct node_t *, struct vpn_packet_t *); extern void receive_tcppacket(struct connection_t *, const char *, int); -extern void broadcast_packet(const struct node_t *, vpn_packet_t *); +extern void broadcast_packet(const struct node_t *, struct vpn_packet_t *); extern char *get_name(void); extern bool setup_myself_reloadable(void); extern bool setup_network(void); diff --git a/src/node.h b/src/node.h index ebe0b9d5..84abcab6 100644 --- a/src/node.h +++ b/src/node.h @@ -62,7 +62,7 @@ typedef struct node_t { struct edge_t *prevedge; /* nearest node from him to us */ struct node_t *via; /* next hop for UDP packets */ - splay_tree_t *edge_tree; /* Edges with this node as one of the endpoints */ + struct splay_tree_t *edge_tree; /* Edges with this node as one of the endpoints */ struct connection_t *connection; /* Connection associated with this node (if a direct connection exists) */ @@ -91,7 +91,7 @@ typedef struct node_t { } node_t; extern struct node_t *myself; -extern splay_tree_t *node_tree; +extern struct splay_tree_t *node_tree; extern void init_nodes(void); extern void exit_nodes(void);