2005-02-20 15:02:48 +00:00
|
|
|
/*
|
|
|
|
* IDL Compiler
|
|
|
|
*
|
|
|
|
* Copyright 2002 Ove Kaaven
|
|
|
|
* Copyright 2004 Mike McCormack
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This 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
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-07-30 12:58:24 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-02-20 15:02:48 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
2006-07-30 12:58:24 +00:00
|
|
|
#include "wine/port.h"
|
2005-02-20 15:02:48 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#ifdef HAVE_UNISTD_H
|
|
|
|
# include <unistd.h>
|
|
|
|
#endif
|
|
|
|
#include <string.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
|
|
|
|
#include "widl.h"
|
|
|
|
#include "utils.h"
|
|
|
|
#include "parser.h"
|
|
|
|
#include "header.h"
|
2008-01-11 13:46:33 +00:00
|
|
|
#include "typegen.h"
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
#include "expr.h"
|
2005-02-20 15:02:48 +00:00
|
|
|
|
|
|
|
static FILE* proxy;
|
|
|
|
static int indent = 0;
|
|
|
|
|
2009-08-07 20:15:12 +00:00
|
|
|
static void print_proxy( const char *format, ... ) __attribute__((format (printf, 1, 2)));
|
2008-01-11 13:46:33 +00:00
|
|
|
static void print_proxy( const char *format, ... )
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
|
|
|
va_list va;
|
|
|
|
va_start( va, format );
|
2008-01-11 13:46:33 +00:00
|
|
|
print( proxy, indent, format, va );
|
2005-02-20 15:02:48 +00:00
|
|
|
va_end( va );
|
2007-05-21 18:28:00 +00:00
|
|
|
}
|
|
|
|
|
2005-02-20 15:02:48 +00:00
|
|
|
static void write_stubdescproto(void)
|
|
|
|
{
|
2008-01-11 13:46:33 +00:00
|
|
|
print_proxy( "static const MIDL_STUB_DESC Object_StubDesc;\n");
|
2007-05-21 18:28:00 +00:00
|
|
|
print_proxy( "\n");
|
|
|
|
}
|
|
|
|
|
2008-01-11 13:46:33 +00:00
|
|
|
static void write_stubdesc(int expr_eval_routines)
|
2007-05-21 18:28:00 +00:00
|
|
|
{
|
2008-01-11 13:46:33 +00:00
|
|
|
print_proxy( "static const MIDL_STUB_DESC Object_StubDesc =\n{\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
indent++;
|
|
|
|
print_proxy( "0,\n");
|
2008-01-11 13:46:33 +00:00
|
|
|
print_proxy( "NdrOleAllocate,\n");
|
|
|
|
print_proxy( "NdrOleFree,\n");
|
|
|
|
print_proxy( "{0}, 0, 0, %s, 0,\n", expr_eval_routines ? "ExprEvalRoutines" : "0");
|
|
|
|
print_proxy( "__MIDL_TypeFormatString.Format,\n");
|
|
|
|
print_proxy( "1, /* -error bounds_check flag */\n");
|
2011-08-09 22:51:55 +00:00
|
|
|
print_proxy( "0x%x, /* Ndr library version */\n", get_stub_mode() == MODE_Oif ? 0x50002 : 0x10001);
|
2008-01-11 13:46:33 +00:00
|
|
|
print_proxy( "0,\n");
|
|
|
|
print_proxy( "0x50100a4, /* MIDL Version 5.1.164 */\n");
|
|
|
|
print_proxy( "0,\n");
|
|
|
|
print_proxy("%s,\n", list_empty(&user_type_list) ? "0" : "UserMarshalRoutines");
|
|
|
|
print_proxy( "0, /* notify & notify_flag routine table */\n");
|
|
|
|
print_proxy( "1, /* Flags */\n");
|
|
|
|
print_proxy( "0, /* Reserved3 */\n");
|
|
|
|
print_proxy( "0, /* Reserved4 */\n");
|
|
|
|
print_proxy( "0 /* Reserved5 */\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
indent--;
|
|
|
|
print_proxy( "};\n");
|
|
|
|
print_proxy( "\n");
|
|
|
|
}
|
|
|
|
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
static void init_proxy(const statement_list_t *stmts)
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
|
|
|
if (proxy) return;
|
|
|
|
if(!(proxy = fopen(proxy_name, "w")))
|
|
|
|
error("Could not open %s for output\n", proxy_name);
|
2008-01-11 13:46:33 +00:00
|
|
|
print_proxy( "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION, input_name);
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( "\n");
|
2013-01-24 23:00:42 +00:00
|
|
|
print_proxy( "#define __midl_proxy\n\n");
|
|
|
|
|
|
|
|
print_proxy( "#ifdef __REACTOS__\n");
|
|
|
|
print_proxy( "#define WIN32_NO_STATUS\n");
|
|
|
|
print_proxy( "#define WIN32_LEAN_AND_MEAN\n");
|
|
|
|
print_proxy( "#endif\n\n");
|
|
|
|
|
2008-01-11 13:46:33 +00:00
|
|
|
print_proxy( "#include \"objbase.h\"\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( "\n");
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "#ifndef DECLSPEC_HIDDEN\n");
|
|
|
|
print_proxy( "#define DECLSPEC_HIDDEN\n");
|
|
|
|
print_proxy( "#endif\n");
|
|
|
|
print_proxy( "\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
}
|
|
|
|
|
2008-01-11 13:46:33 +00:00
|
|
|
static void clear_output_vars( const var_list_t *args )
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
2008-01-11 13:46:33 +00:00
|
|
|
const var_t *arg;
|
|
|
|
|
|
|
|
if (!args) return;
|
|
|
|
LIST_FOR_EACH_ENTRY( arg, args, const var_t, entry )
|
|
|
|
{
|
2011-08-09 22:51:55 +00:00
|
|
|
if (is_attr(arg->attrs, ATTR_IN)) continue;
|
|
|
|
if (!is_attr(arg->attrs, ATTR_OUT)) continue;
|
|
|
|
if (is_ptr(arg->type))
|
|
|
|
{
|
|
|
|
if (type_get_type(type_pointer_get_ref(arg->type)) == TYPE_BASIC) continue;
|
|
|
|
if (type_get_type(type_pointer_get_ref(arg->type)) == TYPE_ENUM) continue;
|
|
|
|
}
|
|
|
|
print_proxy( "if (%s) MIDL_memset( %s, 0, sizeof( *%s ));\n", arg->name, arg->name, arg->name );
|
2005-02-20 15:02:48 +00:00
|
|
|
}
|
2007-05-21 18:28:00 +00:00
|
|
|
}
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
static int need_delegation(const type_t *iface)
|
|
|
|
{
|
2011-08-09 22:51:55 +00:00
|
|
|
const type_t *parent = type_iface_get_inherit( iface );
|
|
|
|
return parent && type_iface_get_inherit(parent) && (parent->ignore || is_local( parent->attrs ));
|
2009-01-15 17:52:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int get_delegation_indirect(const type_t *iface, const type_t ** delegate_to)
|
|
|
|
{
|
|
|
|
const type_t * cur_iface;
|
2009-01-19 12:24:52 +00:00
|
|
|
for (cur_iface = iface; cur_iface != NULL; cur_iface = type_iface_get_inherit(cur_iface))
|
2009-01-15 17:52:35 +00:00
|
|
|
if (need_delegation(cur_iface))
|
|
|
|
{
|
|
|
|
if(delegate_to)
|
2009-01-19 12:24:52 +00:00
|
|
|
*delegate_to = type_iface_get_inherit(cur_iface);
|
2009-01-15 17:52:35 +00:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int need_delegation_indirect(const type_t *iface)
|
|
|
|
{
|
|
|
|
return get_delegation_indirect(iface, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void free_variable( const var_t *arg, const char *local_var_prefix )
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
2012-08-12 16:19:13 +00:00
|
|
|
unsigned int type_offset = arg->typestring_offset;
|
2008-01-11 13:46:33 +00:00
|
|
|
type_t *type = arg->type;
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2011-08-09 22:51:55 +00:00
|
|
|
write_parameter_conf_or_var_exprs(proxy, indent, local_var_prefix, PHASE_FREE, arg, FALSE);
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2009-08-07 20:15:12 +00:00
|
|
|
switch (typegen_detect_type(type, arg->attrs, TDT_IGNORE_STRINGS))
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
2009-08-07 20:15:12 +00:00
|
|
|
case TGT_ENUM:
|
|
|
|
case TGT_BASIC:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case TGT_STRUCT:
|
|
|
|
if (get_struct_fc(type) != RPC_FC_STRUCT)
|
|
|
|
print_proxy("/* FIXME: %s code for %s struct type 0x%x missing */\n", __FUNCTION__, arg->name, get_struct_fc(type) );
|
2005-02-20 15:02:48 +00:00
|
|
|
break;
|
|
|
|
|
2009-08-07 20:15:12 +00:00
|
|
|
case TGT_IFACE_POINTER:
|
|
|
|
case TGT_POINTER:
|
2011-08-09 22:51:55 +00:00
|
|
|
case TGT_ARRAY:
|
|
|
|
print_proxy( "NdrClearOutParameters( &__frame->_StubMsg, ");
|
|
|
|
fprintf(proxy, "&__MIDL_TypeFormatString.Format[%u], ", type_offset );
|
|
|
|
fprintf(proxy, "(void *)%s );\n", arg->name );
|
2005-02-20 15:02:48 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2009-08-07 20:15:12 +00:00
|
|
|
print_proxy("/* FIXME: %s code for %s type %d missing */\n", __FUNCTION__, arg->name, type_get_type(type) );
|
2005-02-20 15:02:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
static void proxy_free_variables( var_list_t *args, const char *local_var_prefix )
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
2008-01-11 13:46:33 +00:00
|
|
|
const var_t *arg;
|
|
|
|
|
|
|
|
if (!args) return;
|
|
|
|
LIST_FOR_EACH_ENTRY( arg, args, const var_t, entry )
|
2007-10-19 23:21:45 +00:00
|
|
|
if (is_attr(arg->attrs, ATTR_OUT))
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
2009-01-15 17:52:35 +00:00
|
|
|
free_variable( arg, local_var_prefix );
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, "\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
static void gen_proxy(type_t *iface, const var_t *func, int idx,
|
2008-01-11 13:46:33 +00:00
|
|
|
unsigned int proc_offset)
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
2012-08-12 16:19:13 +00:00
|
|
|
var_t *retval = type_function_get_retval(func->type);
|
|
|
|
int has_ret = !is_void(retval->type);
|
2009-01-19 12:24:52 +00:00
|
|
|
int has_full_pointer = is_full_pointer_function(func);
|
|
|
|
const char *callconv = get_attrp(func->type->attrs, ATTR_CALLCONV);
|
2011-08-09 22:51:55 +00:00
|
|
|
const var_list_t *args = type_get_function_args(func->type);
|
2010-10-12 20:51:07 +00:00
|
|
|
if (!callconv) callconv = "STDMETHODCALLTYPE";
|
2005-02-20 15:02:48 +00:00
|
|
|
|
|
|
|
indent = 0;
|
2011-08-09 22:51:55 +00:00
|
|
|
if (is_interpreted_func( iface, func ))
|
|
|
|
{
|
|
|
|
if (get_stub_mode() == MODE_Oif && !is_callas( func->attrs )) return;
|
2012-08-12 16:19:13 +00:00
|
|
|
write_type_decl_left(proxy, retval->type);
|
2011-08-09 22:51:55 +00:00
|
|
|
print_proxy( " %s %s_%s_Proxy(\n", callconv, iface->name, get_name(func));
|
|
|
|
write_args(proxy, args, iface->name, 1, TRUE);
|
|
|
|
print_proxy( ")\n");
|
|
|
|
write_client_call_routine( proxy, iface, func, "Object", proc_offset );
|
|
|
|
return;
|
|
|
|
}
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "static void __finally_%s_%s_Proxy( struct __proxy_frame *__frame )\n",
|
2009-01-19 12:24:52 +00:00
|
|
|
iface->name, get_name(func) );
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "{\n");
|
|
|
|
indent++;
|
2009-01-19 12:24:52 +00:00
|
|
|
if (has_full_pointer) write_full_pointer_free(proxy, indent, func);
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "NdrProxyFreeBuffer( __frame->This, &__frame->_StubMsg );\n" );
|
|
|
|
indent--;
|
|
|
|
print_proxy( "}\n");
|
|
|
|
print_proxy( "\n");
|
|
|
|
|
2012-08-12 16:19:13 +00:00
|
|
|
write_type_decl_left(proxy, retval->type);
|
2009-01-19 12:24:52 +00:00
|
|
|
print_proxy( " %s %s_%s_Proxy(\n", callconv, iface->name, get_name(func));
|
2011-08-09 22:51:55 +00:00
|
|
|
write_args(proxy, args, iface->name, 1, TRUE);
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( ")\n");
|
|
|
|
print_proxy( "{\n");
|
|
|
|
indent ++;
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "struct __proxy_frame __f, * const __frame = &__f;\n" );
|
2005-02-20 15:02:48 +00:00
|
|
|
/* local variables */
|
|
|
|
if (has_ret) {
|
2009-08-07 20:15:12 +00:00
|
|
|
print_proxy( "%s", "" );
|
2012-08-12 16:19:13 +00:00
|
|
|
write_type_decl(proxy, retval->type, retval->name);
|
|
|
|
fprintf( proxy, ";\n" );
|
2005-02-20 15:02:48 +00:00
|
|
|
}
|
2008-01-11 13:46:33 +00:00
|
|
|
print_proxy( "RPC_MESSAGE _RpcMessage;\n" );
|
|
|
|
if (has_ret) {
|
2012-08-12 16:19:13 +00:00
|
|
|
if (decl_indirect(retval->type))
|
|
|
|
print_proxy("void *_p_%s = &%s;\n", retval->name, retval->name);
|
2008-01-11 13:46:33 +00:00
|
|
|
}
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( "\n");
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
print_proxy( "RpcExceptionInit( __proxy_filter, __finally_%s_%s_Proxy );\n", iface->name, get_name(func) );
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "__frame->This = This;\n" );
|
|
|
|
|
2008-02-10 10:10:44 +00:00
|
|
|
if (has_full_pointer)
|
2009-01-19 12:24:52 +00:00
|
|
|
write_full_pointer_init(proxy, indent, func, FALSE);
|
2008-02-10 10:10:44 +00:00
|
|
|
|
2005-02-20 15:02:48 +00:00
|
|
|
/* FIXME: trace */
|
2009-01-19 12:24:52 +00:00
|
|
|
clear_output_vars( type_get_function_args(func->type) );
|
2005-02-20 15:02:48 +00:00
|
|
|
|
|
|
|
print_proxy( "RpcTryExcept\n" );
|
|
|
|
print_proxy( "{\n" );
|
|
|
|
indent++;
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "NdrProxyInitialize(This, &_RpcMessage, &__frame->_StubMsg, &Object_StubDesc, %d);\n", idx);
|
2011-08-09 22:51:55 +00:00
|
|
|
write_pointer_checks( proxy, indent, func );
|
2005-02-20 15:02:48 +00:00
|
|
|
|
|
|
|
print_proxy( "RpcTryFinally\n" );
|
|
|
|
print_proxy( "{\n" );
|
|
|
|
indent++;
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
write_remoting_arguments(proxy, indent, func, "", PASS_IN, PHASE_BUFFERSIZE);
|
2008-01-11 13:46:33 +00:00
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "NdrProxyGetBuffer(This, &__frame->_StubMsg);\n" );
|
2008-01-11 13:46:33 +00:00
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
write_remoting_arguments(proxy, indent, func, "", PASS_IN, PHASE_MARSHAL);
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "NdrProxySendReceive(This, &__frame->_StubMsg);\n" );
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, "\n");
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "__frame->_StubMsg.BufferStart = _RpcMessage.Buffer;\n" );
|
|
|
|
print_proxy( "__frame->_StubMsg.BufferEnd = __frame->_StubMsg.BufferStart + _RpcMessage.BufferLength;\n\n" );
|
2008-01-11 13:46:33 +00:00
|
|
|
|
|
|
|
print_proxy("if ((_RpcMessage.DataRepresentation & 0xffff) != NDR_LOCAL_DATA_REPRESENTATION)\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
indent++;
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy("NdrConvert( &__frame->_StubMsg, &__MIDL_ProcFormatString.Format[%u]);\n", proc_offset );
|
2005-02-20 15:02:48 +00:00
|
|
|
indent--;
|
|
|
|
fprintf(proxy, "\n");
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
write_remoting_arguments(proxy, indent, func, "", PASS_OUT, PHASE_UNMARSHAL);
|
2008-01-11 13:46:33 +00:00
|
|
|
|
|
|
|
if (has_ret)
|
|
|
|
{
|
2012-08-12 16:19:13 +00:00
|
|
|
if (decl_indirect(retval->type))
|
|
|
|
print_proxy("MIDL_memset(&%s, 0, sizeof(%s));\n", retval->name, retval->name);
|
|
|
|
else if (is_ptr(retval->type) || is_array(retval->type))
|
|
|
|
print_proxy("%s = 0;\n", retval->name);
|
2009-01-19 12:24:52 +00:00
|
|
|
write_remoting_arguments(proxy, indent, func, "", PASS_RETURN, PHASE_UNMARSHAL);
|
2007-05-21 18:28:00 +00:00
|
|
|
}
|
2005-02-20 15:02:48 +00:00
|
|
|
|
|
|
|
indent--;
|
|
|
|
print_proxy( "}\n");
|
|
|
|
print_proxy( "RpcFinally\n" );
|
|
|
|
print_proxy( "{\n" );
|
|
|
|
indent++;
|
2009-01-19 12:24:52 +00:00
|
|
|
print_proxy( "__finally_%s_%s_Proxy( __frame );\n", iface->name, get_name(func) );
|
2005-02-20 15:02:48 +00:00
|
|
|
indent--;
|
|
|
|
print_proxy( "}\n");
|
|
|
|
print_proxy( "RpcEndFinally\n" );
|
|
|
|
indent--;
|
|
|
|
print_proxy( "}\n" );
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "RpcExcept(__frame->_StubMsg.dwStubPhase != PROXY_SENDRECEIVE)\n" );
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( "{\n" );
|
|
|
|
if (has_ret) {
|
|
|
|
indent++;
|
2009-01-19 12:24:52 +00:00
|
|
|
proxy_free_variables( type_get_function_args(func->type), "" );
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( "_RetVal = NdrProxyErrorHandler(RpcExceptionCode());\n" );
|
|
|
|
indent--;
|
|
|
|
}
|
|
|
|
print_proxy( "}\n" );
|
|
|
|
print_proxy( "RpcEndExcept\n" );
|
|
|
|
|
|
|
|
if (has_ret) {
|
|
|
|
print_proxy( "return _RetVal;\n" );
|
|
|
|
}
|
|
|
|
indent--;
|
|
|
|
print_proxy( "}\n");
|
|
|
|
print_proxy( "\n");
|
|
|
|
}
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
static void gen_stub(type_t *iface, const var_t *func, const char *cas,
|
2008-01-11 13:46:33 +00:00
|
|
|
unsigned int proc_offset)
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
2008-01-11 13:46:33 +00:00
|
|
|
const var_t *arg;
|
2009-01-19 12:24:52 +00:00
|
|
|
int has_ret = !is_void(type_function_get_rettype(func->type));
|
|
|
|
int has_full_pointer = is_full_pointer_function(func);
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2011-08-09 22:51:55 +00:00
|
|
|
if (is_interpreted_func( iface, func )) return;
|
|
|
|
|
2005-02-20 15:02:48 +00:00
|
|
|
indent = 0;
|
2009-01-19 12:24:52 +00:00
|
|
|
print_proxy( "struct __frame_%s_%s_Stub\n{\n", iface->name, get_name(func));
|
2009-01-15 17:52:35 +00:00
|
|
|
indent++;
|
|
|
|
print_proxy( "__DECL_EXCEPTION_FRAME\n" );
|
|
|
|
print_proxy( "MIDL_STUB_MESSAGE _StubMsg;\n");
|
|
|
|
print_proxy( "%s * _This;\n", iface->name );
|
2009-01-19 12:24:52 +00:00
|
|
|
declare_stub_args( proxy, indent, func );
|
2009-01-15 17:52:35 +00:00
|
|
|
indent--;
|
|
|
|
print_proxy( "};\n\n" );
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
print_proxy( "static void __finally_%s_%s_Stub(", iface->name, get_name(func) );
|
|
|
|
print_proxy( " struct __frame_%s_%s_Stub *__frame )\n{\n", iface->name, get_name(func) );
|
2009-01-15 17:52:35 +00:00
|
|
|
indent++;
|
2009-01-19 12:24:52 +00:00
|
|
|
write_remoting_arguments(proxy, indent, func, "__frame->", PASS_OUT, PHASE_FREE);
|
2009-01-15 17:52:35 +00:00
|
|
|
if (has_full_pointer)
|
2009-01-19 12:24:52 +00:00
|
|
|
write_full_pointer_free(proxy, indent, func);
|
2009-01-15 17:52:35 +00:00
|
|
|
indent--;
|
|
|
|
print_proxy( "}\n\n" );
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
print_proxy( "void __RPC_STUB %s_%s_Stub(\n", iface->name, get_name(func));
|
2005-02-20 15:02:48 +00:00
|
|
|
indent++;
|
|
|
|
print_proxy( "IRpcStubBuffer* This,\n");
|
2008-01-11 13:46:33 +00:00
|
|
|
print_proxy( "IRpcChannelBuffer *_pRpcChannelBuffer,\n");
|
|
|
|
print_proxy( "PRPC_MESSAGE _pRpcMessage,\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( "DWORD* _pdwStubPhase)\n");
|
|
|
|
indent--;
|
|
|
|
print_proxy( "{\n");
|
|
|
|
indent++;
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "struct __frame_%s_%s_Stub __f, * const __frame = &__f;\n\n",
|
2009-01-19 12:24:52 +00:00
|
|
|
iface->name, get_name(func) );
|
2009-01-15 17:52:35 +00:00
|
|
|
|
|
|
|
print_proxy("__frame->_This = (%s*)((CStdStubBuffer*)This)->pvServerObject;\n\n", iface->name);
|
2005-02-20 15:02:48 +00:00
|
|
|
|
|
|
|
/* FIXME: trace */
|
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy("NdrStubInitialize(_pRpcMessage, &__frame->_StubMsg, &Object_StubDesc, _pRpcChannelBuffer);\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, "\n");
|
2009-01-19 12:24:52 +00:00
|
|
|
print_proxy( "RpcExceptionInit( 0, __finally_%s_%s_Stub );\n", iface->name, get_name(func) );
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
write_parameters_init(proxy, indent, func, "__frame->");
|
2008-01-11 13:46:33 +00:00
|
|
|
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy("RpcTryFinally\n");
|
|
|
|
print_proxy("{\n");
|
|
|
|
indent++;
|
2008-02-10 10:10:44 +00:00
|
|
|
if (has_full_pointer)
|
2009-01-19 12:24:52 +00:00
|
|
|
write_full_pointer_init(proxy, indent, func, TRUE);
|
2008-01-11 13:46:33 +00:00
|
|
|
print_proxy("if ((_pRpcMessage->DataRepresentation & 0xffff) != NDR_LOCAL_DATA_REPRESENTATION)\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
indent++;
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy("NdrConvert( &__frame->_StubMsg, &__MIDL_ProcFormatString.Format[%u]);\n", proc_offset );
|
2005-02-20 15:02:48 +00:00
|
|
|
indent--;
|
|
|
|
fprintf(proxy, "\n");
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
write_remoting_arguments(proxy, indent, func, "__frame->", PASS_IN, PHASE_UNMARSHAL);
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, "\n");
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
assign_stub_out_args( proxy, indent, func, "__frame->" );
|
2008-01-11 13:46:33 +00:00
|
|
|
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy("*_pdwStubPhase = STUB_CALL_SERVER;\n");
|
|
|
|
fprintf(proxy, "\n");
|
2009-08-07 20:15:12 +00:00
|
|
|
print_proxy( "%s", has_ret ? "__frame->_RetVal = " : "" );
|
2008-01-11 13:46:33 +00:00
|
|
|
if (cas) fprintf(proxy, "%s_%s_Stub", iface->name, cas);
|
2009-01-19 12:24:52 +00:00
|
|
|
else fprintf(proxy, "__frame->_This->lpVtbl->%s", get_name(func));
|
2009-01-15 17:52:35 +00:00
|
|
|
fprintf(proxy, "(__frame->_This");
|
2008-01-11 13:46:33 +00:00
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
if (type_get_function_args(func->type))
|
2008-01-11 13:46:33 +00:00
|
|
|
{
|
2009-01-19 12:24:52 +00:00
|
|
|
LIST_FOR_EACH_ENTRY( arg, type_get_function_args(func->type), const var_t, entry )
|
2009-08-07 20:15:12 +00:00
|
|
|
fprintf(proxy, ", %s__frame->%s", is_array(arg->type) && !type_array_is_decl_as_ptr(arg->type) ? "*" :"" , arg->name);
|
2005-02-20 15:02:48 +00:00
|
|
|
}
|
|
|
|
fprintf(proxy, ");\n");
|
|
|
|
fprintf(proxy, "\n");
|
|
|
|
print_proxy("*_pdwStubPhase = STUB_MARSHAL;\n");
|
|
|
|
fprintf(proxy, "\n");
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
write_remoting_arguments(proxy, indent, func, "__frame->", PASS_OUT, PHASE_BUFFERSIZE);
|
2008-01-11 13:46:33 +00:00
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
if (!is_void(type_function_get_rettype(func->type)))
|
|
|
|
write_remoting_arguments(proxy, indent, func, "__frame->", PASS_RETURN, PHASE_BUFFERSIZE);
|
Sync to wine-0.9.60:
- Rob Shearman <rob@codeweavers.com> Wed, 26 Mar 2008
widl: Support using context handles as the binding handle in client functions.
- Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008
widl: Use is_string_type for detecting strings in write_typeformatstring_var to make it consistent with write_remoting_arg.
- Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008
widl: Add support for generic binding handles.
- Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008
widl: Fix detection of non-pointer context handles.
- Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008
widl: Make sure that string types are always written out by write_string_tfs and not write_simple_pointer.
- Rob Shearman <rob@codeweavers.com> Mon, 31 Mar 2008
widl: Parse typedefs of function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 1 Apr 2008
widl: Be more strict about where semicolons can appear in IDL files.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Add a function to get the return type of a parsed function.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Store function and function pointer types completely within type_t type.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Support parsing calling conventions for function identifiers.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Support __fastcall and __pascal calling conventions.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Add a newline between function prototypes for non-object interfaces.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Fix the writing out of function pointers with more than one level of indirection.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Turn on verbose errors, which gives a little more information in the case of a syntax error.
- Dan Hipschman <dsh@linux.ucla.edu> Thu, 3 Apr 2008
widl: Fix a mistake in an ordered list (keywords).
svn path=/trunk/; revision=36829
2008-10-19 12:30:41 +00:00
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy("NdrStubGetBuffer(This, _pRpcChannelBuffer, &__frame->_StubMsg);\n");
|
2008-01-11 13:46:33 +00:00
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
write_remoting_arguments(proxy, indent, func, "__frame->", PASS_OUT, PHASE_MARSHAL);
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, "\n");
|
|
|
|
|
Sync to wine-0.9.60:
- Rob Shearman <rob@codeweavers.com> Wed, 26 Mar 2008
widl: Support using context handles as the binding handle in client functions.
- Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008
widl: Use is_string_type for detecting strings in write_typeformatstring_var to make it consistent with write_remoting_arg.
- Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008
widl: Add support for generic binding handles.
- Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008
widl: Fix detection of non-pointer context handles.
- Rob Shearman <rob@codeweavers.com> Thu, 27 Mar 2008
widl: Make sure that string types are always written out by write_string_tfs and not write_simple_pointer.
- Rob Shearman <rob@codeweavers.com> Mon, 31 Mar 2008
widl: Parse typedefs of function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 1 Apr 2008
widl: Be more strict about where semicolons can appear in IDL files.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Add a function to get the return type of a parsed function.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Store function and function pointer types completely within type_t type.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Support parsing calling conventions for function identifiers.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Support __fastcall and __pascal calling conventions.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Add a newline between function prototypes for non-object interfaces.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Fix the writing out of function pointers with more than one level of indirection.
- Rob Shearman <rob@codeweavers.com> Wed, 2 Apr 2008
widl: Turn on verbose errors, which gives a little more information in the case of a syntax error.
- Dan Hipschman <dsh@linux.ucla.edu> Thu, 3 Apr 2008
widl: Fix a mistake in an ordered list (keywords).
svn path=/trunk/; revision=36829
2008-10-19 12:30:41 +00:00
|
|
|
/* marshall the return value */
|
2009-01-19 12:24:52 +00:00
|
|
|
if (!is_void(type_function_get_rettype(func->type)))
|
|
|
|
write_remoting_arguments(proxy, indent, func, "__frame->", PASS_RETURN, PHASE_MARSHAL);
|
2005-02-20 15:02:48 +00:00
|
|
|
|
|
|
|
indent--;
|
|
|
|
print_proxy("}\n");
|
|
|
|
print_proxy("RpcFinally\n");
|
|
|
|
print_proxy("{\n");
|
2009-01-15 17:52:35 +00:00
|
|
|
indent++;
|
2009-01-19 12:24:52 +00:00
|
|
|
print_proxy( "__finally_%s_%s_Stub( __frame );\n", iface->name, get_name(func) );
|
2009-01-15 17:52:35 +00:00
|
|
|
indent--;
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy("}\n");
|
|
|
|
print_proxy("RpcEndFinally\n");
|
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy("_pRpcMessage->BufferLength = __frame->_StubMsg.Buffer - (unsigned char *)_pRpcMessage->Buffer;\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
indent--;
|
|
|
|
|
|
|
|
print_proxy("}\n");
|
|
|
|
print_proxy("\n");
|
|
|
|
}
|
|
|
|
|
2011-08-09 22:51:55 +00:00
|
|
|
static void gen_stub_thunk( type_t *iface, const var_t *func, unsigned int proc_offset )
|
|
|
|
{
|
|
|
|
int has_ret = !is_void( type_function_get_rettype( func->type ));
|
|
|
|
const var_t *arg, *callas = is_callas( func->attrs );
|
|
|
|
const var_list_t *args = type_get_function_args( func->type );
|
|
|
|
|
|
|
|
indent = 0;
|
|
|
|
print_proxy( "void __RPC_API %s_%s_Thunk( PMIDL_STUB_MESSAGE pStubMsg )\n",
|
|
|
|
iface->name, get_name(func) );
|
|
|
|
print_proxy( "{\n");
|
|
|
|
indent++;
|
|
|
|
write_func_param_struct( proxy, iface, func->type,
|
|
|
|
"*pParamStruct = (struct _PARAM_STRUCT *)pStubMsg->StackTop", has_ret );
|
|
|
|
print_proxy( "%s%s_%s_Stub( pParamStruct->This",
|
|
|
|
has_ret ? "pParamStruct->_RetVal = " : "", iface->name, callas->name );
|
|
|
|
indent++;
|
|
|
|
if (args) LIST_FOR_EACH_ENTRY( arg, args, const var_t, entry )
|
|
|
|
{
|
|
|
|
fprintf( proxy, ",\n%*spParamStruct->%s", 4 * indent, "", arg->name );
|
|
|
|
}
|
|
|
|
fprintf( proxy, " );\n" );
|
|
|
|
indent--;
|
|
|
|
indent--;
|
|
|
|
print_proxy( "}\n\n");
|
|
|
|
}
|
|
|
|
|
2010-12-19 20:47:16 +00:00
|
|
|
int count_methods(const type_t *iface)
|
2009-01-15 17:52:35 +00:00
|
|
|
{
|
2009-01-19 12:24:52 +00:00
|
|
|
const statement_t *stmt;
|
2009-01-15 17:52:35 +00:00
|
|
|
int count = 0;
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
if (type_iface_get_inherit(iface))
|
|
|
|
count = count_methods(type_iface_get_inherit(iface));
|
|
|
|
|
|
|
|
STATEMENTS_FOR_EACH_FUNC(stmt, type_iface_get_stmts(iface)) {
|
|
|
|
const var_t *func = stmt->u.var;
|
|
|
|
if (!is_callas(func->attrs)) count++;
|
|
|
|
}
|
2009-01-15 17:52:35 +00:00
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
static const statement_t * get_callas_source(const type_t * iface, const var_t * def)
|
|
|
|
{
|
|
|
|
const statement_t * source;
|
|
|
|
STATEMENTS_FOR_EACH_FUNC( source, type_iface_get_stmts(iface)) {
|
|
|
|
const var_t * cas = is_callas(source->u.var->attrs );
|
|
|
|
if (cas && !strcmp(def->name, cas->name))
|
|
|
|
return source;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2018-04-11 11:29:04 +00:00
|
|
|
#ifdef __REACTOS__ /* r57019 / c3be8a3 */
|
2012-08-01 23:25:06 +00:00
|
|
|
static int write_proxy_procformatstring_offsets( const type_t *iface, int skip )
|
2018-04-11 11:29:04 +00:00
|
|
|
#else
|
|
|
|
static void write_proxy_procformatstring_offsets( const type_t *iface, int skip )
|
|
|
|
#endif
|
2011-08-09 22:51:55 +00:00
|
|
|
{
|
|
|
|
const statement_t *stmt;
|
2012-08-01 23:25:06 +00:00
|
|
|
int i = 0;
|
2011-08-09 22:51:55 +00:00
|
|
|
|
|
|
|
if (type_iface_get_inherit(iface))
|
2012-08-01 23:25:06 +00:00
|
|
|
i = write_proxy_procformatstring_offsets( type_iface_get_inherit(iface), need_delegation(iface));
|
2011-08-09 22:51:55 +00:00
|
|
|
else
|
2012-08-01 23:25:06 +00:00
|
|
|
return 0;
|
2011-08-09 22:51:55 +00:00
|
|
|
|
|
|
|
STATEMENTS_FOR_EACH_FUNC( stmt, type_iface_get_stmts(iface) )
|
|
|
|
{
|
|
|
|
const var_t *func = stmt->u.var;
|
|
|
|
int missing = 0;
|
|
|
|
|
|
|
|
if (is_callas(func->attrs)) continue;
|
|
|
|
if (is_local(func->attrs))
|
|
|
|
{
|
|
|
|
const statement_t * callas_source = get_callas_source(iface, func);
|
|
|
|
if (!callas_source)
|
|
|
|
missing = 1;
|
|
|
|
else
|
|
|
|
func = callas_source->u.var;
|
|
|
|
}
|
|
|
|
if (skip || missing)
|
|
|
|
print_proxy( "(unsigned short)-1, /* %s::%s */\n", iface->name, get_name(func));
|
|
|
|
else
|
|
|
|
print_proxy( "%u, /* %s::%s */\n", func->procstring_offset, iface->name, get_name(func));
|
2012-08-01 23:25:06 +00:00
|
|
|
i++;
|
2011-08-09 22:51:55 +00:00
|
|
|
}
|
2018-04-11 11:29:04 +00:00
|
|
|
#ifdef __REACTOS__ /* r57019 / c3be8a3 */
|
2012-08-01 23:25:06 +00:00
|
|
|
return i;
|
2018-04-11 11:29:04 +00:00
|
|
|
#endif
|
2011-08-09 22:51:55 +00:00
|
|
|
}
|
|
|
|
|
2008-09-14 05:07:16 +00:00
|
|
|
static int write_proxy_methods(type_t *iface, int skip)
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
2009-01-19 12:24:52 +00:00
|
|
|
const statement_t *stmt;
|
2005-02-20 15:02:48 +00:00
|
|
|
int i = 0;
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
if (type_iface_get_inherit(iface))
|
|
|
|
i = write_proxy_methods(type_iface_get_inherit(iface),
|
|
|
|
need_delegation(iface));
|
|
|
|
STATEMENTS_FOR_EACH_FUNC(stmt, type_iface_get_stmts(iface)) {
|
|
|
|
const var_t *func = stmt->u.var;
|
|
|
|
if (!is_callas(func->attrs)) {
|
|
|
|
if (skip || (is_local(func->attrs) && !get_callas_source(iface, func)))
|
2011-08-09 22:51:55 +00:00
|
|
|
print_proxy( "0, /* %s::%s */\n", iface->name, get_name(func));
|
|
|
|
else if (is_interpreted_func( iface, func ) &&
|
|
|
|
!is_local( func->attrs ) &&
|
|
|
|
type_iface_get_inherit(iface))
|
|
|
|
print_proxy( "(void *)-1, /* %s::%s */\n", iface->name, get_name(func));
|
|
|
|
else
|
|
|
|
print_proxy( "%s_%s_Proxy,\n", iface->name, get_name(func));
|
2005-02-20 15:02:48 +00:00
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
2008-09-14 05:07:16 +00:00
|
|
|
static int write_stub_methods(type_t *iface, int skip)
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
2009-01-19 12:24:52 +00:00
|
|
|
const statement_t *stmt;
|
2005-02-20 15:02:48 +00:00
|
|
|
int i = 0;
|
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
if (type_iface_get_inherit(iface))
|
|
|
|
i = write_stub_methods(type_iface_get_inherit(iface), need_delegation(iface));
|
|
|
|
else
|
|
|
|
return i; /* skip IUnknown */
|
|
|
|
|
|
|
|
STATEMENTS_FOR_EACH_FUNC(stmt, type_iface_get_stmts(iface)) {
|
|
|
|
const var_t *func = stmt->u.var;
|
|
|
|
if (!is_callas(func->attrs)) {
|
|
|
|
int missing = 0;
|
|
|
|
const char * fname = get_name(func);
|
|
|
|
if(is_local(func->attrs)) {
|
|
|
|
const statement_t * callas_source = get_callas_source(iface, func);
|
|
|
|
if(!callas_source)
|
|
|
|
missing = 1;
|
|
|
|
else
|
|
|
|
fname = get_name(callas_source->u.var);
|
|
|
|
}
|
2008-12-04 21:22:42 +00:00
|
|
|
if (i) fprintf(proxy,",\n");
|
2009-01-19 12:24:52 +00:00
|
|
|
if (skip || missing) print_proxy("STUB_FORWARDING_FUNCTION");
|
2011-08-09 22:51:55 +00:00
|
|
|
else if (is_interpreted_func( iface, func ))
|
|
|
|
print_proxy( "(PRPC_STUB_FUNCTION)%s", get_stub_mode() == MODE_Oif ? "NdrStubCall2" : "NdrStubCall" );
|
2009-01-19 12:24:52 +00:00
|
|
|
else print_proxy( "%s_%s_Stub", iface->name, fname);
|
2008-12-04 21:22:42 +00:00
|
|
|
i++;
|
2005-02-20 15:02:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return i;
|
|
|
|
}
|
|
|
|
|
2011-08-09 22:51:55 +00:00
|
|
|
static void write_thunk_methods( type_t *iface, int skip )
|
|
|
|
{
|
|
|
|
const statement_t *stmt;
|
|
|
|
|
|
|
|
if (type_iface_get_inherit( iface ))
|
|
|
|
write_thunk_methods( type_iface_get_inherit(iface), need_delegation(iface) );
|
|
|
|
else
|
|
|
|
return; /* skip IUnknown */
|
|
|
|
|
|
|
|
STATEMENTS_FOR_EACH_FUNC( stmt, type_iface_get_stmts(iface) )
|
|
|
|
{
|
|
|
|
var_t *func = stmt->u.var;
|
|
|
|
const statement_t * callas_source = NULL;
|
|
|
|
|
|
|
|
if (is_callas(func->attrs)) continue;
|
|
|
|
if (is_local(func->attrs)) callas_source = get_callas_source(iface, func);
|
|
|
|
|
|
|
|
if (!skip && callas_source && is_interpreted_func( iface, func ))
|
|
|
|
print_proxy( "%s_%s_Thunk,\n", iface->name, get_name(callas_source->u.var) );
|
|
|
|
else
|
|
|
|
print_proxy( "0, /* %s::%s */\n", iface->name, get_name(func) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-11 13:46:33 +00:00
|
|
|
static void write_proxy(type_t *iface, unsigned int *proc_offset)
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
2009-01-19 12:24:52 +00:00
|
|
|
int count;
|
|
|
|
const statement_t *stmt;
|
|
|
|
int first_func = 1;
|
2011-08-09 22:51:55 +00:00
|
|
|
int needs_stub_thunks = 0;
|
|
|
|
int needs_inline_stubs = need_inline_stubs( iface ) || need_delegation( iface );
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2009-01-19 12:24:52 +00:00
|
|
|
STATEMENTS_FOR_EACH_FUNC(stmt, type_iface_get_stmts(iface)) {
|
2010-12-19 20:47:16 +00:00
|
|
|
var_t *func = stmt->u.var;
|
2009-01-19 12:24:52 +00:00
|
|
|
if (first_func) {
|
|
|
|
fprintf(proxy, "/*****************************************************************************\n");
|
|
|
|
fprintf(proxy, " * %s interface\n", iface->name);
|
|
|
|
fprintf(proxy, " */\n");
|
|
|
|
first_func = 0;
|
|
|
|
}
|
|
|
|
if (!is_local(func->attrs)) {
|
|
|
|
const var_t *cas = is_callas(func->attrs);
|
2006-07-30 12:58:24 +00:00
|
|
|
const char *cname = cas ? cas->name : NULL;
|
2009-01-19 12:24:52 +00:00
|
|
|
int idx = func->type->details.function->idx;
|
2005-02-20 15:02:48 +00:00
|
|
|
if (cname) {
|
2009-01-19 12:24:52 +00:00
|
|
|
const statement_t *stmt2;
|
|
|
|
STATEMENTS_FOR_EACH_FUNC(stmt2, type_iface_get_stmts(iface)) {
|
|
|
|
const var_t *m = stmt2->u.var;
|
|
|
|
if (!strcmp(m->name, cname))
|
2008-01-11 13:46:33 +00:00
|
|
|
{
|
2009-01-19 12:24:52 +00:00
|
|
|
idx = m->type->details.function->idx;
|
2008-01-11 13:46:33 +00:00
|
|
|
break;
|
|
|
|
}
|
2009-01-19 12:24:52 +00:00
|
|
|
}
|
2005-02-20 15:02:48 +00:00
|
|
|
}
|
2010-12-19 20:47:16 +00:00
|
|
|
func->procstring_offset = *proc_offset;
|
2009-01-19 12:24:52 +00:00
|
|
|
gen_proxy(iface, func, idx, *proc_offset);
|
|
|
|
gen_stub(iface, func, cname, *proc_offset);
|
2011-08-09 22:51:55 +00:00
|
|
|
if (cas && is_interpreted_func( iface, func ))
|
|
|
|
{
|
|
|
|
needs_stub_thunks = 1;
|
|
|
|
gen_stub_thunk(iface, func, *proc_offset);
|
|
|
|
}
|
|
|
|
*proc_offset += get_size_procformatstring_func( iface, func );
|
2005-02-20 15:02:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
count = count_methods(iface);
|
|
|
|
|
2011-08-09 22:51:55 +00:00
|
|
|
print_proxy( "static const unsigned short %s_FormatStringOffsetTable[] =\n", iface->name );
|
|
|
|
print_proxy( "{\n" );
|
|
|
|
indent++;
|
2018-04-11 11:29:04 +00:00
|
|
|
#ifdef __REACTOS__ /* r57019 / c3be8a3 */
|
2012-08-01 23:25:06 +00:00
|
|
|
if (write_proxy_procformatstring_offsets( iface, 0 ) == 0)
|
|
|
|
{
|
|
|
|
print_proxy( "0\n" );
|
|
|
|
}
|
2018-04-11 11:29:04 +00:00
|
|
|
#else
|
|
|
|
write_proxy_procformatstring_offsets( iface, 0 );
|
|
|
|
#endif
|
2011-08-09 22:51:55 +00:00
|
|
|
indent--;
|
|
|
|
print_proxy( "};\n\n" );
|
|
|
|
|
|
|
|
/* proxy info */
|
|
|
|
if (get_stub_mode() == MODE_Oif)
|
|
|
|
{
|
|
|
|
print_proxy( "static const MIDL_STUBLESS_PROXY_INFO %s_ProxyInfo =\n", iface->name );
|
|
|
|
print_proxy( "{\n" );
|
|
|
|
indent++;
|
|
|
|
print_proxy( "&Object_StubDesc,\n" );
|
|
|
|
print_proxy( "__MIDL_ProcFormatString.Format,\n" );
|
|
|
|
print_proxy( "&%s_FormatStringOffsetTable[-3],\n", iface->name );
|
|
|
|
print_proxy( "0,\n" );
|
|
|
|
print_proxy( "0,\n" );
|
|
|
|
print_proxy( "0\n" );
|
|
|
|
indent--;
|
|
|
|
print_proxy( "};\n\n" );
|
|
|
|
}
|
2010-12-19 20:47:16 +00:00
|
|
|
|
2005-02-20 15:02:48 +00:00
|
|
|
/* proxy vtable */
|
2009-08-08 12:40:21 +00:00
|
|
|
print_proxy( "static %sCINTERFACE_PROXY_VTABLE(%d) _%sProxyVtbl =\n",
|
|
|
|
need_delegation_indirect(iface) ? "" : "const ", count, iface->name);
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( "{\n");
|
|
|
|
indent++;
|
2009-08-07 20:15:12 +00:00
|
|
|
print_proxy( "{\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
indent++;
|
2011-08-09 22:51:55 +00:00
|
|
|
if (get_stub_mode() == MODE_Oif) print_proxy( "&%s_ProxyInfo,\n", iface->name );
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( "&IID_%s,\n", iface->name);
|
|
|
|
indent--;
|
|
|
|
print_proxy( "},\n");
|
|
|
|
print_proxy( "{\n");
|
|
|
|
indent++;
|
2008-09-14 05:07:16 +00:00
|
|
|
write_proxy_methods(iface, FALSE);
|
2005-02-20 15:02:48 +00:00
|
|
|
indent--;
|
|
|
|
print_proxy( "}\n");
|
|
|
|
indent--;
|
2010-12-19 20:47:16 +00:00
|
|
|
print_proxy( "};\n\n");
|
|
|
|
|
2011-08-09 22:51:55 +00:00
|
|
|
/* stub thunk table */
|
|
|
|
if (needs_stub_thunks)
|
|
|
|
{
|
|
|
|
print_proxy( "static const STUB_THUNK %s_StubThunkTable[] =\n", iface->name);
|
|
|
|
print_proxy( "{\n");
|
|
|
|
indent++;
|
|
|
|
write_thunk_methods( iface, 0 );
|
|
|
|
indent--;
|
|
|
|
print_proxy( "};\n\n");
|
|
|
|
}
|
|
|
|
|
2010-12-19 20:47:16 +00:00
|
|
|
/* server info */
|
|
|
|
print_proxy( "static const MIDL_SERVER_INFO %s_ServerInfo =\n", iface->name );
|
|
|
|
print_proxy( "{\n" );
|
|
|
|
indent++;
|
|
|
|
print_proxy( "&Object_StubDesc,\n" );
|
|
|
|
print_proxy( "0,\n" );
|
|
|
|
print_proxy( "__MIDL_ProcFormatString.Format,\n" );
|
|
|
|
print_proxy( "&%s_FormatStringOffsetTable[-3],\n", iface->name );
|
2011-08-09 22:51:55 +00:00
|
|
|
if (needs_stub_thunks)
|
|
|
|
print_proxy( "&%s_StubThunkTable[-3],\n", iface->name );
|
|
|
|
else
|
|
|
|
print_proxy( "0,\n" );
|
2010-12-19 20:47:16 +00:00
|
|
|
print_proxy( "0,\n" );
|
|
|
|
print_proxy( "0,\n" );
|
|
|
|
print_proxy( "0\n" );
|
|
|
|
indent--;
|
|
|
|
print_proxy( "};\n\n" );
|
2005-02-20 15:02:48 +00:00
|
|
|
|
|
|
|
/* stub vtable */
|
2011-08-09 22:51:55 +00:00
|
|
|
if (needs_inline_stubs)
|
|
|
|
{
|
|
|
|
print_proxy( "static const PRPC_STUB_FUNCTION %s_table[] =\n", iface->name);
|
|
|
|
print_proxy( "{\n");
|
|
|
|
indent++;
|
2018-04-11 11:29:04 +00:00
|
|
|
#ifdef __REACTOS__ /* r57019 / c3be8a3 */
|
2012-08-01 23:25:06 +00:00
|
|
|
if (write_stub_methods(iface, FALSE) == 0)
|
|
|
|
{
|
|
|
|
fprintf(proxy, "0");
|
|
|
|
}
|
2018-04-11 11:29:04 +00:00
|
|
|
#else
|
|
|
|
write_stub_methods(iface, FALSE);
|
|
|
|
#endif
|
2011-08-09 22:51:55 +00:00
|
|
|
fprintf(proxy, "\n");
|
|
|
|
indent--;
|
|
|
|
fprintf(proxy, "};\n\n");
|
|
|
|
}
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "static %sCInterfaceStubVtbl _%sStubVtbl =\n",
|
|
|
|
need_delegation_indirect(iface) ? "" : "const ", iface->name);
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( "{\n");
|
|
|
|
indent++;
|
|
|
|
print_proxy( "{\n");
|
|
|
|
indent++;
|
|
|
|
print_proxy( "&IID_%s,\n", iface->name);
|
2010-12-19 20:47:16 +00:00
|
|
|
print_proxy( "&%s_ServerInfo,\n", iface->name );
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "%d,\n", count);
|
2011-08-09 22:51:55 +00:00
|
|
|
if (needs_inline_stubs) print_proxy( "&%s_table[-3]\n", iface->name );
|
|
|
|
else print_proxy( "0\n" );
|
2005-02-20 15:02:48 +00:00
|
|
|
indent--;
|
2009-08-07 20:15:12 +00:00
|
|
|
print_proxy( "},\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( "{\n");
|
|
|
|
indent++;
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "CStdStubBuffer_%s\n", need_delegation_indirect(iface) ? "DELEGATING_METHODS" : "METHODS");
|
2005-02-20 15:02:48 +00:00
|
|
|
indent--;
|
|
|
|
print_proxy( "}\n");
|
|
|
|
indent--;
|
|
|
|
print_proxy( "};\n");
|
|
|
|
print_proxy( "\n");
|
|
|
|
}
|
|
|
|
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
static int does_any_iface(const statement_list_t *stmts, type_pred_t pred)
|
2008-01-11 13:46:33 +00:00
|
|
|
{
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
const statement_t *stmt;
|
2008-01-11 13:46:33 +00:00
|
|
|
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
if (stmts)
|
|
|
|
LIST_FOR_EACH_ENTRY(stmt, stmts, const statement_t, entry)
|
|
|
|
{
|
2012-08-12 16:19:13 +00:00
|
|
|
if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE)
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
{
|
|
|
|
if (pred(stmt->u.type))
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
}
|
2008-01-11 13:46:33 +00:00
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
int need_proxy(const type_t *iface)
|
|
|
|
{
|
2011-08-09 22:51:55 +00:00
|
|
|
if (!is_object( iface )) return 0;
|
|
|
|
if (is_local( iface->attrs )) return 0;
|
|
|
|
if (is_attr( iface->attrs, ATTR_DISPINTERFACE )) return 0;
|
|
|
|
return 1;
|
2008-01-11 13:46:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int need_stub(const type_t *iface)
|
|
|
|
{
|
2010-03-04 13:46:14 +00:00
|
|
|
return !is_object(iface) && !is_local(iface->attrs);
|
2008-01-11 13:46:33 +00:00
|
|
|
}
|
|
|
|
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
int need_proxy_file(const statement_list_t *stmts)
|
|
|
|
{
|
2012-12-29 15:18:09 +00:00
|
|
|
return does_any_iface(stmts, need_proxy);
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
}
|
|
|
|
|
2014-04-18 20:22:07 +00:00
|
|
|
int need_proxy_delegation(const statement_list_t *stmts)
|
|
|
|
{
|
|
|
|
return does_any_iface(stmts, need_delegation);
|
|
|
|
}
|
|
|
|
|
2011-08-09 22:51:55 +00:00
|
|
|
int need_inline_stubs(const type_t *iface)
|
|
|
|
{
|
|
|
|
const statement_t *stmt;
|
|
|
|
|
|
|
|
if (get_stub_mode() == MODE_Os) return 1;
|
|
|
|
|
|
|
|
STATEMENTS_FOR_EACH_FUNC( stmt, type_iface_get_stmts(iface) )
|
|
|
|
{
|
|
|
|
const var_t *func = stmt->u.var;
|
|
|
|
if (is_local( func->attrs )) continue;
|
|
|
|
if (!is_interpreted_func( iface, func )) return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int need_proxy_and_inline_stubs(const type_t *iface)
|
|
|
|
{
|
|
|
|
const statement_t *stmt;
|
|
|
|
|
|
|
|
if (!need_proxy( iface )) return 0;
|
|
|
|
if (get_stub_mode() == MODE_Os) return 1;
|
|
|
|
|
|
|
|
STATEMENTS_FOR_EACH_FUNC( stmt, type_iface_get_stmts(iface) )
|
|
|
|
{
|
|
|
|
const var_t *func = stmt->u.var;
|
|
|
|
if (is_local( func->attrs )) continue;
|
|
|
|
if (!is_interpreted_func( iface, func )) return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
int need_stub_files(const statement_list_t *stmts)
|
|
|
|
{
|
|
|
|
return does_any_iface(stmts, need_stub);
|
|
|
|
}
|
|
|
|
|
2011-08-09 22:51:55 +00:00
|
|
|
int need_inline_stubs_file(const statement_list_t *stmts)
|
|
|
|
{
|
|
|
|
return does_any_iface(stmts, need_inline_stubs);
|
|
|
|
}
|
|
|
|
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
static void write_proxy_stmts(const statement_list_t *stmts, unsigned int *proc_offset)
|
|
|
|
{
|
|
|
|
const statement_t *stmt;
|
|
|
|
if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry )
|
|
|
|
{
|
2012-08-12 16:19:13 +00:00
|
|
|
if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE)
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
{
|
|
|
|
if (need_proxy(stmt->u.type))
|
|
|
|
write_proxy(stmt->u.type, proc_offset);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
static int cmp_iid( const void *ptr1, const void *ptr2 )
|
2008-01-11 13:46:33 +00:00
|
|
|
{
|
2009-01-15 17:52:35 +00:00
|
|
|
const type_t * const *iface1 = ptr1;
|
|
|
|
const type_t * const *iface2 = ptr2;
|
|
|
|
const UUID *uuid1 = get_attrp( (*iface1)->attrs, ATTR_UUID );
|
|
|
|
const UUID *uuid2 = get_attrp( (*iface2)->attrs, ATTR_UUID );
|
|
|
|
return memcmp( uuid1, uuid2, sizeof(UUID) );
|
2008-01-11 13:46:33 +00:00
|
|
|
}
|
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
static void build_iface_list( const statement_list_t *stmts, type_t **ifaces[], int *count )
|
2008-01-11 13:46:33 +00:00
|
|
|
{
|
2009-01-15 17:52:35 +00:00
|
|
|
const statement_t *stmt;
|
|
|
|
|
|
|
|
if (!stmts) return;
|
|
|
|
LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry )
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
{
|
2012-08-12 16:19:13 +00:00
|
|
|
if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE)
|
2009-01-15 17:52:35 +00:00
|
|
|
{
|
|
|
|
type_t *iface = stmt->u.type;
|
2009-01-19 12:24:52 +00:00
|
|
|
if (type_iface_get_inherit(iface) && need_proxy(iface))
|
2009-01-15 17:52:35 +00:00
|
|
|
{
|
2010-03-04 13:46:14 +00:00
|
|
|
*ifaces = xrealloc( *ifaces, (*count + 1) * sizeof(**ifaces) );
|
2009-01-15 17:52:35 +00:00
|
|
|
(*ifaces)[(*count)++] = iface;
|
|
|
|
}
|
|
|
|
}
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
}
|
2008-01-11 13:46:33 +00:00
|
|
|
}
|
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
static type_t **sort_interfaces( const statement_list_t *stmts, int *count )
|
2005-02-20 15:02:48 +00:00
|
|
|
{
|
2009-01-15 17:52:35 +00:00
|
|
|
type_t **ifaces = NULL;
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
*count = 0;
|
|
|
|
build_iface_list( stmts, &ifaces, count );
|
|
|
|
qsort( ifaces, *count, sizeof(*ifaces), cmp_iid );
|
|
|
|
return ifaces;
|
|
|
|
}
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
static void write_proxy_routines(const statement_list_t *stmts)
|
|
|
|
{
|
|
|
|
int expr_eval_routines;
|
|
|
|
unsigned int proc_offset = 0;
|
2010-12-19 20:47:16 +00:00
|
|
|
char *file_id = proxy_token;
|
2011-08-09 22:51:55 +00:00
|
|
|
int i, count, have_baseiid = 0;
|
2010-12-19 20:47:16 +00:00
|
|
|
type_t **interfaces;
|
|
|
|
const type_t * delegate_to;
|
|
|
|
|
2011-08-09 22:51:55 +00:00
|
|
|
print_proxy( "#ifndef __REDQ_RPCPROXY_H_VERSION__\n");
|
|
|
|
print_proxy( "#define __REQUIRED_RPCPROXY_H_VERSION__ %u\n", get_stub_mode() == MODE_Oif ? 475 : 440);
|
|
|
|
print_proxy( "#endif\n");
|
2010-12-19 20:47:16 +00:00
|
|
|
print_proxy( "\n");
|
2011-08-09 22:51:55 +00:00
|
|
|
if (get_stub_mode() == MODE_Oif) print_proxy( "#define USE_STUBLESS_PROXY\n");
|
|
|
|
print_proxy( "#include \"rpcproxy.h\"\n");
|
|
|
|
print_proxy( "#ifndef __RPCPROXY_H_VERSION__\n");
|
|
|
|
print_proxy( "#error This code needs a newer version of rpcproxy.h\n");
|
|
|
|
print_proxy( "#endif /* __RPCPROXY_H_VERSION__ */\n");
|
2010-12-19 20:47:16 +00:00
|
|
|
print_proxy( "\n");
|
2011-08-09 22:51:55 +00:00
|
|
|
print_proxy( "#include \"%s\"\n", header_name);
|
2010-12-19 20:47:16 +00:00
|
|
|
print_proxy( "\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2011-08-09 22:51:55 +00:00
|
|
|
if (does_any_iface(stmts, need_proxy_and_inline_stubs))
|
|
|
|
{
|
|
|
|
write_exceptions( proxy );
|
|
|
|
print_proxy( "\n");
|
|
|
|
print_proxy( "struct __proxy_frame\n");
|
|
|
|
print_proxy( "{\n");
|
|
|
|
print_proxy( " __DECL_EXCEPTION_FRAME\n");
|
|
|
|
print_proxy( " MIDL_STUB_MESSAGE _StubMsg;\n");
|
|
|
|
print_proxy( " void *This;\n");
|
|
|
|
print_proxy( "};\n");
|
|
|
|
print_proxy( "\n");
|
|
|
|
print_proxy("static int __proxy_filter( struct __proxy_frame *__frame )\n");
|
|
|
|
print_proxy( "{\n");
|
|
|
|
print_proxy( " return (__frame->_StubMsg.dwStubPhase != PROXY_SENDRECEIVE);\n");
|
|
|
|
print_proxy( "}\n");
|
|
|
|
print_proxy( "\n");
|
|
|
|
}
|
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
write_formatstringsdecl(proxy, indent, stmts, need_proxy);
|
|
|
|
write_stubdescproto();
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
write_proxy_stmts(stmts, &proc_offset);
|
2007-05-21 18:28:00 +00:00
|
|
|
|
2008-01-11 13:46:33 +00:00
|
|
|
expr_eval_routines = write_expr_eval_routines(proxy, proxy_token);
|
|
|
|
if (expr_eval_routines)
|
|
|
|
write_expr_eval_routine_list(proxy, proxy_token);
|
|
|
|
write_user_quad_list(proxy);
|
|
|
|
write_stubdesc(expr_eval_routines);
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
print_proxy( "#if !defined(__RPC_WIN%u__)\n", pointer_size == 8 ? 64 : 32);
|
2005-02-20 15:02:48 +00:00
|
|
|
print_proxy( "#error Currently only Wine and WIN32 are supported.\n");
|
|
|
|
print_proxy( "#endif\n");
|
|
|
|
print_proxy( "\n");
|
Sync to wine-0.9.61:
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Stop looping in check_remoting_args when a context_handle or wire_marshal type is found as they are in effect fundamental types.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Check that fields in structures and unions referenced by non-local functions can be marshalled and that their attributes are consistent.
-Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: The implicit_handle attribute is allowed with a handle explicitly specified in the function parameters. In that case, that handle is used instead of the implicit handle. Fix the check for the explicit_handle attribute being specified without a handle being specified in the function parameters, even though issuing an error is wrong. (Thanks to Marcus Meissner & Coverity for spotting that the check didn't do what it was supposed to do.)
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Automatically add "handle_t IDL_handle" parameter to functions with no explicit handle specified whose containing interface has the explicit_handle attribute.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Issue an error instead of crashing for dividing by zero in a constant expression.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for "->" and "." operators in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for arrays in expressions.
- Rob Shearman <rob@codeweavers.com> Sun, 20 Apr 2008
widl: Add support for '%' operator in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Fix operator precedence in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Require a constant expression for case statements.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Add support for comparison, exclusive or, logical not and positive operators in expressions.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove EXPR_MEMBERPTR and implement it using EXPR_PPTR and EXPR_MEMBER instead.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Don't free input_name in pop_import as we keep pointers to it in the var_t type now.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Pass the actual type into check_remoting_fields and check_field_common instead of the type name.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Check that expressions resolve so that expressions in generated code will compile. Also check that expressions return the correct type for the attribute.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Move expression functions to a new file, expr.c.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Use expr_resolve_type to get the type of the identifier in write_conf_or_var_desc. Remove the conversion of pointer types into base types as this was only needed due to lack of proper type resolving.
- Rob Shearman <rob@codeweavers.com> Tue, 22 Apr 2008
widl: Remove duplicated code in the form of the write_struct_expr function by enhancing write_expr to allow toplevel identifiers to be prefixed by a string, if specified.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Implement lcid property on library declarations.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Construct the pointer chain while parsing pointers, rather than storing a ptr_level. This method is more flexible and somewhat simpler.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Allow NULL to be used in expressions.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Create a list of statements in the whole IDL file, instead of just a list of interfaces.
- Rob Shearman <rob@codeweavers.com> Thu, 24 Apr 2008
widl: Add typedef statements to the statement lists.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Consolidate most of the inner loop of reg_typedefs into set_type.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Rename pident to declarator and parse the array declarations as part of declarators. This allows arrays to be used in typedefs and const statements.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Make the rules for parsing fields in structures, encapsulated unions and non-encapsulated unions more strict. Move the rules in fields that handle empty union cases into separate union rules so that they can't erroneously be accepted for structures or other types of unions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for declaring multiple fields of a structure in one statement.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Add support for string literals and wide-string literals in expressions.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Create a statement object for import statements. Move the writing of include directives into the generated header into header.c.
- Rob Shearman <rob@codeweavers.com> Fri, 25 Apr 2008
widl: Move the func_declarator rule entirely into direct_declarator.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Add typedefs to typelibs which have the public or uuid attributes, not any other attribute.
- Rob Shearman <rob@codeweavers.com> Sat, 26 Apr 2008
widl: Support hex digits that use an uppercase 0X prefix.
- Rob Shearman <rob@codeweavers.com> Sun, 27 Apr 2008
widl: Accept integer constant suffixes in the lexer.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Keep const attributes applied to pointers when writing out the type. Use an attribute to store the const qualifier for the pointer and type. Allow multiple type-qualifiers to be applied to a type by adding a declaration-specifier rule that encompasses type-qualifiers and types.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Add support for "inline" on function definitions. Fix applying calling convention to function type.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Make constdef and externdef take a declarator instead of an ident so that functions and arrays can be defined using the statements.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: Allow pointer attributes to be applied to function pointers.
- Rob Shearman <rob@codeweavers.com> Tue, 29 Apr 2008
widl: callback, code, comm_status and in_line are attribute names, not keywords.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Prepare for supporting storage classes in declaration statements. Return a decl_spec_t structure from decl_spec rules so that the storage
class and type qualifiers can both be returned.
- Rob Shearman <rob@codeweavers.com> Wed, 30 Apr 2008
widl: Add the parsing of storage classes into declaration-specifiers. Support the static and register keywords. This consolidates externdef and constdef rules into one declaration rule.
- Rob Shearman <rob@codeweavers.com> Thu, 1 May 2008
widl: Consolidate writing of COM and dispatch interfaces into one function to remove duplicated code. Split up the writing into start and end to eventually support the style MIDL uses where it writes declared types, etc. between the start and end of the interface. Make internal header functions take the file pointer to print to. Don't write interface IDs for non-object interfaces and always write handle declarations even if the interface has no methods, like MIDL does.
- Gerald Pfeifer <gerald@pfeifer.com> Fri, 2 May 2008
widl: Fix syntax to also work with older versions of bison.
svn path=/trunk/; revision=37313
2008-11-12 19:26:25 +00:00
|
|
|
write_procformatstring(proxy, stmts, need_proxy);
|
|
|
|
write_typeformatstring(proxy, stmts, need_proxy);
|
2005-02-20 15:02:48 +00:00
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
interfaces = sort_interfaces(stmts, &count);
|
2008-01-11 13:46:33 +00:00
|
|
|
fprintf(proxy, "static const CInterfaceProxyVtbl* const _%s_ProxyVtblList[] =\n", file_id);
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, "{\n");
|
2009-01-15 17:52:35 +00:00
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
fprintf(proxy, " (const CInterfaceProxyVtbl*)&_%sProxyVtbl,\n", interfaces[i]->name);
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, " 0\n");
|
|
|
|
fprintf(proxy, "};\n");
|
|
|
|
fprintf(proxy, "\n");
|
|
|
|
|
2008-01-11 13:46:33 +00:00
|
|
|
fprintf(proxy, "static const CInterfaceStubVtbl* const _%s_StubVtblList[] =\n", file_id);
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, "{\n");
|
2009-01-15 17:52:35 +00:00
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
fprintf(proxy, " &_%sStubVtbl,\n", interfaces[i]->name);
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, " 0\n");
|
|
|
|
fprintf(proxy, "};\n");
|
|
|
|
fprintf(proxy, "\n");
|
|
|
|
|
2008-01-11 13:46:33 +00:00
|
|
|
fprintf(proxy, "static PCInterfaceName const _%s_InterfaceNamesList[] =\n", file_id);
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, "{\n");
|
2009-01-15 17:52:35 +00:00
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
fprintf(proxy, " \"%s\",\n", interfaces[i]->name);
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, " 0\n");
|
|
|
|
fprintf(proxy, "};\n");
|
|
|
|
fprintf(proxy, "\n");
|
|
|
|
|
2011-08-09 22:51:55 +00:00
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
if ((have_baseiid = get_delegation_indirect( interfaces[i], NULL ))) break;
|
|
|
|
|
|
|
|
if (have_baseiid)
|
2009-01-15 17:52:35 +00:00
|
|
|
{
|
|
|
|
fprintf(proxy, "static const IID * _%s_BaseIIDList[] =\n", file_id);
|
|
|
|
fprintf(proxy, "{\n");
|
|
|
|
for (i = 0; i < count; i++)
|
|
|
|
{
|
|
|
|
if (get_delegation_indirect(interfaces[i], &delegate_to))
|
|
|
|
fprintf( proxy, " &IID_%s, /* %s */\n", delegate_to->name, interfaces[i]->name );
|
|
|
|
else
|
|
|
|
fprintf( proxy, " 0,\n" );
|
|
|
|
}
|
|
|
|
fprintf(proxy, " 0\n");
|
|
|
|
fprintf(proxy, "};\n");
|
|
|
|
fprintf(proxy, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
fprintf(proxy, "static int __stdcall _%s_IID_Lookup(const IID* pIID, int* pIndex)\n", file_id);
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, "{\n");
|
2009-01-15 17:52:35 +00:00
|
|
|
fprintf(proxy, " int low = 0, high = %d;\n", count - 1);
|
|
|
|
fprintf(proxy, "\n");
|
|
|
|
fprintf(proxy, " while (low <= high)\n");
|
|
|
|
fprintf(proxy, " {\n");
|
|
|
|
fprintf(proxy, " int pos = (low + high) / 2;\n");
|
|
|
|
fprintf(proxy, " int res = IID_GENERIC_CHECK_IID(_%s, pIID, pos);\n", file_id);
|
|
|
|
fprintf(proxy, " if (!res) { *pIndex = pos; return 1; }\n");
|
|
|
|
fprintf(proxy, " if (res > 0) low = pos + 1;\n");
|
|
|
|
fprintf(proxy, " else high = pos - 1;\n");
|
|
|
|
fprintf(proxy, " }\n");
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, " return 0;\n");
|
|
|
|
fprintf(proxy, "}\n");
|
|
|
|
fprintf(proxy, "\n");
|
|
|
|
|
2009-01-15 17:52:35 +00:00
|
|
|
fprintf(proxy, "const ExtendedProxyFileInfo %s_ProxyFileInfo DECLSPEC_HIDDEN =\n", file_id);
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, "{\n");
|
2009-01-06 07:19:59 +00:00
|
|
|
fprintf(proxy, " (const PCInterfaceProxyVtblList*)_%s_ProxyVtblList,\n", file_id);
|
|
|
|
fprintf(proxy, " (const PCInterfaceStubVtblList*)_%s_StubVtblList,\n", file_id);
|
2008-01-11 13:46:33 +00:00
|
|
|
fprintf(proxy, " _%s_InterfaceNamesList,\n", file_id);
|
2009-01-15 17:52:35 +00:00
|
|
|
if (have_baseiid) fprintf(proxy, " _%s_BaseIIDList,\n", file_id);
|
|
|
|
else fprintf(proxy, " 0,\n");
|
2009-01-06 07:19:59 +00:00
|
|
|
fprintf(proxy, " _%s_IID_Lookup,\n", file_id);
|
2009-01-15 17:52:35 +00:00
|
|
|
fprintf(proxy, " %d,\n", count);
|
2011-08-09 22:51:55 +00:00
|
|
|
fprintf(proxy, " %d,\n", get_stub_mode() == MODE_Oif ? 2 : 1);
|
2005-02-20 15:02:48 +00:00
|
|
|
fprintf(proxy, " 0,\n");
|
|
|
|
fprintf(proxy, " 0,\n");
|
|
|
|
fprintf(proxy, " 0,\n");
|
|
|
|
fprintf(proxy, " 0\n");
|
|
|
|
fprintf(proxy, "};\n");
|
2010-12-19 20:47:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void write_proxies(const statement_list_t *stmts)
|
|
|
|
{
|
|
|
|
if (!do_proxies) return;
|
|
|
|
if (do_everything && !need_proxy_file(stmts)) return;
|
|
|
|
|
|
|
|
init_proxy(stmts);
|
|
|
|
if(!proxy) return;
|
|
|
|
|
|
|
|
if (do_win32 && do_win64)
|
|
|
|
{
|
|
|
|
fprintf(proxy, "\n#ifndef _WIN64\n\n");
|
|
|
|
pointer_size = 4;
|
|
|
|
write_proxy_routines( stmts );
|
|
|
|
fprintf(proxy, "\n#else /* _WIN64 */\n\n");
|
|
|
|
pointer_size = 8;
|
|
|
|
write_proxy_routines( stmts );
|
|
|
|
fprintf(proxy, "\n#endif /* _WIN64 */\n");
|
|
|
|
}
|
|
|
|
else if (do_win32)
|
|
|
|
{
|
|
|
|
pointer_size = 4;
|
|
|
|
write_proxy_routines( stmts );
|
|
|
|
}
|
|
|
|
else if (do_win64)
|
|
|
|
{
|
|
|
|
pointer_size = 8;
|
|
|
|
write_proxy_routines( stmts );
|
|
|
|
}
|
2005-02-20 15:02:48 +00:00
|
|
|
|
|
|
|
fclose(proxy);
|
|
|
|
}
|