Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Tranform extern for XBT_PUBLIC
authornavarro <pierre.navarro@imag.fr>
Thu, 25 Oct 2012 17:27:57 +0000 (10:27 -0700)
committernavarro <pierre.navarro@imag.fr>
Thu, 25 Oct 2012 17:27:57 +0000 (10:27 -0700)
14 files changed:
include/gras/process.h
include/gras/virtu.h
include/msg/msg.h
include/surf/surf_routing.h
include/xbt/ex.h
include/xbt/misc.h
include/xbt/mmalloc.h
include/xbt/module.h
src/include/simgrid/platf_interface.h
src/include/surf/maxmin.h
src/simix/smx_network.c
src/surf/surfxml_parseplatf.c
src/xbt/mmalloc/mmprivate.h
tools/gras/stub_generator.c

index 073df64..5fe6d6e 100644 (file)
@@ -18,7 +18,7 @@ SG_BEGIN_DECL()
  * @{ */
 
 /** \brief Create a new thread */
  * @{ */
 
 /** \brief Create a new thread */
-void gras_agent_spawn(const char *name, xbt_main_func_t code,
+XBT_PUBLIC(void) gras_agent_spawn(const char *name, xbt_main_func_t code,
                       int argc, char *argv[], xbt_dict_t properties);
 
 /** @} */
                       int argc, char *argv[], xbt_dict_t properties);
 
 /** @} */
index d4b80ca..c735cdf 100644 (file)
@@ -17,14 +17,14 @@ SG_BEGIN_DECL()
 
 /* Initialization of the simulation world. Do not call them in RL. 
    Indeed, do not call them at all. Let gras_stub_generator do it for you. */
 
 /* Initialization of the simulation world. Do not call them in RL. 
    Indeed, do not call them at all. Let gras_stub_generator do it for you. */
-void gras_global_init(int *argc, char **argv);
-void gras_create_environment(const char *file);
-void gras_function_register(const char *name, xbt_main_func_t code);
-void gras_function_register_default(xbt_main_func_t code);
-void gras_launch_application(const char *file);
-void gras_load_environment_script(const char *file);
-void gras_clean(void);
-void gras_main(void);
+XBT_PUBLIC(void) gras_global_init(int *argc, char **argv);
+XBT_PUBLIC(void) gras_create_environment(const char *file);
+XBT_PUBLIC(void) gras_function_register(const char *name, xbt_main_func_t code);
+XBT_PUBLIC(void) gras_function_register_default(xbt_main_func_t code);
+XBT_PUBLIC(void) gras_launch_application(const char *file);
+XBT_PUBLIC(void) gras_load_environment_script(const char *file);
+XBT_PUBLIC(void) gras_clean(void);
+XBT_PUBLIC(void) gras_main(void);
 
 
 /** @addtogroup GRAS_virtu  
 
 
 /** @addtogroup GRAS_virtu  
index 19f733a..a0f6261 100644 (file)
@@ -273,7 +273,7 @@ void MSG_mailbox_set_async(const char *alias);
 
 
 /************************** Action handling **********************************/
 
 
 /************************** Action handling **********************************/
-msg_error_t MSG_action_trace_run(char *path);
+XBT_PUBLIC(msg_error_t) MSG_action_trace_run(char *path);
 
 #ifdef MSG_USE_DEPRECATED
 
 
 #ifdef MSG_USE_DEPRECATED
 
index 2d0e95e..86379ba 100644 (file)
 #include "xbt/lib.h"
 #include "simgrid/platf_interface.h"
 
 #include "xbt/lib.h"
 #include "simgrid/platf_interface.h"
 
-extern xbt_lib_t host_lib;
-extern int ROUTING_HOST_LEVEL; //Routing level
-extern int  SURF_CPU_LEVEL;    //Surf cpu level
-extern int SURF_WKS_LEVEL;    //Surf workstation level
-extern int SIMIX_HOST_LEVEL;  //Simix level
-extern int  MSG_HOST_LEVEL;    //Msg level
-extern int  SD_HOST_LEVEL;    //Simdag level
-extern int  COORD_HOST_LEVEL;  //Coordinates level
-extern int NS3_HOST_LEVEL;    //host node for ns3
-
-extern xbt_lib_t link_lib;
-extern int SD_LINK_LEVEL;    //Simdag level
-extern int SURF_LINK_LEVEL;  //Surf level
-extern int NS3_LINK_LEVEL;    //link for ns3
-
-extern xbt_lib_t as_router_lib;
-extern int ROUTING_ASR_LEVEL;  //Routing level
-extern int COORD_ASR_LEVEL;  //Coordinates level
-extern int NS3_ASR_LEVEL;    //host node for ns3
-extern int ROUTING_PROP_ASR_LEVEL; //Properties for AS and router
-
-extern xbt_lib_t storage_lib;
-extern int ROUTING_STORAGE_LEVEL;        //Routing storage level
-extern int ROUTING_STORAGE_HOST_LEVEL;
-extern int SURF_STORAGE_LEVEL;
-
-extern xbt_lib_t storage_type_lib;
-extern int ROUTING_STORAGE_TYPE_LEVEL;   //Routing storage_type level
+XBT_PUBLIC(xbt_lib_t) host_lib;
+XBT_PUBLIC(int) ROUTING_HOST_LEVEL; //Routing level
+XBT_PUBLIC(int)  SURF_CPU_LEVEL;    //Surf cpu level
+XBT_PUBLIC(int) SURF_WKS_LEVEL;    //Surf workstation level
+XBT_PUBLIC(int) SIMIX_HOST_LEVEL;  //Simix level
+XBT_PUBLIC(int)  MSG_HOST_LEVEL;    //Msg level
+XBT_PUBLIC(int)  SD_HOST_LEVEL;    //Simdag level
+XBT_PUBLIC(int)  COORD_HOST_LEVEL;  //Coordinates level
+XBT_PUBLIC(int) NS3_HOST_LEVEL;    //host node for ns3
+
+XBT_PUBLIC(xbt_lib_t) link_lib;
+XBT_PUBLIC(int) SD_LINK_LEVEL;    //Simdag level
+XBT_PUBLIC(int) SURF_LINK_LEVEL;  //Surf level
+XBT_PUBLIC(int) NS3_LINK_LEVEL;    //link for ns3
+
+XBT_PUBLIC(xbt_lib_t) as_router_lib;
+XBT_PUBLIC(int) ROUTING_ASR_LEVEL;  //Routing level
+XBT_PUBLIC(int) COORD_ASR_LEVEL;  //Coordinates level
+XBT_PUBLIC(int) NS3_ASR_LEVEL;    //host node for ns3
+XBT_PUBLIC(int) ROUTING_PROP_ASR_LEVEL; //Properties for AS and router
+
+XBT_PUBLIC(xbt_lib_t) storage_lib;
+XBT_PUBLIC(int) ROUTING_STORAGE_LEVEL;        //Routing storage level
+XBT_PUBLIC(int) ROUTING_STORAGE_HOST_LEVEL;
+XBT_PUBLIC(int) SURF_STORAGE_LEVEL;
+
+XBT_PUBLIC(xbt_lib_t) storage_type_lib;
+XBT_PUBLIC(int) ROUTING_STORAGE_TYPE_LEVEL;   //Routing storage_type level
 
 /* The callbacks to register for the routing to work */
 void routing_AS_begin(sg_platf_AS_cbarg_t AS);
 
 /* The callbacks to register for the routing to work */
 void routing_AS_begin(sg_platf_AS_cbarg_t AS);
index a6db6fc..2d17bff 100644 (file)
@@ -313,12 +313,12 @@ XBT_PUBLIC_DATA(const xbt_running_ctx_t) __xbt_ex_ctx_initializer;
 /* the exception context */
 typedef xbt_running_ctx_t *(*xbt_running_ctx_fetcher_t) (void);
 XBT_PUBLIC_DATA(xbt_running_ctx_fetcher_t) __xbt_running_ctx_fetch;
 /* the exception context */
 typedef xbt_running_ctx_t *(*xbt_running_ctx_fetcher_t) (void);
 XBT_PUBLIC_DATA(xbt_running_ctx_fetcher_t) __xbt_running_ctx_fetch;
-extern xbt_running_ctx_t *__xbt_ex_ctx_default(void);
+XBT_PUBLIC( xbt_running_ctx_t *)__xbt_ex_ctx_default(void);
 
 /* the termination handler */
 typedef void (*ex_term_cb_t) (xbt_ex_t *);
 XBT_PUBLIC_DATA(ex_term_cb_t) __xbt_ex_terminate;
 
 /* the termination handler */
 typedef void (*ex_term_cb_t) (xbt_ex_t *);
 XBT_PUBLIC_DATA(ex_term_cb_t) __xbt_ex_terminate;
-extern void __xbt_ex_terminate_default(xbt_ex_t * e);
+XBT_PUBLIC( void )__xbt_ex_terminate_default(xbt_ex_t * e);
 
 /** @brief Introduce a block where exception may be dealed with 
  *  @hideinitializer
 
 /** @brief Introduce a block where exception may be dealed with 
  *  @hideinitializer
index ab21baf..529bfc6 100644 (file)
 #  define XBT_PUBLIC_DATA(type)       extern type
 
 /* Link against the DLL */
 #  define XBT_PUBLIC_DATA(type)       extern type
 
 /* Link against the DLL */
-#elif (defined(_WIN32) && !defined(DLL_EXPORT) && !defined(DLL_STATIC))
+#elif (defined(_XBT_WIN32) && !defined(DLL_EXPORT) && !defined(DLL_STATIC))
 #  define XBT_PUBLIC(type)              __declspec(dllimport) type
 #  define XBT_EXPORT_NO_IMPORT(type)    type
 #  define XBT_IMPORT_NO_EXPORT(type)    __declspec(dllimport) type
 #  define XBT_PUBLIC(type)              __declspec(dllimport) type
 #  define XBT_EXPORT_NO_IMPORT(type)    type
 #  define XBT_IMPORT_NO_EXPORT(type)    __declspec(dllimport) type
index 6963c4a..7490408 100644 (file)
 typedef struct mdesc *xbt_mheap_t;
 
 /* Allocate SIZE bytes of memory (and memset it to 0).  */
 typedef struct mdesc *xbt_mheap_t;
 
 /* Allocate SIZE bytes of memory (and memset it to 0).  */
-extern void *mmalloc(xbt_mheap_t md, size_t size);
+XBT_PUBLIC( void ) *mmalloc(xbt_mheap_t md, size_t size);
 
 /* Allocate SIZE bytes of memory (and don't mess with it) */
 void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size);
 
 /* Re-allocate the previously allocated block in void*, making the new block
    SIZE bytes long.  */
 
 /* Allocate SIZE bytes of memory (and don't mess with it) */
 void *mmalloc_no_memset(xbt_mheap_t mdp, size_t size);
 
 /* Re-allocate the previously allocated block in void*, making the new block
    SIZE bytes long.  */
-extern void *mrealloc(xbt_mheap_t md, void *ptr, size_t size);
+XBT_PUBLIC( void ) *mrealloc(xbt_mheap_t md, void *ptr, size_t size);
 
 /* Free a block allocated by `mmalloc', `mrealloc' or `mcalloc'.  */
 
 /* Free a block allocated by `mmalloc', `mrealloc' or `mcalloc'.  */
-extern void mfree(xbt_mheap_t md, void *ptr);
+XBT_PUBLIC( void ) mfree(xbt_mheap_t md, void *ptr);
 
 /* Allocate SIZE bytes allocated to ALIGNMENT bytes.  */
 
 /* Allocate SIZE bytes allocated to ALIGNMENT bytes.  */
-extern void *mmemalign(xbt_mheap_t md, size_t alignment, size_t size);
+XBT_PUBLIC( void ) *mmemalign(xbt_mheap_t md, size_t alignment, size_t size);
 
 /* Allocate SIZE bytes on a page boundary.  */
 
 /* Allocate SIZE bytes on a page boundary.  */
-extern void *mvalloc(xbt_mheap_t md, size_t size);
+XBT_PUBLIC( void ) *mvalloc(xbt_mheap_t md, size_t size);
 
 
-extern xbt_mheap_t xbt_mheap_new(int fd, void *baseaddr);
+XBT_PUBLIC( xbt_mheap_t ) xbt_mheap_new(int fd, void *baseaddr);
 
 
-extern void xbt_mheap_destroy_no_free(xbt_mheap_t md);
+XBT_PUBLIC( void ) xbt_mheap_destroy_no_free(xbt_mheap_t md);
 
 
-extern void *xbt_mheap_destroy(xbt_mheap_t md);
+XBT_PUBLIC( void ) *xbt_mheap_destroy(xbt_mheap_t md);
 
 /* return the heap used when NULL is passed as first argument to any mm* function */
 
 /* return the heap used when NULL is passed as first argument to any mm* function */
-extern xbt_mheap_t mmalloc_get_default_md(void);
+XBT_PUBLIC( xbt_mheap_t ) mmalloc_get_default_md(void);
 
 /* To change the heap used when using the legacy version malloc/free/realloc and such */
 void mmalloc_set_current_heap(xbt_mheap_t new_heap);
 
 /* To change the heap used when using the legacy version malloc/free/realloc and such */
 void mmalloc_set_current_heap(xbt_mheap_t new_heap);
index af66946..f3f5a44 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <xbt/misc.h>           /* XBT_PUBLIC */
 
 
 #include <xbt/misc.h>           /* XBT_PUBLIC */
 
-extern char *xbt_binary_name;
+XBT_PUBLIC(char *)xbt_binary_name;
 
 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);
