Added winebuild support for generating a .dbg.c file containing the
[wine] / tools / winebuild / README
1                         Spec file format
2                         ----------------
3
4 name    NAME
5 type    win16|win32
6 [file   WINFILENAME]
7 [mode   dll|cuiexe|guiexe|cuiexe_unicode|guiexe_unicode]
8 [heap   SIZE]
9 [stack  SIZE]
10 [init   FUNCTION]
11 [rsrc   RESFILE]
12 [ignore ([SYMBOL [SYMBOL...]])]
13
14 ORDINAL FUNCTYPE [FLAGS] EXPORTNAME([ARGTYPE [ARGTYPE [...]]]) HANDLERNAME
15
16 ORDINAL variable [FLAGS] EXPORTNAME (DATA [DATA [DATA [...]]])
17
18 ORDINAL stub [FLAGS] EXPORTNAME
19
20 ORDINAL equate [FLAGS] EXPORTNAME DATA
21
22 ORDINAL extern [FLAGS] EXPORTNAME SYMBOLNAME
23
24 ORDINAL forward [FLAGS] EXPORTNAME SYMBOLNAME
25
26 # COMMENT_TEXT
27
28 --------------------
29 General:
30 ========
31
32     "name" and "type" fields are mandatory.  Specific ordinal
33 declarations are optional, but the default handler will print an error
34 message.
35
36 "mode" specifies whether it is the spec file for a dll or the main exe.
37 This is only valid for Win32 spec files.
38
39 "heap" is the size of the module local heap (only valid for Win16
40 modules); default is no local heap.
41
42 "stack" is the stack size for Win32 exe modules, in kilobytes; default
43 size is 1024 (1Mb stack).
44
45 "file" gives the name of the Windows file that is replaced by the
46 builtin. <name>.DLL is assumed if none is given. (This is important
47 for kernel, which lives in the Windows file KRNL386.EXE).
48
49 "init" specifies a function which will be called when this dll
50 is loaded. This is only valid for Win32 modules.
51
52 "rsrc" specifies the path of the compiled resource file.
53
54 "ignore" specifies a list of symbols that should be ignored when
55 resolving undefined symbols against the imported libraries.
56
57 "ORDINAL" specified the ordinal number corresponding to the entry
58 point, or "@" for automatic ordinal allocation (Win32 only).
59
60 "FLAGS" is a series of optional flags, preceded by a '-' character.
61 The supported flags are:
62   "-noimport":  the entry point is not made available for importing
63                 from winelib applications (Win32 only).
64   "-norelay":   the entry point is not displayed in relay debugging
65                 traces (Win32 only).
66   "-ret64":     the function returns a 64-bit value (Win32 only).
67   "-i386":      the entry point is only available on i386 platforms.
68   "-register":  the function uses CPU register to pass arguments.
69   "-interrupt": the function is an interrupt handler routine.
70
71 Lines whose first character is a '#' will be ignored as comments.
72
73
74 Variable ordinals:
75 ==================
76
77     This type defines data storage as 32-bit words at the ordinal specified.
78 "EXPORTNAME" will be the name available for dynamic linking.  "DATA"
79 can be a decimal number or a hex number preceeded by "0x".  The
80 following example defines the variable "VariableA" at ordinal 2 and
81 containing 4 ints:
82
83         2 variable VariableA(-1 0xff 0 0)
84
85 Function ordinals:
86 ==================
87
88     This type defines a function entry point.  The prototype defined by
89 "EXPORTNAME ([ARGTYPE [ARGTYPE [...]]])" specifies the name available for
90 dynamic linking and the format of the arguments. "@" can be used
91 instead of "EXPORTNAME" for ordinal-only exports.
92
93 "FUNCTYPE" should be one of:
94 - "pascal16" for a Win16 function returning a 16-bit value
95 - "pascal" for a Win16 function returning a 32-bit value
96 - "stdcall" for a normal Win32 function
97 - "cdecl" for a Win32 function using the C calling convention
98 - "varargs" for a Win32 function taking a variable number of arguments
99
100 "ARGTYPE" should be one of:
101 - "word"   (16-bit unsigned value)
102 - "s_word" (16-bit signed word)
103 - "long"   (32-bit value)
104 - "double" (64-bit value)
105 - "ptr"    (linear pointer)
106 - "str"    (linear pointer to a null-terminated ASCII string)
107 - "wstr"   (linear pointer to a null-terminated Unicode string)
108 - "segptr" (segmented pointer)
109 - "segstr" (segmented pointer to a null-terminated ASCII string)
110
111 Only "ptr", "str", "wstr", "long" and "double" are valid for Win32 functions.
112
113 "HANDLERNAME" is the name of the actual Wine function that will
114 process the request in 32-bit mode.
115
116     This first example defines an entry point for the CreateWindow()
117 call (the ordinal 100 is just an example):
118
119         100 pascal CreateWindow(ptr ptr long s_word s_word s_word s_word
120                                 word word word ptr)
121                    WIN_CreateWindow
122
123    This second example defines an entry point for the GetFocus()
124 call (the ordinal 100 is just an example):
125
126         100 pascal GetFocus() WIN_GetFocus()
127
128 To declare a function using a variable number of arguments in Win16,
129 specify the function as taking no arguments. The arguments are then
130 available with CURRENT_STACK16->args. In Win32, specify the function
131 as 'varargs' and declare it with a '...' parameter in the C file.  See
132 the wsprintf* functions in user.spec and user32.spec for an example.
133
134 Stub ordinals:
135 ==============
136
137     This type defines a stub function. It makes the name and ordinal
138 available for dynamic linking, but will terminate execution with an
139 error message if the function is ever called.
140
141 Equate ordinals:
142 ================
143
144     This type defines an ordinal as an absolute value.
145 "EXPORTNAME" will be the name available for dynamic linking.  
146 "DATA" can be a decimal number or a hex number preceeded by "0x".
147
148 Extern ordinals:
149 ================
150
151     This type defines an entry that simply maps to a Wine symbol
152 (variable or function); "EXPORTNAME" will point to the symbol
153 "SYMBOLNAME" that must be defined in C code. This type only works with
154 Win32.
155
156 Forwarded ordinals:
157 ===================
158
159     This type defines an entry that is forwarded to another entry
160 point (kind of a symbolic link). "EXPORTNAME" will forward to the
161 entry point "SYMBOLNAME" that must be of the form "DLL.Function". This 
162 type only works with Win32.
163