Switch to the new widl (Wine-20080118)

svn path=/trunk/; revision=31864
This commit is contained in:
Colin Finck 2008-01-18 12:41:15 +00:00
parent 4caea795dd
commit 5c06769534
8 changed files with 1237 additions and 1185 deletions

View file

@ -299,6 +299,7 @@ static const struct keyword attr_keywords[] =
{"single", tSINGLE},
{"size_is", tSIZEIS},
{"source", tSOURCE},
{"strict_context_handle", tSTRICTCONTEXTHANDLE},
{"string", tSTRING},
{"switch_is", tSWITCHIS},
{"switch_type", tSWITCHTYPE},

File diff suppressed because it is too large Load diff

View file

@ -140,28 +140,29 @@
tSMALL = 366,
tSOURCE = 367,
tSTDCALL = 368,
tSTRING = 369,
tSTRUCT = 370,
tSWITCH = 371,
tSWITCHIS = 372,
tSWITCHTYPE = 373,
tTRANSMITAS = 374,
tTRUE = 375,
tTYPEDEF = 376,
tUNION = 377,
tUNIQUE = 378,
tUNSIGNED = 379,
tUUID = 380,
tV1ENUM = 381,
tVARARG = 382,
tVERSION = 383,
tVOID = 384,
tWCHAR = 385,
tWIREMARSHAL = 386,
CAST = 387,
PPTR = 388,
NEG = 389,
ADDRESSOF = 390
tSTRICTCONTEXTHANDLE = 369,
tSTRING = 370,
tSTRUCT = 371,
tSWITCH = 372,
tSWITCHIS = 373,
tSWITCHTYPE = 374,
tTRANSMITAS = 375,
tTRUE = 376,
tTYPEDEF = 377,
tUNION = 378,
tUNIQUE = 379,
tUNSIGNED = 380,
tUUID = 381,
tV1ENUM = 382,
tVARARG = 383,
tVERSION = 384,
tVOID = 385,
tWCHAR = 386,
tWIREMARSHAL = 387,
CAST = 388,
PPTR = 389,
NEG = 390,
ADDRESSOF = 391
};
#endif
/* Tokens. */
@ -276,28 +277,29 @@
#define tSMALL 366
#define tSOURCE 367
#define tSTDCALL 368
#define tSTRING 369
#define tSTRUCT 370
#define tSWITCH 371
#define tSWITCHIS 372
#define tSWITCHTYPE 373
#define tTRANSMITAS 374
#define tTRUE 375
#define tTYPEDEF 376
#define tUNION 377
#define tUNIQUE 378
#define tUNSIGNED 379
#define tUUID 380
#define tV1ENUM 381
#define tVARARG 382
#define tVERSION 383
#define tVOID 384
#define tWCHAR 385
#define tWIREMARSHAL 386
#define CAST 387
#define PPTR 388
#define NEG 389
#define ADDRESSOF 390
#define tSTRICTCONTEXTHANDLE 369
#define tSTRING 370
#define tSTRUCT 371
#define tSWITCH 372
#define tSWITCHIS 373
#define tSWITCHTYPE 374
#define tTRANSMITAS 375
#define tTRUE 376
#define tTYPEDEF 377
#define tUNION 378
#define tUNIQUE 379
#define tUNSIGNED 380
#define tUUID 381
#define tV1ENUM 382
#define tVARARG 383
#define tVERSION 384
#define tVOID 385
#define tWCHAR 386
#define tWIREMARSHAL 387
#define CAST 388
#define PPTR 389
#define NEG 390
#define ADDRESSOF 391
@ -327,7 +329,7 @@ typedef union YYSTYPE {
interface_info_t ifinfo;
} YYSTYPE;
/* Line 1447 of yacc.c. */
#line 331 "parser.tab.h"
#line 333 "parser.tab.h"
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1

View file