index 691f238..63cff21 100644 (file)
@@ -13,8 +13,8 @@
 #include "xbt/RngStream.h"
 
 /* Module management functions */
 #include "xbt/RngStream.h"
 
 /* Module management functions */
-void sg_platf_init(void);
-void sg_platf_exit(void);
+XBT_PUBLIC(void) sg_platf_init(void);
+XBT_PUBLIC(void) sg_platf_exit(void);
 
 /* Managing the parsing callbacks */
 
 
 /* Managing the parsing callbacks */
 
@@ -42,43 +42,42 @@ typedef void (*sg_platf_mstorage_cb_t)(sg_platf_mstorage_cbarg_t);
 /* TUTORIAL: New TAG                         */
 
 typedef void (*sg_platf_gpu_cb_t)(sg_platf_gpu_cbarg_t);
 /* TUTORIAL: New TAG                         */
 
 typedef void (*sg_platf_gpu_cb_t)(sg_platf_gpu_cbarg_t);
-void sg_platf_gpu_add_cb(sg_platf_gpu_cb_t);
+XBT_PUBLIC(void) sg_platf_gpu_add_cb(sg_platf_gpu_cb_t);
 /* ***************************************** */
 
 /* ***************************************** */
 
-
-void sg_platf_host_add_cb(sg_platf_host_cb_t);
-void sg_platf_host_link_add_cb(sg_platf_host_link_cb_t);
-void sg_platf_router_add_cb(sg_platf_router_cb_t);
-void sg_platf_link_add_cb(sg_platf_link_cb_t);
-void sg_platf_peer_add_cb(sg_platf_peer_cb_t fct);
-void sg_platf_cluster_add_cb(sg_platf_cluster_cb_t fct);
-void sg_platf_cabinet_add_cb(sg_platf_cabinet_cb_t fct);
-void sg_platf_postparse_add_cb(void_f_void_t fct);
-void sg_platf_AS_begin_add_cb(sg_platf_AS_cb_t fct);
-void sg_platf_AS_end_add_cb(sg_platf_AS_cb_t fct);
-void sg_platf_prop_add_cb(sg_platf_prop_cb_t fct);
-
-void sg_platf_route_add_cb(sg_platf_route_cb_t);
-void sg_platf_ASroute_add_cb(sg_platf_route_cb_t);
-void sg_platf_bypassRoute_add_cb(sg_platf_route_cb_t);
-void sg_platf_bypassASroute_add_cb(sg_platf_route_cb_t);
-
-void sg_platf_trace_add_cb(sg_platf_trace_cb_t);
-void sg_platf_trace_connect_add_cb(sg_platf_trace_connect_cb_t);
-
-void sg_platf_storage_add_cb(sg_platf_storage_cb_t fct);
-void sg_platf_mstorage_add_cb(sg_platf_mstorage_cb_t fct);
-void sg_platf_storage_type_add_cb(sg_platf_storage_type_cb_t fct);
-void sg_platf_mount_add_cb(sg_platf_mount_cb_t fct);
+XBT_PUBLIC(void) sg_platf_host_add_cb(sg_platf_host_cb_t);
+XBT_PUBLIC(void) sg_platf_host_link_add_cb(sg_platf_host_link_cb_t);
+XBT_PUBLIC(void) sg_platf_router_add_cb(sg_platf_router_cb_t);
+XBT_PUBLIC(void) sg_platf_link_add_cb(sg_platf_link_cb_t);
+XBT_PUBLIC(void) sg_platf_peer_add_cb(sg_platf_peer_cb_t fct);
+XBT_PUBLIC(void) sg_platf_cluster_add_cb(sg_platf_cluster_cb_t fct);
+XBT_PUBLIC(void) sg_platf_cabinet_add_cb(sg_platf_cabinet_cb_t fct);
+XBT_PUBLIC(void) sg_platf_postparse_add_cb(void_f_void_t fct);
+XBT_PUBLIC(void) sg_platf_AS_begin_add_cb(sg_platf_AS_cb_t fct);
+XBT_PUBLIC(void) sg_platf_AS_end_add_cb(sg_platf_AS_cb_t fct);
+XBT_PUBLIC(void) sg_platf_prop_add_cb(sg_platf_prop_cb_t fct);
+
+XBT_PUBLIC(void) sg_platf_route_add_cb(sg_platf_route_cb_t);
+XBT_PUBLIC(void) sg_platf_ASroute_add_cb(sg_platf_route_cb_t);
+XBT_PUBLIC(void) sg_platf_bypassRoute_add_cb(sg_platf_route_cb_t);
+XBT_PUBLIC(void) sg_platf_bypassASroute_add_cb(sg_platf_route_cb_t);
+
+XBT_PUBLIC(void) sg_platf_trace_add_cb(sg_platf_trace_cb_t);
+XBT_PUBLIC(void) sg_platf_trace_connect_add_cb(sg_platf_trace_connect_cb_t);
+
+XBT_PUBLIC(void) sg_platf_storage_add_cb(sg_platf_storage_cb_t fct);
+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);
 
 /** \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>)
  */
