Portability fixes.
[wine] / include / builtin16.h
1 /*
2  * Win16 built-in DLLs definitions
3  *
4  * Copyright 1999 Ulrich Weigand
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_BUILTIN16_H
22 #define __WINE_BUILTIN16_H
23
24 #include "windef.h"
25 #include "wine/windef16.h"
26
27 struct _CONTEXT86;
28 struct _STACK16FRAME;
29
30 #include "pshpack1.h"
31
32 #ifdef __i386__
33
34 typedef struct
35 {
36     WORD   pushw_bp;               /* pushw %bp */
37     BYTE   pushl;                  /* pushl $target */
38     void (*target)();
39     WORD   call;                   /* call CALLFROM16 */
40     short  callfrom16;
41 } ENTRYPOINT16;
42
43 typedef struct
44 {
45     BYTE   pushl;                  /* pushl $relay */
46     void  *relay;
47     BYTE   lcall;                  /* lcall __FLATCS__:glue */
48     void  *glue;
49     WORD   flatcs;
50     WORD   lret;                   /* lret $nArgs */
51     WORD   nArgs;
52     DWORD  arg_types[2];           /* type of each argument */
53 } CALLFROM16;
54
55 #else
56
57 typedef struct
58 {
59     void (*target)();
60     WORD   call;                   /* call CALLFROM16 */
61     short  callfrom16;
62 } ENTRYPOINT16;
63
64 typedef struct
65 {
66     WORD   lret;                   /* lret $nArgs */
67     WORD   nArgs;
68     DWORD  arg_types[2];           /* type of each argument */
69 } CALLFROM16;
70
71 #endif
72
73 #include "poppack.h"
74
75 /* argument type flags for relay debugging */
76 enum arg_types
77 {
78     ARG_NONE = 0, /* indicates end of arg list */
79     ARG_WORD,     /* unsigned word */
80     ARG_SWORD,    /* signed word */
81     ARG_LONG,     /* long or segmented pointer */
82     ARG_PTR,      /* linear pointer */
83     ARG_STR,      /* linear pointer to null-terminated string */
84     ARG_SEGSTR    /* segmented pointer to null-terminated string */
85 };
86
87 /* flags added to arg_types[0] */
88 #define ARG_RET16    0x80000000  /* function returns 16-bit value */
89 #define ARG_REGISTER 0x40000000  /* function is register */
90
91 extern WORD __wine_call_from_16_word();
92 extern LONG __wine_call_from_16_long();
93 extern void __wine_call_from_16_regs();
94
95 #endif /* __WINE_BUILTIN16_H */