Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
5c7047bbe2a38f4a5a1ffdaad40877523b55720b
[simgrid.git] / include / gras / process.h
1 /* $Id$                     */
2
3 /* gras/core.h - Unsorted part of the GRAS public interface                 */
4
5 /* Authors: Martin Quinson                                                  */
6 /* Copyright (C) 2003,2004 the OURAGAN project.                             */
7
8 /* This program is free software; you can redistribute it and/or modify it
9    under the terms of the license (GNU LGPL) which comes with this package. */
10
11 #ifndef GRAS_PROCESS_H
12 #define GRAS_PROCESS_H
13
14 #include "xbt/misc.h" /* BEGIN_DECL */
15
16 BEGIN_DECL
17
18 /* **************************************************************************
19  * Initializing the processes
20  * **************************************************************************/
21 /**
22  * gras_process_init:
23  * 
24  * Perform the various intialisations needed by gras. Each process must run it
25  */
26 xbt_error_t gras_process_init(void);
27
28 /**
29  * gras_process_exit:
30  * 
31  * Frees the memory allocated by gras. Processes should run it
32  */
33 xbt_error_t gras_process_exit(void);
34
35 /****************************************************************************/
36 /* Manipulating User Data                                                   */
37 /****************************************************************************/
38 /**
39  * gras_userdata_get:
40  *
41  * Get the data associated with the current process.
42  */
43 void *gras_userdata_get(void);
44
45 /**
46  * gras_userdata_set:
47  *
48  * Set the data associated with the current process.
49  */
50 void gras_userdata_set(void *ud);
51
52 /**
53  * gras_userdata_new:
54  *
55  * Malloc and set the data associated with the current process.
56  */
57
58 #define gras_userdata_new(type) (gras_userdata_set(xbt_new0(type,1)),gras_userdata_get())
59
60 END_DECL
61
62 #endif /* GRAS_PROCESS_H */
63