Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use SG_{BEGIN,END}_DECL() for what it's designed to serve.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 5 Dec 2013 20:59:49 +0000 (21:59 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 5 Dec 2013 21:20:04 +0000 (22:20 +0100)
17 files changed:
include/simgrid/platf.h
include/surf/surf_routing.h
include/xbt/heap.h
include/xbt/module.h
src/include/instr/instr_interface.h
src/include/simgrid/platf_interface.h
src/include/simgrid/sg_config.h
src/include/surf/maxmin.h
src/include/surf/surf.h
src/include/surf/trace_mgr.h
src/instr/instr_private.h
src/simix/smx_host_private.h
src/simix/smx_smurf_private.h
src/surf/gtnets/gtnets_interface.h
src/surf/ns3/ns3_interface.h
src/surf/surf_interface.hpp
src/surf/surf_private.h

index 6bf1cbe..20bb10f 100644 (file)
 
 #include <xbt.h>
 
 
 #include <xbt.h>
 
+SG_BEGIN_DECL()
+
 typedef void *sg_routing_link_t; /* FIXME:The actual type is model-dependent so use void* instead*/
 typedef struct RoutingEdge *sg_routing_edge_t;
 
 typedef void *sg_routing_link_t; /* FIXME:The actual type is model-dependent so use void* instead*/
 typedef struct RoutingEdge *sg_routing_edge_t;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 XBT_PUBLIC(sg_routing_edge_t) sg_routing_edge_by_name_or_null(const char *name);
 XBT_PUBLIC(sg_routing_edge_t) sg_routing_edge_by_name_or_null(const char *name);
