Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add extern "C"
[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 extern "C"{
33
34 #include <windows.h>
35     typedef struct __stack {
36   void *ss_sp;
37   size_t ss_size;
38   int ss_flags;
39 } stack_t;
40 typedef CONTEXT mcontext_t;
41 typedef unsigned long __sigset_t;
42 typedef struct __ucontext {
43   unsigned long int uc_flags;
44   struct __ucontext *uc_link;
45   stack_t uc_stack;
46   mcontext_t uc_mcontext;
47   __sigset_t uc_sigmask;
48 } ucontext_t;
49 int getcontext(ucontext_t * ucp);
50 int setcontext(const ucontext_t * ucp);
51 int makecontext(ucontext_t *, void (*)(), int, ...);
52 int swapcontext(ucontext_t *, const ucontext_t *);
53
54 }
55 #endif  /* UCONTEXT_H */