Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
8e7b6469e5ed806411afe45c1b4590cfb24cb420
[simgrid.git] / 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
13 /** \name Context types
14  *  \ingroup XBT_context
15 */
16 /*@{*/
17 typedef struct s_xbt_context *xbt_context_t;
18 /**< A context */
19 typedef int(*xbt_context_function_t)(int argc, char *argv[]);
20 /**< A context function */
21 /*@}*/
22
23 void xbt_context_init(void);
24 void xbt_context_exit(void);
25 void xbt_context_empty_trash(void);
26 xbt_context_t xbt_context_new(xbt_context_function_t code, 
27                               void_f_pvoid_t startup_func, void *startup_arg,
28                               void_f_pvoid_t cleanup_func, void *cleanup_arg,
29                               int argc, char *argv[]);
30 void xbt_context_free(xbt_context_t context);
31 void xbt_context_start(xbt_context_t context);
32 void xbt_context_yield(void);
33 void xbt_context_schedule(xbt_context_t context);
34
35 #endif                          /* _XBT_CONTEXT_H */