37#include "wpp_private.h"
41"Usage: widl [options...] infile.idl\n"
42" or: widl [options...] --dlldata-only name1 [name2...]\n"
43" --acf=file Use ACF file\n"
44" --align=n Set structure packing to 'n'\n"
45" -app_config Ignored, present for midl compatibility\n"
46" -b arch Set the target architecture\n"
47" -c Generate client stub\n"
48" -d n Set debug level to 'n'\n"
49" -D id[=val] Define preprocessor identifier id=val\n"
50" -E Preprocess only\n"
51" --help Display this help and exit\n"
52" -h Generate headers\n"
53" -H file Name of header file (default is infile.h)\n"
54" -I directory Add directory to the include search path (multiple -I allowed)\n"
55" -L directory Add directory to the library search path (multiple -L allowed)\n"
56" --local-stubs=file Write empty stubs for call_as/local methods to file\n"
57" -m32, -m64 Set the target architecture (Win32 or Win64)\n"
58" -N Do not preprocess input\n"
59" --nostdinc Do not search the standard include path\n"
60" --ns_prefix Prefix namespaces with ABI namespace\n"
61" --oldnames Use old naming conventions\n"
62" --oldtlb Generate typelib in the old format (SLTG)\n"
63" -o, --output=NAME Set the output file name\n"
64" -Otype Type of stubs to generate (-Os, -Oi, -Oif)\n"
66" --packing=n Set structure packing to 'n'\n"
67" --prefix-all=p Prefix names of client stubs / server functions with 'p'\n"
68" --prefix-client=p Prefix names of client stubs with 'p'\n"
69" --prefix-server=p Prefix names of server functions with 'p'\n"
70" -r Generate registration script\n"
71" -robust Ignored, present for midl compatibility\n"
72" --sysroot=DIR Prefix include paths with DIR\n"
73" -s Generate server stub\n"
74" -t Generate typelib\n"
75" -u Generate interface identifiers file\n"
76" -V Print version and exit\n"
77" -W Enable pedantic warnings\n"
78" --win32, --win64 Set the target architecture (Win32 or Win64)\n"
79" --winrt Enable Windows Runtime mode\n"
80"Debug level 'n' is a bitmask with following meaning:\n"
81" * 0x01 Tell which resource is parsed (verbose mode)\n"
82" * 0x02 Dump internal structures\n"
83" * 0x04 Create a parser trace (yydebug=1)\n"
84" * 0x08 Preprocessor messages\n"
85" * 0x10 Preprocessor lex messages\n"
86" * 0x20 Preprocessor yacc trace\n"
90 "Copyright 2002 Ove Kaaven\n";
174 "b:cC:d:D:EhH:I:L:m:No:O:pP:rsS:tT:uU:VW";
187 {
"output", 0,
'o' },
194 {
"target", 0,
'b' },
227 char version_str[32];
270 fprintf(fp,
"#ifdef __cplusplus\n");
271 fprintf(fp,
"extern \"C\" {\n");
277 fprintf(fp,
"#ifdef __cplusplus\n");
292 fprintf(dlldata,
"- Do not edit ***/\n\n");
293 if (define_proxy_delegation)
294 fprintf(dlldata,
"#define PROXY_DELEGATION\n");
297 fprintf(dlldata,
"#ifdef __REACTOS__\n");
298 fprintf(dlldata,
"#define WIN32_NO_STATUS\n");
299 fprintf(dlldata,
"#define WIN32_LEAN_AND_MEAN\n");
300 fprintf(dlldata,
"#endif\n\n");
303 fprintf(dlldata,
"#include <objbase.h>\n");
304 fprintf(dlldata,
"#include <rpcproxy.h>\n\n");
307 for (
i = 0;
i < filenames.
count;
i++)
308 fprintf(dlldata,
"EXTERN_PROXY_FILE(%s)\n", filenames.
str[
i]);
310 fprintf(dlldata,
"\nPROXYFILE_LIST_START\n");
311 fprintf(dlldata,
"/* Start of list */\n");
312 for (
i = 0;
i < filenames.
count;
i++)
313 fprintf(dlldata,
" REFERENCE_PROXY_FILE(%s),\n", filenames.
str[
i]);
314 fprintf(dlldata,
"/* End of list */\n");
315 fprintf(dlldata,
"PROXYFILE_LIST_END\n\n");
317 fprintf(dlldata,
"DLLDATA_ROUTINES(aProxyFileList, GET_DLL_CLSID)\n\n");
332 int define_proxy_delegation = 0;
342 static const char marker[] =
"REFERENCE_PROXY_FILE";
343 static const char delegation_define[] =
"#define PROXY_DELEGATION";
355 while (*
end && *
end !=
')')
364 }
else if (!define_proxy_delegation &&
strncmp(
start, delegation_define,
sizeof(delegation_define)-1)) {
365 define_proxy_delegation = 1;
387 fprintf(
f,
"MIDL_DEFINE_GUID(%s, %s_%s, 0x%08x, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,"
388 "0x%02x,0x%02x,0x%02x,0x%02x,0x%02x);\n",
462 fprintf(
idfile,
"#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \\\n");
463 fprintf(
idfile,
" DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)\n\n");
467 fprintf(
idfile,
"#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \\\n");
468 fprintf(
idfile,
" EXTERN_C const type DECLSPEC_SELECTANY name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}\n\n");
472 fprintf(
idfile,
"#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \\\n");
473 fprintf(
idfile,
" const type DECLSPEC_SELECTANY name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}\n\n");
539 error(
"Structure packing must be one of 2, 4 or 8\n");
553 error(
"Invalid target specification '%s'\n",
optarg );
653 static const char *default_dirs[] = {
LIBDIR "/wine",
"/usr/lib/wine",
"/usr/local/lib/wine" };
660#define TRYOPEN(str) do { \
662 if ((fd = open( file, O_RDONLY | O_BINARY )) != -1) return fd; \
663 free( file ); } while(0)
691 if (
i && !
strcmp( default_dirs[
i], default_dirs[0] ))
continue;
724 static const char *incl_dirs[] = { INCLUDEDIR,
"/usr/include",
"/usr/local/include" };
733 if (
i && !
strcmp( incl_dirs[
i], incl_dirs[0] ))
continue;
792 else if (files.
count > 1) {
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
char * strchr(const char *String, int ch)
char * xstrdup(const char *s)
void parse_options(struct packet *)
int wpp_parse(const char *input, FILE *output)
static const WCHAR *const ext[]
static const WCHAR version[]
int __cdecl atexit(void(__cdecl *function)(void))
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei GLenum type
GLsizeiptr const GLvoid GLenum usage
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat token
_Check_return_ _CRTIMP int __cdecl isalnum(_In_ int _C)
_Check_return_ _CRTIMP int __cdecl ferror(_In_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
_CRTIMP void __cdecl setbuf(_Inout_ FILE *_File, _Inout_updates_opt_(BUFSIZ) _Post_readable_size_(0) char *_Buffer)
const char * strerror(int err)
char * strmake(size_t *lenp,...)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
union _statement_t::@5358 u
const attr_list_t * attrs
static enum type_type type_get_type(const type_t *type)
static type_t * type_iface_get_async_iface(const type_t *type)
void start_cplusplus_guard(FILE *fp)
static struct strarray dlldirs
static void write_dlldata_list(struct strarray filenames, int define_proxy_delegation)
const char * prefix_server
static const char short_options[]
static const char * bindir
static const char * libdir
static const char * sysroot
static void write_id_guid(FILE *f, const char *type, const char *guid_prefix, const char *name, const struct uuid *uuid)
static void rm_tempfile(void)
unsigned int pointer_size
static void exit_on_signal(int sig)
static const char * includedir
static char * output_name
static void option_callback(int optc, char *optarg)
FILE * open_input_file(const char *path)
static const char version_string[]
static char * eat_space(char *s)
static char * dup_basename_token(const char *name, const char *ext)
static const struct long_option long_options[]
char * find_input_file(const char *name, const char *parent)
static void write_id_data_stmts(const statement_list_t *stmts)
static void add_widl_version_define(void)
struct strarray temp_files
void write_dlldata(const statement_list_t *stmts)
void end_cplusplus_guard(FILE *fp)
static char * make_token(const char *name)
static void set_everything(int x)
void write_id_data(const statement_list_t *stmts)
static char * idfile_name
static int preprocess_only
const char * prefix_client
int open_typelib(const char *name)
#define DEBUGLEVEL_PPTRACE
int wpp_add_cmdline_define(const char *value)
void wpp_set_debug(int lex_debug, int parser_debug, int msg_debug)
char * wpp_find_include(const char *name, const char *parent_name)
int wpp_add_include_path(const char *path)