#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;
-#ifdef __cplusplus
-extern "C" {
-#endif
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 {
/** 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(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) {
/* ***************************************** */
-#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
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 */
#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
void routing_cluster_add_backbone(void* bb);
-#ifdef __cplusplus
-}
-#endif
+SG_END_DECL()
#endif /* _SURF_SURF_H */
-/* 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
#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 */
-#ifdef __cplusplus
-extern "C" {
-#endif
typedef struct xbt_heap *xbt_heap_t;
XBT_PUBLIC(xbt_heap_t) xbt_heap_new(int init_size,
*,
int));
XBT_PUBLIC(void *) xbt_heap_remove(xbt_heap_t H, int i);
-#ifdef __cplusplus
-}
-#endif
/* @} */
+SG_END_DECL()
#endif /* _XBT_HEAP_H */
/* 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
#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);
-#ifdef __cplusplus
-}
-#endif
+
+SG_END_DECL()
#endif /* _XBT_MODULE_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(void) TRACE_add_start_function(void (*func)(void));
XBT_PUBLIC(void) TRACE_add_end_function(void (*func)(void));
-#ifdef __cplusplus
-}
-#endif
+SG_END_DECL()
/* 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
#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);
/* ***************************************** */
/* 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);
/* ***************************************** */
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>)
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 */
/*** 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;
void sg_config_init(int *argc, char **argv);
void sg_config_finalize(void);
-#ifdef __cplusplus
-}
-#endif
+SG_END_DECL()
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(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 */
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);
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 */
/*******************************************/
/*** 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(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 **************************/
-/* 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
#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);
XBT_PUBLIC(void) tmgr_finalize(void);
-#ifdef __cplusplus
-}
-#endif
+SG_END_DECL()
#endif /* _SURF_TMGR_H */
#ifdef HAVE_TRACING
+SG_BEGIN_DECL()
+
/* Need to define function drand48 for Windows */
#ifdef _WIN32
# define drand48() (rand()/(RAND_MAX + 1.0))
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);
int num_processes;
} s_instr_extra_data_t;
-#ifdef __cplusplus
-}
-#endif
-
+SG_END_DECL()
#endif /* HAVE_TRACING */
#include "instr/jedule/jedule_sd_binding.h"
#endif
-
-
-
-
-
#endif /* INSTR_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;
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_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
#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
};
} 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)
-#ifdef __cplusplus
-}
-#endif
/******************************** General *************************************/
extern const char *simcall_types[];
extern simcall_handler_t simcall_table[];
+SG_END_DECL()
+
#endif
-/* 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
#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
-/* 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
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);
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
extern xbt_dynar_t surf_path;
-#ifdef __cplusplus
extern "C" {
-#endif
XBT_PUBLIC(double) surf_get_clock(void);
-#ifdef __cplusplus
}
-#endif
extern double sg_sender_gap;
XBT_PUBLIC(int) SURF_CPU_LEVEL; //Surf cpu level
#define NO_MAX_DURATION -1.0
-#ifdef __cplusplus
-extern "C" {
-#endif
+SG_BEGIN_DECL()
extern xbt_dict_t watched_hosts_lib;
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 */