3 /* gras/process.h - Manipulating data related to an host. */
5 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */
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. */
10 #ifndef GRAS_PROCESS_H
11 #define GRAS_PROCESS_H
13 #include "xbt/misc.h" /* BEGIN_DECL */
17 /* **************************************************************************
18 * Initializing the processes
19 * **************************************************************************/
23 * Perform the various intialisations needed by gras. Each process must run it
25 xbt_error_t gras_process_init(void);
30 * Frees the memory allocated by gras. Processes should run it
32 xbt_error_t gras_process_exit(void);
34 /****************************************************************************/
35 /* Manipulating User Data */
36 /****************************************************************************/
40 * Get the data associated with the current process.
42 void *gras_userdata_get(void);
47 * Set the data associated with the current process.
49 void gras_userdata_set(void *ud);
54 * Malloc and set the data associated with the current process.
57 #define gras_userdata_new(type) (gras_userdata_set(xbt_new0(type,1)),gras_userdata_get())
61 #endif /* GRAS_PROCESS_H */