XBT_PUBLIC(gras_datadesc_type_t)
gras_datadesc_dynar(gras_datadesc_type_t elm_t,
- void_f_pvoid_t *free_func);
+ void_f_pvoid_t free_func);
XBT_PUBLIC(gras_datadesc_type_t)
gras_datadesc_matrix(gras_datadesc_type_t elm_t,
- void_f_pvoid_t * const free_f);
+ void_f_pvoid_t const free_f);
/*********************************
* Change stuff within datadescs *
/* Functions module implementor should use */
XBT_PUBLIC(void) gras_module_add(const char *name, unsigned int data_size, int *ID,
- void_f_void_t *init_f, void_f_void_t *exit_f,
- void_f_pvoid_t *join_f, void_f_pvoid_t *leave_f) ;
+ void_f_void_t init_f, void_f_void_t exit_f,
+ void_f_pvoid_t join_f, void_f_pvoid_t leave_f) ;
XBT_PUBLIC(void*)gras_moddata_by_id(unsigned int ID);
#include "surf/surfxml.h"
#include "xbt/function_types.h"
/* Entry-point of the surfxml parser. */
-XBT_PUBLIC_DATA(int_f_void_t *) surf_parse;
+XBT_PUBLIC_DATA(int_f_void_t) surf_parse;
/* Hook for the different tags. They can be redefined at will whereas
the versions without the _fun can't. */
-XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_platform_description_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_platform_description_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_cpu_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_cpu_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_router_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_router_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_network_link_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_network_link_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_route_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_route_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_route_element_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_route_element_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_process_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_process_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) STag_surfxml_argument_fun;
-XBT_PUBLIC_DATA(void_f_void_t *) ETag_surfxml_argument_fun;
+XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_platform_description_fun;
+XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_platform_description_fun;
+XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_cpu_fun;
+XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_cpu_fun;
+XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_router_fun;
+XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_router_fun;
+XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_network_link_fun;
+XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_network_link_fun;
+XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_route_fun;
+XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_route_fun;
+XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_route_element_fun;
+XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_route_element_fun;
+XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_process_fun;
+XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_process_fun;
+XBT_PUBLIC_DATA(void_f_void_t) STag_surfxml_argument_fun;
+XBT_PUBLIC_DATA(void_f_void_t) ETag_surfxml_argument_fun;
XBT_PUBLIC(void) surf_parse_open(const char *file);
XBT_PUBLIC(void) surf_parse_close(void);
* @{
*/
- XBT_PUBLIC(void) xbt_dict_set(xbt_dict_t dict, const char *key, void *data, void_f_pvoid_t *free_ctn);
+ XBT_PUBLIC(void) xbt_dict_set(xbt_dict_t dict, const char *key, void *data, void_f_pvoid_t free_ctn);
XBT_PUBLIC(void*) xbt_dict_get(xbt_dict_t dict,const char *key);
XBT_PUBLIC(void*) xbt_dict_get_or_null(xbt_dict_t dict, const char *key);
XBT_PUBLIC(void) xbt_dict_set_ext(xbt_dict_t dict,
const char *key, int key_len,
void *data,
- void_f_pvoid_t *free_ctn);
+ void_f_pvoid_t free_ctn);
XBT_PUBLIC(void*) xbt_dict_get_ext(xbt_dict_t dict, const char *key, int key_len);
XBT_PUBLIC(void) xbt_dict_remove_ext(xbt_dict_t dict, const char *key, int key_len);
XBT_PUBLIC(void)
xbt_multidict_set_ext(xbt_dict_t mdict,
xbt_dynar_t keys, xbt_dynar_t lens,
- void *data,void_f_pvoid_t *free_ctn);
+ void *data,void_f_pvoid_t free_ctn);
/*----[ xbt_multidict_get ]--------------------------------------------------*/
XBT_PUBLIC(void*) xbt_multidict_get (xbt_dict_t mdict, xbt_dynar_t keys);
XBT_PUBLIC(xbt_dynar_t) xbt_dynar_new(const unsigned long elm_size,
- void_f_pvoid_t * const free_f);
+ void_f_pvoid_t const free_f);
XBT_PUBLIC(xbt_dynar_t) xbt_dynar_new_sync(const unsigned long elm_size,
- void_f_pvoid_t * const free_f);
+ void_f_pvoid_t const free_f);
XBT_PUBLIC(void) xbt_dynar_free(xbt_dynar_t *dynar);
XBT_PUBLIC(void) xbt_dynar_free_voidp(void *dynar);
XBT_PUBLIC(void) xbt_dynar_free_container(xbt_dynar_t *dynar);
XBT_PUBLIC(void) xbt_dynar_pop (xbt_dynar_t const dynar, void *const dst);
XBT_PUBLIC(void) xbt_dynar_unshift (xbt_dynar_t const dynar, const void *src);
XBT_PUBLIC(void) xbt_dynar_shift (xbt_dynar_t const dynar, void *const dst);
- XBT_PUBLIC(void) xbt_dynar_map (const xbt_dynar_t dynar, void_f_pvoid_t * const op);
+ XBT_PUBLIC(void) xbt_dynar_map (const xbt_dynar_t dynar, void_f_pvoid_t const op);
/** @} */
/** @defgroup XBT_dynar_ctn Direct manipulation to the dynars content
SG_BEGIN_DECL()
- typedef void (void_f_ppvoid_t)(void**);
- typedef void (void_f_pvoid_t) (void*);
- typedef void* (pvoid_f_void_t)(void);
- typedef void* (pvoid_f_pvoid_t)(void*);
- typedef void (void_f_void_t) (void);
+ typedef void (*void_f_ppvoid_t)(void**);
+ typedef void (*void_f_pvoid_t) (void*);
+ typedef void* (*pvoid_f_void_t)(void);
+ typedef void* (*pvoid_f_pvoid_t)(void*);
+ typedef void (*void_f_void_t) (void);
- typedef int (int_f_void_t) (void);
+ typedef int (*int_f_void_t) (void);
- typedef int (int_f_pvoid_pvoid_t) (void*,void*);
+ typedef int (*int_f_pvoid_pvoid_t) (void*,void*);
typedef int (*xbt_main_func_t)(int argc, char *argv[]);
- typedef void* (*pvoid_pf_void_t)(void);
- typedef void (*void_fp_pvoid_t)(void*);
SG_END_DECL()
#endif /* XBT_FUNCTION_TYPE_H */
XBT_PUBLIC(double*) xbt_graph_get_length_matrix(xbt_graph_t g);
XBT_PUBLIC(void) xbt_graph_free_node(xbt_graph_t g, xbt_node_t n,
- void_f_pvoid_t *node_free_function , void_f_pvoid_t *edge_free_function);
+ void_f_pvoid_t node_free_function , void_f_pvoid_t edge_free_function);
XBT_PUBLIC(void) xbt_graph_free_edge(xbt_graph_t g, xbt_edge_t e,
- void_f_pvoid_t *free_function);
+ void_f_pvoid_t free_function);
XBT_PUBLIC(void) xbt_graph_free_graph(xbt_graph_t g,
- void_f_pvoid_t *node_free_function,
- void_f_pvoid_t *edge_free_function,
- void_f_pvoid_t *graph_free_function);
+ void_f_pvoid_t node_free_function,
+ void_f_pvoid_t edge_free_function,
+ void_f_pvoid_t graph_free_function);
XBT_PUBLIC(int) __xbt_find_in_dynar(xbt_dynar_t dynar, void *p);
#include "xbt/graphxml.h"
/* Entry-point of the graphxml parser. */
-extern int_f_void_t *xbt_graph_parse;
+extern int_f_void_t xbt_graph_parse;
/* Hook for the different tags. They can be redefined at will whereas
the versions without the _fun can't. */
-extern void_f_void_t *STag_graphxml_graph_fun;
-extern void_f_void_t *ETag_graphxml_graph_fun;
-extern void_f_void_t *STag_graphxml_node_fun;
-extern void_f_void_t *ETag_graphxml_node_fun;
-extern void_f_void_t *STag_graphxml_edge_fun;
-extern void_f_void_t *ETag_graphxml_edge_fun;
+extern void_f_void_t STag_graphxml_graph_fun;
+extern void_f_void_t ETag_graphxml_graph_fun;
+extern void_f_void_t STag_graphxml_node_fun;
+extern void_f_void_t ETag_graphxml_node_fun;
+extern void_f_void_t STag_graphxml_edge_fun;
+extern void_f_void_t ETag_graphxml_edge_fun;
XBT_PUBLIC(void) xbt_graph_parse_open(const char *file);
XBT_PUBLIC(void) xbt_graph_parse_close(void);
/* @brief heap datatype */
typedef struct xbt_heap *xbt_heap_t;
-XBT_PUBLIC(xbt_heap_t) xbt_heap_new(int num, void_f_pvoid_t * const free_func);
+XBT_PUBLIC(xbt_heap_t) xbt_heap_new(int num, void_f_pvoid_t const free_func);
XBT_PUBLIC(void) xbt_heap_free(xbt_heap_t H);
XBT_PUBLIC(int) xbt_heap_size(xbt_heap_t H);
unsigned long elmsize;
char *data;
- void_f_pvoid_t *free_f;
+ void_f_pvoid_t free_f;
} s_xbt_matrix_t, *xbt_matrix_t;
XBT_PUBLIC(xbt_matrix_t) xbt_matrix_new(int lines, int rows,
const unsigned long elmsize,
- void_f_pvoid_t * const free_f);
+ void_f_pvoid_t const free_f);
XBT_PUBLIC(xbt_matrix_t) xbt_matrix_new_sub(xbt_matrix_t from,
int lsize, int rsize,
int lpos, int rpos,
- pvoid_f_pvoid_t *const cpy_f);
+ pvoid_f_pvoid_t const cpy_f);
XBT_PUBLIC(void) xbt_matrix_free(xbt_matrix_t matrix);
XBT_PUBLIC(void) xbt_matrix_free_voidp(void *d);
int lsize, int rsize,
int lpos_dst,int rpos_dst,
int lpos_src,int rpos_src,
- pvoid_f_pvoid_t *const cpy_f);
+ pvoid_f_pvoid_t const cpy_f);
XBT_PUBLIC(void) xbt_matrix_dump(xbt_matrix_t matrix, const char *name, int coords,
void_f_pvoid_t display_fun);
* @{
*/
-XBT_PUBLIC(void) xbt_set_add (xbt_set_t set, xbt_set_elm_t elm, void_f_pvoid_t *free_func);
+XBT_PUBLIC(void) xbt_set_add (xbt_set_t set, xbt_set_elm_t elm, void_f_pvoid_t free_func);
XBT_PUBLIC(void) xbt_set_remove (xbt_set_t set, xbt_set_elm_t elm);
XBT_PUBLIC(void) xbt_set_remove_by_name (xbt_set_t set, const char *key);
XBT_PUBLIC(void) xbt_set_remove_by_name_ext (xbt_set_t set, const char *key, int key_len);
/** \brief Thread data type (opaque structure) */
typedef struct s_xbt_thread_ *xbt_thread_t;
- XBT_PUBLIC(xbt_thread_t) xbt_thread_create(const char *name, void_fp_pvoid_t start_routine,void* param);
+ XBT_PUBLIC(xbt_thread_t) xbt_thread_create(const char *name, void_f_pvoid_t start_routine,void* param);
XBT_PUBLIC(void) xbt_thread_exit();
XBT_PUBLIC(xbt_thread_t) xbt_thread_self(void);
XBT_PUBLIC(const char*) xbt_thread_name(xbt_thread_t t);
SG_BEGIN_DECL()
/* Get the PID of the current process */
- XBT_PUBLIC_DATA(int_f_void_t*) xbt_getpid;
+ XBT_PUBLIC_DATA(int_f_void_t) xbt_getpid;
SG_END_DECL()
*/
gras_datadesc_type_t
gras_datadesc_dynar(gras_datadesc_type_t elm_t,
- void_f_pvoid_t *free_func) {
+ void_f_pvoid_t free_func) {
char *buffname;
gras_datadesc_type_t res;
}
gras_datadesc_type_t
gras_datadesc_matrix(gras_datadesc_type_t elm_t,
- void_f_pvoid_t * const free_f) {
+ void_f_pvoid_t const free_f) {
char *buffname;
gras_datadesc_type_t res;
XBT_OUT;
}
-static void add_free_f(xbt_dynar_t dynar,void_f_pvoid_t* free_f) {
+static void add_free_f(xbt_dynar_t dynar,void_f_pvoid_t free_f) {
s_identifier_t former,ref;
memset(&ref,0,sizeof(ref));
if (!storage)
PARSE_ERROR1("value for free_f annotation of field %s is not a known constant",identifier.name);
if (identifier.tm.is_matrix == -1) {
- add_free_f(identifiers,*(void_f_pvoid_t**)storage);
+ add_free_f(identifiers,*(void_f_pvoid_t*)storage);
identifier.tm.is_matrix = 0;
} else if (identifier.tm.is_dynar == -1) {
- add_free_f(identifiers,*(void_f_pvoid_t**)storage);
+ add_free_f(identifiers,*(void_f_pvoid_t*)storage);
identifier.tm.is_dynar = 0;
} else {
PARSE_ERROR1("free_f annotation only accepted for dynars and matrices which subtype is already declared (field %s)",
typedef struct {
double expiry;
double period;
- void_f_void_t *action;
+ void_f_void_t action;
int repeat;
} s_gras_timer_t, *gras_timer_t;
DEBUG2("Action %p expires in %f", timer->action, untilthis);
if (untilthis <= 0.0) {
- void_f_void_t *action = timer->action;
+ void_f_void_t action = timer->action;
DEBUG5("[%.0f] Serve %s action %p (%f<%f)",gras_os_time(),
timer->repeat ? "repetitive" : "delayed", timer->action,
DEBUG2("[%.0f] Remove %p now that it's done", gras_os_time(), timer->action);
xbt_dynar_cursor_rm(pd->timers, &cursor);
}
- action();
+ (*action)();
return 0.0;
} else if (untilthis < untilnext || untilnext == -1) {
untilnext = untilthis;
loading/unloading */
int *p_id; /* where the module stores the libdata ID (a global somewhere), to tweak it on need */
- void_f_void_t *init_f; /* First time the module is referenced. */
- void_f_void_t *exit_f; /* When last process referencing it stops doing so. */
- void_f_pvoid_t *join_f; /* Called by each process in initialization phase (init_f called once for all processes) */
- void_f_pvoid_t *leave_f; /* Called by each process in finalization phase. Should free moddata passed */
+ void_f_void_t init_f; /* First time the module is referenced. */
+ void_f_void_t exit_f; /* When last process referencing it stops doing so. */
+ void_f_pvoid_t join_f; /* Called by each process in initialization phase (init_f called once for all processes) */
+ void_f_pvoid_t leave_f; /* Called by each process in finalization phase. Should free moddata passed */
} s_gras_module_t, *gras_module_t;
static xbt_set_t _gras_modules = NULL; /* content: s_gras_module_t */
*/
void gras_module_add(const char *name, unsigned int datasize, int *ID,
- void_f_void_t *init_f, void_f_void_t *exit_f,
- void_f_pvoid_t *join_f, void_f_pvoid_t *leave_f) {
+ void_f_void_t init_f, void_f_void_t exit_f,
+ void_f_pvoid_t join_f, void_f_pvoid_t leave_f) {
gras_module_t mod=NULL;
xbt_ex_t e;
volatile int found = 0;
/* Functions to handle gras_procdata_t->libdata cells*/
typedef struct {
char *name;
- pvoid_f_void_t *constructor;
- void_f_pvoid_t *destructor;
+ pvoid_f_void_t constructor;
+ void_f_pvoid_t destructor;
} s_gras_procdata_fabric_t, *gras_procdata_fabric_t;
static xbt_dynar_t _gras_procdata_fabrics = NULL; /* content: s_gras_procdata_fabric_t */
THROW1(unknown_error,0,"MayDay: two modules use '%s' as libdata name", fab.name);
/* Add the data in place, after some more sanity checking */
- elem = (fab.constructor)();
+ elem = (*fab.constructor)();
if (elem->name_len && elem->name_len != strlen(elem->name)) {
elem->name_len = strlen(elem->name);
WARN1("Module '%s' constructor is borken: it does not set elem->name_len",
* int argc, char **argv: parameters passed to code
*
* */
-typedef void *(smx_creation_func_t)(/*name*/ const char *,
+typedef void *(*smx_creation_func_t)(/*name*/ const char *,
/*code*/ xbt_main_func_t,
/*userdata*/ void *,
/*hostname*/ char *,
/* argc */ int,
/* argv */ char **);
-XBT_PUBLIC(void) SIMIX_function_register_process_create(smx_creation_func_t *function);
-XBT_PUBLIC(void) SIMIX_function_register_process_kill(void_f_pvoid_t *function);
-XBT_PUBLIC(void) SIMIX_function_register_process_cleanup(void_f_pvoid_t *function);
+XBT_PUBLIC(void) SIMIX_function_register_process_create(smx_creation_func_t function);
+XBT_PUBLIC(void) SIMIX_function_register_process_kill(void_f_pvoid_t function);
+XBT_PUBLIC(void) SIMIX_function_register_process_cleanup(void_f_pvoid_t function);
/************************** Host handling ***********************************/
smx_process_t current_process;
xbt_dict_t registered_functions;
- smx_creation_func_t *create_process_function;
- void_f_pvoid_t *kill_process_function;
- void_f_pvoid_t *cleanup_process_function;
+ smx_creation_func_t create_process_function;
+ void_f_pvoid_t kill_process_function;
+ void_f_pvoid_t cleanup_process_function;
} s_SIMIX_Global_t, *SIMIX_Global_t;
extern SIMIX_Global_t simix_global;
if (simix_global->create_process_function)
process =
- simix_global->create_process_function(parse_argv[0], parse_code,
+ (*simix_global->create_process_function)(parse_argv[0], parse_code,
NULL, parse_host,
parse_argc, parse_argv);
else
* \param function Create process function
*
*/
-void SIMIX_function_register_process_create(smx_creation_func_t * function)
+void SIMIX_function_register_process_create(smx_creation_func_t function)
{
xbt_assert0((simix_global->create_process_function == NULL),
"Data already set");
* \param function Kill process function
*
*/
-void SIMIX_function_register_process_kill(void_f_pvoid_t * function)
+void SIMIX_function_register_process_kill(void_f_pvoid_t function)
{
xbt_assert0((simix_global->kill_process_function == NULL),
"Data already set");
* \param function cleanup process function
*
*/
-void SIMIX_function_register_process_cleanup(void_f_pvoid_t * function)
+void SIMIX_function_register_process_cleanup(void_f_pvoid_t function)
{
simix_global->cleanup_process_function = function;
}
return;
}
-void_f_void_t *STag_surfxml_platform_description_fun = nil_function;
-void_f_void_t *ETag_surfxml_platform_description_fun = nil_function;
-void_f_void_t *STag_surfxml_cpu_fun = nil_function;
-void_f_void_t *ETag_surfxml_cpu_fun = nil_function;
-void_f_void_t *STag_surfxml_router_fun = nil_function;
-void_f_void_t *ETag_surfxml_router_fun = nil_function;
-void_f_void_t *STag_surfxml_network_link_fun = nil_function;
-void_f_void_t *ETag_surfxml_network_link_fun = nil_function;
-void_f_void_t *STag_surfxml_route_fun = nil_function;
-void_f_void_t *ETag_surfxml_route_fun = nil_function;
-void_f_void_t *STag_surfxml_route_element_fun = nil_function;
-void_f_void_t *ETag_surfxml_route_element_fun = nil_function;
-void_f_void_t *STag_surfxml_process_fun = nil_function;
-void_f_void_t *ETag_surfxml_process_fun = nil_function;
-void_f_void_t *STag_surfxml_argument_fun = nil_function;
-void_f_void_t *ETag_surfxml_argument_fun = nil_function;
+void_f_void_t STag_surfxml_platform_description_fun = nil_function;
+void_f_void_t ETag_surfxml_platform_description_fun = nil_function;
+void_f_void_t STag_surfxml_cpu_fun = nil_function;
+void_f_void_t ETag_surfxml_cpu_fun = nil_function;
+void_f_void_t STag_surfxml_router_fun = nil_function;
+void_f_void_t ETag_surfxml_router_fun = nil_function;
+void_f_void_t STag_surfxml_network_link_fun = nil_function;
+void_f_void_t ETag_surfxml_network_link_fun = nil_function;
+void_f_void_t STag_surfxml_route_fun = nil_function;
+void_f_void_t ETag_surfxml_route_fun = nil_function;
+void_f_void_t STag_surfxml_route_element_fun = nil_function;
+void_f_void_t ETag_surfxml_route_element_fun = nil_function;
+void_f_void_t STag_surfxml_process_fun = nil_function;
+void_f_void_t ETag_surfxml_process_fun = nil_function;
+void_f_void_t STag_surfxml_argument_fun = nil_function;
+void_f_void_t ETag_surfxml_argument_fun = nil_function;
YY_BUFFER_STATE surf_input_buffer;
FILE *surf_file_to_parse;
"Last, do not forget to also update your values for "
"the calls to MSG_task_create (if any).");
- STag_surfxml_platform_description_fun();
+ (*STag_surfxml_platform_description_fun)();
}
void ETag_surfxml_platform_description(void)
{
- ETag_surfxml_platform_description_fun();
+ (*ETag_surfxml_platform_description_fun)();
}
void STag_surfxml_cpu(void)
{
- STag_surfxml_cpu_fun();
+ (*STag_surfxml_cpu_fun)();
}
void ETag_surfxml_cpu(void)
{
- ETag_surfxml_cpu_fun();
+ (*ETag_surfxml_cpu_fun)();
}
void STag_surfxml_router(void)
{
- STag_surfxml_router_fun();
+ (*STag_surfxml_router_fun)();
}
void ETag_surfxml_router(void)
{
- ETag_surfxml_router_fun();
+ (*ETag_surfxml_router_fun)();
}
void STag_surfxml_network_link(void)
{
- STag_surfxml_network_link_fun();
+ (*STag_surfxml_network_link_fun)();
}
void ETag_surfxml_network_link(void)
{
- ETag_surfxml_network_link_fun();
+ (*ETag_surfxml_network_link_fun)();
}
void STag_surfxml_route(void)
{
- STag_surfxml_route_fun();
+ (*STag_surfxml_route_fun)();
}
void ETag_surfxml_route(void)
{
- ETag_surfxml_route_fun();
+ (*ETag_surfxml_route_fun)();
}
void STag_surfxml_route_element(void)
{
- STag_surfxml_route_element_fun();
+ (*STag_surfxml_route_element_fun)();
}
void ETag_surfxml_route_element(void)
{
- ETag_surfxml_route_element_fun();
+ (*ETag_surfxml_route_element_fun)();
}
void STag_surfxml_process(void)
{
- STag_surfxml_process_fun();
+ (*STag_surfxml_process_fun)();
}
void ETag_surfxml_process(void)
{
- ETag_surfxml_process_fun();
+ (*ETag_surfxml_process_fun)();
}
void STag_surfxml_argument(void)
{
- STag_surfxml_argument_fun();
+ (*STag_surfxml_argument_fun)();
}
void ETag_surfxml_argument(void)
{
- ETag_surfxml_argument_fun();
+ (*ETag_surfxml_argument_fun)();
}
void surf_parse_open(const char *file)
return surf_parse_lex();
}
-int_f_void_t *surf_parse = _surf_parse;
+int_f_void_t surf_parse = _surf_parse;
void surf_parse_get_double(double *value, const char *string)
{
char **argv;
/* Init/exit functions */
- void_f_pvoid_t *startup_func;
+ void_f_pvoid_t startup_func;
void *startup_arg;
- void_f_pvoid_t *cleanup_func;
+ void_f_pvoid_t cleanup_func;
void *cleanup_arg;
int iwannadie; /* Set to true by the context when it wants to commit suicide */
* Set the \a data in the structure under the \a key, which can be any kind
* of data, as long as its length is provided in \a key_len.
*/
-void xbt_dict_set_ext(xbt_dict_t dict,
+void xbt_dict_set_ext(xbt_dict_t dict,
const char *key,
int key_len,
void *data,
- void_f_pvoid_t *free_ctn) {
+ void_f_pvoid_t free_ctn) {
unsigned int hash_code;
xbt_dictelm_t current, previous = NULL;
* set the \a data in the structure under the \a key, which is a
* null terminated string.
*/
-void xbt_dict_set(xbt_dict_t dict,
+void xbt_dict_set(xbt_dict_t dict,
const char *key,
void *data,
- void_f_pvoid_t *free_ctn) {
+ void_f_pvoid_t free_ctn) {
xbt_assert(dict);
*/
void xbt_dict_dump(xbt_dict_t dict,
- void_f_pvoid_t *output) {
+ void_f_pvoid_t output) {
int i;
xbt_dictelm_t element;
printf("Dict %p:\n", dict);
while (element != NULL) {
printf("%s -> ", element->key);
if (output != NULL) {
- output(element->content);
+ (*output)(element->content);
}
printf("\n");
element = element->next;
void
xbt_multidict_set_ext(xbt_dict_t mdict,
xbt_dynar_t keys, xbt_dynar_t lens,
- void *data, void_f_pvoid_t *free_ctn) {
+ void *data, void_f_pvoid_t free_ctn) {
xbt_ex_t e;
xbt_dict_t thislevel,nextlevel=NULL;
void
xbt_multidict_set(xbt_dict_t mdict,
xbt_dynar_t keys,
- void *data, void_f_pvoid_t *free_ctn) {
+ void *data, void_f_pvoid_t free_ctn) {
xbt_dynar_t lens = xbt_dynar_new(sizeof(unsigned long int),NULL);
int i;
xbt_ex_t e;
char *key;
int key_len;
void *content;
- void_f_pvoid_t *free_f;
+ void_f_pvoid_t free_f;
xbt_dictelm_t next;
} s_xbt_dictelm_t;
"dynar %p is empty", dynar)
static void _dynar_map(const xbt_dynar_t dynar,
- void_f_pvoid_t * const op);
+ void_f_pvoid_t const op);
static XBT_INLINE
void _xbt_clear_mem(void * const ptr,
*/
xbt_dynar_t
xbt_dynar_new(const unsigned long elmsize,
- void_f_pvoid_t * const free_f) {
+ void_f_pvoid_t const free_f) {
xbt_dynar_t dynar = xbt_new0(s_xbt_dynar_t,1);
*/
xbt_dynar_t
xbt_dynar_new_sync(const unsigned long elmsize,
- void_f_pvoid_t * const free_f) {
+ void_f_pvoid_t const free_f) {
xbt_dynar_t res = xbt_dynar_new(elmsize,free_f);
res->mutex = xbt_mutex_init();
return res;
}
static void _dynar_map(const xbt_dynar_t dynar,
- void_f_pvoid_t * const op) {
+ void_f_pvoid_t const op) {
char elm[SIZEOF_MAX];
const unsigned long used = dynar->used;
unsigned long i = 0;
*/
void
xbt_dynar_map(const xbt_dynar_t dynar,
- void_f_pvoid_t * const op) {
+ void_f_pvoid_t const op) {
_dynar_lock(dynar);
_sanity_check_dynar(dynar);
unsigned long used;
unsigned long elmsize;
void *data;
- void_f_pvoid_t *free_f;
+ void_f_pvoid_t free_f;
xbt_mutex_t mutex;
} s_xbt_dynar_t;
* Free the graph structure.
*/
void xbt_graph_free_graph(xbt_graph_t g,
- void_f_pvoid_t * node_free_function,
- void_f_pvoid_t * edge_free_function,
- void_f_pvoid_t * graph_free_function)
+ void_f_pvoid_t node_free_function,
+ void_f_pvoid_t edge_free_function,
+ void_f_pvoid_t graph_free_function)
{
int cursor = 0;
xbt_node_t node = NULL;
xbt_dynar_foreach(g->edges, cursor, edge)
free(edge);
xbt_dynar_free(&(g->edges));
- if(graph_free_function) (*graph_free_function)(g->data);
+ if(graph_free_function)
+ (*graph_free_function)(g->data);
free(g);
return;
/** @brief remove the given node from the given graph */
void xbt_graph_free_node(xbt_graph_t g, xbt_node_t n,
- void_f_pvoid_t * node_free_function,
- void_f_pvoid_t * edge_free_function)
+ void_f_pvoid_t node_free_function,
+ void_f_pvoid_t edge_free_function)
{
unsigned long nbr;
int i;
}
if ((node_free_function) && (n->data))
- node_free_function(n->data);
+ (*node_free_function)(n->data);
cursor = 0;
xbt_dynar_foreach(g->nodes, cursor, node)
/** @brief remove the given edge from the given graph */
void xbt_graph_free_edge(xbt_graph_t g, xbt_edge_t e,
- void_f_pvoid_t *free_function)
+ void_f_pvoid_t free_function)
{
int idx;
int cursor = 0;
/** @brief Import a graph from a file following the GraphXML format */
xbt_graph_t xbt_graph_read(const char *filename,
- void *(node_label_and_data) (xbt_node_t,
+ void *(*node_label_and_data) (xbt_node_t,
const char *,
const char *),
- void *(edge_label_and_data) (xbt_edge_t,
+ void *(*edge_label_and_data) (xbt_edge_t,
const char *,
const char *))
{
return;
}
-void_f_void_t *STag_graphxml_graph_fun = nil_function;
-void_f_void_t *ETag_graphxml_graph_fun = nil_function;
-void_f_void_t *STag_graphxml_node_fun = nil_function;
-void_f_void_t *ETag_graphxml_node_fun = nil_function;
-void_f_void_t *STag_graphxml_edge_fun = nil_function;
-void_f_void_t *ETag_graphxml_edge_fun = nil_function;
+void_f_void_t STag_graphxml_graph_fun = nil_function;
+void_f_void_t ETag_graphxml_graph_fun = nil_function;
+void_f_void_t STag_graphxml_node_fun = nil_function;
+void_f_void_t ETag_graphxml_node_fun = nil_function;
+void_f_void_t STag_graphxml_edge_fun = nil_function;
+void_f_void_t ETag_graphxml_edge_fun = nil_function;
YY_BUFFER_STATE xbt_graph_input_buffer;
FILE *xbt_graph_file_to_parse;
void STag_graphxml_graph(void)
{
- STag_graphxml_graph_fun();
+ (*STag_graphxml_graph_fun)();
}
void ETag_graphxml_graph(void)
{
- ETag_graphxml_graph_fun();
+ (*ETag_graphxml_graph_fun)();
}
void STag_graphxml_node(void)
{
- STag_graphxml_node_fun();
+ (*STag_graphxml_node_fun)();
}
void ETag_graphxml_node(void)
{
- ETag_graphxml_node_fun();
+ (*ETag_graphxml_node_fun)();
}
void STag_graphxml_edge(void)
{
- STag_graphxml_edge_fun();
+ (*STag_graphxml_edge_fun)();
}
void ETag_graphxml_edge(void)
{
- ETag_graphxml_edge_fun();
+ (*ETag_graphxml_edge_fun)();
}
return xbt_graph_parse_lex();
}
-int_f_void_t *xbt_graph_parse = _xbt_graph_parse;
+int_f_void_t xbt_graph_parse = _xbt_graph_parse;
void xbt_graph_parse_get_double(double *value,const char *string)
{
*
* Creates a new heap.
*/
-xbt_heap_t xbt_heap_new(int init_size, void_f_pvoid_t * const free_func)
+xbt_heap_t xbt_heap_new(int init_size, void_f_pvoid_t const free_func)
{
xbt_heap_t H = xbt_new0(struct xbt_heap, 1);
H->size = init_size;
int i;
if (H->free)
for (i = 0; i < H->count; i++)
- H->free(H->items[i].content);
+ (*H->free)(H->items[i].content);
free(H->items);
free(H);
return;
int size;
int count;
xbt_heapItem_t items;
- void_f_pvoid_t *free;
+ void_f_pvoid_t free;
} s_xbt_heap_t;
#define PARENT(i) i/2
int current_size; /* number of objects currently stored */
void **objects; /* objects stored by the mallocator and available for the user */
int max_size; /* maximum number of objects */
- pvoid_f_void_t *new_f; /* function to call when we are running out of objects */
- void_f_pvoid_t *free_f; /* function to call when we have got too many objects */
- void_f_pvoid_t *reset_f; /* function to call when an object is released by the user */
+ pvoid_f_void_t new_f; /* function to call when we are running out of objects */
+ void_f_pvoid_t free_f; /* function to call when we have got too many objects */
+ void_f_pvoid_t reset_f; /* function to call when an object is released by the user */
} s_xbt_mallocator_t;
#endif
*/
void xbt_set_add (xbt_set_t set,
xbt_set_elm_t elm,
- void_f_pvoid_t *free_func) {
+ void_f_pvoid_t free_func) {
int found = 1;
xbt_set_elm_t found_in_dict = NULL;
/** \brief constructor */
xbt_matrix_t xbt_matrix_new(int lines, int rows,
const unsigned long elmsize,
- void_f_pvoid_t * const free_f) {
+ void_f_pvoid_t const free_f) {
xbt_matrix_t res=xbt_new(s_xbt_matrix_t, 1);
res->lines = lines;
res->rows = rows;
xbt_matrix_t xbt_matrix_new_sub(xbt_matrix_t from,
int lsize, int rsize,
int lpos, int rpos,
- pvoid_f_pvoid_t *const cpy_f) {
+ pvoid_f_pvoid_t const cpy_f) {
xbt_matrix_t res=xbt_matrix_new(lsize,rsize,
from->elmsize, from->free_f);
fprintf(stderr," (%d,%d)=",i,j);
else
fprintf(stderr," ");
- display_fun(xbt_matrix_get_ptr(matrix,i,j));
+ (*display_fun)(xbt_matrix_get_ptr(matrix,i,j));
}
fprintf(stderr,"\n");
}
int lsize, int rsize,
int lpos_dst,int rpos_dst,
int lpos_src,int rpos_src,
- pvoid_f_pvoid_t *const cpy_f) {
+ pvoid_f_pvoid_t const cpy_f) {
int i,j;
DEBUG10("Copy a %dx%d submatrix from %dx%d(of %dx%d) to %dx%d (of %dx%d)",
for (i=0;i<rsize;i++) {
if (cpy_f) {
for (j=0;j<lsize;j++)
- xbt_matrix_get_as(dst,j+lpos_dst,i+rpos_dst,void*) = cpy_f(xbt_matrix_get_ptr(src,j+rpos_src,i+lpos_src));
+ xbt_matrix_get_as(dst,j+lpos_dst,i+rpos_dst,void*) = (*cpy_f)(xbt_matrix_get_ptr(src,j+rpos_src,i+lpos_src));
} else {
memcpy(xbt_matrix_get_ptr(dst,lpos_dst,i+rpos_dst),
xbt_matrix_get_ptr(src,lpos_src,i+rpos_src),
pthread_t t;
char *name;
void *param;
- pvoid_f_pvoid_t *start_routine;
+ pvoid_f_pvoid_t start_routine;
ex_ctx_t *exception;
} s_xbt_os_thread_t ;
static xbt_os_thread_t main_thread = NULL;
if ((errcode=pthread_setspecific(xbt_self_thread_key,t)))
THROW0(system_error,errcode,
"pthread_setspecific failed for xbt_self_thread_key");
- return t->start_routine(t->param);
+ return (*t->start_routine)(t->param);
}
xbt_os_thread_t xbt_os_thread_create(const char*name,
pvoid_f_pvoid_t start_routine,
char *name;
HANDLE handle; /* the win thread handle */
unsigned long id; /* the win thread id */
- pvoid_f_pvoid_t *start_routine;
+ pvoid_f_pvoid_t start_routine;
void* param;
} s_xbt_os_thread_t ;
typedef struct s_xbt_thread_ {
xbt_os_thread_t os_thread;
- void_f_pvoid_t *code;
+ void_f_pvoid_t code;
void *userparam;
}s_xbt_thread_t;
}
-xbt_thread_t xbt_thread_create(const char*name,void_f_pvoid_t* code, void* param) {
+xbt_thread_t xbt_thread_create(const char*name,void_f_pvoid_t code, void* param) {
xbt_thread_t res = xbt_new0(s_xbt_thread_t,1);
res->userparam = param;
typedef struct s_xbt_thread_ {
char *name;
smx_process_t s_process;
- void_f_pvoid_t *code;
+ void_f_pvoid_t code;
void *userparam;
void *father_data;
} s_xbt_thread_t;
return 0;
}
-xbt_thread_t xbt_thread_create(const char*name,void_fp_pvoid_t code, void* param) {
+xbt_thread_t xbt_thread_create(const char*name,void_f_pvoid_t code, void* param) {
xbt_thread_t res = xbt_new0(s_xbt_thread_t,1);
res->name = xbt_strdup(name);
res->userparam = param;
return 0;
}
-int_f_void_t *xbt_getpid=&xbt_fake_pid;
+int_f_void_t xbt_getpid=xbt_fake_pid;