Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Initial structure. Nothing works yet.
[simgrid.git] / src / xbt / context_win32.h
1 /********************************************************************************
2  * Copyright (c) 2003, 2004                                                     *
3  * Panagiotis E. Hadjidoukas    (peh@hpclab.ceid.upatras.gr)                    *
4  * HPCLab - University of Patras. All Rights Reserved.                          *
5  * Unix ucontext_t on Windows Operating System, May 2004 (revision 1)           *
6  *                                                                              *
7  * The author disclaims all warranties with regard to this software including   *
8  * all implied warranties of merchantability and fitness for a particular       *
9  * purpose. In no event shall HPCLab be liable for any special, indirect,       *
10  * or consequential damages or any damages whatsoever resulting from            *
11  * loss of use, data or profits, whether in action of contract negligence,      *
12  * or other tortious action, arising out of or in connection with the use       *
13  * or performance of this software.                                             *
14  ********************************************************************************/
15
16 /* The original author granted me (Martin Quinson) to redistribute this work 
17    under the LGPL licence, what I here do. */
18
19 #ifndef UCONTEXT_H
20 #define UCONTEXT_H
21
22 #ifndef S_SPLINT_S
23 #  include <windows.h>
24 #endif
25
26 typedef struct __stack {
27         void *ss_sp;
28         size_t ss_size;
29         int ss_flags;
30 } stack_t;
31
32 typedef CONTEXT mcontext_t;
33 typedef unsigned long __sigset_t;
34
35 typedef struct __ucontext {
36         unsigned long int       uc_flags;
37         struct __ucontext       *uc_link;
38         stack_t                         uc_stack;
39         mcontext_t                      uc_mcontext; 
40         __sigset_t                      uc_sigmask;
41 } ucontext_t;
42
43
44 int getcontext(ucontext_t *ucp);
45 int setcontext(const ucontext_t *ucp);
46 int makecontext(ucontext_t *, void (*)(), int, ...);
47 int swapcontext(ucontext_t *, const ucontext_t *);
48
49 #endif /* UCONTEXT_H */