Logo AND Algorithmique Numérique Distribuée

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