Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Removes the gras_config.h inclusion, adds the portable.h inclusion for win32 portability.
[simgrid.git] / src / gras / DataDesc / datadesc_private.h
index 2435c23..7255748 100644 (file)
@@ -4,23 +4,23 @@
 
 /* module's private interface masked even to other parts of GRAS.           */
 
-/* Authors: Olivier Aumage, Martin Quinson                                  */
-/* Copyright (C) 2003, 2004 the GRAS posse.                                 */
+/* Copyright (c) 2003 Olivier Aumage.                                       */
+/* Copyright (c) 2003, 2004 Martin Quinson.                                 */
+/* 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. */
* under the terms of the license (GNU LGPL) which comes with this package. */
 
 #ifndef GRAS_DATADESC_PRIVATE_H
 #define GRAS_DATADESC_PRIVATE_H
 
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
-#include "xbt/error.h"
 #include "xbt/dynar.h"
 #include "xbt/dict.h"
 #include "xbt/set.h"
 
-#include "gras_config.h" /* GRAS_THISARCH */
+#include "portable.h" /* GRAS_THISARCH */
 
 #include "gras/transport.h"  /* socket handling */
 
 #include "gras/DataDesc/datadesc_interface.h" /* semi-public API */
 
 /**
- * aligned:
+ * ddt_aligned:
  * 
  * Align the data v on the boundary a.
  */
-#define aligned(v, a) (((v) + (a - 1)) & ~(a - 1))
+#define ddt_aligned(v, a) (((v) + (a - 1)) & ~(a - 1))
 
-extern xbt_set_t gras_datadesc_set_local;
+/*@null@*/extern xbt_set_t gras_datadesc_set_local;
 void gras_ddt_freev(void *ddt);
 /*******************************************
  * Descriptions of all known architectures *
  *******************************************/
 
-#define gras_arch_count 5
+#define gras_arch_count 9
 typedef enum {
   gras_ddt_scalar_char      = 0,
   gras_ddt_scalar_short     = 1,
@@ -91,9 +91,8 @@ typedef enum e_gras_datadesc_type_category {
   e_gras_datadesc_type_cat_union = 3,
   e_gras_datadesc_type_cat_ref = 4,       /* ref to an uniq element */
   e_gras_datadesc_type_cat_array = 5,
-  e_gras_datadesc_type_cat_ignored = 6,
   
-  e_gras_datadesc_type_cat_invalid = 7
+  e_gras_datadesc_type_cat_invalid = 6
 } gras_datadesc_type_category_t;
 
 /*------------------------------------------------*/
@@ -110,8 +109,8 @@ typedef struct s_gras_dd_cat_field {
   long int  offset[gras_arch_count];
   gras_datadesc_type_t type;
   
-  gras_datadesc_type_cb_void_t pre;
-  gras_datadesc_type_cb_void_t post;
+  gras_datadesc_type_cb_void_t send;
+  gras_datadesc_type_cb_void_t recv;
 
 } s_gras_dd_cat_field_t,*gras_dd_cat_field_t;
 
@@ -133,7 +132,7 @@ enum e_gras_dd_scalar_encoding {
 };
 typedef struct s_gras_dd_cat_scalar {
   enum e_gras_dd_scalar_encoding encoding;
-  gras_ddt_scalar_type_t type; /* to check easily that redefinition matches*/
+  gras_ddt_scalar_type_t type; /* to check easily that redefinition matches */
 } gras_dd_cat_scalar_t;
 
 /**
@@ -186,17 +185,6 @@ typedef struct s_gras_dd_cat_array {
 
 } gras_dd_cat_array_t;
 
-/**
- * gras_dd_cat_ignored_t:
- *
- * Specific fields of an ignored field
- */
-typedef struct s_gras_dd_cat_ignored {
-  void                         *default_value;
-  void_f_pvoid_t                *free_func;
-} gras_dd_cat_ignored_t;
-
-
 /**
  * u_gras_datadesc_category:
  *
@@ -209,10 +197,8 @@ union u_gras_datadesc_category {
         gras_dd_cat_union_t    union_data;
         gras_dd_cat_ref_t      ref_data;
         gras_dd_cat_array_t    array_data;
-        gras_dd_cat_ignored_t  ignored_data;
 };
 
-
 /****************************************/
 /* The holy grail: type descriptor type */
 /****************************************/
@@ -239,7 +225,12 @@ typedef struct s_gras_datadesc_type {
   gras_datadesc_type_cb_void_t         send;
   gras_datadesc_type_cb_void_t         recv;
    
-  int                                  cycle; /* true if the datatype may contain cycle */
+  /* flags */
+  int                                  cycle :1;
+   
+  /* random value for users (like default value or whatever) */
+  char                                 extra[SIZEOF_MAX]; 
+
 } s_gras_datadesc_type_t;
 
 /***************************
@@ -257,14 +248,20 @@ gras_datadesc_type_t
  ****************************************************/
 gras_cbps_t gras_cbps_new(void);
 void gras_cbps_free(gras_cbps_t *state);
+void gras_cbps_reset(gras_cbps_t state);
 
 /***************
  * Convertions *
  ***************/
-xbt_error_t
+void
 gras_dd_convert_elm(gras_datadesc_type_t type, int count,
                    int r_arch, 
                    void *src, void *dst);
 
+/********************************************************************
+ * Dictionnary containing the constant values for the parsing macro *
+ ********************************************************************/
+extern xbt_dict_t gras_dd_constants; /* lives in ddt_parse.c of course */
+
 #endif /* GRAS_DATADESC_PRIVATE_H */