-void surf_config_models_setup(void);
+XBT_PUBLIC(void) surf_config_models_setup(void);
 
 /* RngStream management functions */
 
 /* RngStream management functions */
-void sg_platf_rng_stream_init(unsigned long seed[6]);
-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);
 
 #endif                          /* SG_PLATF_INTERFACE_H */
 
 #endif                          /* SG_PLATF_INTERFACE_H */
index 9fd51c0..5445c62 100644 (file)
@@ -46,7 +46,7 @@ XBT_PUBLIC(lmm_variable_t) lmm_variable_new(lmm_system_t sys, void *id,
                                             double weight_value,
                                             double bound,
                                             int number_of_constraints);
                                             double weight_value,
                                             double bound,
                                             int number_of_constraints);
-void lmm_variable_free(lmm_system_t sys, lmm_variable_t var);
+XBT_PUBLIC(void) lmm_variable_free(lmm_system_t sys, lmm_variable_t var);
 XBT_PUBLIC(double) lmm_variable_getvalue(lmm_variable_t var);
 XBT_PUBLIC(double) lmm_variable_getbound(lmm_variable_t var);
 
 XBT_PUBLIC(double) lmm_variable_getvalue(lmm_variable_t var);
 XBT_PUBLIC(double) lmm_variable_getbound(lmm_variable_t var);
 
