X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a7729514e277aabe9422a2626541f889ad1af08b..488566dad1ae2b42f26a8e291824ff9b16a976f7:/src/gras/Virtu/virtu_interface.h diff --git a/src/gras/Virtu/virtu_interface.h b/src/gras/Virtu/virtu_interface.h index f4fd3f9e61..8df85bc7e1 100644 --- a/src/gras/Virtu/virtu_interface.h +++ b/src/gras/Virtu/virtu_interface.h @@ -1,40 +1,48 @@ -/* $Id$ */ - /* virtu[alization] - speciafic parts for each OS and for SG */ -/* module's public interface exported within GRAS, but not to end user. */ +/* module's public interface exported within GRAS, but not to end user. */ -/* Authors: Martin Quinson */ -/* Copyright (C) 2004 Martin Quinson. */ +/* Copyright (c) 2004, 2005, 2006, 2007, 2009, 2010. The SimGrid Team. + * 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_VIRTU_INTERFACE_H #define GRAS_VIRTU_INTERFACE_H -/** - * gras_process_data_t: - * - * Data for each process - */ -typedef struct { - /* queue of messages which where received but not wanted in msgWait, and therefore - temporarly queued until the next msgHandle */ - gras_dynar_t *msg_queue; /* elm type: gras_msg_t */ - /* registered callbacks for each message */ - gras_dynar_t *cbl_list; /* elm type: gras_cblist_t */ - +#include "xbt/function_types.h" +#include "xbt/sysdep.h" +#include "xbt/log.h" +#include "xbt/set.h" +#include "gras/virtu.h" +#include "gras/process.h" + +SG_BEGIN_DECL() + +/* shutdown the module mechanism (world-wide cleanups) */ +void gras_moddata_exit(void); +/* shutdown this process wrt module mecanism (process-wide cleanups) */ +void gras_moddata_leave(void); + + +/* Perform the various intialisations needed by gras. Each process must run it */ +XBT_PUBLIC(void) gras_process_init(void); + +/* Frees the memory allocated by gras. Processes should run it */ +XBT_PUBLIC(void) gras_process_exit(void); + - /* The channel we are listening to in SG for formated messages */ - int chan; - /* The channel we are listening to in SG for raw send/recv */ - int rawChan; +/* This is the old interface (deprecated) */ - /* globals of the process */ - void *userdata; -} gras_process_data_t; +/* declare a new process specific data + (used by gras__register to make sure that gras_process_init will create it) */ +int gras_procdata_add(const char *name, pvoid_f_void_t creator, + void_f_pvoid_t destructor); +void *gras_libdata_by_name(const char *name); +void *gras_libdata_by_id(int id); -#endif /* GRAS_VIRTU_INTERFACE_H */ +SG_END_DECL() +#endif /* GRAS_VIRTU_INTERFACE_H */