Logo AND Algorithmique Numérique Distribuée

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