-#ifdef __cplusplus
-}
-#endif
 
 /** Defines whether a given resource is working or not */
 typedef enum {
 
 /** Defines whether a given resource is working or not */
 typedef enum {
@@ -53,9 +49,6 @@ typedef struct tmgr_trace *tmgr_trace_t; /**< Opaque structure defining an avail
 /** opaque structure defining a event generator for availability based on a probability distribution */
 typedef struct probabilist_event_generator *probabilist_event_generator_t;
 
 /** opaque structure defining a event generator for availability based on a probability distribution */
 typedef struct probabilist_event_generator *probabilist_event_generator_t;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_file(const char *filename);
 XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(const char *id,
                                                     const char *input,
 XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_file(const char *filename);
 XBT_PUBLIC(tmgr_trace_t) tmgr_trace_new_from_string(const char *id,
                                                     const char *input,
@@ -80,9 +73,6 @@ XBT_PUBLIC(probabilist_event_generator_t) tmgr_event_generator_new_exponential(c
 XBT_PUBLIC(probabilist_event_generator_t) tmgr_event_generator_new_weibull(const char* id,
                                                                            double scale,
                                                                            double shape);
 XBT_PUBLIC(probabilist_event_generator_t) tmgr_event_generator_new_weibull(const char* id,
                                                                            double scale,
                                                                            double shape);
-#ifdef __cplusplus
-}
-#endif
 
 typedef xbt_dictelm_t sg_host_t;
 static inline char* sg_host_name(sg_host_t host) {
 
 typedef xbt_dictelm_t sg_host_t;
 static inline char* sg_host_name(sg_host_t host) {
@@ -331,10 +321,6 @@ typedef struct s_sg_platf_gpu_cbarg {
 
 /* ***************************************** */
 
 
 /* ***************************************** */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 XBT_PUBLIC(void) sg_platf_begin(void);  // Start a new platform
 XBT_PUBLIC(void) sg_platf_end(void); // Finish the creation of the platform
 
 XBT_PUBLIC(void) sg_platf_begin(void);  // Start a new platform
 XBT_PUBLIC(void) sg_platf_end(void); // Finish the creation of the platform
 
@@ -384,8 +370,6 @@ XBT_PUBLIC(void) sg_platf_ASroute_add_link (const char* link_id, sg_platf_route_
 typedef void (*sg_platf_process_cb_t)(sg_platf_process_cbarg_t);
 XBT_PUBLIC(void) sg_platf_process_add_cb(sg_platf_process_cb_t fct);
 
 typedef void (*sg_platf_process_cb_t)(sg_platf_process_cbarg_t);
 XBT_PUBLIC(void) sg_platf_process_add_cb(sg_platf_process_cb_t fct);
 
-#ifdef __cplusplus
-}
-#endif
+SG_END_DECL()
 
 #endif                          /* SG_PLATF_H */
 
 #endif                          /* SG_PLATF_H */
index 3c2e36a..1e03fdf 100644 (file)
@@ -10,9 +10,7 @@
 #include "xbt/lib.h"
 #include "simgrid/platf_interface.h"
 
 #include "xbt/lib.h"
 #include "simgrid/platf_interface.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+SG_BEGIN_DECL()
 
 XBT_PUBLIC(xbt_lib_t) host_lib;
 XBT_PUBLIC(int) ROUTING_HOST_LEVEL; //Routing level
 
 XBT_PUBLIC(xbt_lib_t) host_lib;
 XBT_PUBLIC(int) ROUTING_HOST_LEVEL; //Routing level
@@ -51,8 +49,6 @@ void routing_AS_end(sg_platf_AS_cbarg_t AS);
 
 void routing_cluster_add_backbone(void* bb);
 
 
 void routing_cluster_add_backbone(void* bb);
 
-#ifdef __cplusplus
-}
-#endif
+SG_END_DECL()
 
 #endif                          /* _SURF_SURF_H */
 
 #endif                          /* _SURF_SURF_H */
index cc50c02..46a1dbc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2007, 2009-2011. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2011, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 #include "xbt/misc.h"
 #include "xbt/dynar.h"          /* void_f_pvoid_t */
 
 #include "xbt/misc.h"
 #include "xbt/dynar.h"          /* void_f_pvoid_t */
 
+SG_BEGIN_DECL()
+
 /** @addtogroup XBT_heap
  *  @brief This section describes the API to generic heap with O(log(n)) access.
  *
  *  @{
  */
 /* @brief heap datatype */
 /** @addtogroup XBT_heap
  *  @brief This section describes the API to generic heap with O(log(n)) access.
  *
  *  @{
  */
 /* @brief heap datatype */
-#ifdef __cplusplus
-extern "C" {
-#endif
 typedef struct xbt_heap *xbt_heap_t;
 
 XBT_PUBLIC(xbt_heap_t) xbt_heap_new(int init_size,
 typedef struct xbt_heap *xbt_heap_t;
 
 XBT_PUBLIC(xbt_heap_t) xbt_heap_new(int init_size,
@@ -36,8 +35,6 @@ XBT_PUBLIC(void) xbt_heap_set_update_callback(xbt_heap_t H,
                                                                        *,
                                                                        int));
 XBT_PUBLIC(void *) xbt_heap_remove(xbt_heap_t H, int i);
                                                                        *,
                                                                        int));
 XBT_PUBLIC(void *) xbt_heap_remove(xbt_heap_t H, int i);
-#ifdef __cplusplus
-}
-#endif
 /* @} */
 /* @} */
+SG_END_DECL()
 #endif                          /* _XBT_HEAP_H */
 #endif                          /* _XBT_HEAP_H */
index 29cad1b..2e87787 100644 (file)
@@ -1,6 +1,6 @@
 /* module - modularize the code                                             */
 
 /* module - modularize the code                                             */
 
-/* Copyright (c) 2004-2007, 2009-2010, 2012. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2010, 2012, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 
 #include <xbt/misc.h>           /* XBT_PUBLIC */
 
 
 #include <xbt/misc.h>           /* XBT_PUBLIC */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+SG_BEGIN_DECL()
+
 XBT_PUBLIC(void) xbt_init(int *argc, char **argv);
 XBT_PUBLIC(void) xbt_exit(void);
 XBT_PUBLIC(void) xbt_init(int *argc, char **argv);
 XBT_PUBLIC(void) xbt_exit(void);
-#ifdef __cplusplus
-}
-#endif
+
+SG_END_DECL()
 
 #endif                          /* _XBT_MODULE_H */
 
 #endif                          /* _XBT_MODULE_H */
index 0f5c429..cb1ccdc 100644 (file)
@@ -1,8 +1,6 @@
 #include "xbt.h"
 
 #include "xbt.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+SG_BEGIN_DECL()
 
 XBT_PUBLIC(int) TRACE_start (void);
 XBT_PUBLIC(int) TRACE_end (void);
 
 XBT_PUBLIC(int) TRACE_start (void);
 XBT_PUBLIC(int) TRACE_end (void);
@@ -13,6 +11,4 @@ XBT_PUBLIC(void) TRACE_surf_resource_utilization_release(void);
 XBT_PUBLIC(void) TRACE_add_start_function(void (*func)(void));
 XBT_PUBLIC(void) TRACE_add_end_function(void (*func)(void));
 
 XBT_PUBLIC(void) TRACE_add_start_function(void (*func)(void));
 XBT_PUBLIC(void) TRACE_add_end_function(void (*func)(void));
 
-#ifdef __cplusplus
-}
-#endif
+SG_END_DECL()
index 7091f04..6a8a005 100644 (file)
@@ -1,6 +1,6 @@
 /* platf_interface.h - Internal interface to the SimGrid platforms          */
 
 /* platf_interface.h - Internal interface to the SimGrid platforms          */
 
-/* Copyright (c) 2004-2007, 2009-2012. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -12,6 +12,8 @@
 #include "simgrid/platf.h" /* public interface */
 #include "xbt/RngStream.h"
 
 #include "simgrid/platf.h" /* public interface */
 #include "xbt/RngStream.h"
 
+SG_BEGIN_DECL()
+
 /* Module management functions */
 XBT_PUBLIC(void) sg_platf_init(void);
 XBT_PUBLIC(void) sg_platf_exit(void);
 /* Module management functions */
 XBT_PUBLIC(void) sg_platf_init(void);
 XBT_PUBLIC(void) sg_platf_exit(void);
@@ -41,10 +43,6 @@ typedef void (*sg_platf_mstorage_cb_t)(sg_platf_mstorage_cbarg_t);
 /* ***************************************** */
 /* TUTORIAL: New TAG                         */
 
 /* ***************************************** */
 /* TUTORIAL: New TAG                         */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 typedef void (*sg_platf_gpu_cb_t)(sg_platf_gpu_cbarg_t);
 XBT_PUBLIC(void) sg_platf_gpu_add_cb(sg_platf_gpu_cb_t);
 /* ***************************************** */
 typedef void (*sg_platf_gpu_cb_t)(sg_platf_gpu_cbarg_t);
 XBT_PUBLIC(void) sg_platf_gpu_add_cb(sg_platf_gpu_cb_t);
 /* ***************************************** */
@@ -74,9 +72,6 @@ XBT_PUBLIC(void) sg_platf_mstorage_add_cb(sg_platf_mstorage_cb_t fct);
 XBT_PUBLIC(void) sg_platf_storage_type_add_cb(sg_platf_storage_type_cb_t fct);
 XBT_PUBLIC(void) sg_platf_mount_add_cb(sg_platf_mount_cb_t fct);
 
 XBT_PUBLIC(void) sg_platf_storage_type_add_cb(sg_platf_storage_type_cb_t fct);
 XBT_PUBLIC(void) sg_platf_mount_add_cb(sg_platf_mount_cb_t fct);
 
-#ifdef __cplusplus
-}
-#endif
 /** \brief Pick the right models for CPU, net and workstation, and call their model_init_preparse
  *
  * Must be called within parsing/creating the environment (after the <config>s, if any, and before <AS> or friends such as <cluster>)
 /** \brief Pick the right models for CPU, net and workstation, and call their model_init_preparse
  *
  * Must be called within parsing/creating the environment (after the <config>s, if any, and before <AS> or friends such as <cluster>)
@@ -87,4 +82,6 @@ XBT_PUBLIC(void) surf_config_models_setup(void);
 XBT_PUBLIC(void) sg_platf_rng_stream_init(unsigned long seed[6]);
 XBT_PUBLIC(RngStream) sg_platf_rng_stream_get(const char* id);
 
 XBT_PUBLIC(void) sg_platf_rng_stream_init(unsigned long seed[6]);
 XBT_PUBLIC(RngStream) sg_platf_rng_stream_get(const char* id);
 
+SG_END_DECL()
+
 #endif                          /* SG_PLATF_INTERFACE_H */
 #endif                          /* SG_PLATF_INTERFACE_H */
index 3d01e63..33665a0 100644 (file)
@@ -10,9 +10,7 @@
 /*** Config Globals **************************/
 /*******************************************/
 
 /*** Config Globals **************************/
 /*******************************************/
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+SG_BEGIN_DECL()
 
 XBT_PUBLIC_DATA(xbt_cfg_t) _sg_cfg_set;
 XBT_PUBLIC_DATA(int) _sg_cfg_init_status;
 
 XBT_PUBLIC_DATA(xbt_cfg_t) _sg_cfg_set;
 XBT_PUBLIC_DATA(int) _sg_cfg_init_status;
@@ -27,6 +25,4 @@ XBT_PUBLIC(xbt_dynar_t) sg_cfg_get_dynar(const char* name);
 void sg_config_init(int *argc, char **argv);
 void sg_config_finalize(void);
 
 void sg_config_init(int *argc, char **argv);
 void sg_config_finalize(void);
 
-#ifdef __cplusplus
-}
-#endif
+SG_END_DECL()
index e4e67c5..94a1f7d 100644 (file)
@@ -31,9 +31,7 @@ static XBT_INLINE int double_equals(double value1, double value2)
   return (fabs(value1 - value2) < MAXMIN_PRECISION);
 }
 
   return (fabs(value1 - value2) < MAXMIN_PRECISION);
 }
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+SG_BEGIN_DECL()
 
 XBT_PUBLIC(lmm_system_t) lmm_system_new(int selective_update);
 XBT_PUBLIC(void) lmm_system_free(lmm_system_t sys);
 
 XBT_PUBLIC(lmm_system_t) lmm_system_new(int selective_update);
 XBT_PUBLIC(void) lmm_system_free(lmm_system_t sys);
