Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
2004-04-09 Martin Quinson <martin.quinson@tuxfamily.org>
[simgrid.git] / src / gras / Virtu / rl_process.c
1 /* $Id$ */
2
3 /* process_rl - GRAS process handling on real life                         */
4
5 /* Authors: Martin Quinson                                                  */
6 /* Copyright (C) 2003,2004 da GRAS posse.                                   */
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 #include "Virtu/virtu_rl.h"
12
13 GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(process,GRAS);
14                               
15 /* globals */
16 static gras_process_data_t *_gras_process_data;
17
18 gras_error_t gras_process_init() {
19   //  gras_error_t errcode;
20
21   if (!(_gras_process_data=(gras_process_data_t *)malloc(sizeof(gras_process_data_t))))
22     RAISE_MALLOC;
23
24   WARNING0("Implement message queue");
25   /*
26   TRY(gras_dynar_new(  &(_gras_process_data->msg_queue)  ));
27   TRY(gras_dynar_new(  &(_gras_process_data->cbl_list)  ));
28   */
29
30   _gras_process_data->userdata = NULL;
31   return no_error;
32 }
33 gras_error_t gras_process_exit() {
34   WARNING0("FIXME: not implemented (=> leaking on exit :)");
35   return no_error;
36 }
37
38 /* **************************************************************************
39  * Process data
40  * **************************************************************************/
41
42 void *gras_userdata_get(void) {
43   return _gras_process_data->userdata;
44 }
45
46 void *gras_userdata_set(void *ud) {
47   _gras_process_data->userdata = ud;
48   return ud;
49 }