Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Adding licence + cosmetics
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 14 Mar 2006 21:01:37 +0000 (21:01 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 14 Mar 2006 21:01:37 +0000 (21:01 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@1944 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/graph.c
src/xbt/graph_private.h

index f740315..01c8111 100644 (file)
@@ -1,9 +1,19 @@
+/*     $Id$     */
+
+/* a generic graph library.                                                 */
+
+/* Copyright (c) 2006 Darina Dimitrova, Arnaud Legrand. 
+   All rights reserved.                  */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/graph.h"
 #include "graph_private.h"
 
-/* XBT_LOG_NEW_DEFAULT_SUBCATEGORY(graph,xbt,"GRAPH"); */
+/* XBT_LOG_NEW_DEFAULT_SUBCATEGORY(graph,xbt,"Graph"); */
 
 /** Constructor
  * \return a new graph
@@ -73,7 +83,8 @@ void xbt_graph_free_graph(xbt_graph_t g,
   xbt_dynar_foreach(g->nodes,cursor,node)
     xbt_graph_remove_node(g,node,node_free_function);
 
-  /* if xbt_dynar_size(g->edges)>0 SCREAM! */
+  xbt_assert0(!xbt_dynar_length(g->edges),
+             "Damnit, there are some remaining edges!");
 
   xbt_dynar_foreach(g->edges,cursor,edge)
       xbt_graph_remove_edge(g,edge,edge_free_function); 
index 9911475..922f164 100644 (file)
@@ -1,5 +1,13 @@
-#include "xbt/misc.h"
-#include "xbt/sysdep.h"
+/*     $Id$     */
+
+/* Copyright (c) 2006 Darina Dimitrova, Arnaud Legrand. 
+   All rights reserved.                  */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef _XBT_GRAPH_PRIVATE_H
+#define _XBT_GRAPH_PRIVATE_H
 #include "xbt/dynar.h"
 
 /* Node structure */
@@ -30,3 +38,4 @@ typedef struct xbt_graph
   void *data;
 } s_xbt_graph_t;
 
+#endif                         /* _XBT_GRAPH_PRIVATE_H */