Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a0324543671df3f75680f8aa21531b5ff4173c04
[simgrid.git] / src / include / xbt / context.h
1 /*      $Id$     */
2
3 /* Copyright (c) 2004 Arnaud Legrand. All rights reserved.                  */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef _XBT_CONTEXT_H
9 #define _XBT_CONTEXT_H
10
11 #include "xbt/misc.h"
12 #include "xbt/function_types.h"
13 #include "xbt_modinter.h" /* init/exit of this module */
14
15 /** @addtogroup XBT_context
16  *  
17  *  INTERNALS OF SIMGRID, DON'T USE IT.
18  *
19  *  This is a portable to Unix and Windows context implementation.
20  *
21  * @{
22  */
23
24 /** @name Context types
25  *  @{
26  */
27
28   /** @brief A context */
29   typedef struct s_xbt_context *xbt_context_t;
30   /** @brief A context function */
31   typedef int(*xbt_context_function_t)(int argc, char *argv[]);
32
33 /* @}*/
34
35 void xbt_context_empty_trash(void);
36 XBT_PUBLIC(xbt_context_t) xbt_context_new(xbt_context_function_t code, 
37                                           void_f_pvoid_t startup_func, void *startup_arg,
38                                           void_f_pvoid_t cleanup_func, void *cleanup_arg,
39                                           int argc, char *argv[]);
40 XBT_PUBLIC(void) xbt_context_kill(xbt_context_t context);
41 XBT_PUBLIC(void) xbt_context_start(xbt_context_t context);
42 XBT_PUBLIC(void) xbt_context_yield(void);
43 XBT_PUBLIC(void) xbt_context_schedule(xbt_context_t context);
44
45 void  xbt_context_set_jprocess(xbt_context_t context, void *jp);
46 void* xbt_context_get_jprocess(xbt_context_t context);
47
48 void  xbt_context_set_jmutex(xbt_context_t context,void *jm);
49 void* xbt_context_get_jmutex(xbt_context_t context);
50
51 void  xbt_context_set_jcond(xbt_context_t context,void *jc);
52 void* xbt_context_get_jcond(xbt_context_t context);
53
54 void  xbt_context_set_jenv(xbt_context_t context,void* je);
55 void* xbt_context_get_jenv(xbt_context_t context);
56    
57 /* @} */
58 #endif                          /* _XBT_CONTEXT_H */