@@ -133,8 +131,6 @@ XBT_PUBLIC(double func_vegas_f) (lmm_variable_t var, double x);
 XBT_PUBLIC(double func_vegas_fp) (lmm_variable_t var, double x);
 XBT_PUBLIC(double func_vegas_fpi) (lmm_variable_t var, double x);
 
 XBT_PUBLIC(double func_vegas_fp) (lmm_variable_t var, double x);
 XBT_PUBLIC(double func_vegas_fpi) (lmm_variable_t var, double x);
 
-#ifdef __cplusplus
-}
-#endif
+SG_END_DECL()
 
 #endif                          /* _SURF_MAXMIN_H */
 
 #endif                          /* _SURF_MAXMIN_H */
index 11f2472..0620175 100644 (file)
@@ -210,9 +210,6 @@ static inline void *surf_storage_resource_by_name(const char *name){
   return xbt_lib_get_elm_or_null(storage_lib, name);
 }
 
   return xbt_lib_get_elm_or_null(storage_lib, name);
 }
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 char *surf_routing_edge_name(sg_routing_edge_t edge);
 void *surf_as_cluster_get_backbone(AS_t as);
 void surf_as_cluster_set_backbone(AS_t as, void* backbone);
 char *surf_routing_edge_name(sg_routing_edge_t edge);
 void *surf_as_cluster_get_backbone(AS_t as);
 void surf_as_cluster_set_backbone(AS_t as, void* backbone);
