Sweden-Number/tools/winebuild
Gavriel State f98c52b11f Some older versions of GDB need to have the filename data available
for each section, so we need to output it again for the data section.
2002-02-12 18:46:14 +00:00
..
.cvsignore Split the build program in several files. 2000-06-23 20:15:35 +00:00
Makefile.in Use libwine and libwine_unicode directly from their build directory 2000-12-06 00:05:14 +00:00
README Made register and interrupt flags instead of entry point types, so 2001-12-14 23:14:22 +00:00
build.h Support for generation of .def files from .spec files. 2002-02-04 18:48:18 +00:00
import.c Should process the .dynsym of shared libraries instead of the .stab. 2002-01-29 02:58:20 +00:00
main.c Support for generation of .def files from .spec files. 2002-02-04 18:48:18 +00:00
parser.c Support for generation of .def files from .spec files. 2002-02-04 18:48:18 +00:00
relay.c Some older versions of GDB need to have the filename data available 2002-02-12 18:46:14 +00:00
res16.c Fixed winebuild to work on non-Intel architectures. 2000-12-29 05:17:33 +00:00
res32.c Added checking for mmap. 2000-11-25 23:54:12 +00:00
spec16.c Move __stdcall/__cdecl to the right place. 2002-01-31 23:22:07 +00:00
spec32.c Support for generation of .def files from .spec files. 2002-02-04 18:48:18 +00:00
utils.c Fix the #include order for config.h. 2001-11-06 20:57:11 +00:00

README

			Spec file format
			----------------

name	NAME
type    win16|win32
[file   WINFILENAME]
[mode	dll|cuiexe|guiexe|cuiexe_unicode|guiexe_unicode]
[heap   SIZE]
[stack  SIZE]
[init	FUNCTION]
[import [IMP_FLAGS] DLL]
[rsrc	RESFILE]
[debug_channels ([CHANNEL [CHANNEL...]])]
[ignore ([SYMBOL [SYMBOL...]])]

ORDINAL FUNCTYPE [FLAGS] EXPORTNAME([ARGTYPE [ARGTYPE [...]]]) HANDLERNAME

ORDINAL variable [FLAGS] EXPORTNAME (DATA [DATA [DATA [...]]])

ORDINAL stub [FLAGS] EXPORTNAME

ORDINAL equate [FLAGS] EXPORTNAME DATA

ORDINAL extern [FLAGS] EXPORTNAME SYMBOLNAME

ORDINAL forward [FLAGS] EXPORTNAME SYMBOLNAME

# COMMENT_TEXT

--------------------
General:
========

    "name" and "type" fields are mandatory.  Specific ordinal
declarations are optional, but the default handler will print an error
message.

"mode" specifies whether it is the spec file for a dll or the main exe.
This is only valid for Win32 spec files.

"heap" is the size of the module local heap (only valid for Win16
modules); default is no local heap.

"stack" is the stack size for Win32 exe modules, in kilobytes; default
size is 1024 (1Mb stack).

"file" gives the name of the Windows file that is replaced by the
builtin. <name>.DLL is assumed if none is given. (This is important
for kernel, which lives in the Windows file KRNL386.EXE).

"init" specifies a function which will be called when this dll
is loaded. This is only valid for Win32 modules.

"import" names a module that this one depends on (only for Win32
modules at the present). The import declaration can be present several
times.

"IMP_FLAGS" is a series of optional flags, preceded by a '-'
character. The supported flags are:
"-delay":       the module this module depends upon will be loaded
	 	when the first API will be called (and not while this
		module is loaded)

"rsrc" specifies the path of the compiled resource file.

"debug_channels" specifies the list of debug channels used by the dll.

"ignore" specifies a list of symbols that should be ignored when
resolving undefined symbols against the imported libraries.

"ORDINAL" specified the ordinal number corresponding to the entry
point, or "@" for automatic ordinal allocation (Win32 only).

"FLAGS" is a series of optional flags, preceded by a '-' character.
The supported flags are:
  "-noimport":  the entry point is not made available for importing
                from winelib applications (Win32 only).
  "-norelay":   the entry point is not displayed in relay debugging
                traces (Win32 only).
  "-ret64":     the function returns a 64-bit value (Win32 only).
  "-i386":      the entry point is only available on i386 platforms.
  "-register":  the function uses CPU register to pass arguments.
  "-interrupt": the function is an interrupt handler routine.

Lines whose first character is a '#' will be ignored as comments.


Variable ordinals:
==================

    This type defines data storage as 32-bit words at the ordinal specified.
"EXPORTNAME" will be the name available for dynamic linking.  "DATA"
can be a decimal number or a hex number preceeded by "0x".  The
following example defines the variable "VariableA" at ordinal 2 and
containing 4 ints:

	2 variable VariableA(-1 0xff 0 0)

Function ordinals:
==================

    This type defines a function entry point.  The prototype defined by
"EXPORTNAME ([ARGTYPE [ARGTYPE [...]]])" specifies the name available for
dynamic linking and the format of the arguments. "@" can be used
instead of "EXPORTNAME" for ordinal-only exports.

"FUNCTYPE" should be one of:
- "pascal16" for a Win16 function returning a 16-bit value
- "pascal" for a Win16 function returning a 32-bit value
- "stdcall" for a normal Win32 function
- "cdecl" for a Win32 function using the C calling convention
- "varargs" for a Win32 function taking a variable number of arguments

"ARGTYPE" should be one of:
- "word"   (16-bit unsigned value)
- "s_word" (16-bit signed word)
- "long"   (32-bit value)
- "double" (64-bit value)
- "ptr"    (linear pointer)
- "str"    (linear pointer to a null-terminated ASCII string)
- "wstr"   (linear pointer to a null-terminated Unicode string)
- "segptr" (segmented pointer)
- "segstr" (segmented pointer to a null-terminated ASCII string)

Only "ptr", "str", "wstr", "long" and "double" are valid for Win32 functions.

"HANDLERNAME" is the name of the actual Wine function that will
process the request in 32-bit mode.

    This first example defines an entry point for the CreateWindow()
call (the ordinal 100 is just an example):

	100 pascal CreateWindow(ptr ptr long s_word s_word s_word s_word
				word word word ptr)
		   WIN_CreateWindow

   This second example defines an entry point for the GetFocus()
call (the ordinal 100 is just an example):

	100 pascal GetFocus() WIN_GetFocus()

To declare a function using a variable number of arguments in Win16,
specify the function as taking no arguments. The arguments are then
available with CURRENT_STACK16->args. In Win32, specify the function
as 'varargs' and declare it with a '...' parameter in the C file.  See
the wsprintf* functions in user.spec and user32.spec for an example.

Stub ordinals:
==============

    This type defines a stub function. It makes the name and ordinal
available for dynamic linking, but will terminate execution with an
error message if the function is ever called.

Equate ordinals:
================

    This type defines an ordinal as an absolute value.
"EXPORTNAME" will be the name available for dynamic linking.  
"DATA" can be a decimal number or a hex number preceeded by "0x".

Extern ordinals:
================

    This type defines an entry that simply maps to a Wine symbol
(variable or function); "EXPORTNAME" will point to the symbol
"SYMBOLNAME" that must be defined in C code. This type only works with
Win32.

Forwarded ordinals:
===================

    This type defines an entry that is forwarded to another entry
point (kind of a symbolic link). "EXPORTNAME" will forward to the
entry point "SYMBOLNAME" that must be of the form "DLL.Function". This 
type only works with Win32.