Release 960811
[wine] / tools / build-spec.txt
1 name    NAME
2 type    win16|win32
3 [base   ORDINAL]
4 [heap   SIZE]
5
6 ORDINAL VARTYPE EXPORTNAME (DATA [DATA [DATA [...]]])
7
8 ORDINAL FUNCTYPE EXPORTNAME([ARGTYPE [ARGTYPE [...]]]) HANDLERNAME
9
10 ORDINAL stub EXPORTNAME
11
12 ORDINAL equate EXPORTNAME DATA
13
14 ORDINAL return EXPORTNAME ARGLENGTH RETVALUE
15
16 ORDINAL extern EXPORTNAME SYMBOLNAME
17
18 # COMMENT_TEXT
19
20 --------------------
21 General:
22 ========
23
24     "name" and "type" fields are mandatory.  Specific ordinal
25 declarations are optional, but the default handler will print an error
26 message.  "base" gives the offset of the first ordinal; default is 0.
27 "heap" is the size of the module local heap (only valid for Win16
28 modules); default is no local heap.  Lines whose first character is a
29 '#' will be ignored as comments.
30
31 Variable ordinals:
32 ==================
33
34     This type defines data storage at the ordinal specified.  You may
35 store items as bytes, 16-bit words, or 32-bit words.
36     "ORDINAL" is replaced by the ordinal number corresponding to the
37 variable.  "VARTYPE" should be "byte", "word" or "long" for 8, 16, or
38 32 bits respectively.  "EXPORTNAME" will be the name available for
39 dynamic linking.  "DATA" can be a decimal number or a hex number preceeded
40 by "0x".  The following example defines the variable "VariableA" at
41 ordinal 2 and containing 4 bytes:
42
43         2 byte VariableA(-1 0xff 0 0)
44
45 Function ordinals:
46 ==================
47
48     This type defines a function entry point.  The prototype defined by
49 "EXPORTNAME ([ARGTYPE [ARGTYPE [...]]])" specifies the name available for
50 dynamic linking and the format of the arguments. "ORDINAL" is replaced
51 by the ordinal number corresponding to the function.
52
53 "FUNCTYPE" should be one of:
54 - "pascal16" for a Win16 function returning a 16-bit value
55 - "pascal" for a Win16 function returning a 32-bit value
56 - "register" for a function using CPU register to pass arguments
57 - "stdcall" for a normal Win32 function
58 - "cdecl" for a Win32 function using the C calling convention
59
60 "ARGTYPE" should be one of:
61 - "byte"
62 - "word"
63 - "long"
64 - "ptr" (linear pointer)
65 - "s_byte" (signed byte)
66 - "s_word" (signed word)
67 - "s_long" (signed long)
68 - "segptr" (segmented pointer).
69
70 Only "ptr" and "long" are valid for Win32 functions.
71
72 "HANDLERNAME" is the name of the actual Wine function that will
73 process the request in 32-bit mode.
74
75     This first example defines an entry point for the CreateWindow()
76 call (the ordinal 100 is just an example):
77
78         100 pascal CreateWindow(ptr ptr long s_word s_word s_word s_word
79                                 word word word ptr)
80                    WIN_CreateWindow
81
82    This second example defines an entry point for the GetFocus()
83 call (the ordinal 100 is just an example):
84
85         100 pascal GetFocus() WIN_GetFocus()
86
87 To declare a function using a variable number of arguments, specify
88 the function as taking no arguments. In this special case, in Win32
89 the called function will be passed a pointer to the first arg; in
90 Win16, the args are available with CURRENT_STACK16->args. See the
91 wsprintf* functions in user.spec and user32.spec for an example.
92
93 Stub ordinals:
94 ==============
95
96     This type defines a stub function. It makes the name and ordinal
97 available for dynamic linking, but will terminate execution with an
98 error message if the function is ever called.
99
100 Equate ordinals:
101 ================
102
103     This type defines an ordinal as an absolute value.
104 "ORDINAL" is replaced by the ordinal number corresponding to the
105 variable.  "EXPORTNAME" will be the name available for dynamic linking.  
106 "DATA" can be a decimal number or a hex number preceeded by "0x".
107
108 Return ordinals:
109 ================
110
111     This type defines a function entry point whose handler should do
112 nothing but return a value.
113     "ORDINAL" is replaced by the ordinal number corresponding to the
114 variable.  ARGLENGTH is the number of bytes that need to be removed
115 from the stack before returning to the caller.  RETVALUE is the
116 return value which will be passed back to the caller.
117
118 Extern ordinals:
119 ================
120
121     This type defines an entry that simply maps to a Wine symbol
122 (variable or function); "EXPORTNAME" will point to the symbol
123 "SYMBOLNAME" that must be defined in C code. This type only works with
124 Win32.