Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move the type definition to a specific header so that we can share it with the code...
[simgrid.git] / src / xbt / dynar.c
index 7090ea8..a9e768e 100644 (file)
@@ -7,6 +7,7 @@
 /* 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 "portable.h" /* SIZEOF_MAX */
 #include "xbt/misc.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/dynar.h"
 #include <sys/types.h>
 
-
+#include "xbt/dynar_private.h" /* type definition, which we share with the 
+                                 code in charge of sending this across the net */
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(dynar,xbt,"Dynamic arrays");
 
-typedef struct xbt_dynar_s {
-  unsigned long          size;
-  unsigned long          used;
-  unsigned long          elmsize;
-  void           *data;
-  void_f_pvoid_t *free_f;
-} s_xbt_dynar_t;
 
 #define __sanity_check_dynar(dynar)       \
            xbt_assert0(dynar,           \
@@ -466,7 +461,7 @@ xbt_dynar_map(const xbt_dynar_t  dynar,
   __sanity_check_dynar(dynar);
 
   {
-    char         elm[64];
+    char         elm[SIZEOF_MAX];
     const unsigned long used = dynar->used;
     unsigned long       i    = 0;