Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Compile pas avec les warnings, sinon
[simgrid.git] / testsuite / xbt / swag_usage.c
index 8acd7df..96279cc 100644 (file)
@@ -1,3 +1,12 @@
+/*     $Id$     */
+
+/* A simple example to demonstrate the use of swags */
+
+/* Copyright (c) 2004 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 <stdlib.h>
 #include <stdio.h>
 #include "xbt/swag.h"
@@ -5,7 +14,7 @@
 typedef struct {
   s_xbt_swag_hookup_t setA;
   s_xbt_swag_hookup_t setB;
-  char *name;
+  const char *name;
 } shmurtz, s_shmurtz_t, *shmurtz_t;
 
 int main(void)
@@ -30,8 +39,8 @@ int main(void)
   xbt_swag_insert(obj2, setA);
   xbt_swag_insert(obj2, setB);
 
-  xbt_swag_extract(obj1, setB);
-  //  xbt_swag_extract(obj2, setB);
+  xbt_swag_remove(obj1, setB);
+  //  xbt_swag_remove(obj2, setB);
 
   xbt_swag_foreach(obj,setA) {
     printf("\t%s\n",obj->name);