Sync to Wine-20050211 Added: trunk/reactos/tools/winebuild/ Deleted: trunk/reactos/tools/winebuild/CVS/ Added: trunk/reactos/tools/winebuild/Makefile Modified: trunk/reactos/tools/winebuild/build.h Modified: trunk/reactos/tools/winebuild/import.c Modified: trunk/reactos/tools/winebuild/main.c Added: trunk/reactos/tools/winebuild/mkstemps.c Modified: trunk/reactos/tools/winebuild/parser.c Modified: trunk/reactos/tools/winebuild/relay.c Modified: trunk/reactos/tools/winebuild/res16.c Modified: trunk/reactos/tools/winebuild/res32.c Modified: trunk/reactos/tools/winebuild/spec16.c Modified: trunk/reactos/tools/winebuild/spec32.c Modified: trunk/reactos/tools/winebuild/utils.c Modified: trunk/reactos/tools/winebuild/winebuild.man.in Added: trunk/reactos/tools/winebuild/winglue.h _____
Copied: trunk/reactos/tools/winebuild (from rev 13572, vendor/wine/tools/winebuild/current) _____
Added: trunk/reactos/tools/winebuild/Makefile --- vendor/wine/tools/winebuild/current/Makefile 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/Makefile 2005-02-14 18:39:15 UTC (rev 13573) @@ -0,0 +1,43 @@
+# +# winebuild +# +PATH_TO_TOP = ../.. + +include $(PATH_TO_TOP)/rules.mak + +TARGET = winebuild$(EXE_POSTFIX) + +all: $(TARGET) + +# relay.o spec16.o +OBJECTS = \ + import.o \ + main.o \ + parser.o \ + res16.o \ + res32.o \ + spec32.o \ + utils.o \ + mkstemps.o + +CLEAN_FILES = *.o $(TARGET) + +HOST_CFLAGS = -D__USE_W32API -I$(PATH_TO_TOP)/include/wine + +%.o: %.c + $(HOST_CC) $(HOST_CFLAGS) -c $< -o $@ + +$(TARGET): $(OBJECTS) + $(HOST_CC) $(OBJECTS) -o $(TARGET) + +ifeq ($(HOST),mingw32-linux) +clean: + rm -f $(CLEAN_FILES) +endif +ifneq ($(HOST),mingw32-linux) +clean: + del $(CLEAN_FILES) +endif + +.PHONY: clean + Property changes on: trunk/reactos/tools/winebuild/Makefile ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____
Modified: trunk/reactos/tools/winebuild/build.h --- vendor/wine/tools/winebuild/current/build.h 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/build.h 2005-02-14 18:39:15 UTC (rev 13573) @@ -185,6 +185,7 @@
extern void BuildSpec32File( FILE *outfile, DLLSPEC *spec ); extern void BuildDef32File( FILE *outfile, DLLSPEC *spec ); extern void BuildDebugFile( FILE *outfile, const char *srcdir, char **argv ); +extern void BuildPedllFile( FILE *outfile, DLLSPEC *spec );
extern int parse_spec_file( FILE *file, DLLSPEC *spec ); extern int parse_def_file( FILE *file, DLLSPEC *spec ); _____
Modified: trunk/reactos/tools/winebuild/import.c --- vendor/wine/tools/winebuild/current/import.c 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/import.c 2005-02-14 18:39:15 UTC (rev 13573) @@ -20,7 +20,6 @@
*/
#include "config.h" -#include "wine/port.h"
#include <ctype.h> #include <fcntl.h> @@ -31,8 +30,7 @@ # include <unistd.h> #endif
-#include "windef.h" -#include "winbase.h" +#include "winglue.h" #include "build.h"
struct import _____
Modified: trunk/reactos/tools/winebuild/main.c --- vendor/wine/tools/winebuild/current/main.c 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/main.c 2005-02-14 18:39:15 UTC (rev 13573) @@ -23,7 +23,6 @@
*/
#include "config.h" -#include "wine/port.h"
#include <assert.h> #include <stdio.h> @@ -36,8 +35,7 @@ # include <getopt.h> #endif
-#include "windef.h" -#include "winbase.h" +#include "winglue.h" #include "build.h"
int UsePIC = 0; @@ -78,7 +76,8 @@ MODE_DEF, MODE_DEBUG, MODE_RELAY16, - MODE_RELAY32 + MODE_RELAY32, + MODE_PEDLL };
static enum exec_mode_values exec_mode = MODE_NONE; @@ -170,7 +169,8 @@ " --exe=NAME Build a .c file for the named executable\n" " --debug [FILES] Build a .c file with the debug channels declarations\n" " --relay16 Build the 16-bit relay assembly routines\n" -" --relay32 Build the 32-bit relay assembly routines\n\n" +" --relay32 Build the 32-bit relay assembly routines\n" +" --pedll Build a .c file for PE dll\n\n" "The mode options are mutually exclusive; you must specify one and only one.\n\n";
enum long_options_values @@ -184,7 +184,8 @@ LONG_OPT_RELAY16, LONG_OPT_RELAY32, LONG_OPT_SUBSYSTEM, - LONG_OPT_VERSION + LONG_OPT_VERSION, + LONG_OPT_PEDLL };
static const char short_options[] = "C:D:F:H:I:K:L:M:N:d:e:f:hi:kl:m:o:r:w"; @@ -201,6 +202,7 @@ { "relay32", 0, 0, LONG_OPT_RELAY32 }, { "subsystem",1, 0, LONG_OPT_SUBSYSTEM }, { "version", 0, 0, LONG_OPT_VERSION }, + { "pedll", 1, 0, LONG_OPT_PEDLL }, /* aliases for short options */ { "source-dir", 1, 0, 'C' }, { "delay-lib", 1, 0, 'd' }, @@ -362,6 +364,11 @@ case LONG_OPT_VERSION: printf( "winebuild version " PACKAGE_VERSION "\n" ); exit(0); + case LONG_OPT_PEDLL: + set_exec_mode( MODE_PEDLL ); + spec_file_name = xstrdup( optarg ); + set_dll_file_name( optarg, spec ); + break; case '?': usage(1); break; @@ -439,9 +446,7 @@ switch (spec->type) { case SPEC_WIN16: - if (argv[0]) - fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); - BuildSpec16File( output_file, spec ); + fatal_error( "Win16 specs are not supported in ReactOS version of winebuild\n" ); break; case SPEC_WIN32: read_undef_symbols( argv ); @@ -466,12 +471,15 @@ BuildDebugFile( output_file, current_src_dir, argv ); break; case MODE_RELAY16: - if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); - BuildRelays16( output_file ); + fatal_error( "Win16 relays are not supported in ReactOS version of winebuild\n" ); break; case MODE_RELAY32: + fatal_error( "Win32 relays are not supported in ReactOS version of winebuild\n" ); + break; + case MODE_PEDLL: if (argv[0]) fatal_error( "file argument '%s' not allowed in this mode\n", argv[0] ); - BuildRelays32( output_file ); + if (!parse_input_file( spec )) break; + BuildPedllFile( output_file, spec ); break; default: usage(1); _____
Added: trunk/reactos/tools/winebuild/mkstemps.c --- vendor/wine/tools/winebuild/current/mkstemps.c 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/mkstemps.c 2005-02-14 18:39:15 UTC (rev 13573) @@ -0,0 +1,138 @@
+/* Copyright (C) 1991, 1992, 1996, 1998 Free Software Foundation, Inc. + This file is derived from mkstemp.c from the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with the GNU C Library; see the file COPYING.LIB. If not, + write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include "config.h" + +#include <sys/types.h> +#include <stdlib.h> +#include <string.h> +#include <errno.h> +#include <stdio.h> +#include <fcntl.h> +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +#ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +#endif +#ifdef HAVE_PROCESS_H +#include <process.h> +#endif + +/* We need to provide a type for gcc_uint64_t. */ +#ifdef __GNUC__ +__extension__ typedef unsigned long long gcc_uint64_t; +#else +typedef unsigned long gcc_uint64_t; +#endif + +#ifndef TMP_MAX +#define TMP_MAX 16384 +#endif + +/* + +@deftypefn Replacement int mkstemps (char *@var{template}, int @var{suffix_len}) + +Generate a unique temporary file name from @var{template}. +@var{template} has the form: + +@example + @var{path}/ccXXXXXX@var{suffix} +@end example + +@var{suffix_len} tells us how long @var{suffix} is (it can be zero +length). The last six characters of @var{template} before @var{suffix} +must be @samp{XXXXXX}; they are replaced with a string that makes the +filename unique. Returns a file descriptor open on the file for +reading and writing. + +@end deftypefn + +*/ + +int +mkstemps ( + char *template, + int suffix_len) +{ + static const char letters[] + = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; + static gcc_uint64_t value; +#ifdef HAVE_GETTIMEOFDAY + struct timeval tv; +#endif + char *XXXXXX; + size_t len; + int count; + + len = strlen (template); + + if ((int) len < 6 + suffix_len + || strncmp (&template[len - 6 - suffix_len], "XXXXXX", 6)) + { + return -1; + } + + XXXXXX = &template[len - 6 - suffix_len]; + +#ifdef HAVE_GETTIMEOFDAY + /* Get some more or less random data. */ + gettimeofday (&tv, NULL); + value += ((gcc_uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid (); +#else + value += getpid (); +#endif + + for (count = 0; count < TMP_MAX; ++count) + { + gcc_uint64_t v = value; + int fd; + + /* Fill in the random bits. */ + XXXXXX[0] = letters[v % 62]; + v /= 62; + XXXXXX[1] = letters[v % 62]; + v /= 62; + XXXXXX[2] = letters[v % 62]; + v /= 62; + XXXXXX[3] = letters[v % 62]; + v /= 62; + XXXXXX[4] = letters[v % 62]; + v /= 62; + XXXXXX[5] = letters[v % 62]; + +#ifdef VMS + fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600, "fop=tmd"); +#else + fd = open (template, O_RDWR|O_CREAT|O_EXCL, 0600); +#endif + if (fd >= 0) + /* The file does not exist. */ + return fd; + + /* This is a random value. It is only necessary that the next + TMP_MAX values generated by adding 7777 to VALUE are different + with (module 2^32). */ + value += 7777; + } + + /* We return the null string if we can't find a unique file name. */ + template[0] = '\0'; + return -1; +} Property changes on: trunk/reactos/tools/winebuild/mkstemps.c ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native _____
Modified: trunk/reactos/tools/winebuild/parser.c --- vendor/wine/tools/winebuild/current/parser.c 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/parser.c 2005-02-14 18:39:15 UTC (rev 13573) @@ -23,7 +23,6 @@
*/
#include "config.h" -#include "wine/port.h"
#include <assert.h> #include <ctype.h> @@ -32,8 +31,7 @@ #include <stdlib.h> #include <string.h>
-#include "windef.h" -#include "winbase.h" +#include "winglue.h" #include "build.h"
int current_line = 0; _____
Modified: trunk/reactos/tools/winebuild/relay.c --- vendor/wine/tools/winebuild/current/relay.c 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/relay.c 2005-02-14 18:39:15 UTC (rev 13573) @@ -23,7 +23,6 @@
*/
#include "config.h" -#include "wine/port.h"
#include <ctype.h>
_____
Modified: trunk/reactos/tools/winebuild/res16.c --- vendor/wine/tools/winebuild/current/res16.c 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/res16.c 2005-02-14 18:39:15 UTC (rev 13573) @@ -19,7 +19,6 @@
*/
#include "config.h" -#include "wine/port.h"
#include <ctype.h> #include <stdlib.h> @@ -37,8 +36,7 @@ #include <sys/mman.h> #endif
-#include "windef.h" -#include "winbase.h" +#include "winglue.h" #include "build.h"
#define ALIGNMENT 2 /* alignment for resource data */ _____
Modified: trunk/reactos/tools/winebuild/res32.c --- vendor/wine/tools/winebuild/current/res32.c 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/res32.c 2005-02-14 18:39:15 UTC (rev 13573) @@ -19,7 +19,6 @@
*/
#include "config.h" -#include "wine/port.h"
#include <ctype.h> #include <stdlib.h> @@ -37,8 +36,7 @@ #include <sys/mman.h> #endif
-#include "windef.h" -#include "winbase.h" +#include "winglue.h" #include "build.h"
/* Unicode string or integer id */ _____
Modified: trunk/reactos/tools/winebuild/spec16.c --- vendor/wine/tools/winebuild/current/spec16.c 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/spec16.c 2005-02-14 18:39:15 UTC (rev 13573) @@ -23,7 +23,6 @@
*/
#include "config.h" -#include "wine/port.h"
#include <assert.h> #include <ctype.h> _____
Modified: trunk/reactos/tools/winebuild/spec32.c --- vendor/wine/tools/winebuild/current/spec32.c 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/spec32.c 2005-02-14 18:39:15 UTC (rev 13573) @@ -23,16 +23,17 @@
*/
#include "config.h" -#include "wine/port.h"
#include <assert.h> #include <ctype.h> #include <stdarg.h> #include <string.h>
-#include "windef.h" -#include "winbase.h" -#include "wine/exception.h" +#include "winglue.h" + +#define EXCEPTION_WINE_STUB 0x80000100 /* stub entry point called */ +#define EH_NONCONTINUABLE 0x01 + #include "build.h"
@@ -860,12 +861,10 @@ int is_data = 0;
if (!odp) continue; - if (odp->flags & FLAG_REGISTER) continue; - if (odp->type == TYPE_STUB) continue; - if (odp->name) name = odp->name; + else if (odp->type == TYPE_STUB) name = make_internal_name( odp, spec, "stub" ); else if (odp->export_name) name = odp->export_name; - else continue; + else name = make_internal_name( odp, spec, "noname_export" );
fprintf(outfile, " %s", name);
@@ -895,13 +894,42 @@ } break; } + case TYPE_STUB: + { + if (!kill_at) + { + const char *check = name + strlen(name); + while (name != check && + '0' <= check[-1] && check[-1] <= '9') + { + check--; + } + if (name != check && check != name + strlen(name) && + '@' == check[-1]) + { + fprintf(outfile, "%s", check - 1); + } + } + if (NULL != odp->name) + { + fprintf(outfile, "=%s", make_internal_name( odp, spec, "stub" )); + } + break; + } default: assert(0); } fprintf( outfile, " @%d", odp->ordinal ); +#if 0 /* MinGW binutils cannot handle this correctly */ if (!odp->name) fprintf( outfile, " NONAME" ); +#else + if (!odp->name && (odp->type == TYPE_STUB || odp->export_name)) fprintf( outfile, " NONAME" ); +#endif if (is_data) fprintf( outfile, " DATA" ); +#if 0 + /* MinGW binutils cannot handle this correctly */ if (odp->flags & FLAG_PRIVATE) fprintf( outfile, " PRIVATE" ); +#endif fprintf( outfile, "\n" ); } } @@ -1006,3 +1034,24 @@
free( prefix ); } + + +/******************************************************************* + * BuildPedllFile + * + * Build a PE DLL C file from a spec file. + */ +void BuildPedllFile( FILE *outfile, DLLSPEC *spec ) +{ + int nr_exports; + + nr_exports = spec->base <= spec->limit ? spec->limit - spec->base + 1 : 0; + output_standard_file_header( outfile ); + + if (nr_exports) + { + /* Output the stub functions */ + + output_stub_funcs( outfile, spec ); + } +} _____
Modified: trunk/reactos/tools/winebuild/utils.c --- vendor/wine/tools/winebuild/current/utils.c 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/utils.c 2005-02-14 18:39:15 UTC (rev 13573) @@ -19,8 +19,11 @@
*/
#include "config.h" -#include "wine/port.h"
+#if !defined(WIN32) +#undef strdup +#endif + #include <ctype.h> #include <stdarg.h> #include <stdio.h> _____
Modified: trunk/reactos/tools/winebuild/winebuild.man.in --- vendor/wine/tools/winebuild/current/winebuild.man.in 2005-02-14 18:36:46 UTC (rev 13572) +++ trunk/reactos/tools/winebuild/winebuild.man.in 2005-02-14 18:39:15 UTC (rev 13573) @@ -1,434 +1,434 @@
-." -*- nroff -*- -.TH WINEBUILD 1 "March 2003" "@PACKAGE_STRING@" "Wine dll builder" -.SH NAME -winebuild - Wine dll builder -.SH SYNOPSIS -.BI winebuild\ [options]\ [input\ files] -.SH DESCRIPTION -.B winebuild -generates the C and assembly files that are necessary to build a Wine -dll, which is basically a Win32 dll encapsulated inside a Unix -library. -.PP -.B winebuild -has different modes, depending on what kind of file it is asked to -generate. The mode is specified by one of the mode options specified -below. In addition to the mode option, various other command-line -option can be specified, as described in the \fBOPTIONS\fR section. -.SH "MODE OPTIONS" -You have to specify exactly one of the following options, depending on -what you want winebuild to generate. -.TP -.BI --dll= filename -Build a C file from a .spec file (see \fBSPEC FILE SYNTAX\fR for -details), or from a standard Windows .def file. The resulting C file -must be compiled and linked to the other object files to build a -working Wine dll. -.br -In that mode, the -.I input files -should be the list of all object files that will be linked into the -final dll, to allow -.B winebuild -to get the list of all undefined symbols that need to be imported from -other dlls. -.TP -.BI --exe= name -Build a C file for the named executable. This is basically the same as -the --dll mode except that it doesn't require a .spec file as input, -since an executable doesn't export functions. The resulting C file -must be compiled and linked to the other object files to build a -working Wine executable, and all the other object files must be listed -as -.I input files. -.TP -.BI --def= file.spec -Build a .def file from a spec file. This is used when building dlls -with a PE (Win32) compiler. -.TP -.B --debug -Build a C file containing the definitions for debugging channels. In -that mode the -.I input files -should be a list of C files to search for debug channel -definitions. The resulting C file must be compiled and linked with the -dll. -.TP -.B --relay16 -Generate the assembly code for the 16-bit relay routines. This is for -Wine internal usage only, you should never need to use this option. -.TP -.B --relay32 -Generate the assembly code for the 32-bit relay routines. This is for -Wine internal usage only, you should never need to use this option. -.SH OPTIONS -.TP -.BI -C,\ --source-dir= directory -Change to the specified directory before reading source files. Only -meaningful in -.BR --debug\ mode. -.TP -.BI -D\ symbol -Ignored for compatibility with the C compiler. -.TP -.BI -e,\ --entry= function -Specify the module entry point function; if not specified, the default -is -.B DllMain -for dlls, and -.B WinMain -for executables (if -.B WinMain -is not defined, the standard C -.B main -is used instead). This is only valid for Win32 modules. -.TP -.BI -f\ flags -Ignored for compatibility with the C compiler. -.TP -.BI -F,\ --filename= filename -Set the file name of the module. The default is to use the base name -of the spec file (without any extension). -.TP -.B -h, --help -Display a usage message and exit. -.TP -.BI -H,\ --heap= size -Specify the size of the module local heap in bytes (only valid for -Win16 modules); default is no local heap. -.TP -.BI -i,\ --ignore= [-]symbol[,[-]symbol] -Specify a list of symbols that should be ignored when resolving -undefined symbols against the imported libraries. This forces these -symbols to be resolved from the Unix C library (or from another Unix -library linked with the application). If a symbol is prefixed by '-' -it is removed from the list instead of being added; a stand-alone '-' -clears the whole list. -.TP -.BI -I\ directory -Ignored for compatibility with the C compiler. -.TP -.B -k, --kill-at -Remove the stdcall decorations from the symbol names in the -generated .def file. Only meaningful in \fB--def\fR mode. -.TP -.BI -K\ flags -Ignored for compatibility with the C compiler. -.TP -.BI --ld-cmd= ld-command -Specify the command to use to link the object files; the default is -\fBld\fR. -.TP -.BI --nm-cmd= nm-command -Specify the command to use to get the list of undefined symbols; the -default is \fBnm\fR. -.TP -.BI -L,\ --library-path= directory -Append the specified directory to the list of directories that are -searched for import libraries. -.TP -.BI -l,\ --library= name -Import the specified library, looking for a corresponding -\fIlibname.def\fR file in the directories specified with the \fB-L\fR -option. -.TP -.BI -d,\ --delay-lib= name -Same as the \fB-l\fR option, but import the specified library in -delayed mode (i.e. the library won't be loaded until a function -imported from it is actually called). -.TP -.BI -M,\ --main-module= module -Specify that we are building a 16-bit dll, that will ultimately be -linked together with the 32-bit dll specified in \fImodule\fR. Only -meaningful in \fB--dll\fR mode. -.TP -.BI -N,\ --dll-name= dllname -Set the internal name of the module. It is only used in Win16 -modules. The default is to use the base name of the spec file (without -any extension). This is used for KERNEL, since it lives in -KRNL386.EXE. It shouldn't be needed otherwise. -.TP -.BI -o,\ --output= file -Set the name of the output file (default is standard output). -.TP -.BI -r,\ --res= rsrc.res -Load resources from the specified binary resource file. The -\fIrsrc.res\fR can be produced from a source resource file with -.BR wrc(1) -(or with a Windows resource compiler). -.br -This option is only necessary for Win16 resource files, the Win32 ones -can simply listed as -.I input files -and will automatically be handled correctly (though the -.B -r -option will also work for Win32 files). -.TP -.BI --subsystem= subsystem[:major[.minor]] -Set the subsystem of the executable, which can be one of the following: -.br -.B console -for a command line executable, -.br -.B windows -for a graphical executable, -.br -.B native -for a native-mode dll. -.br -The entry point of a command line executable is a normal C \fBmain\fR -function. A \fBwmain\fR function can be used instead if you need the -argument array to use Unicode strings. A graphical executable has a -\fBWinMain\fR entry point. -.br -Optionally a major and minor subsystem version can also be specified; -the default subsystem version is 4.0. -.TP -.B --version -Display the program version and exit. -.TP -.B -w, --warnings -Turn on warnings. -.SH "SPEC FILE SYNTAX" -.SS "General syntax" -A spec file should contain a list of ordinal declarations. The general -syntax is the following: -.PP -.I ordinal functype -.RI [ flags ]\ exportname \ \fB(\fR\ [ args... ] \ \fB) \ [ handler ] -.br -.IB ordinal\ variable -.RI [ flags ]\ exportname \ \fB(\fR\ [ data... ] \ \fB) -.br -.IB ordinal\ extern -.RI [ flags ]\ exportname \ [ symbolname ] -.br -.IB ordinal\ stub -.RI [ flags ]\ exportname -.br -.IB ordinal\ equate -.RI [ flags ]\ exportname\ data -.br -.BI #\ comments -.PP -Declarations must fit on a single line, except if the end of line is -escaped using a backslash character. The -.B # -character anywhere in a line causes the rest of the line to be ignored -as a comment. -.PP -.I ordinal -specifies the ordinal number corresponding to the entry point, or '@' -for automatic ordinal allocation (Win32 only). -.PP -.I flags -is a series of optional flags, preceded by a '-' character. The -supported flags are: -.RS -.TP -.B -norelay -The entry point is not displayed in relay debugging traces (Win32 -only). -.TP -.B -noname -The entry point will be imported by ordinal instead of by name. -.TP -.B -ret16 -The function returns a 16-bit value (Win16 only). -.TP -.B -ret64 -The function returns a 64-bit value (Win32 only). -.TP -.B -i386 -The entry point is only available on i386 platforms. -.TP -.B -register -The function uses CPU register to pass arguments. -.TP -.B -private -The function cannot be imported from other dlls, it can only be -accessed through GetProcAddress. -.SS "Function ordinals" -Syntax: -.br -.I ordinal functype -.RI [ flags ]\ exportname \ \fB(\fR\ [ args... ] \ \fB) \ [ handler ] -.br - -This declaration defines a function entry point. The prototype defined by -.IR exportname \ \fB(\fR\ [ args... ] \ \fB) -specifies the name available for dynamic linking and the format of the -arguments. '@' can be used instead of -.I exportname -for ordinal-only exports. -.PP -.I functype -should be one of: -.RS -.TP -.B stdcall -for a normal Win32 function -.TP -.B pascal -for a normal Win16 function -.TP -.B cdecl -for a Win16 or Win32 function using the C calling convention -.TP -.B varargs -for a Win16 or Win32 function using the C calling convention with a -variable number of arguments -.RE -.PP -.I args -should be one or several of: -.RS -.TP -.B word -(16-bit unsigned value) -.TP -.B s_word -(16-bit signed word) -.TP -.B long -(32-bit value) -.TP -.B double -(64-bit value) -.TP -.B ptr -(linear pointer) -.TP -.B str -(linear pointer to a null-terminated ASCII string) -.TP -.B wstr -(linear pointer to a null-terminated Unicode string) -.TP -.B segptr -(segmented pointer) -.TP -.B segstr -(segmented pointer to a null-terminated ASCII string). -.HP -.RB Only\ ptr ,\ str ,\ wstr ,\ long\ and\ double -are valid for Win32 functions. -.RE -.PP -.I handler -is the name of the actual C function that will implement that entry -point in 32-bit mode. The handler can also be specified as -.IB dllname . function -to define a forwarded function (one whose implementation is in another -dll). If -.I handler -is not specified, it is assumed to be identical to -.I exportname. -.PP -This first example defines an entry point for the 32-bit GetFocus() -call: -.IP -@ stdcall GetFocus() GetFocus -.PP -This second example defines an entry point for the 16-bit -CreateWindow() call (the ordinal 100 is just an example); it also -shows how long lines can be split using a backslash: -.IP -100 pascal CreateWindow(ptr ptr long s_word s_word s_word \ - s_word word word word ptr) WIN_CreateWindow -.PP -To declare a function using a variable number of arguments, specify -the function as -.B varargs -and declare it in the C file with a '...' parameter for a Win32 -function, or with an extra VA_LIST16 argument for a Win16 function. -See the wsprintf* functions in user.exe.spec and user32.spec for an -example. -.SS "Variable ordinals" -Syntax: -.br -.IB ordinal\ variable -.RI [ flags ]\ exportname \ \fB(\fR\ [ data... ] \ \fB) -.PP -This declaration defines data storage as 32-bit words at the ordinal -specified. -.I exportname -will be the name available for dynamic -linking. -.I 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: -.IP -2 variable VariableA(-1 0xff 0 0) -.PP -This declaration only works in Win16 spec files. In Win32 you should -use -.B extern -instead (see below). -.SS "Extern ordinals" -Syntax: -.br -.IB ordinal\ extern -.RI [ flags ]\ exportname \ [ symbolname ] -.PP -This declaration defines an entry that simply maps to a C symbol -(variable or function). It only works in Win32 spec files. -.I exportname -will point to the symbol -.I symbolname -that must be defined in the C code. Alternatively, it can be of the -form -.IB dllname . symbolname -to define a forwarded symbol (one whose implementation is in another -dll). If -.I symbolname -is not specified, it is assumed to be identical to -.I exportname. -.SS "Stub ordinals" -Syntax: -.br -.IB ordinal\ stub -.RI [ flags ]\ exportname -.PP -This declaration 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. -.SS "Equate ordinals" -Syntax: -.br -.IB ordinal\ equate -.RI [ flags ]\ exportname\ data -.PP -This declaration defines an ordinal as an absolute value. -.I exportname -will be the name available for dynamic linking. -.I data -can be a decimal number or a hex number preceeded by "0x". -.SH AUTHORS -.B winebuild -has been worked on by many people over the years. The main authors are -Robert J. Amstadt, Alexandre Julliard, Martin von Loewis, Ulrich -Weigand and Eric Youngdale. Many other Wine developers have -contributed, please check the file Changelog in the Wine distribution -for the complete details. -.SH BUGS -It is not yet possible to use a PE-format dll in an import -specification; only Wine dlls can be imported. -.PP -If you find a bug, please submit a bug report at -.UR http://bugs.winehq.org -.B http://bugs.winehq.org. -.UE -.SH AVAILABILITY -.B winebuild -is part of the wine distribution, which is available through WineHQ, -the -.B wine -development headquarters, at -.UR http://www.winehq.org/ -.B http://www.winehq.org/. -.UE -.SH "SEE ALSO" -.BR wine (1), -.BR wrc (1). +." -*- nroff -*- +.TH WINEBUILD 1 "March 2003" "@PACKAGE_STRING@" "Wine dll builder" +.SH NAME +winebuild - Wine dll builder +.SH SYNOPSIS [truncated at 1000 lines; 471 more skipped]