@@ -296,9 +293,6 @@ void surf_cpu_action_set_bound(surf_action_t action, double bound);
 surf_file_t surf_storage_action_get_file(surf_action_t action);
 xbt_dict_t surf_storage_action_get_ls_dict(surf_action_t action);
 surf_model_t surf_resource_model(const void *host, int level);
 surf_file_t surf_storage_action_get_file(surf_action_t action);
 xbt_dict_t surf_storage_action_get_ls_dict(surf_action_t action);
 surf_model_t surf_resource_model(const void *host, int level);
-#ifdef __cplusplus
-}
-#endif
 
 /**************************************/
 /* Implementations of model object */
 
 /**************************************/
 /* Implementations of model object */
@@ -593,9 +587,6 @@ XBT_PUBLIC(xbt_dict_t) watched_hosts_lib;
 /*******************************************/
 /*** SURF Platform *************************/
 /*******************************************/
 /*******************************************/
 /*** SURF Platform *************************/
 /*******************************************/
-#ifdef __cplusplus
-extern "C" {
-#endif
 XBT_PUBLIC_DATA(AS_t) surf_AS_get_routing_root(void); 
 XBT_PUBLIC_DATA(const char *) surf_AS_get_name(AS_t as);
 XBT_PUBLIC_DATA(xbt_dict_t) surf_AS_get_routing_sons(AS_t as);
 XBT_PUBLIC_DATA(AS_t) surf_AS_get_routing_root(void); 
 XBT_PUBLIC_DATA(const char *) surf_AS_get_name(AS_t as);
 XBT_PUBLIC_DATA(xbt_dict_t) surf_AS_get_routing_sons(AS_t as);
@@ -604,9 +595,6 @@ XBT_PUBLIC_DATA(xbt_dynar_t) surf_AS_get_hosts(AS_t as);
 XBT_PUBLIC_DATA(void) surf_AS_get_graph(AS_t as, xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
 XBT_PUBLIC_DATA(AS_t) surf_platf_get_root(routing_platf_t platf);
 XBT_PUBLIC_DATA(e_surf_network_element_type_t) surf_routing_edge_get_rc_type(sg_routing_edge_t edge);
 XBT_PUBLIC_DATA(void) surf_AS_get_graph(AS_t as, xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges);
 XBT_PUBLIC_DATA(AS_t) surf_platf_get_root(routing_platf_t platf);
 XBT_PUBLIC_DATA(e_surf_network_element_type_t) surf_routing_edge_get_rc_type(sg_routing_edge_t edge);
-#ifdef __cplusplus
-}
-#endif
 
 /*******************************************/
 /*** SURF Globals **************************/
 
 /*******************************************/
 /*** SURF Globals **************************/
index 3343492..d6bc750 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2004-2007, 2009-2012. The SimGrid Team.
+/* Copyright (c) 2004-2007, 2009-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -13,9 +13,7 @@
 #include "surf/datatypes.h"
 #include "simgrid/platf_interface.h"
 
 #include "surf/datatypes.h"
 #include "simgrid/platf_interface.h"
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+SG_BEGIN_DECL()
 
 /* Creation functions */
 XBT_PUBLIC(tmgr_history_t) tmgr_history_new(void);
 
 /* Creation functions */
 XBT_PUBLIC(tmgr_history_t) tmgr_history_new(void);
@@ -47,8 +45,6 @@ XBT_PUBLIC(tmgr_trace_event_t)
 
 XBT_PUBLIC(void) tmgr_finalize(void);
 
 
 XBT_PUBLIC(void) tmgr_finalize(void);
 
-#ifdef __cplusplus
-}
-#endif
+SG_END_DECL()
 
 #endif                          /* _SURF_TMGR_H */
 
 #endif                          /* _SURF_TMGR_H */
