K&R style braces.
[tinc] / src / edge.c
index 7b48b05..403dfff 100644 (file)
@@ -1,7 +1,7 @@
 /*
     edge.c -- edge tree management
-    Copyright (C) 2000-2004 Guus Sliepen <guus@tinc-vpn.org>,
-                  2000-2004 Ivo Timmermans <ivo@tinc-vpn.org>
+    Copyright (C) 2000-2006 Guus Sliepen <guus@tinc-vpn.org>,
+                  2000-2005 Ivo Timmermans
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
-    $Id$
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
 #include "system.h"
 
 avl_tree_t *edge_weight_tree;  /* Tree with all edges, sorted on weight */
 
-static int edge_compare(const edge_t *a, const edge_t *b)
-{
+static int edge_compare(const edge_t *a, const edge_t *b) {
        return strcmp(a->to->name, b->to->name);
 }
 
-static int edge_weight_compare(const edge_t *a, const edge_t *b)
-{
+static int edge_weight_compare(const edge_t *a, const edge_t *b) {
        int result;
 
        result = a->weight - b->weight;
@@ -54,29 +50,25 @@ static int edge_weight_compare(const edge_t *a, const edge_t *b)
        return strcmp(a->to->name, b->to->name);
 }
 
-void init_edges(void)
-{
+void init_edges(void) {
        cp();
 
        edge_weight_tree = avl_alloc_tree((avl_compare_t) edge_weight_compare, NULL);
 }
 
-avl_tree_t *new_edge_tree(void)
-{
+avl_tree_t *new_edge_tree(void) {
        cp();
 
        return avl_alloc_tree((avl_compare_t) edge_compare, (avl_action_t) free_edge);
 }
 
-void free_edge_tree(avl_tree_t *edge_tree)
-{
+void free_edge_tree(avl_tree_t *edge_tree) {
        cp();
 
        avl_delete_tree(edge_tree);
 }
 
-void exit_edges(void)
-{
+void exit_edges(void) {
        cp();
 
        avl_delete_tree(edge_weight_tree);
@@ -84,15 +76,13 @@ void exit_edges(void)
 
 /* Creation and deletion of connection elements */
 
-edge_t *new_edge(void)
-{
+edge_t *new_edge(void) {
        cp();
 
        return xmalloc_and_zero(sizeof(edge_t));
 }
 
-void free_edge(edge_t *e)
-{
+void free_edge(edge_t *e) {
        cp();
        
        sockaddrfree(&e->address);
@@ -100,8 +90,7 @@ void free_edge(edge_t *e)
        free(e);
 }
 
-void edge_add(edge_t *e)
-{
+void edge_add(edge_t *e) {
        cp();
 
        avl_insert(edge_weight_tree, e);
@@ -113,8 +102,7 @@ void edge_add(edge_t *e)
                e->reverse->reverse = e;
 }
 
-void edge_del(edge_t *e)
-{
+void edge_del(edge_t *e) {
        cp();
 
        if(e->reverse)
@@ -124,8 +112,7 @@ void edge_del(edge_t *e)
        avl_delete(e->from->edge_tree, e);
 }
 
-edge_t *lookup_edge(node_t *from, node_t *to)
-{
+edge_t *lookup_edge(node_t *from, node_t *to) {
        edge_t v;
        
        cp();
@@ -136,8 +123,7 @@ edge_t *lookup_edge(node_t *from, node_t *to)
        return avl_search(from->edge_tree, &v);
 }
 
-void dump_edges(void)
-{
+void dump_edges(void) {
        avl_node_t *node, *node2;
        node_t *n;
        edge_t *e;