index 6a7a7a4..8ca62bb 100644 (file)
@@ -13,7 +13,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(simix_network, simix,
                                 "Logging specific to SIMIX (network)");
 
 static xbt_dict_t rdv_points = NULL;
                                 "Logging specific to SIMIX (network)");
 
 static xbt_dict_t rdv_points = NULL;
-unsigned long int smx_total_comms = 0;
+XBT_PUBLIC(unsigned long int) smx_total_comms = 0;
 
 static void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall);
 static void SIMIX_comm_copy_data(smx_action_t comm);
 
 static void SIMIX_waitany_remove_simcall_from_actions(smx_simcall_t simcall);
 static void SIMIX_comm_copy_data(smx_action_t comm);
index 92040f0..0a404f2 100644 (file)
@@ -25,8 +25,8 @@ int surfxml_bufferstack_size = 2048;
 
 static char *old_buff = NULL;
 
 
 static char *old_buff = NULL;
 
-unsigned int surfxml_buffer_stack_stack_ptr;
-unsigned int surfxml_buffer_stack_stack[1024];
+XBT_PUBLIC(unsigned int) surfxml_buffer_stack_stack_ptr;
+XBT_PUBLIC(unsigned int) surfxml_buffer_stack_stack[1024];
 
 
 void surfxml_bufferstack_push(int new)
 
 
 void surfxml_bufferstack_push(int new)