index 84e81c2..10785fe 100644 (file)
@@ -14,6 +14,8 @@
 
 #ifdef HAVE_TRACING
 
 
 #ifdef HAVE_TRACING
 
+SG_BEGIN_DECL()
+
 /* Need to define function drand48 for Windows */
 #ifdef _WIN32
 #  define drand48() (rand()/(RAND_MAX + 1.0))
 /* Need to define function drand48 for Windows */
 #ifdef _WIN32
 #  define drand48() (rand()/(RAND_MAX + 1.0))
@@ -230,10 +232,6 @@ extern xbt_dict_t user_vm_variables;
 extern xbt_dict_t user_link_variables;
 extern double TRACE_last_timestamp_to_dump;
 
 extern xbt_dict_t user_link_variables;
 extern double TRACE_last_timestamp_to_dump;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 /* instr_paje_header.c */
 void TRACE_header(int basic, int size);
 
 /* instr_paje_header.c */
 void TRACE_header(int basic, int size);
 
@@ -461,10 +459,7 @@ typedef struct s_instr_extra_data {
   int num_processes;
 } s_instr_extra_data_t;
 
   int num_processes;
 } s_instr_extra_data_t;
 
-#ifdef __cplusplus
-}
-#endif
-
+SG_END_DECL()
 
 #endif /* HAVE_TRACING */
 
 
 #endif /* HAVE_TRACING */
 
