Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
seriously, me
[simgrid.git] / src / include / xbt / win32_ucontext.h
1 /* Copyright (c) 2010, 2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 /*
8  *      win32-ucontext: Unix ucontext_t operations on Windows platforms
9  *      Copyright(C) 2007 Panagiotis E. Hadjidoukas
10  *
11  *      Contact Email: phadjido@cs.uoi.gr, xdoukas@ceid.upatras.gr
12  *
13  *      win32-ucontext is free software; you can redistribute it and/or
14  *      modify it under the terms of the GNU Lesser General Public
15  *      License as published by the Free Software Foundation; either
16  *      version 2 of the License, or (at your option) any later version.
17  *
18  *      win32-ucontext is distributed in the hope that it will be useful,
19  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
20  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21  *      Lesser General Public License for more details.
22  *
23  *      You should have received a copy of the GNU Lesser General Public
24  *      License along with SimGrid in the file LICENSE-LGPL-2.1;
25  *      if not, write to the Free Software Foundation, Inc.,
26  *      59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
27  */  
28     
29 #ifndef UCONTEXT_H
30 #define UCONTEXT_H
31     
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36
37 #include <windows.h>
38     typedef struct __stack {
39   void *ss_sp;
40   size_t ss_size;
41   int ss_flags;
42 } stack_t;
43 typedef CONTEXT mcontext_t;
44 typedef unsigned long __sigset_t;
45 typedef struct __ucontext {
46   unsigned long int uc_flags;
47   struct __ucontext *uc_link;
48   stack_t uc_stack;
49   mcontext_t uc_mcontext;
50   __sigset_t uc_sigmask;
51 } ucontext_t;
52 int getcontext(ucontext_t * ucp);
53 int setcontext(const ucontext_t * ucp);
54 int makecontext(ucontext_t *, void (*)(), int, ...);
55 int swapcontext(ucontext_t *, const ucontext_t *);
56
57 #ifdef __cplusplus
58 }
59 #endif
60 #endif  /* UCONTEXT_H */