index 4fce4c6..a0c0b56 100644 (file)
@@ -263,16 +263,16 @@ struct mdesc {
 
 /* A default malloc descriptor for the single sbrk() managed region. */
 
 
 /* A default malloc descriptor for the single sbrk() managed region. */
 
-extern struct mdesc *__mmalloc_default_mdp;
+XBT_PUBLIC( struct mdesc ) *__mmalloc_default_mdp;
 
 /* Remap a mmalloc region that was previously mapped. */
 
 
 /* Remap a mmalloc region that was previously mapped. */
 
-extern void *__mmalloc_remap_core(xbt_mheap_t mdp);
+XBT_PUBLIC( void *)__mmalloc_remap_core(xbt_mheap_t mdp);
 
 /*  Get core for the memory region specified by MDP, using SIZE as the
     amount to either add to or subtract from the existing region.  Works
     like sbrk(), but using mmap(). */
 
 /*  Get core for the memory region specified by MDP, using SIZE as the
     amount to either add to or subtract from the existing region.  Works
     like sbrk(), but using mmap(). */
-extern void *mmorecore(struct mdesc *mdp, int size);
+XBT_PUBLIC( void *)mmorecore(struct mdesc *mdp, int size);
 
 /* Thread-safety (if the sem is already created)
  *
 
 /* Thread-safety (if the sem is already created)
  *
index bdd5613..3d32883 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "gras_stub_generator.h"
 #include <stdarg.h>
 
 #include "gras_stub_generator.h"
 #include <stdarg.h>
-extern char *xbt_binary_name;
+XBT_PUBLIC(char*)xbt_binary_name;
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(stubgen, gras, "Stub generator");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(stubgen, gras, "Stub generator");