@@ -472,9 +467,4 @@ typedef struct s_instr_extra_data {
 #include "instr/jedule/jedule_sd_binding.h"
 #endif
 
 #include "instr/jedule/jedule_sd_binding.h"
 #endif
 
-
-
-
-
-
 #endif /* INSTR_PRIVATE_H_ */
 #endif /* INSTR_PRIVATE_H_ */
index 614ce1f..7ce4beb 100644 (file)
@@ -10,6 +10,8 @@
 #include "simgrid/simix.h"
 #include "smx_smurf_private.h"
 
 #include "simgrid/simix.h"
 #include "smx_smurf_private.h"
 
+SG_BEGIN_DECL()
+
 /** @brief Host datatype */
 typedef struct s_smx_host_priv {
   xbt_swag_t process_list;
 /** @brief Host datatype */
 typedef struct s_smx_host_priv {
   xbt_swag_t process_list;
@@ -22,10 +24,6 @@ static inline smx_host_priv_t SIMIX_host_priv(smx_host_t host){
   return (smx_host_priv_t) xbt_lib_get_level(host, SIMIX_HOST_LEVEL);
 }
 
   return (smx_host_priv_t) xbt_lib_get_level(host, SIMIX_HOST_LEVEL);
 }
 
-
-#ifdef __cplusplus
-extern "C" {
-#endif
 void _SIMIX_host_free_process_arg(void *);
 smx_host_t SIMIX_host_create(const char *name, void *workstation, void *data);
 void SIMIX_host_destroy(void *host);
 void _SIMIX_host_free_process_arg(void *);
 smx_host_t SIMIX_host_create(const char *name, void *workstation, void *data);
 void SIMIX_host_destroy(void *host);
@@ -160,9 +158,8 @@ void SIMIX_pre_host_get_params(smx_simcall_t simcall, smx_host_t ind_vm, ws_para
 
 void SIMIX_host_set_params(smx_host_t ind_vm, ws_params_t params);
 void SIMIX_pre_host_set_params(smx_simcall_t simcall, smx_host_t ind_vm, ws_params_t params);
 
 void SIMIX_host_set_params(smx_host_t ind_vm, ws_params_t params);
 void SIMIX_pre_host_set_params(smx_simcall_t simcall, smx_host_t ind_vm, ws_params_t params);
-#ifdef __cplusplus
-}
-#endif
+
+SG_END_DECL()
 
 #endif
 
 
 #endif
 
index 915c890..1b20fbe 100644 (file)
@@ -7,6 +7,8 @@
 #ifndef _SIMIX_SMURF_PRIVATE_H
 #define _SIMIX_SMURF_PRIVATE_H
 
 #ifndef _SIMIX_SMURF_PRIVATE_H
 #define _SIMIX_SMURF_PRIVATE_H
 
+SG_BEGIN_DECL()
+
 /********************************* Simcalls *********************************/
 
 /* we want to build the e_smx_simcall_t enumeration, the table of the
 /********************************* Simcalls *********************************/
 
 /* we want to build the e_smx_simcall_t enumeration, the table of the
@@ -492,14 +494,8 @@ typedef struct s_smx_simcall {
   };
 } s_smx_simcall_t, *smx_simcall_t;
 
   };
 } s_smx_simcall_t, *smx_simcall_t;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 SIMCALL_LIST(SIMCALL_RES_GETSET, SIMCALL_SEP_NOTHING)
 SIMCALL_LIST(SIMCALL_ARG_GETSET, SIMCALL_SEP_NOTHING)
 SIMCALL_LIST(SIMCALL_RES_GETSET, SIMCALL_SEP_NOTHING)
 SIMCALL_LIST(SIMCALL_ARG_GETSET, SIMCALL_SEP_NOTHING)
-#ifdef __cplusplus
-}
-#endif
 
 /******************************** General *************************************/
 
 
 /******************************** General *************************************/
 
@@ -519,5 +515,7 @@ typedef smx_action_t (*simcall_handler_t)(u_smx_scalar_t *);
 extern const char *simcall_types[];
 extern simcall_handler_t simcall_table[];
 
 extern const char *simcall_types[];
 extern simcall_handler_t simcall_table[];
 
+SG_END_DECL()
+
 #endif
 
 #endif
 
index 0c36743..ce72d34 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2010. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -8,29 +8,28 @@
 #ifndef _GTNETS_INTERFACE_H
 #define _GTNETS_INTERFACE_H
 
 #ifndef _GTNETS_INTERFACE_H
 #define _GTNETS_INTERFACE_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include "xbt/misc.h"           /* SG_{BEGIN,END}_DECL() */
+
+SG_BEGIN_DECL()
+
+int gtnets_initialize(int wsize);
+int gtnets_add_link(int id, double bandwidth, double latency);
+int gtnets_add_route(int src, int dst, int *links, int nlink);
+int gtnets_add_router(int id);
+int gtnets_add_onehop_route(int src, int dst, int link);
+int gtnets_create_flow(int src, int dst, long datasize, void *metadata);
+double gtnets_get_time_to_next_flow_completion();
+double gtnets_run_until_next_flow_completion(void ***metadata,
+                                             int *number_of_flows);
+double gtnets_get_flow_rx(void *metadata);
+
+void gtnets_print_topology(void);
+
+int gtnets_run(double delta);
+int gtnets_finalize();
+void gtnets_set_jitter(double);
+void gtnets_set_jitter_seed(int);
+
+SG_END_DECL()
 
 
-  int gtnets_initialize(int wsize);
-  int gtnets_add_link(int id, double bandwidth, double latency);
-  int gtnets_add_route(int src, int dst, int *links, int nlink);
-  int gtnets_add_router(int id);
-  int gtnets_add_onehop_route(int src, int dst, int link);
-  int gtnets_create_flow(int src, int dst, long datasize, void *metadata);
-  double gtnets_get_time_to_next_flow_completion();
-  double gtnets_run_until_next_flow_completion(void ***metadata,
-                                               int *number_of_flows);
-  double gtnets_get_flow_rx(void *metadata);
-
-  void gtnets_print_topology(void);
-
-  int gtnets_run(double delta);
-  int gtnets_finalize();
-  void gtnets_set_jitter(double);
-  void gtnets_set_jitter_seed(int);
-
-#ifdef __cplusplus
-}
-#endif
 #endif
 #endif
index 6105510..b3b141e 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2012. The SimGrid Team.
+/* Copyright (c) 2007-2013. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
@@ -25,9 +25,7 @@ typedef struct ns3_nodes{
   void * data;
 }s_ns3_nodes_t, *ns3_nodes_t;
 
   void * data;
 }s_ns3_nodes_t, *ns3_nodes_t;
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+SG_BEGIN_DECL()
 
 XBT_PUBLIC(int)    ns3_finalize(void);
 XBT_PUBLIC(int)    ns3_initialize(const char* TcpProtocol);
 
 XBT_PUBLIC(int)    ns3_finalize(void);
 XBT_PUBLIC(int)    ns3_initialize(const char* TcpProtocol);
@@ -47,8 +45,7 @@ XBT_PUBLIC(void *) ns3_add_link(int src, e_ns3_network_element_type_t type_src,
                 char * bw,char * lat);
 XBT_PUBLIC(void *) ns3_end_platform(void);
 XBT_PUBLIC(void *) ns3_add_cluster(char * bw,char * lat,const char *id);
                 char * bw,char * lat);
 XBT_PUBLIC(void *) ns3_end_platform(void);
 XBT_PUBLIC(void *) ns3_add_cluster(char * bw,char * lat,const char *id);
-#ifdef __cplusplus
-}
-#endif
+
+SG_END_DECL()
 
 #endif
 
 #endif
index 0e001a9..b28e1c0 100644 (file)
@@ -44,13 +44,9 @@ extern int sg_gtnets_jitter_seed;
 #endif
 extern xbt_dynar_t surf_path;
 
 #endif
 extern xbt_dynar_t surf_path;
 
-#ifdef __cplusplus
 extern "C" {
 extern "C" {
-#endif
 XBT_PUBLIC(double) surf_get_clock(void);
 XBT_PUBLIC(double) surf_get_clock(void);
-#ifdef __cplusplus
 }
 }
-#endif
 
 extern double sg_sender_gap;
 XBT_PUBLIC(int)  SURF_CPU_LEVEL;    //Surf cpu level
 
 extern double sg_sender_gap;
 XBT_PUBLIC(int)  SURF_CPU_LEVEL;    //Surf cpu level
index 4240c00..f2a889c 100644 (file)
@@ -17,9 +17,7 @@
 
 #define NO_MAX_DURATION -1.0
 
 
 #define NO_MAX_DURATION -1.0
 
-#ifdef __cplusplus
-extern "C" {
-#endif
+SG_BEGIN_DECL()
 
 extern xbt_dict_t watched_hosts_lib;
 
 
 extern xbt_dict_t watched_hosts_lib;
 
@@ -92,8 +90,6 @@ XBT_PUBLIC_DATA(int) surfxml_bufferstack_size;
 void TRACE_surf_host_set_power(double date, const char *resource, double power);
 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth);
 
 void TRACE_surf_host_set_power(double date, const char *resource, double power);
 void TRACE_surf_link_set_bandwidth(double date, const char *resource, double bandwidth);
 
-#ifdef __cplusplus
-}
-#endif
+SG_END_DECL()
 
 #endif                          /* _SURF_SURF_PRIVATE_H */
 
 #endif                          /* _SURF_SURF_PRIVATE_H */