@ -225,6 +225,7 @@ static void check_all_user_types(ifref_list_t *ifaces);
%token tSMALL
%token tSOURCE
%token tSTDCALL
%token tSTRICTCONTEXTHANDLE
%token tSTRING tSTRUCT
%token tSWITCH tSWITCHIS tSWITCHTYPE
%token tTRANSMITAS
@ -497,6 +498,7 @@ attribute: { $$ = NULL; }
| tRETVAL { $$ = make_attr(ATTR_RETVAL); }
| tSIZEIS '(' m_exprs ')' { $$ = make_attrp(ATTR_SIZEIS, $3); }
| tSOURCE { $$ = make_attr(ATTR_SOURCE); }
| tSTRICTCONTEXTHANDLE { $$ = make_attr(ATTR_STRICTCONTEXTHANDLE); }
| tSTRING { $$ = make_attr(ATTR_STRING); }
| tSWITCHIS '(' expr ')' { $$ = make_attrp(ATTR_SWITCHIS, $3); }
| tSWITCHTYPE '(' type ')' { $$ = make_attrp(ATTR_SWITCHTYPE, $3); }

View file

@ -16,10 +16,11 @@
#define yytext parser_text
#define yywrap parser_wrap
#line 20 "parser.yy.c"
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $
* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
*/
#define FLEX_SCANNER
@ -144,6 +145,7 @@ extern FILE *yyin, *yyout;
{ \
/* Undo effects of setting up yytext. */ \
*yy_cp = yy_hold_char; \
YY_RESTORE_YY_MORE_OFFSET \
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
@ -253,7 +255,7 @@ void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )
YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));
static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
@ -480,6 +482,7 @@ static char *yy_last_accepting_cpos;
#define REJECT reject_used_but_not_detected
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
char *yytext;
#line 1 "parser.l"
#define INITIAL 0
@ -580,7 +583,7 @@ UUID *parse_uuid(const char *u)
* The flexer starts here
**************************************************************************
*/
#line 584 "lex.parser_.c"
#line 587 "parser.yy.c"
/* Macros after this point can all be overridden by user definitions in
* section 1.
@ -602,6 +605,10 @@ static void yyunput YY_PROTO(( int c, char *buf_ptr ));
static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int ));
#endif
#ifdef YY_NEED_STRLEN
static int yy_flex_strlen YY_PROTO(( yyconst char * ));
#endif
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput YY_PROTO(( void ));
@ -732,7 +739,7 @@ YY_DECL
#line 108 "parser.l"
#line 736 "lex.parser_.c"
#line 743 "parser.yy.c"
if ( yy_init )
{
@ -978,7 +985,7 @@ YY_RULE_SETUP
#line 172 "parser.l"
ECHO;
YY_BREAK
#line 982 "lex.parser_.c"
#line 989 "parser.yy.c"
case YY_END_OF_BUFFER:
{
@ -987,6 +994,7 @@ ECHO;
/* Undo the effects of YY_DO_BEFORE_ACTION. */
*yy_cp = yy_hold_char;
YY_RESTORE_YY_MORE_OFFSET
if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
{
@ -1132,7 +1140,7 @@ static int yy_get_next_buffer()
{ /* Don't try to fill the buffer, so this is an EOF. */
if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
{
/* We matched a singled characater, the EOB, so
/* We matched a single character, the EOB, so
* treat this as a final EOF.
*/
return EOB_ACT_END_OF_FILE;
@ -1159,7 +1167,7 @@ static int yy_get_next_buffer()
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
*/
yy_n_chars = 0;
yy_current_buffer->yy_n_chars = yy_n_chars = 0;
else
{
@ -1214,6 +1222,8 @@ static int yy_get_next_buffer()
/* Read in more data. */
YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
yy_n_chars, num_to_read );
yy_current_buffer->yy_n_chars = yy_n_chars;
}
if ( yy_n_chars == 0 )
@ -1339,6 +1349,7 @@ register char *yy_bp;
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
yy_current_buffer->yy_n_chars =
yy_n_chars = yy_current_buffer->yy_buf_size;
if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
@ -1377,19 +1388,31 @@ static int input()
else
{ /* need more input */
yytext_ptr = yy_c_buf_p;
int offset = yy_c_buf_p - yytext_ptr;
++yy_c_buf_p;
switch ( yy_get_next_buffer() )
{
case EOB_ACT_LAST_MATCH:
/* This happens because yy_g_n_b()
* sees that we've accumulated a
* token and flags that we need to
* try matching the token before
* proceeding. But for input(),
* there's no matching to consider.
* So convert the EOB_ACT_LAST_MATCH
* to EOB_ACT_END_OF_FILE.
*/
/* Reset buffer status. */
yyrestart( yyin );
/* fall through */
case EOB_ACT_END_OF_FILE:
{
if ( yywrap() )
{
yy_c_buf_p =
yytext_ptr + YY_MORE_ADJ;
return EOF;
}
if ( ! yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
@ -1401,17 +1424,8 @@ static int input()
}
case EOB_ACT_CONTINUE_SCAN:
yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
yy_c_buf_p = yytext_ptr + offset;
break;
case EOB_ACT_LAST_MATCH:
#ifdef __cplusplus
YY_FATAL_ERROR(
"unexpected last match in yyinput()" );
#else
YY_FATAL_ERROR(
"unexpected last match in input()" );
#endif
}
}
}
@ -1576,6 +1590,9 @@ YY_BUFFER_STATE b;
#endif
{
if ( ! b )
return;
b->yy_n_chars = 0;
/* We always need two end-of-buffer characters. The first causes
@ -1635,17 +1652,17 @@ yy_size_t size;
#ifndef YY_NO_SCAN_STRING
#ifdef YY_USE_PROTOS
YY_BUFFER_STATE yy_scan_string( yyconst char *str )
YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str )
#else
YY_BUFFER_STATE yy_scan_string( str )
yyconst char *str;
YY_BUFFER_STATE yy_scan_string( yy_str )
yyconst char *yy_str;
#endif
{
int len;
for ( len = 0; str[len]; ++len )
for ( len = 0; yy_str[len]; ++len )
;
return yy_scan_bytes( str, len );
return yy_scan_bytes( yy_str, len );
}
#endif
@ -1766,7 +1783,7 @@ char msg[];
{ \
/* Undo effects of setting up yytext. */ \
yytext[yyleng] = yy_hold_char; \
yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
yy_c_buf_p = yytext + n; \
yy_hold_char = *yy_c_buf_p; \
*yy_c_buf_p = '\0'; \
yyleng = n; \
@ -1792,6 +1809,22 @@ int n;
}
#endif
#ifdef YY_NEED_STRLEN
#ifdef YY_USE_PROTOS
static int yy_flex_strlen( yyconst char *s )
#else
static int yy_flex_strlen( s )
yyconst char *s;
#endif
{
register int n;
for ( n = 0; s[n]; ++n )
;
return n;
}
#endif
#ifdef YY_USE_PROTOS
static void *yy_flex_alloc( yy_size_t size )
@ -1969,6 +2002,7 @@ static const struct keyword attr_keywords[] =
{"single", tSINGLE},
{"size_is", tSIZEIS},
{"source", tSOURCE},
{"strict_context_handle", tSTRICTCONTEXTHANDLE},
{"string", tSTRING},
{"switch_is", tSWITCHIS},
{"switch_type", tSWITCHTYPE},

View file

@ -43,6 +43,7 @@
static const func_t *current_func;
static const type_t *current_structure;
static const ifref_t *current_iface;
static struct list expr_eval_routines = LIST_INIT(expr_eval_routines);
struct expr_eval_routine
@ -1472,11 +1473,9 @@ static size_t write_string_tfs(FILE *file, const attr_list_t *attrs,
const char *name, unsigned int *typestring_offset,
int toplevel)
{
size_t start_offset = *typestring_offset;
size_t start_offset;
unsigned char rtype;
update_tfsoff(type, start_offset, file);
if (toplevel && is_declptr(type))
{
unsigned char flag = is_conformant_array(type) ? 0 : RPC_FC_P_SIMPLEPOINTER;
@ -1494,6 +1493,9 @@ static size_t write_string_tfs(FILE *file, const attr_list_t *attrs,
}
}
start_offset = *typestring_offset;
update_tfsoff(type, start_offset, file);
rtype = type->ref->type;
if ((rtype != RPC_FC_BYTE) && (rtype != RPC_FC_CHAR) && (rtype != RPC_FC_WCHAR))
@ -2056,7 +2058,10 @@ static size_t write_contexthandle_tfs(FILE *file, const type_t *type,
unsigned int *typeformat_offset)
{
size_t start_offset = *typeformat_offset;
unsigned char flags = 0x08 /* strict */;
unsigned char flags = 0;
if (is_attr(current_iface->attrs, ATTR_STRICTCONTEXTHANDLE))
flags |= NDR_STRICT_CONTEXT_HANDLE;
if (is_ptr(type))
flags |= 0x80;
@ -2064,20 +2069,21 @@ static size_t write_contexthandle_tfs(FILE *file, const type_t *type,
{
flags |= 0x40;
if (!is_attr(var->attrs, ATTR_OUT))
flags |= 0x01;
flags |= NDR_CONTEXT_HANDLE_CANNOT_BE_NULL;
}
if (is_attr(var->attrs, ATTR_OUT))
flags |= 0x20;
WRITE_FCTYPE(file, FC_BIND_CONTEXT, *typeformat_offset);
print_file(file, 2, "0x%x,\t/* Context flags: ", flags);
if (((flags & 0x21) != 0x21) && (flags & 0x01))
/* return and can't be null values overlap */
if (((flags & 0x21) != 0x21) && (flags & NDR_CONTEXT_HANDLE_CANNOT_BE_NULL))
print_file(file, 0, "can't be null, ");
if (flags & 0x02)
if (flags & NDR_CONTEXT_HANDLE_SERIALIZE)
print_file(file, 0, "serialize, ");
if (flags & 0x04)
if (flags & NDR_CONTEXT_HANDLE_NO_SERIALIZE)
print_file(file, 0, "no serialize, ");
if (flags & 0x08)
if (flags & NDR_STRICT_CONTEXT_HANDLE)
print_file(file, 0, "strict, ");
if ((flags & 0x21) == 0x20)
print_file(file, 0, "out, ");
@ -2279,6 +2285,7 @@ static size_t process_tfs(FILE *file, const ifref_list_t *ifaces, type_pred_t pr
if (iface->iface->funcs)
{
const func_t *func;
current_iface = iface;
LIST_FOR_EACH_ENTRY( func, iface->iface->funcs, const func_t, entry )
{
if (is_local(func->def->attrs)) continue;
@ -2706,10 +2713,11 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func,
}
else
{
print_file(file, indent, "NdrServerContextMarshall(\n");
print_file(file, indent, "NdrServerContextNewMarshall(\n");
print_file(file, indent + 1, "&_StubMsg,\n");
print_file(file, indent + 1, "(NDR_SCONTEXT)%s,\n", var->name);
print_file(file, indent + 1, "(NDR_RUNDOWN)%s_rundown);\n", get_context_handle_type_name(var->type));
print_file(file, indent + 1, "(NDR_RUNDOWN)%s_rundown,\n", get_context_handle_type_name(var->type));
print_file(file, indent + 1, "(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%d]);\n", start_offset);
}
}
else if (phase == PHASE_UNMARSHAL)
@ -2722,7 +2730,11 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func,
print_file(file, indent + 1, "_Handle);\n");
}
else
print_file(file, indent, "%s = NdrServerContextUnmarshall(&_StubMsg);\n", var->name);
{
print_file(file, indent, "%s = NdrServerContextNewUnmarshall(\n", var->name);
print_file(file, indent + 1, "&_StubMsg,\n");
print_file(file, indent + 1, "(PFORMAT_STRING)&__MIDL_TypeFormatString.Format[%d]);\n", start_offset);
}
}
}
else if (is_user_type(var->type))
@ -2743,10 +2755,11 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func,
}
if ((phase == PHASE_FREE) || (pointer_type == RPC_FC_UP))
print_phase_function(file, indent, "Pointer", phase, var, start_offset);
print_phase_function(file, indent, "Pointer", phase, var,
start_offset - (type->size_is ? 4 : 2));
else
print_phase_function(file, indent, "ConformantString", phase, var,
start_offset + (type->size_is ? 4 : 2));
start_offset);
}
}
else if (is_array(type))
@ -2813,7 +2826,8 @@ static void write_remoting_arg(FILE *file, int indent, const func_t *func,
if (type->type == RPC_FC_BOGUS_ARRAY ||
type->type == RPC_FC_CVARRAY ||
((type->type == RPC_FC_SMVARRAY || type->type == RPC_FC_LGVARRAY) && in_attr) ||
(type->type == RPC_FC_CARRAY && !in_attr)) {
(type->type == RPC_FC_CARRAY && !in_attr))
{
print_file(file, indent, "if (%s)\n", var->name);
indent++;
print_file(file, indent, "_StubMsg.pfnFree(%s);\n", var->name);

View file

@ -1,6 +1,6 @@
Index: hash.c
===================================================================
--- hash.c (revision 31815)
--- hash.c (revision 31863)
+++ hash.c (working copy)
@@ -21,9 +21,7 @@
#include <stdio.h>
@ -36,7 +36,7 @@ Index: hash.c
break;
Index: server.c
===================================================================
--- server.c (revision 31815)
--- server.c (revision 31863)
+++ server.c (working copy)
@@ -390,6 +390,7 @@
print_server("/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n", PACKAGE_VERSION, input_name);
@ -48,7 +48,7 @@ Index: server.c
}
Index: typelib.c
===================================================================
--- typelib.c (revision 31815)
--- typelib.c (revision 31863)
+++ typelib.c (working copy)
@@ -35,8 +35,7 @@
#define NONAMELESSUNION
@ -62,7 +62,7 @@ Index: typelib.c
#include "utils.h"
Index: utils.c
===================================================================
--- utils.c (revision 31815)
--- utils.c (revision 31863)
+++ utils.c (working copy)
@@ -136,6 +136,9 @@
name = "widl.tab";
@ -76,7 +76,7 @@ Index: utils.c
Index: widl.c
===================================================================
--- widl.c (revision 31815)
--- widl.c (revision 31863)
+++ widl.c (working copy)
@@ -166,6 +166,9 @@
int i;
@ -90,7 +90,7 @@ Index: widl.c
token = xstrdup(name);
Index: widltypes.h
===================================================================
--- widltypes.h (revision 31815)
--- widltypes.h (revision 31863)
+++ widltypes.h (working copy)
@@ -21,6 +21,13 @@
#ifndef __WIDL_WIDLTYPES_H
@ -108,7 +108,7 @@ Index: widltypes.h
#include "wine/rpcfc.h"
Index: write_msft.c
===================================================================
--- write_msft.c (revision 31815)
--- write_msft.c (revision 31863)
+++ write_msft.c (working copy)
@@ -40,10 +40,8 @@
#define NONAMELESSUNION

View file

@ -128,6 +128,7 @@ enum attr_type
ATTR_RETVAL,
ATTR_SIZEIS,
ATTR_SOURCE,
ATTR_STRICTCONTEXTHANDLE,
ATTR_STRING,
ATTR_SWITCHIS,
ATTR_SWITCHTYPE,