* Sync with Wine 1.7.17.
CORE-8080

svn path=/trunk/; revision=62774
This commit is contained in:
Amine Khaldi
2014-04-18 20:22:07 +00:00
parent d6098a47bf
commit 16e97786ec
19 changed files with 4147 additions and 3298 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ When porting a new DLL from Wine to ReactOS, please do the following steps
The following build tools are shared with Wine.
reactos/tools/unicode # Synced to Wine-1.7.1
reactos/tools/widl # Synced to Wine-1.5.11
reactos/tools/widl # Synced to Wine-1.7.17
reactos/tools/wpp # Synced to Wine-1.7.1
The following libraries are shared with Wine.
File diff suppressed because it is too large Load Diff
+4 -11
View File
@@ -109,17 +109,7 @@ unsigned int get_attrv(const attr_list_t *list, enum attr_type t)
return 0;
}
int is_void(const type_t *t)
{
return type_get_type(t) == TYPE_VOID;
}
int is_conformant_array(const type_t *t)
{
return is_array(t) && type_array_has_conformance(t);
}
void write_guid(FILE *f, const char *guid_prefix, const char *name, const UUID *uuid)
static void write_guid(FILE *f, const char *guid_prefix, const char *name, const UUID *uuid)
{
if (!uuid) return;
fprintf(f, "DEFINE_GUID(%s_%s, 0x%08x, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,"
@@ -1351,6 +1341,7 @@ static void write_imports(FILE *header, const statement_list_t *stmts)
case STMT_TYPEDEF:
case STMT_MODULE:
case STMT_CPPQUOTE:
case STMT_PRAGMA:
case STMT_DECLARATION:
/* not processed here */
break;
@@ -1385,6 +1376,7 @@ static void write_forward_decls(FILE *header, const statement_list_t *stmts)
case STMT_TYPEDEF:
case STMT_MODULE:
case STMT_CPPQUOTE:
case STMT_PRAGMA:
case STMT_DECLARATION:
/* not processed here */
break;
@@ -1437,6 +1429,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons
break;
case STMT_IMPORTLIB:
case STMT_MODULE:
case STMT_PRAGMA:
/* not included in header */
break;
case STMT_IMPORT:
+26 -5
View File
@@ -28,9 +28,6 @@ extern int is_aliaschain_attr(const type_t *var, enum attr_type t);
extern int is_attr(const attr_list_t *list, enum attr_type t);
extern void *get_attrp(const attr_list_t *list, enum attr_type t);
extern unsigned int get_attrv(const attr_list_t *list, enum attr_type t);
extern int is_void(const type_t *t);
extern int is_conformant_array(const type_t *t);
extern int is_declptr(const type_t *t);
extern const char* get_name(const var_t *v);
extern void write_type_left(FILE *h, type_t *t, int declonly);
extern void write_type_right(FILE *h, type_t *t, int is_field);
@@ -47,6 +44,7 @@ extern int need_proxy(const type_t *iface);
extern int need_inline_stubs(const type_t *iface);
extern int need_stub_files(const statement_list_t *stmts);
extern int need_proxy_file(const statement_list_t *stmts);
extern int need_proxy_delegation(const statement_list_t *stmts);
extern int need_inline_stubs_file(const statement_list_t *stmts);
extern const var_t *is_callas(const attr_list_t *list);
extern void write_args(FILE *h, const var_list_t *arg, const char *name, int obj, int do_indent);
@@ -55,10 +53,33 @@ extern const type_t* get_explicit_generic_handle_type(const var_t* var);
extern const var_t *get_func_handle_var( const type_t *iface, const var_t *func,
unsigned char *explicit_fc, unsigned char *implicit_fc );
extern int has_out_arg_or_return(const var_t *func);
extern void write_guid(FILE *f, const char *guid_prefix, const char *name,
const UUID *uuid);
extern int is_const_decl(const var_t *var);
static inline int is_ptr(const type_t *t)
{
return type_get_type(t) == TYPE_POINTER;
}
static inline int is_array(const type_t *t)
{
return type_get_type(t) == TYPE_ARRAY;
}
static inline int is_void(const type_t *t)
{
return type_get_type(t) == TYPE_VOID;
}
static inline int is_declptr(const type_t *t)
{
return is_ptr(t) || (type_get_type(t) == TYPE_ARRAY && type_array_is_decl_as_ptr(t));
}
static inline int is_conformant_array(const type_t *t)
{
return is_array(t) && type_array_has_conformance(t);
}
static inline int last_ptr(const type_t *type)
{
return is_ptr(type) && !is_declptr(type_pointer_get_ref(type));
+6 -1
View File
@@ -37,6 +37,7 @@ double [0-9]+\.[0-9]+([eE][+-]?[0-9]+)*
%x WSTRQUOTE
%x ATTR
%x PP_LINE
%x PP_PRAGMA
%x SQUOTE
%{
@@ -125,6 +126,7 @@ UUID *parse_uuid(const char *u)
**************************************************************************
*/
%%
<INITIAL>^{ws}*\#{ws}*pragma{ws}+ yy_push_state(PP_PRAGMA);
<INITIAL,ATTR>^{ws}*\#{ws}* yy_push_state(PP_LINE);
<PP_LINE>[^\n]* {
int lineno;
@@ -144,6 +146,8 @@ UUID *parse_uuid(const char *u)
line_number = lineno - 1; /* We didn't read the newline */
input_name = xstrdup(fname);
}
<PP_PRAGMA>midl_echo[^\n]* yyless(9); yy_pop_state(); return tCPPQUOTE;
<PP_PRAGMA>[^\n]* parser_lval.str = xstrdup(yytext); yy_pop_state(); return aPRAGMA;
<INITIAL,ATTR>\" yy_push_state(QUOTE); cbufidx = 0;
<QUOTE>\" {
yy_pop_state();
@@ -261,6 +265,7 @@ static const struct keyword keywords[] = {
{"long", tLONG},
{"methods", tMETHODS},
{"module", tMODULE},
{"namespace", tNAMESPACE},
{"pascal", tPASCAL},
{"properties", tPROPERTIES},
{"register", tREGISTER},
@@ -414,7 +419,7 @@ static int kw_token(const char *kw)
struct keyword key, *kwp;
key.kw = kw;
kwp = bsearch(&key, keywords, NKEYWORDS, sizeof(keywords[0]), kw_cmp_func);
if (kwp) {
if (kwp && (do_rt_extension || kwp->token != tNAMESPACE)) {
parser_lval.str = xstrdup(kwp->kw);
return kwp->token;
}
File diff suppressed because it is too large Load Diff
+184 -182
View File
@@ -38,186 +38,188 @@
know about them. */
enum yytokentype {
aIDENTIFIER = 258,
aKNOWNTYPE = 259,
aNUM = 260,
aHEXNUM = 261,
aDOUBLE = 262,
aSTRING = 263,
aWSTRING = 264,
aSQSTRING = 265,
aUUID = 266,
aEOF = 267,
SHL = 268,
SHR = 269,
MEMBERPTR = 270,
EQUALITY = 271,
INEQUALITY = 272,
GREATEREQUAL = 273,
LESSEQUAL = 274,
LOGICALOR = 275,
LOGICALAND = 276,
ELLIPSIS = 277,
tAGGREGATABLE = 278,
tALLOCATE = 279,
tANNOTATION = 280,
tAPPOBJECT = 281,
tASYNC = 282,
tASYNCUUID = 283,
tAUTOHANDLE = 284,
tBINDABLE = 285,
tBOOLEAN = 286,
tBROADCAST = 287,
tBYTE = 288,
tBYTECOUNT = 289,
tCALLAS = 290,
tCALLBACK = 291,
tCASE = 292,
tCDECL = 293,
tCHAR = 294,
tCOCLASS = 295,
tCODE = 296,
tCOMMSTATUS = 297,
tCONST = 298,
tCONTEXTHANDLE = 299,
tCONTEXTHANDLENOSERIALIZE = 300,
tCONTEXTHANDLESERIALIZE = 301,
tCONTROL = 302,
tCPPQUOTE = 303,
tDECODE = 304,
tDEFAULT = 305,
tDEFAULTBIND = 306,
tDEFAULTCOLLELEM = 307,
tDEFAULTVALUE = 308,
tDEFAULTVTABLE = 309,
tDISABLECONSISTENCYCHECK = 310,
tDISPLAYBIND = 311,
tDISPINTERFACE = 312,
tDLLNAME = 313,
tDOUBLE = 314,
tDUAL = 315,
tENABLEALLOCATE = 316,
tENCODE = 317,
tENDPOINT = 318,
tENTRY = 319,
tENUM = 320,
tERRORSTATUST = 321,
tEXPLICITHANDLE = 322,
tEXTERN = 323,
tFALSE = 324,
tFASTCALL = 325,
tFAULTSTATUS = 326,
tFLOAT = 327,
tFORCEALLOCATE = 328,
tHANDLE = 329,
tHANDLET = 330,
tHELPCONTEXT = 331,
tHELPFILE = 332,
tHELPSTRING = 333,
tHELPSTRINGCONTEXT = 334,
tHELPSTRINGDLL = 335,
tHIDDEN = 336,
tHYPER = 337,
tID = 338,
tIDEMPOTENT = 339,
tIGNORE = 340,
tIIDIS = 341,
tIMMEDIATEBIND = 342,
tIMPLICITHANDLE = 343,
tIMPORT = 344,
tIMPORTLIB = 345,
tIN = 346,
tIN_LINE = 347,
tINLINE = 348,
tINPUTSYNC = 349,
tINT = 350,
tINT3264 = 351,
tINT64 = 352,
tINTERFACE = 353,
tLCID = 354,
tLENGTHIS = 355,
tLIBRARY = 356,
tLICENSED = 357,
tLOCAL = 358,
tLONG = 359,
tMAYBE = 360,
tMESSAGE = 361,
tMETHODS = 362,
tMODULE = 363,
tNOCODE = 364,
tNONBROWSABLE = 365,
tNONCREATABLE = 366,
tNONEXTENSIBLE = 367,
tNOTIFY = 368,
tNOTIFYFLAG = 369,
tNULL = 370,
tOBJECT = 371,
tODL = 372,
tOLEAUTOMATION = 373,
tOPTIMIZE = 374,
tOPTIONAL = 375,
tOUT = 376,
tPARTIALIGNORE = 377,
tPASCAL = 378,
tPOINTERDEFAULT = 379,
tPROGID = 380,
tPROPERTIES = 381,
tPROPGET = 382,
tPROPPUT = 383,
tPROPPUTREF = 384,
tPROXY = 385,
tPTR = 386,
tPUBLIC = 387,
tRANGE = 388,
tREADONLY = 389,
tREF = 390,
tREGISTER = 391,
tREPRESENTAS = 392,
tREQUESTEDIT = 393,
tRESTRICTED = 394,
tRETVAL = 395,
tSAFEARRAY = 396,
tSHORT = 397,
tSIGNED = 398,
tSIZEIS = 399,
tSIZEOF = 400,
tSMALL = 401,
tSOURCE = 402,
tSTATIC = 403,
tSTDCALL = 404,
tSTRICTCONTEXTHANDLE = 405,
tSTRING = 406,
tSTRUCT = 407,
tSWITCH = 408,
tSWITCHIS = 409,
tSWITCHTYPE = 410,
tTHREADING = 411,
tTRANSMITAS = 412,
tTRUE = 413,
tTYPEDEF = 414,
tUIDEFAULT = 415,
tUNION = 416,
tUNIQUE = 417,
tUNSIGNED = 418,
tUSESGETLASTERROR = 419,
tUSERMARSHAL = 420,
tUUID = 421,
tV1ENUM = 422,
tVARARG = 423,
tVERSION = 424,
tVIPROGID = 425,
tVOID = 426,
tWCHAR = 427,
tWIREMARSHAL = 428,
tAPARTMENT = 429,
tNEUTRAL = 430,
tSINGLE = 431,
tFREE = 432,
tBOTH = 433,
ADDRESSOF = 434,
NEG = 435,
POS = 436,
PPTR = 437,
CAST = 438
aPRAGMA = 259,
aKNOWNTYPE = 260,
aNUM = 261,
aHEXNUM = 262,
aDOUBLE = 263,
aSTRING = 264,
aWSTRING = 265,
aSQSTRING = 266,
aUUID = 267,
aEOF = 268,
SHL = 269,
SHR = 270,
MEMBERPTR = 271,
EQUALITY = 272,
INEQUALITY = 273,
GREATEREQUAL = 274,
LESSEQUAL = 275,
LOGICALOR = 276,
LOGICALAND = 277,
ELLIPSIS = 278,
tAGGREGATABLE = 279,
tALLOCATE = 280,
tANNOTATION = 281,
tAPPOBJECT = 282,
tASYNC = 283,
tASYNCUUID = 284,
tAUTOHANDLE = 285,
tBINDABLE = 286,
tBOOLEAN = 287,
tBROADCAST = 288,
tBYTE = 289,
tBYTECOUNT = 290,
tCALLAS = 291,
tCALLBACK = 292,
tCASE = 293,
tCDECL = 294,
tCHAR = 295,
tCOCLASS = 296,
tCODE = 297,
tCOMMSTATUS = 298,
tCONST = 299,
tCONTEXTHANDLE = 300,
tCONTEXTHANDLENOSERIALIZE = 301,
tCONTEXTHANDLESERIALIZE = 302,
tCONTROL = 303,
tCPPQUOTE = 304,
tDECODE = 305,
tDEFAULT = 306,
tDEFAULTBIND = 307,
tDEFAULTCOLLELEM = 308,
tDEFAULTVALUE = 309,
tDEFAULTVTABLE = 310,
tDISABLECONSISTENCYCHECK = 311,
tDISPLAYBIND = 312,
tDISPINTERFACE = 313,
tDLLNAME = 314,
tDOUBLE = 315,
tDUAL = 316,
tENABLEALLOCATE = 317,
tENCODE = 318,
tENDPOINT = 319,
tENTRY = 320,
tENUM = 321,
tERRORSTATUST = 322,
tEXPLICITHANDLE = 323,
tEXTERN = 324,
tFALSE = 325,
tFASTCALL = 326,
tFAULTSTATUS = 327,
tFLOAT = 328,
tFORCEALLOCATE = 329,
tHANDLE = 330,
tHANDLET = 331,
tHELPCONTEXT = 332,
tHELPFILE = 333,
tHELPSTRING = 334,
tHELPSTRINGCONTEXT = 335,
tHELPSTRINGDLL = 336,
tHIDDEN = 337,
tHYPER = 338,
tID = 339,
tIDEMPOTENT = 340,
tIGNORE = 341,
tIIDIS = 342,
tIMMEDIATEBIND = 343,
tIMPLICITHANDLE = 344,
tIMPORT = 345,
tIMPORTLIB = 346,
tIN = 347,
tIN_LINE = 348,
tINLINE = 349,
tINPUTSYNC = 350,
tINT = 351,
tINT3264 = 352,
tINT64 = 353,
tINTERFACE = 354,
tLCID = 355,
tLENGTHIS = 356,
tLIBRARY = 357,
tLICENSED = 358,
tLOCAL = 359,
tLONG = 360,
tMAYBE = 361,
tMESSAGE = 362,
tMETHODS = 363,
tMODULE = 364,
tNAMESPACE = 365,
tNOCODE = 366,
tNONBROWSABLE = 367,
tNONCREATABLE = 368,
tNONEXTENSIBLE = 369,
tNOTIFY = 370,
tNOTIFYFLAG = 371,
tNULL = 372,
tOBJECT = 373,
tODL = 374,
tOLEAUTOMATION = 375,
tOPTIMIZE = 376,
tOPTIONAL = 377,
tOUT = 378,
tPARTIALIGNORE = 379,
tPASCAL = 380,
tPOINTERDEFAULT = 381,
tPROGID = 382,
tPROPERTIES = 383,
tPROPGET = 384,
tPROPPUT = 385,
tPROPPUTREF = 386,
tPROXY = 387,
tPTR = 388,
tPUBLIC = 389,
tRANGE = 390,
tREADONLY = 391,
tREF = 392,
tREGISTER = 393,
tREPRESENTAS = 394,
tREQUESTEDIT = 395,
tRESTRICTED = 396,
tRETVAL = 397,
tSAFEARRAY = 398,
tSHORT = 399,
tSIGNED = 400,
tSIZEIS = 401,
tSIZEOF = 402,
tSMALL = 403,
tSOURCE = 404,
tSTATIC = 405,
tSTDCALL = 406,
tSTRICTCONTEXTHANDLE = 407,
tSTRING = 408,
tSTRUCT = 409,
tSWITCH = 410,
tSWITCHIS = 411,
tSWITCHTYPE = 412,
tTHREADING = 413,
tTRANSMITAS = 414,
tTRUE = 415,
tTYPEDEF = 416,
tUIDEFAULT = 417,
tUNION = 418,
tUNIQUE = 419,
tUNSIGNED = 420,
tUSESGETLASTERROR = 421,
tUSERMARSHAL = 422,
tUUID = 423,
tV1ENUM = 424,
tVARARG = 425,
tVERSION = 426,
tVIPROGID = 427,
tVOID = 428,
tWCHAR = 429,
tWIREMARSHAL = 430,
tAPARTMENT = 431,
tNEUTRAL = 432,
tSINGLE = 433,
tFREE = 434,
tBOTH = 435,
ADDRESSOF = 436,
NEG = 437,
POS = 438,
PPTR = 439,
CAST = 440
};
#endif
@@ -228,7 +230,7 @@ typedef union YYSTYPE
{
/* Line 2068 of yacc.c */
#line 153 "parser.y"
#line 129 "parser.y"
attr_t *attr;
attr_list_t *attr_list;
@@ -258,7 +260,7 @@ typedef union YYSTYPE
/* Line 2068 of yacc.c */
#line 262 "parser.tab.h"
#line 264 "parser.tab.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+69 -46
View File
@@ -38,33 +38,6 @@
#include "expr.h"
#include "typetree.h"
#if defined(YYBYACC)
/* Berkeley yacc (byacc) doesn't seem to know about these */
/* Some *BSD supplied versions do define these though */
# ifndef YYEMPTY
# define YYEMPTY (-1) /* Empty lookahead value of yychar */
# endif
# ifndef YYLEX
# define YYLEX yylex()
# endif
#elif defined(YYBISON)
/* Bison was used for original development */
/* #define YYEMPTY -2 */
/* #define YYLEX yylex() */
#else
/* No yacc we know yet */
# if !defined(YYEMPTY) || !defined(YYLEX)
# error Yacc version/type unknown. This version needs to be verified for settings of YYEMPTY and YYLEX.
# elif defined(__GNUC__) /* gcc defines the #warning directive */
# warning Yacc version/type unknown. It defines YYEMPTY and YYLEX, but is not tested
/* #else we just take a chance that it works... */
# endif
#endif
#define YYERROR_VERBOSE
static unsigned char pointer_default = RPC_FC_UP;
typedef struct list typelist_t;
@@ -141,6 +114,7 @@ static statement_t *make_statement_type_decl(type_t *type);
static statement_t *make_statement_reference(type_t *type);
static statement_t *make_statement_declaration(var_t *var);
static statement_t *make_statement_library(typelib_t *typelib);
static statement_t *make_statement_pragma(const char *str);
static statement_t *make_statement_cppquote(const char *str);
static statement_t *make_statement_importlib(const char *str);
static statement_t *make_statement_module(type_t *type);
@@ -148,6 +122,8 @@ static statement_t *make_statement_typedef(var_list_t *names);
static statement_t *make_statement_import(const char *str);
static statement_t *make_statement_typedef(var_list_t *names);
static statement_list_t *append_statement(statement_list_t *list, statement_t *stmt);
static statement_list_t *append_statements(statement_list_t *, statement_list_t *);
static attr_list_t *append_attribs(attr_list_t *, attr_list_t *);
%}
%union {
@@ -177,7 +153,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s
enum storage_class stgclass;
}
%token <str> aIDENTIFIER
%token <str> aIDENTIFIER aPRAGMA
%token <str> aKNOWNTYPE
%token <num> aNUM aHEXNUM
%token <dbl> aDOUBLE
@@ -229,6 +205,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s
%token tMAYBE tMESSAGE
%token tMETHODS
%token tMODULE
%token tNAMESPACE
%token tNOCODE tNONBROWSABLE
%token tNONCREATABLE
%token tNONEXTENSIBLE
@@ -285,6 +262,7 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s
%type <type> inherit interface interfacedef interfacedec
%type <type> dispinterface dispinterfacehdr dispinterfacedef
%type <type> module modulehdr moduledef
%type <type> namespacedef
%type <type> base_type int_std
%type <type> enumdef structdef uniondef typedecl
%type <type> type
@@ -323,6 +301,8 @@ static statement_list_t *append_statement(statement_list_t *list, statement_t *s
%right '!' '~' CAST PPTR POS NEG ADDRESSOF tSIZEOF
%left '.' MEMBERPTR '[' ']'
%error-verbose
%%
input: gbl_statements { fix_incomplete();
@@ -340,6 +320,8 @@ input: gbl_statements { fix_incomplete();
;
gbl_statements: { $$ = NULL; }
| gbl_statements namespacedef '{' gbl_statements '}'
{ $$ = append_statements($1, $4); }
| gbl_statements interfacedec { $$ = append_statement($1, make_statement_reference($2)); }
| gbl_statements interfacedef { $$ = append_statement($1, make_statement_type_decl($2)); }
| gbl_statements coclass ';' { $$ = $1;
@@ -355,6 +337,8 @@ gbl_statements: { $$ = NULL; }
imp_statements: { $$ = NULL; }
| imp_statements interfacedec { $$ = append_statement($1, make_statement_reference($2)); }
| imp_statements namespacedef '{' imp_statements '}'
{ $$ = append_statements($1, $4); }
| imp_statements interfacedef { $$ = append_statement($1, make_statement_type_decl($2)); }
| imp_statements coclass ';' { $$ = $1; reg_type($2, $2->name, 0); }
| imp_statements coclassdef { $$ = append_statement($1, make_statement_type_decl($2));
@@ -380,6 +364,7 @@ statement:
| declaration ';' { $$ = make_statement_declaration($1); }
| import { $$ = make_statement_import($1); }
| typedef ';' { $$ = $1; }
| aPRAGMA { $$ = make_statement_pragma($1); }
;
typedecl:
@@ -573,6 +558,7 @@ attribute: { $$ = NULL; }
| tUSESGETLASTERROR { $$ = make_attr(ATTR_USESGETLASTERROR); }
| tUSERMARSHAL '(' type ')' { $$ = make_attrp(ATTR_USERMARSHAL, $3); }
| tUUID '(' uuid_string ')' { $$ = make_attrp(ATTR_UUID, $3); }
| tASYNCUUID '(' uuid_string ')' { $$ = make_attrp(ATTR_ASYNCUUID, $3); }
| tV1ENUM { $$ = make_attr(ATTR_V1ENUM); }
| tVARARG { $$ = make_attr(ATTR_VARARG); }
| tVERSION '(' version ')' { $$ = make_attrv(ATTR_VERSION, $3); }
@@ -826,6 +812,9 @@ coclassdef: coclasshdr '{' coclass_ints '}' semicolon_opt
{ $$ = type_coclass_define($1, $3); }
;
namespacedef: tNAMESPACE aIDENTIFIER { $$ = NULL; }
;
coclass_ints: { $$ = NULL; }
| coclass_ints coclass_int { $$ = append_ifref( $1, $2 ); }
;
@@ -887,6 +876,8 @@ interfacehdr: attributes interface { $$.interface = $2;
interfacedef: interfacehdr inherit
'{' int_statements '}' semicolon_opt { $$ = $1.interface;
if($$ == $2)
error_loc("Interface can't inherit from itself\n");
type_interface_define($$, $2, $4);
pointer_default = $1.old_pointer_default;
}
@@ -1106,9 +1097,10 @@ type: tVOID { $$ = type_new_void(); }
| tSAFEARRAY '(' type ')' { $$ = make_safearray($3); }
;
typedef: tTYPEDEF m_attributes decl_spec declarator_list
{ reg_typedefs($3, $4, check_typedef_attrs($2));
$$ = make_statement_typedef($4);
typedef: m_attributes tTYPEDEF m_attributes decl_spec declarator_list
{ $1 = append_attribs($1, $3);
reg_typedefs($4, $5, check_typedef_attrs($1));
$$ = make_statement_typedef($5);
}
;
@@ -1122,6 +1114,7 @@ uniondef: tUNION t_ident '{' ne_union_fields '}'
version:
aNUM { $$ = MAKEVERSION($1, 0); }
| aNUM '.' aNUM { $$ = MAKEVERSION($1, $3); }
| aHEXNUM { $$ = $1; }
;
%%
@@ -1424,11 +1417,6 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl
array_dims_t *arr = decl ? decl->array : NULL;
type_t *func_type = decl ? decl->func_type : NULL;
type_t *type = decl_spec->type;
/* In case of a range attribute, duplicate the type to keep track of
* the min/max values in the type format string */
if(is_attr(attrs, ATTR_RANGE))
type = duptype(type, 1);
if (is_attr(type->attrs, ATTR_INLINE))
{
@@ -1854,13 +1842,14 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at
type_get_type_detect_alias(type) == TYPE_STRUCT ||
type_get_type_detect_alias(type) == TYPE_UNION ||
type_get_type_detect_alias(type) == TYPE_ENCAPSULATED_UNION) &&
!type->name && !parse_only)
!type->name)
{
if (! is_attr(attrs, ATTR_PUBLIC))
if (! is_attr(attrs, ATTR_PUBLIC) && ! is_attr (attrs, ATTR_HIDDEN))
attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) );
type->name = gen_name();
}
else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC))
else if (is_attr(attrs, ATTR_UUID) && !is_attr(attrs, ATTR_PUBLIC)
&& !is_attr(attrs, ATTR_HIDDEN))
attrs = append_attr( attrs, make_attr(ATTR_PUBLIC) );
/* Append the SWITCHTYPE attribute to a non-encapsulated union if it does not already have it. */
@@ -1877,7 +1866,17 @@ static type_t *reg_typedefs(decl_spec_t *decl_spec, declarator_list_t *decls, at
var_t *name;
cur = find_type(decl->var->name, 0);
if (cur)
/*
* MIDL allows shadowing types that are declared in imported files.
* We don't throw an error in this case and instead add a new type
* (which is earlier on the list in hash table, so it will be used
* instead of shadowed type).
*
* FIXME: We may consider string separated type tables for each input
* for cleaner solution.
*/
if (cur && input_name == cur->loc_info.input_name)
error_loc("%s: redefinition error; original definition was at %s:%d\n",
cur->name, cur->loc_info.input_name,
cur->loc_info.line_number);
@@ -1989,7 +1988,7 @@ static char *gen_name(void)
if (! file_id)
{
char *dst = dup_basename(input_name, ".idl");
char *dst = dup_basename(input_idl_name, ".idl");
file_id = dst;
for (; *dst; ++dst)
@@ -2030,6 +2029,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_ANNOTATION */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "annotation" },
/* ATTR_APPOBJECT */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "appobject" },
/* ATTR_ASYNC */ { 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "async" },
/* ATTR_ASYNCUUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "async_uuid" },
/* ATTR_AUTO_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "auto_handle" },
/* ATTR_BINDABLE */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "bindable" },
/* ATTR_BROADCAST */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "broadcast" },
@@ -2065,8 +2065,8 @@ struct allowed_attr allowed_attr[] =
/* ATTR_HELPSTRING */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstring" },
/* ATTR_HELPSTRINGCONTEXT */ { 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "helpstringcontext" },
/* ATTR_HELPSTRINGDLL */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "helpstringdll" },
/* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, "hidden" },
/* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "id" },
/* ATTR_HIDDEN */ { 0, 0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, "hidden" },
/* ATTR_ID */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, "id" },
/* ATTR_IDEMPOTENT */ { 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "idempotent" },
/* ATTR_IGNORE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, "ignore" },
/* ATTR_IIDIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "iid_is" },
@@ -2074,7 +2074,7 @@ struct allowed_attr allowed_attr[] =
/* ATTR_IMPLICIT_HANDLE */ { 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "implicit_handle" },
/* ATTR_IN */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, "in" },
/* ATTR_INLINE */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inline" },
/* ATTR_INPUTSYNC */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" },
/* ATTR_INPUTSYNC */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "inputsync" },
/* ATTR_LENGTHIS */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, "length_is" },
/* ATTR_LIBLCID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, "lcid" },
/* ATTR_LICENSED */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "licensed" },
@@ -2120,10 +2120,10 @@ struct allowed_attr allowed_attr[] =
/* ATTR_UIDEFAULT */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "uidefault" },
/* ATTR_USESGETLASTERROR */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "usesgetlasterror" },
/* ATTR_USERMARSHAL */ { 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "user_marshal" },
/* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, "uuid" },
/* ATTR_UUID */ { 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, "uuid" },
/* ATTR_V1ENUM */ { 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, "v1_enum" },
/* ATTR_VARARG */ { 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "vararg" },
/* ATTR_VERSION */ { 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, "version" },
/* ATTR_VERSION */ { 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, "version" },
/* ATTR_VIPROGID */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, "vi_progid" },
/* ATTR_WIREMARSHAL */ { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, "wire_marshal" },
};
@@ -2752,6 +2752,13 @@ static statement_t *make_statement_library(typelib_t *typelib)
return stmt;
}
static statement_t *make_statement_pragma(const char *str)
{
statement_t *stmt = make_statement(STMT_PRAGMA);
stmt->u.str = str;
return stmt;
}
static statement_t *make_statement_cppquote(const char *str)
{
statement_t *stmt = make_statement(STMT_CPPQUOTE);
@@ -2808,6 +2815,22 @@ static statement_t *make_statement_typedef(declarator_list_t *decls)
return stmt;
}
static statement_list_t *append_statements(statement_list_t *l1, statement_list_t *l2)
{
if (!l2) return l1;
if (!l1 || l1 == l2) return l2;
list_move_tail (l1, l2);
return l1;
}
static attr_list_t *append_attribs(attr_list_t *l1, attr_list_t *l2)
{
if (!l2) return l1;
if (!l1 || l1 == l2) return l2;
list_move_tail (l1, l2);
return l1;
}
static statement_list_t *append_statement(statement_list_t *list, statement_t *stmt)
{
if (!stmt) return list;
+354 -273
View File
@@ -73,7 +73,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@@ -104,6 +103,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@@ -160,7 +161,15 @@ typedef unsigned int flex_uint32_t;
/* Size of default input buffer. */
#ifndef YY_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k.
* Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
* Ditto for the __ia64__ case accordingly.
*/
#define YY_BUF_SIZE 32768
#else
#define YY_BUF_SIZE 16384
#endif /* __ia64__ */
#endif
/* The state buf must be large enough to hold one state per character in the main buffer.
@@ -379,8 +388,8 @@ static void yy_fatal_error (yyconst char msg[] );
*yy_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
#define YY_NUM_RULES 36
#define YY_END_OF_BUFFER 37
#define YY_NUM_RULES 39
#define YY_END_OF_BUFFER 40
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -388,24 +397,27 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
static yyconst flex_int16_t yy_accept[148] =
static yyconst flex_int16_t yy_accept[174] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 2, 2,
0, 0, 37, 35, 24, 23, 35, 3, 35, 7,
35, 35, 19, 19, 35, 35, 35, 22, 22, 22,
14, 35, 24, 1, 13, 36, 4, 13, 6, 19,
19, 16, 16, 16, 15, 2, 8, 13, 29, 33,
27, 0, 0, 19, 19, 19, 0, 25, 31, 28,
30, 26, 22, 5, 22, 32, 0, 1, 1, 12,
10, 9, 19, 0, 16, 16, 2, 11, 34, 20,
19, 19, 18, 22, 19, 0, 16, 0, 18, 18,
22, 19, 0, 16, 0, 20, 18, 18, 22, 19,
0, 0, 0, 0, 0, 0, 0, 0, 3, 3,
5, 5, 0, 0, 40, 38, 27, 26, 38, 6,
38, 10, 38, 38, 22, 22, 38, 38, 38, 25,
25, 25, 17, 38, 27, 2, 16, 39, 7, 16,
9, 22, 22, 19, 19, 19, 18, 27, 2, 3,
5, 5, 11, 16, 32, 36, 30, 0, 0, 22,
22, 22, 0, 28, 34, 31, 33, 29, 25, 8,
25, 35, 0, 2, 2, 0, 15, 13, 12, 22,
0, 19, 19, 0, 2, 2, 3, 5, 5, 14,
37, 23, 22, 22, 21, 25, 0, 22, 0, 19,
0, 16, 22, 19, 0, 16, 22, 19, 0, 16,
22, 19, 0, 16, 22, 0, 19, 0, 21, 0,
5, 0, 21, 21, 25, 0, 22, 0, 19, 5,
0, 23, 21, 21, 25, 0, 22, 0, 19, 5,
25, 0, 22, 0, 19, 5, 25, 0, 22, 0,
19, 5, 25, 1, 22, 0, 19, 5, 25, 0,
22, 4, 0, 24, 0, 4, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 17, 0
0, 20, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -419,11 +431,11 @@ static yyconst flex_int32_t yy_ec[256] =
16, 17, 1, 1, 18, 19, 19, 19, 20, 21,
22, 22, 22, 22, 22, 23, 22, 22, 22, 22,
22, 24, 25, 22, 26, 22, 22, 27, 28, 22,
29, 30, 31, 1, 22, 1, 19, 19, 19, 19,
29, 30, 31, 1, 32, 1, 33, 19, 34, 35,
32, 19, 22, 22, 22, 22, 22, 33, 22, 22,
22, 22, 22, 22, 22, 22, 34, 22, 22, 35,
22, 22, 1, 36, 1, 1, 1, 1, 1, 1,
36, 19, 37, 38, 39, 22, 22, 40, 41, 22,
42, 43, 22, 44, 22, 22, 45, 22, 22, 46,
22, 22, 1, 47, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -440,182 +452,227 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
static yyconst flex_int32_t yy_meta[37] =
static yyconst flex_int32_t yy_meta[48] =
{ 0,
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 3, 3, 1, 1, 1, 3, 3, 3,
3, 4, 4, 4, 4, 4, 4, 4, 1, 1,
1, 3, 4, 4, 4, 1
1, 4, 3, 3, 3, 3, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 1
} ;
static yyconst flex_int16_t yy_base[184] =
static yyconst flex_int16_t yy_base[214] =
{ 0,
0, 35, 35, 39, 40, 43, 61, 45, 262, 261,
46, 47, 263, 481, 481, 481, 246, 481, 254, 481,
243, 243, 85, 25, 41, 238, 42, 0, 248, 229,
481, 210, 60, 243, 481, 481, 481, 34, 481, 108,
26, 131, 154, 239, 481, 0, 481, 60, 481, 481,
481, 231, 58, 0, 75, 77, 0, 481, 481, 481,
481, 481, 0, 481, 220, 481, 61, 238, 236, 481,
481, 481, 174, 0, 196, 0, 0, 481, 481, 93,
481, 481, 113, 213, 216, 0, 238, 166, 89, 81,
214, 258, 0, 280, 89, 169, 481, 481, 207, 300,
0, 46, 46, 50, 51, 54, 84, 56, 345, 344,
129, 130, 131, 132, 346, 639, 639, 639, 325, 639,
333, 639, 322, 326, 160, 124, 45, 321, 47, 0,
331, 316, 639, 286, 63, 139, 639, 639, 639, 45,
639, 194, 117, 228, 0, 326, 639, 64, 324, 0,
0, 286, 639, 135, 639, 639, 639, 312, 54, 154,
130, 119, 0, 639, 639, 639, 639, 639, 0, 639,
296, 639, 71, 146, 147, 272, 639, 639, 639, 252,
0, 285, 0, 72, 313, 312, 0, 0, 278, 639,
639, 140, 639, 639, 158, 291, 277, 309, 0, 342,
0, 322, 203, 342, 0, 364, 208, 384, 0, 406,
197, 428, 213, 212, 115, 0, 211, 128, 481, 0,
0, 0, 210, 0, 0, 0, 0, 209, 0, 0,
0, 0, 208, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 481, 481, 462, 466, 468,
472, 476, 215, 210, 209, 208, 202, 201, 200, 199,
196, 195, 193, 188, 187, 182, 181, 178, 175, 168,
167, 166, 159, 158, 157, 145, 135, 130, 129, 113,
102, 88, 75
269, 182, 152, 162, 290, 265, 366, 0, 399, 269,
58, 196, 639, 639, 276, 255, 423, 0, 456, 259,
270, 258, 480, 0, 513, 255, 266, 281, 537, 0,
570, 244, 251, 275, 212, 265, 263, 227, 143, 0,
267, 0, 149, 639, 0, 0, 0, 0, 257, 0,
0, 0, 0, 256, 0, 0, 0, 0, 249, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 639, 639, 606, 610, 614, 616, 620, 622, 626,
630, 256, 255, 253, 252, 251, 250, 248, 247, 634,
242, 241, 240, 234, 233, 230, 228, 221, 219, 216,
215, 208, 201, 198, 188, 185, 176, 154, 152, 143,
80, 79, 76
} ;
static yyconst flex_int16_t yy_def[184] =
static yyconst flex_int16_t yy_def[214] =
{ 0,
147, 1, 148, 148, 148, 148, 1, 7, 149, 149,
148, 148, 147, 147, 147, 147, 147, 147, 147, 147,
147, 147, 147, 23, 147, 147, 147, 150, 150, 150,
147, 147, 147, 147, 147, 147, 147, 151, 147, 147,
40, 147, 42, 43, 147, 152, 147, 151, 147, 147,
147, 147, 147, 24, 147, 147, 153, 147, 147, 147,
147, 147, 150, 147, 150, 147, 147, 147, 147, 147,
147, 147, 147, 154, 43, 43, 152, 147, 147, 147,
147, 147, 153, 150, 147, 155, 43, 147, 147, 147,
150, 147, 156, 43, 147, 147, 147, 147, 150, 147,
173, 1, 174, 174, 174, 174, 173, 7, 175, 175,
176, 176, 174, 174, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 177,
177, 177, 173, 173, 173, 173, 173, 173, 173, 178,
173, 173, 42, 179, 179, 179, 173, 173, 173, 180,
181, 181, 173, 178, 173, 173, 173, 173, 173, 173,
173, 173, 182, 173, 173, 173, 173, 173, 177, 173,
177, 173, 173, 173, 173, 173, 173, 173, 173, 173,
183, 179, 179, 173, 173, 173, 180, 181, 181, 173,
173, 173, 173, 173, 182, 177, 173, 173, 184, 179,
157, 43, 150, 147, 158, 43, 150, 147, 159, 43,
150, 147, 147, 43, 150, 160, 112, 147, 147, 161,
162, 163, 147, 164, 165, 166, 167, 147, 168, 169,
170, 171, 147, 172, 173, 174, 175, 176, 177, 178,
179, 180, 181, 182, 183, 147, 0, 147, 147, 147,
147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
147, 147, 147
181, 173, 173, 173, 177, 173, 173, 185, 179, 181,
173, 173, 173, 173, 177, 173, 173, 186, 179, 181,
177, 173, 173, 187, 179, 181, 177, 173, 173, 188,
179, 181, 177, 173, 173, 173, 179, 181, 177, 189,
173, 190, 173, 173, 191, 190, 192, 193, 173, 194,
195, 196, 197, 173, 198, 199, 200, 201, 173, 202,
203, 204, 205, 206, 207, 208, 209, 210, 211, 212,
213, 173, 0, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173
} ;
static yyconst flex_int16_t yy_nxt[518] =
static yyconst flex_int16_t yy_nxt[687] =
{ 0,
14, 15, 16, 17, 18, 14, 19, 20, 14, 14,
21, 22, 23, 24, 25, 26, 27, 28, 28, 28,
28, 28, 29, 28, 30, 28, 28, 28, 31, 14,
14, 28, 28, 28, 28, 32, 33, 36, 71, 37,
34, 36, 36, 37, 39, 36, 33, 39, 36, 36,
34, 147, 147, 47, 47, 58, 59, 61, 62, 147,
147, 67, 67, 72, 38, 68, 68, 78, 38, 38,
80, 80, 38, 40, 41, 48, 48, 146, 42, 42,
42, 42, 43, 44, 43, 43, 43, 43, 43, 72,
145, 45, 42, 43, 43, 43, 53, 54, 54, 82,
16, 17, 18, 19, 20, 16, 21, 22, 16, 16,
23, 24, 25, 26, 27, 28, 29, 30, 30, 30,
30, 30, 31, 30, 32, 30, 30, 30, 33, 16,
16, 30, 30, 30, 30, 30, 30, 30, 30, 30,
30, 30, 30, 30, 30, 30, 34, 35, 38, 78,
39, 36, 38, 38, 39, 41, 38, 48, 41, 64,
65, 49, 67, 68, 73, 84, 92, 92, 74, 85,
112, 112, 73, 84, 79, 40, 74, 85, 172, 40,
40, 171, 170, 40, 16, 17, 18, 19, 20, 16,
21, 22, 16, 16, 23, 24, 42, 43, 27, 28,
81, 96, 96, 98, 144, 80, 80, 55, 81, 82,
56, 57, 88, 98, 97, 143, 118, 55, 56, 57,
73, 73, 97, 119, 88, 74, 74, 74, 74, 118,
55, 142, 141, 56, 57, 89, 119, 140, 90, 74,
55, 56, 57, 75, 75, 89, 90, 139, 75, 75,
75, 75, 76, 76, 76, 76, 76, 76, 76, 138,
137, 136, 75, 76, 76, 76, 76, 76, 135, 133,
132, 76, 76, 76, 76, 95, 95, 131, 96, 96,
130, 96, 96, 128, 127, 76, 85, 85, 88, 126,
125, 86, 86, 86, 86, 123, 55, 122, 121, 56,
29, 44, 44, 44, 44, 45, 46, 45, 45, 45,
45, 45, 33, 16, 47, 45, 44, 44, 44, 44,
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
34, 38, 38, 38, 38, 59, 60, 60, 53, 53,
75, 94, 90, 173, 143, 169, 61, 75, 75, 62,
143, 144, 92, 92, 168, 93, 167, 144, 94, 102,
54, 54, 173, 61, 79, 59, 60, 60, 62, 52,
52, 59, 60, 60, 93, 102, 61, 113, 166, 62,
103, 76, 61, 104, 114, 62, 63, 165, 76, 76,
164, 111, 111, 61, 112, 112, 113, 103, 62, 61,
88, 120, 113, 109, 105, 86, 55, 56, 87, 87,
101, 93, 86, 87, 87, 87, 87, 83, 134, 129,
124, 147, 116, 116, 115, 111, 107, 87, 92, 92,
103, 99, 91, 93, 93, 93, 93, 69, 55, 69,
84, 56, 79, 64, 69, 66, 65, 93, 55, 56,
94, 94, 64, 60, 52, 94, 94, 94, 94, 51,
50, 49, 147, 36, 36, 147, 147, 147, 147, 94,
100, 100, 147, 147, 147, 101, 101, 101, 101, 147,
55, 147, 147, 56, 147, 147, 147, 147, 147, 101,
55, 56, 102, 102, 147, 147, 147, 102, 102, 102,
163, 114, 104, 162, 62, 63, 80, 80, 112, 112,
161, 81, 81, 81, 81, 102, 61, 159, 158, 62,
63, 157, 140, 156, 141, 141, 81, 81, 81, 81,
154, 102, 153, 61, 61, 152, 151, 62, 62, 63,
82, 82, 149, 148, 147, 82, 82, 82, 82, 145,
136, 61, 130, 124, 118, 108, 62, 99, 95, 160,
82, 82, 82, 82, 98, 98, 155, 150, 142, 99,
99, 99, 99, 140, 61, 140, 134, 62, 139, 141,
141, 138, 134, 133, 99, 99, 99, 99, 132, 61,
128, 61, 62, 127, 126, 122, 62, 100, 100, 121,
102, 147, 147, 147, 147, 147, 147, 147, 147, 147,
147, 102, 104, 104, 147, 147, 147, 105, 105, 105,
105, 147, 55, 147, 147, 56, 147, 147, 147, 147,
147, 105, 55, 56, 106, 106, 147, 147, 147, 106,
106, 106, 106, 147, 147, 147, 147, 147, 147, 147,
147, 147, 147, 106, 108, 108, 147, 147, 147, 109,
109, 109, 109, 147, 55, 147, 147, 56, 147, 147,
147, 147, 147, 109, 55, 56, 110, 110, 147, 147,
147, 110, 110, 110, 110, 147, 147, 147, 147, 147,
147, 147, 147, 147, 147, 110, 112, 112, 147, 147,
120, 116, 100, 100, 100, 100, 61, 115, 110, 106,
105, 62, 101, 86, 86, 97, 96, 100, 100, 100,
100, 107, 107, 91, 89, 86, 108, 108, 108, 108,
70, 61, 72, 71, 62, 70, 66, 58, 57, 56,
55, 108, 108, 108, 108, 173, 38, 38, 61, 173,
173, 173, 173, 62, 109, 109, 173, 173, 173, 109,
109, 109, 109, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 109, 109, 109, 109, 117, 117,
173, 173, 173, 118, 118, 118, 118, 173, 61, 173,
173, 62, 173, 173, 173, 173, 173, 173, 118, 118,
147, 113, 113, 113, 113, 147, 55, 147, 147, 56,
147, 147, 147, 147, 147, 113, 55, 56, 114, 114,
147, 147, 147, 114, 114, 114, 114, 147, 147, 147,
147, 147, 147, 147, 147, 147, 147, 114, 116, 147,
117, 117, 147, 147, 147, 147, 147, 147, 147, 147,
55, 147, 147, 56, 147, 147, 147, 147, 147, 147,
55, 56, 35, 35, 35, 35, 46, 46, 46, 46,
63, 63, 70, 147, 70, 70, 77, 147, 77, 77,
13, 147, 147, 147, 147, 147, 147, 147, 147, 147,
147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
118, 118, 173, 173, 173, 61, 173, 173, 173, 173,
62, 119, 119, 173, 173, 173, 119, 119, 119, 119,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 119, 119, 119, 119, 123, 123, 173, 173, 173,
124, 124, 124, 124, 173, 61, 173, 173, 62, 173,
173, 173, 173, 173, 173, 124, 124, 124, 124, 173,
173, 173, 61, 173, 173, 173, 173, 62, 125, 125,
173, 173, 173, 125, 125, 125, 125, 173, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 125, 125,
125, 125, 129, 129, 173, 173, 173, 130, 130, 130,
147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
147, 147, 147, 147, 147, 147, 147
130, 173, 61, 173, 173, 62, 173, 173, 173, 173,
173, 173, 130, 130, 130, 130, 173, 173, 173, 61,
173, 173, 173, 173, 62, 131, 131, 173, 173, 173,
131, 131, 131, 131, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 131, 131, 131, 131, 135,
135, 173, 173, 173, 136, 136, 136, 136, 173, 61,
173, 173, 62, 173, 173, 173, 173, 173, 173, 136,
136, 136, 136, 173, 173, 173, 61, 173, 173, 173,
173, 62, 137, 137, 173, 173, 173, 137, 137, 137,
137, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 137, 137, 137, 137, 37, 37, 37, 37,
50, 50, 50, 50, 51, 51, 51, 51, 69, 69,
77, 173, 77, 77, 83, 83, 87, 173, 87, 87,
88, 173, 88, 88, 146, 173, 146, 146, 15, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173
} ;
static yyconst flex_int16_t yy_chk[518] =
static yyconst flex_int16_t yy_chk[687] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 2, 3, 38, 3,
2, 4, 5, 4, 5, 6, 8, 6, 11, 12,
8, 24, 41, 11, 12, 25, 25, 27, 27, 24,
41, 33, 67, 38, 3, 33, 67, 48, 4, 5,
53, 53, 6, 7, 7, 11, 12, 183, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 48,
182, 7, 7, 7, 7, 7, 23, 23, 23, 56,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 2, 3, 40,
3, 2, 4, 5, 4, 5, 6, 8, 6, 27,
27, 8, 29, 29, 35, 48, 59, 59, 35, 48,
111, 111, 73, 84, 40, 3, 73, 84, 213, 4,
5, 212, 211, 6, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
55, 95, 95, 90, 181, 80, 80, 23, 55, 56,
23, 23, 80, 90, 89, 180, 115, 23, 23, 23,
40, 40, 89, 115, 80, 40, 40, 40, 40, 118,
40, 179, 178, 40, 40, 83, 118, 177, 83, 40,
40, 40, 40, 42, 42, 83, 83, 176, 42, 42,
42, 42, 42, 42, 42, 42, 42, 42, 42, 175,
174, 173, 42, 42, 42, 42, 43, 43, 172, 171,
170, 43, 43, 43, 43, 88, 88, 169, 88, 88,
168, 96, 96, 167, 166, 43, 73, 73, 96, 165,
164, 73, 73, 73, 73, 163, 73, 162, 161, 73,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 11, 12, 13, 14, 26, 26, 26, 13, 14,
36, 62, 54, 43, 139, 210, 26, 74, 75, 26,
143, 139, 92, 92, 209, 61, 208, 143, 62, 92,
13, 14, 43, 26, 54, 60, 60, 60, 26, 11,
12, 25, 25, 25, 61, 92, 60, 103, 207, 60,
95, 36, 25, 95, 104, 25, 25, 206, 74, 75,
205, 102, 102, 60, 102, 102, 103, 95, 60, 25,
96, 160, 159, 158, 157, 73, 73, 73, 75, 75,
156, 155, 154, 75, 75, 75, 75, 153, 133, 128,
123, 117, 114, 113, 111, 107, 103, 75, 85, 85,
99, 91, 84, 85, 85, 85, 85, 69, 85, 68,
65, 85, 52, 44, 34, 32, 30, 85, 85, 85,
87, 87, 29, 26, 22, 87, 87, 87, 87, 21,
19, 17, 13, 10, 9, 0, 0, 0, 0, 87,
92, 92, 0, 0, 0, 92, 92, 92, 92, 0,
92, 0, 0, 92, 0, 0, 0, 0, 0, 92,
92, 92, 94, 94, 0, 0, 0, 94, 94, 94,
204, 104, 95, 203, 25, 25, 42, 42, 112, 112,
202, 42, 42, 42, 42, 112, 42, 201, 200, 42,
42, 199, 135, 198, 135, 135, 42, 42, 42, 42,
197, 112, 196, 42, 135, 195, 194, 135, 42, 42,
44, 44, 193, 192, 191, 44, 44, 44, 44, 189,
188, 135, 187, 186, 185, 184, 135, 183, 182, 159,
44, 44, 44, 44, 80, 80, 154, 149, 138, 80,
80, 80, 80, 137, 80, 136, 134, 80, 133, 141,
141, 132, 128, 127, 80, 80, 80, 80, 126, 141,
122, 80, 141, 121, 120, 116, 80, 82, 82, 115,
94, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 94, 100, 100, 0, 0, 0, 100, 100, 100,
100, 0, 100, 0, 0, 100, 0, 0, 0, 0,
0, 100, 100, 100, 102, 102, 0, 0, 0, 102,
102, 102, 102, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 102, 104, 104, 0, 0, 0, 104,
104, 104, 104, 0, 104, 0, 0, 104, 0, 0,
0, 0, 0, 104, 104, 104, 106, 106, 0, 0,
0, 106, 106, 106, 106, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 106, 108, 108, 0, 0,
110, 106, 82, 82, 82, 82, 141, 105, 101, 97,
96, 141, 89, 86, 85, 76, 71, 82, 82, 82,
82, 98, 98, 58, 52, 49, 98, 98, 98, 98,
46, 98, 34, 32, 98, 31, 28, 24, 23, 21,
19, 98, 98, 98, 98, 15, 10, 9, 98, 0,
0, 0, 0, 98, 100, 100, 0, 0, 0, 100,
100, 100, 100, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 100, 100, 100, 100, 107, 107,
0, 0, 0, 107, 107, 107, 107, 0, 107, 0,
0, 107, 0, 0, 0, 0, 0, 0, 107, 107,
0, 108, 108, 108, 108, 0, 108, 0, 0, 108,
0, 0, 0, 0, 0, 108, 108, 108, 110, 110,
0, 0, 0, 110, 110, 110, 110, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 110, 112, 0,
112, 112, 0, 0, 0, 0, 0, 0, 0, 0,
112, 0, 0, 112, 0, 0, 0, 0, 0, 0,
112, 112, 148, 148, 148, 148, 149, 149, 149, 149,
150, 150, 151, 0, 151, 151, 152, 0, 152, 152,
147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
107, 107, 0, 0, 0, 107, 0, 0, 0, 0,
107, 109, 109, 0, 0, 0, 109, 109, 109, 109,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 109, 109, 109, 109, 117, 117, 0, 0, 0,
117, 117, 117, 117, 0, 117, 0, 0, 117, 0,
0, 0, 0, 0, 0, 117, 117, 117, 117, 0,
0, 0, 117, 0, 0, 0, 0, 117, 119, 119,
0, 0, 0, 119, 119, 119, 119, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 119, 119,
119, 119, 123, 123, 0, 0, 0, 123, 123, 123,
147, 147, 147, 147, 147, 147, 147, 147, 147, 147,
147, 147, 147, 147, 147, 147, 147
123, 0, 123, 0, 0, 123, 0, 0, 0, 0,
0, 0, 123, 123, 123, 123, 0, 0, 0, 123,
0, 0, 0, 0, 123, 125, 125, 0, 0, 0,
125, 125, 125, 125, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 125, 125, 125, 125, 129,
129, 0, 0, 0, 129, 129, 129, 129, 0, 129,
0, 0, 129, 0, 0, 0, 0, 0, 0, 129,
129, 129, 129, 0, 0, 0, 129, 0, 0, 0,
0, 129, 131, 131, 0, 0, 0, 131, 131, 131,
131, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 131, 131, 131, 131, 174, 174, 174, 174,
175, 175, 175, 175, 176, 176, 176, 176, 177, 177,
178, 0, 178, 178, 179, 179, 180, 0, 180, 180,
181, 0, 181, 181, 190, 0, 190, 190, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173, 173, 173, 173, 173,
173, 173, 173, 173, 173, 173
} ;
static yy_state_type yy_last_accepting_state;
@@ -658,7 +715,8 @@ char *parser_text;
#line 43 "parser.l"
#line 44 "parser.l"
#include "config.h"
#include "wine/port.h"
@@ -741,14 +799,15 @@ UUID *parse_uuid(const char *u)
* The flexer starts here
**************************************************************************
*/
#line 745 "parser.yy.c"
#line 803 "parser.yy.c"
#define INITIAL 0
#define QUOTE 1
#define WSTRQUOTE 2
#define ATTR 3
#define PP_LINE 4
#define SQUOTE 5
#define PP_PRAGMA 5
#define SQUOTE 6
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
@@ -833,7 +892,12 @@ static int input (void );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
#ifdef __ia64__
/* On IA-64, the buffer size is 16k, not 8k */
#define YY_READ_BUF_SIZE 16384
#else
#define YY_READ_BUF_SIZE 8192
#endif /* __ia64__ */
#endif
/* Copy whatever the last rule matched to the standard output. */
@@ -841,7 +905,7 @@ static int input (void );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
#define ECHO fwrite( parser_text, parser_leng, 1, parser_out )
#define ECHO do { if (fwrite( parser_text, parser_leng, 1, parser_out )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -852,7 +916,7 @@ static int input (void );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
int n; \
size_t n; \
for ( n = 0; n < max_size && \
(c = getc( parser_in )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -937,9 +1001,9 @@ YY_DECL
register char *yy_cp, *yy_bp;
register int yy_act;
#line 127 "parser.l"
#line 128 "parser.l"
#line 943 "parser.yy.c"
#line 1007 "parser.yy.c"
if ( !(yy_init) )
{
@@ -993,13 +1057,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 148 )
if ( yy_current_state >= 174 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
while ( yy_current_state != 147 );
while ( yy_current_state != 173 );
yy_cp = (yy_last_accepting_cpos);
yy_current_state = (yy_last_accepting_state);
@@ -1021,12 +1085,17 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
#line 128 "parser.l"
yy_push_state(PP_LINE);
#line 129 "parser.l"
yy_push_state(PP_PRAGMA);
YY_BREAK
case 2:
YY_RULE_SETUP
#line 129 "parser.l"
#line 130 "parser.l"
yy_push_state(PP_LINE);
YY_BREAK
case 3:
YY_RULE_SETUP
#line 131 "parser.l"
{
int lineno;
char *cptr, *fname;
@@ -1046,194 +1115,204 @@ YY_RULE_SETUP
input_name = xstrdup(fname);
}
YY_BREAK
case 3:
YY_RULE_SETUP
#line 147 "parser.l"
yy_push_state(QUOTE); cbufidx = 0;
YY_BREAK
case 4:
YY_RULE_SETUP
#line 148 "parser.l"
#line 149 "parser.l"
yyless(9); yy_pop_state(); return tCPPQUOTE;
YY_BREAK
case 5:
YY_RULE_SETUP
#line 150 "parser.l"
parser_lval.str = xstrdup(parser_text); yy_pop_state(); return aPRAGMA;
YY_BREAK
case 6:
YY_RULE_SETUP
#line 151 "parser.l"
yy_push_state(QUOTE); cbufidx = 0;
YY_BREAK
case 7:
YY_RULE_SETUP
#line 152 "parser.l"
{
yy_pop_state();
parser_lval.str = get_buffered_cstring();
return aSTRING;
}
YY_BREAK
case 5:
case 8:
YY_RULE_SETUP
#line 153 "parser.l"
#line 157 "parser.l"
yy_push_state(WSTRQUOTE); cbufidx = 0;
YY_BREAK
case 6:
case 9:
YY_RULE_SETUP
#line 154 "parser.l"
#line 158 "parser.l"
{
yy_pop_state();
parser_lval.str = get_buffered_cstring();
return aWSTRING;
}
YY_BREAK
case 7:
case 10:
YY_RULE_SETUP
#line 159 "parser.l"
#line 163 "parser.l"
yy_push_state(SQUOTE); cbufidx = 0;
YY_BREAK
case 8:
case 11:
YY_RULE_SETUP
#line 160 "parser.l"
#line 164 "parser.l"
{
yy_pop_state();
parser_lval.str = get_buffered_cstring();
return aSQSTRING;
}
YY_BREAK
case 9:
#line 166 "parser.l"
case 10:
YY_RULE_SETUP
#line 166 "parser.l"
addcchar(parser_text[1]);
YY_BREAK
case 11:
YY_RULE_SETUP
#line 167 "parser.l"
addcchar(parser_text[1]);
YY_BREAK
case 12:
YY_RULE_SETUP
#line 168 "parser.l"
addcchar('\\'); addcchar(parser_text[1]);
YY_BREAK
#line 170 "parser.l"
case 13:
YY_RULE_SETUP
#line 169 "parser.l"
addcchar(parser_text[0]);
#line 170 "parser.l"
addcchar(parser_text[1]);
YY_BREAK
case 14:
YY_RULE_SETUP
#line 170 "parser.l"
yy_push_state(ATTR); return '[';
#line 171 "parser.l"
addcchar(parser_text[1]);
YY_BREAK
case 15:
YY_RULE_SETUP
#line 171 "parser.l"
yy_pop_state(); return ']';
#line 172 "parser.l"
addcchar('\\'); addcchar(parser_text[1]);
YY_BREAK
case 16:
YY_RULE_SETUP
#line 172 "parser.l"
return attr_token(parser_text);
#line 173 "parser.l"
addcchar(parser_text[0]);
YY_BREAK
case 17:
YY_RULE_SETUP
#line 173 "parser.l"
#line 174 "parser.l"
yy_push_state(ATTR); return '[';
YY_BREAK
case 18:
YY_RULE_SETUP
#line 175 "parser.l"
yy_pop_state(); return ']';
YY_BREAK
case 19:
YY_RULE_SETUP
#line 176 "parser.l"
return attr_token(parser_text);
YY_BREAK
case 20:
YY_RULE_SETUP
#line 177 "parser.l"
{
parser_lval.uuid = parse_uuid(parser_text);
return aUUID;
}
YY_BREAK
case 18:
case 21:
YY_RULE_SETUP
#line 177 "parser.l"
#line 181 "parser.l"
{
parser_lval.num = xstrtoul(parser_text, NULL, 0);
return aHEXNUM;
}
YY_BREAK
case 19:
case 22:
YY_RULE_SETUP
#line 181 "parser.l"
#line 185 "parser.l"
{
parser_lval.num = xstrtoul(parser_text, NULL, 0);
return aNUM;
}
YY_BREAK
case 20:
case 23:
YY_RULE_SETUP
#line 185 "parser.l"
#line 189 "parser.l"
{
parser_lval.dbl = strtod(parser_text, NULL);
return aDOUBLE;
}
YY_BREAK
case 21:
case 24:
*yy_cp = (yy_hold_char); /* undo effects of setting up parser_text */
(yy_c_buf_p) = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up parser_text again */
YY_RULE_SETUP
#line 189 "parser.l"
#line 193 "parser.l"
return tSAFEARRAY;
YY_BREAK
case 22:
YY_RULE_SETUP
#line 190 "parser.l"
return kw_token(parser_text);
YY_BREAK
case 23:
/* rule 23 can match eol */
YY_RULE_SETUP
#line 191 "parser.l"
line_number++;
YY_BREAK
case 24:
YY_RULE_SETUP
#line 192 "parser.l"
YY_BREAK
case 25:
YY_RULE_SETUP
#line 193 "parser.l"
return SHL;
#line 194 "parser.l"
return kw_token(parser_text);
YY_BREAK
case 26:
/* rule 26 can match eol */
YY_RULE_SETUP
#line 194 "parser.l"
return SHR;
#line 195 "parser.l"
line_number++;
YY_BREAK
case 27:
YY_RULE_SETUP
#line 195 "parser.l"
return MEMBERPTR;
#line 196 "parser.l"
YY_BREAK
case 28:
YY_RULE_SETUP
#line 196 "parser.l"
return EQUALITY;
#line 197 "parser.l"
return SHL;
YY_BREAK
case 29:
YY_RULE_SETUP
#line 197 "parser.l"
return INEQUALITY;
#line 198 "parser.l"
return SHR;
YY_BREAK
case 30:
YY_RULE_SETUP
#line 198 "parser.l"
return GREATEREQUAL;
#line 199 "parser.l"
return MEMBERPTR;
YY_BREAK
case 31:
YY_RULE_SETUP
#line 199 "parser.l"
return LESSEQUAL;
#line 200 "parser.l"
return EQUALITY;
YY_BREAK
case 32:
YY_RULE_SETUP
#line 200 "parser.l"
return LOGICALOR;
#line 201 "parser.l"
return INEQUALITY;
YY_BREAK
case 33:
YY_RULE_SETUP
#line 201 "parser.l"
return LOGICALAND;
#line 202 "parser.l"
return GREATEREQUAL;
YY_BREAK
case 34:
YY_RULE_SETUP
#line 202 "parser.l"
return ELLIPSIS;
#line 203 "parser.l"
return LESSEQUAL;
YY_BREAK
case 35:
YY_RULE_SETUP
#line 203 "parser.l"
#line 204 "parser.l"
return LOGICALOR;
YY_BREAK
case 36:
YY_RULE_SETUP
#line 205 "parser.l"
return LOGICALAND;
YY_BREAK
case 37:
YY_RULE_SETUP
#line 206 "parser.l"
return ELLIPSIS;
YY_BREAK
case 38:
YY_RULE_SETUP
#line 207 "parser.l"
return parser_text[0];
YY_BREAK
case YY_STATE_EOF(INITIAL):
@@ -1241,20 +1320,21 @@ case YY_STATE_EOF(QUOTE):
case YY_STATE_EOF(WSTRQUOTE):
case YY_STATE_EOF(ATTR):
case YY_STATE_EOF(PP_LINE):
case YY_STATE_EOF(PP_PRAGMA):
case YY_STATE_EOF(SQUOTE):
#line 204 "parser.l"
#line 208 "parser.l"
{
if (import_stack_ptr)
return aEOF;
else yyterminate();
}
YY_BREAK
case 36:
case 39:
YY_RULE_SETUP
#line 209 "parser.l"
#line 213 "parser.l"
ECHO;
YY_BREAK
#line 1258 "parser.yy.c"
#line 1338 "parser.yy.c"
case YY_END_OF_BUFFER:
{
@@ -1546,7 +1626,7 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 148 )
if ( yy_current_state >= 174 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -1574,11 +1654,11 @@ static int yy_get_next_buffer (void)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 148 )
if ( yy_current_state >= 174 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 147);
yy_is_jam = (yy_current_state == 173);
return yy_is_jam ? 0 : yy_current_state;
}
@@ -1973,8 +2053,8 @@ YY_BUFFER_STATE parser__scan_string (yyconst char * yystr )
/** Setup the input buffer state to scan the given bytes. The next call to parser_lex() will
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
*
* @return the newly allocated buffer state object.
*/
@@ -2253,7 +2333,7 @@ void parser_free (void * ptr )
#define YYTABLES_NAME "yytables"
#line 209 "parser.l"
#line 213 "parser.l"
@@ -2310,6 +2390,7 @@ static const struct keyword keywords[] = {
{"long", tLONG},
{"methods", tMETHODS},
{"module", tMODULE},
{"namespace", tNAMESPACE},
{"pascal", tPASCAL},
{"properties", tPROPERTIES},
{"register", tREGISTER},
@@ -2463,7 +2544,7 @@ static int kw_token(const char *kw)
struct keyword key, *kwp;
key.kw = kw;
kwp = bsearch(&key, keywords, NKEYWORDS, sizeof(keywords[0]), kw_cmp_func);
if (kwp) {
if (kwp && (do_rt_extension || kwp->token != tNAMESPACE)) {
parser_lval.str = xstrdup(kwp->kw);
return kwp->token;
}
+5
View File
@@ -796,6 +796,11 @@ int need_proxy_file(const statement_list_t *stmts)
return does_any_iface(stmts, need_proxy);
}
int need_proxy_delegation(const statement_list_t *stmts)
{
return does_any_iface(stmts, need_delegation);
}
int need_inline_stubs(const type_t *iface)
{
const statement_t *stmt;
+43 -28
View File
@@ -85,6 +85,8 @@ static const unsigned short IsSimpleRef = 0x0100;
static unsigned int field_memsize(const type_t *type, unsigned int *offset);
static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align);
static unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align);
static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *type,
const char *name, unsigned int *typestring_offset);
static unsigned int write_struct_tfs(FILE *file, type_t *type, const char *name, unsigned int *tfsoff);
static int write_embedded_types(FILE *file, const attr_list_t *attrs, type_t *type,
const char *name, int write_ptr, unsigned int *tfsoff);
@@ -860,7 +862,7 @@ static const char *get_context_handle_type_name(const type_t *type)
do { \
if (file) \
fprintf(file, "/* %2u */\n", typestring_offset); \
print_file((file), 2, "0x%02x, /* " #fctype " */\n", RPC_##fctype); \
print_file((file), 2, "0x%02x,\t/* " #fctype " */\n", RPC_##fctype); \
} \
while (0)
@@ -1447,8 +1449,8 @@ static void write_procformatstring_func( FILE *file, int indent, const type_t *i
if (!is_new_style)
{
print_file(file, 0, "/* %u (void) */\n", *offset);
print_file(file, indent, "0x5b, /* FC_END */\n");
print_file(file, indent, "0x5c, /* FC_PAD */\n");
print_file(file, indent, "0x5b,\t/* FC_END */\n");
print_file(file, indent, "0x5c,\t/* FC_PAD */\n");
*offset += 2;
}
}
@@ -2316,7 +2318,7 @@ static void write_member_type(FILE *file, const type_t *cont,
error("Unsupported member type %d\n", type_get_type(type));
}
static void write_array_element_type(FILE *file, const type_t *type,
static void write_array_element_type(FILE *file, const attr_list_t *attrs, const type_t *type,
int cont_is_complex, unsigned int *tfsoff)
{
type_t *elem = type_array_get_element(type);
@@ -2331,7 +2333,7 @@ static void write_array_element_type(FILE *file, const type_t *type,
ref->typestring_offset, tfsoff);
return;
}
if (cont_is_complex && is_string_type(NULL, elem))
if (cont_is_complex && is_string_type(attrs, elem))
{
write_string_tfs(file, NULL, elem, TYPE_CONTEXT_CONTAINER, NULL, tfsoff);
return;
@@ -2350,10 +2352,10 @@ static void write_end(FILE *file, unsigned int *tfsoff)
{
if (*tfsoff % 2 == 0)
{
print_file(file, 2, "0x%x,\t\t/* FC_PAD */\n", RPC_FC_PAD);
print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD);
*tfsoff += 1;
}
print_file(file, 2, "0x%x,\t\t/* FC_END */\n", RPC_FC_END);
print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END);
*tfsoff += 1;
}
@@ -2728,7 +2730,7 @@ static int write_varying_array_pointer_descriptions(
return pointer_count;
}
static void write_pointer_description(FILE *file, type_t *type,
static void write_pointer_description(FILE *file, const attr_list_t *attrs, type_t *type,
unsigned int *typestring_offset)
{
unsigned int offset_in_buffer;
@@ -2757,7 +2759,7 @@ static void write_pointer_description(FILE *file, type_t *type,
if (is_conformant_array(type) &&
(type_array_is_decl_as_ptr(type) || !current_structure))
write_conformant_array_pointer_descriptions(
file, NULL, type, 0, typestring_offset);
file, attrs, type, 0, typestring_offset);
else if (type_get_type(type) == TYPE_STRUCT &&
get_struct_fc(type) == RPC_FC_CPSTRUCT)
{
@@ -2774,11 +2776,6 @@ static void write_pointer_description(FILE *file, type_t *type,
&offset_in_memory, &offset_in_buffer, typestring_offset);
}
int is_declptr(const type_t *t)
{
return is_ptr(t) || (type_get_type(t) == TYPE_ARRAY && type_array_is_decl_as_ptr(t));
}
static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs,
type_t *type, enum type_context context,
const char *name, unsigned int *typestring_offset)
@@ -2814,6 +2811,9 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs,
else
elem_type = type_pointer_get_ref(type);
if (type_get_type(elem_type) == TYPE_POINTER && is_array(type))
return write_array_tfs(file, attrs, type, name, typestring_offset);
if (type_get_type(elem_type) != TYPE_BASIC)
{
error("write_string_tfs: Unimplemented for non-basic type %s\n", name);
@@ -2842,7 +2842,7 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs,
WRITE_FCTYPE(file, FC_WSTRING, *typestring_offset);
else
WRITE_FCTYPE(file, FC_CSTRING, *typestring_offset);
print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD);
print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD);
*typestring_offset += 2;
print_file(file, 2, "NdrFcShort(0x%hx),\t/* %d */\n", (unsigned short)dim, dim);
@@ -2857,7 +2857,7 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs,
WRITE_FCTYPE(file, FC_C_WSTRING, *typestring_offset);
else
WRITE_FCTYPE(file, FC_C_CSTRING, *typestring_offset);
print_file(file, 2, "0x%x, /* FC_STRING_SIZED */\n", RPC_FC_STRING_SIZED);
print_file(file, 2, "0x%x,\t/* FC_STRING_SIZED */\n", RPC_FC_STRING_SIZED);
*typestring_offset += 2;
*typestring_offset += write_conf_or_var_desc(
@@ -2878,7 +2878,7 @@ static unsigned int write_string_tfs(FILE *file, const attr_list_t *attrs,
WRITE_FCTYPE(file, FC_C_WSTRING, *typestring_offset);
else
WRITE_FCTYPE(file, FC_C_CSTRING, *typestring_offset);
print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD);
print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD);
*typestring_offset += 2;
update_tfsoff(type, start_offset, file);
@@ -2904,7 +2904,8 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t
if (!pointer_type)
pointer_type = RPC_FC_RP;
write_embedded_types(file, attrs, type_array_get_element(type), name, FALSE, typestring_offset);
if (!is_string_type(attrs, type_array_get_element(type)))
write_embedded_types(file, attrs, type_array_get_element(type), name, FALSE, typestring_offset);
size = type_memsize(is_conformant_array(type) ? type_array_get_element(type) : type);
align = type_buffer_alignment(is_conformant_array(type) ? type_array_get_element(type) : type);
@@ -2964,15 +2965,15 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t
if (type_has_pointers(type_array_get_element(type)) &&
(type_array_is_decl_as_ptr(type) || !current_structure))
{
print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP);
print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD);
print_file(file, 2, "0x%x,\t/* FC_PP */\n", RPC_FC_PP);
print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD);
*typestring_offset += 2;
write_pointer_description(file, type, typestring_offset);
print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END);
write_pointer_description(file, is_string_type(attrs, type) ? attrs : NULL, type, typestring_offset);
print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END);
*typestring_offset += 1;
}
write_array_element_type(file, type, FALSE, typestring_offset);
write_array_element_type(file, is_string_type(attrs, type) ? attrs : NULL, type, FALSE, typestring_offset);
write_end(file, typestring_offset);
}
else
@@ -2987,7 +2988,7 @@ static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t
+= write_conf_or_var_desc(file, current_structure, baseoff,
type, length_is);
write_array_element_type(file, type, TRUE, typestring_offset);
write_array_element_type(file, is_string_type(attrs, type) ? attrs : NULL, type, TRUE, typestring_offset);
write_end(file, typestring_offset);
}
@@ -3151,11 +3152,11 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type,
(fc == RPC_FC_CPSTRUCT) ||
(fc == RPC_FC_CVSTRUCT && type_has_pointers(type)))
{
print_file(file, 2, "0x%x, /* FC_PP */\n", RPC_FC_PP);
print_file(file, 2, "0x%x, /* FC_PAD */\n", RPC_FC_PAD);
print_file(file, 2, "0x%x,\t/* FC_PP */\n", RPC_FC_PP);
print_file(file, 2, "0x%x,\t/* FC_PAD */\n", RPC_FC_PAD);
*tfsoff += 2;
write_pointer_description(file, type, tfsoff);
print_file(file, 2, "0x%x, /* FC_END */\n", RPC_FC_END);
write_pointer_description(file, NULL, type, tfsoff);
print_file(file, 2, "0x%x,\t/* FC_END */\n", RPC_FC_END);
*tfsoff += 1;
}
@@ -3586,12 +3587,26 @@ static unsigned int write_type_tfs(FILE *file, int indent,
case TGT_POINTER:
{
enum type_context ref_context;
type_t *ref = type_pointer_get_ref(type);
if (context == TYPE_CONTEXT_TOPLEVELPARAM)
ref_context = TYPE_CONTEXT_PARAM;
else if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS)
ref_context = TYPE_CONTEXT_CONTAINER;
else
ref_context = context;
if (is_string_type(attrs, ref))
{
if (context != TYPE_CONTEXT_CONTAINER_NO_POINTERS)
write_pointer_tfs(file, attrs, type, *typeformat_offset + 4, context, typeformat_offset);
offset = write_type_tfs(file, indent, attrs, ref, name, ref_context, typeformat_offset);
if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS)
return 0;
return offset;
}
offset = write_type_tfs( file, indent, attrs, type_pointer_get_ref(type), name,
ref_context, typeformat_offset);
if (context == TYPE_CONTEXT_CONTAINER_NO_POINTERS)
-10
View File
@@ -47,16 +47,6 @@
static typelib_t *typelib;
int is_ptr(const type_t *t)
{
return type_get_type(t) == TYPE_POINTER;
}
int is_array(const type_t *t)
{
return type_get_type(t) == TYPE_ARRAY;
}
/* List of oleauto types that should be recognized by name.
* (most of) these seem to be intrinsic types in mktyplib.
* This table MUST be alphabetically sorted on the kw field.
+4 -4
View File
@@ -97,12 +97,12 @@ typedef struct tagMSFT_SegDir {
/*2*/MSFT_pSeg pImpInfo; /* table with info for imported types */
/*3*/MSFT_pSeg pImpFiles; /* import libraries */
/*4*/MSFT_pSeg pRefTab; /* References table */
/*5*/MSFT_pSeg pLibtab; /* always exists, always same size (0x80) */
/* hash table w offsets to guid????? */
/*5*/MSFT_pSeg pGuidHashTab; /* always exists, always same size (0x80) */
/* hash table with offsets to guid */
/*6*/MSFT_pSeg pGuidTab; /* all guids are stored here together with */
/* offset in some table???? */
/*7*/MSFT_pSeg res07; /* always created, always same size (0x200) */
/* purpose largely unknown */
/*7*/MSFT_pSeg pNameHashTab; /* always created, always same size (0x200) */
/* hash table with offsets to names */
/*8*/MSFT_pSeg pNametab; /* name tables */
/*9*/MSFT_pSeg pStringtab; /* string table */
/*A*/MSFT_pSeg pTypdescTab; /* table with type descriptors */
+2 -2
View File
@@ -159,8 +159,8 @@ char *dup_basename(const char *name, const char *ext)
namelen = strlen(name);
/* +4 for later extension and +1 for '\0' */
base = xmalloc(namelen +4 +1);
/* +6 for later extension (strlen("_r.rgs")) and +1 for '\0' */
base = xmalloc(namelen +6 +1);
strcpy(base, name);
if(!strcasecmp(name + namelen-extlen, ext))
{
+85 -18
View File
@@ -51,6 +51,7 @@
static const char usage[] =
"Usage: widl [options...] infile.idl\n"
" or: widl [options...] --dlldata-only name1 [name2...]\n"
" -app_config Ignored, present for midl compatibility\n"
" -b arch Set the target architecture\n"
" -c Generate client stub\n"
" -d n Set debug level to 'n'\n"
@@ -71,6 +72,7 @@ static const char usage[] =
" --prefix-client=p Prefix names of client stubs with 'p'\n"
" --prefix-server=p Prefix names of server functions with 'p'\n"
" -r Generate registration script\n"
" --rt Enable WinRT's language extensions for IDL\n"
" -s Generate server stub\n"
" -t Generate typelib\n"
" -u Generate interface identifiers file\n"
@@ -112,9 +114,11 @@ int do_win32 = 1;
int do_win64 = 1;
int win32_packing = 8;
int win64_packing = 8;
int do_rt_extension = 0;
static enum stub_mode stub_mode = MODE_Os;
char *input_name;
char *input_idl_name;
char *header_name;
char *local_stubs_name;
char *header_token;
@@ -151,10 +155,12 @@ enum {
PREFIX_CLIENT_OPTION,
PREFIX_SERVER_OPTION,
PRINT_HELP,
RT_OPTION,
WIN32_OPTION,
WIN64_OPTION,
WIN32_ALIGN_OPTION,
WIN64_ALIGN_OPTION
WIN64_ALIGN_OPTION,
APP_CONFIG_OPTION
};
static const char short_options[] =
@@ -169,10 +175,12 @@ static const struct option long_options[] = {
{ "prefix-all", 1, NULL, PREFIX_ALL_OPTION },
{ "prefix-client", 1, NULL, PREFIX_CLIENT_OPTION },
{ "prefix-server", 1, NULL, PREFIX_SERVER_OPTION },
{ "rt", 0, NULL, RT_OPTION },
{ "win32", 0, NULL, WIN32_OPTION },
{ "win64", 0, NULL, WIN64_OPTION },
{ "win32-align", 1, NULL, WIN32_ALIGN_OPTION },
{ "win64-align", 1, NULL, WIN64_ALIGN_OPTION },
{ "app_config", 0, NULL, APP_CONFIG_OPTION },
{ NULL, 0, NULL, 0 }
};
@@ -260,10 +268,9 @@ static void set_target( const char *target )
{ "i786", SYS_WIN32 },
{ "amd64", SYS_WIN64 },
{ "x86_64", SYS_WIN64 },
{ "sparc", SYS_WIN32 },
{ "alpha", SYS_WIN32 },
{ "powerpc", SYS_WIN32 },
{ "arm", SYS_WIN32 }
{ "arm", SYS_WIN32 },
{ "aarch64", SYS_WIN64 }
};
unsigned int i;
@@ -340,7 +347,7 @@ static void free_filename_nodes(struct list *list)
}
}
static void write_dlldata_list(struct list *filenames)
static void write_dlldata_list(struct list *filenames, int define_proxy_delegation)
{
FILE *dlldata;
filename_node_t *node;
@@ -351,6 +358,8 @@ static void write_dlldata_list(struct list *filenames)
fprintf(dlldata, "/*** Autogenerated by WIDL %s ", PACKAGE_VERSION);
fprintf(dlldata, "- Do not edit ***/\n\n");
if (define_proxy_delegation)
fprintf(dlldata, "#define PROXY_DELEGATION\n");
fprintf(dlldata, "#ifdef __REACTOS__\n");
fprintf(dlldata, "#define WIN32_NO_STATUS\n");
@@ -386,15 +395,19 @@ static char *eat_space(char *s)
void write_dlldata(const statement_list_t *stmts)
{
struct list filenames = LIST_INIT(filenames);
int define_proxy_delegation = 0;
filename_node_t *node;
FILE *dlldata;
if (!do_dlldata || !need_proxy_file(stmts))
return;
define_proxy_delegation = need_proxy_delegation(stmts);
dlldata = fopen(dlldata_name, "r");
if (dlldata) {
static char marker[] = "REFERENCE_PROXY_FILE";
static const char marker[] = "REFERENCE_PROXY_FILE";
static const char delegation_define[] = "#define PROXY_DELEGATION";
char *line = NULL;
size_t len = 0;
@@ -415,6 +428,8 @@ void write_dlldata(const statement_list_t *stmts)
*end = '\0';
if (start < end)
add_filename_node(&filenames, start);
}else if (!define_proxy_delegation && strncmp(start, delegation_define, sizeof(delegation_define)-1)) {
define_proxy_delegation = 1;
}
}
@@ -433,10 +448,20 @@ void write_dlldata(const statement_list_t *stmts)
}
add_filename_node(&filenames, proxy_token);
write_dlldata_list(&filenames);
write_dlldata_list(&filenames, define_proxy_delegation);
free_filename_nodes(&filenames);
}
static void write_id_guid(FILE *f, const char *type, const char *guid_prefix, const char *name, const UUID *uuid)
{
if (!uuid) return;
fprintf(f, "MIDL_DEFINE_GUID(%s, %s_%s, 0x%08x, 0x%04x, 0x%04x, 0x%02x,0x%02x, 0x%02x,"
"0x%02x,0x%02x,0x%02x,0x%02x,0x%02x);\n",
type, guid_prefix, name, uuid->Data1, uuid->Data2, uuid->Data3, uuid->Data4[0],
uuid->Data4[1], uuid->Data4[2], uuid->Data4[3], uuid->Data4[4], uuid->Data4[5],
uuid->Data4[6], uuid->Data4[7]);
}
static void write_id_data_stmts(const statement_list_t *stmts)
{
const statement_t *stmt;
@@ -451,19 +476,19 @@ static void write_id_data_stmts(const statement_list_t *stmts)
if (!is_object(type) && !is_attr(type->attrs, ATTR_DISPINTERFACE))
continue;
uuid = get_attrp(type->attrs, ATTR_UUID);
write_guid(idfile, is_attr(type->attrs, ATTR_DISPINTERFACE) ? "DIID" : "IID",
write_id_guid(idfile, "IID", is_attr(type->attrs, ATTR_DISPINTERFACE) ? "DIID" : "IID",
type->name, uuid);
}
else if (type_get_type(type) == TYPE_COCLASS)
{
const UUID *uuid = get_attrp(type->attrs, ATTR_UUID);
write_guid(idfile, "CLSID", type->name, uuid);
write_id_guid(idfile, "CLSID", "CLSID", type->name, uuid);
}
}
else if (stmt->type == STMT_LIBRARY)
{
const UUID *uuid = get_attrp(stmt->u.lib->attrs, ATTR_UUID);
write_guid(idfile, "LIBID", stmt->u.lib->name, uuid);
write_id_guid(idfile, "IID", "LIBID", stmt->u.lib->name, uuid);
write_id_data_stmts(stmt->u.lib->stmts);
}
}
@@ -480,7 +505,7 @@ void write_id_data(const statement_list_t *stmts)
}
fprintf(idfile, "/*** Autogenerated by WIDL %s ", PACKAGE_VERSION);
fprintf(idfile, "from %s - Do not edit ***/\n\n", input_name);
fprintf(idfile, "from %s - Do not edit ***/\n\n", input_idl_name);
fprintf(idfile, "#ifdef __REACTOS__\n");
fprintf(idfile, "#define WIN32_NO_STATUS\n");
@@ -489,13 +514,33 @@ void write_id_data(const statement_list_t *stmts)
fprintf(idfile, "#include <rpc.h>\n");
fprintf(idfile, "#include <rpcndr.h>\n\n");
fprintf(idfile, "#include <initguid.h>\n\n");
fprintf(idfile, "#ifdef _MIDL_USE_GUIDDEF_\n\n");
fprintf(idfile, "#ifndef INITGUID\n");
fprintf(idfile, "#define INITGUID\n");
fprintf(idfile, "#include <guiddef.h>\n");
fprintf(idfile, "#undef INITGUID\n");
fprintf(idfile, "#else\n");
fprintf(idfile, "#include <guiddef.h>\n");
fprintf(idfile, "#endif\n\n");
fprintf(idfile, "#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \\\n");
fprintf(idfile, " DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)\n\n");
fprintf(idfile, "#else\n\n");
fprintf(idfile, "#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \\\n");
fprintf(idfile, " const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}\n\n");
fprintf(idfile, "#endif\n\n");
start_cplusplus_guard(idfile);
write_id_data_stmts(stmts);
fprintf(idfile, "\n");
end_cplusplus_guard(idfile);
fprintf(idfile, "#undef MIDL_DEFINE_GUID\n" );
fclose(idfile);
}
@@ -515,7 +560,7 @@ int main(int argc,char *argv[])
now = time(NULL);
while((optc = getopt_long(argc, argv, short_options, long_options, &opti)) != EOF) {
while((optc = getopt_long_only(argc, argv, short_options, long_options, &opti)) != EOF) {
switch(optc) {
case DLLDATA_OPTION:
dlldata_name = xstrdup(optarg);
@@ -544,6 +589,9 @@ int main(int argc,char *argv[])
case PRINT_HELP:
fprintf(stderr, "%s", usage);
return 0;
case RT_OPTION:
do_rt_extension = 1;
break;
case WIN32_OPTION:
do_win32 = 1;
do_win64 = 0;
@@ -562,6 +610,10 @@ int main(int argc,char *argv[])
if(win64_packing != 2 && win64_packing != 4 && win64_packing != 8)
error("Packing must be one of 2, 4 or 8\n");
break;
case APP_CONFIG_OPTION:
/* widl does not distinguish between app_mode and default mode,
but we ignore this option for midl compatibility */
break;
case 'b':
set_target( optarg );
break;
@@ -595,7 +647,6 @@ int main(int argc,char *argv[])
case 'm':
if (!strcmp( optarg, "32" )) typelib_kind = SYS_WIN32;
else if (!strcmp( optarg, "64" )) typelib_kind = SYS_WIN64;
else error( "Invalid -m argument '%s'\n", optarg );
break;
case 'N':
no_preprocess = 1;
@@ -659,14 +710,30 @@ int main(int argc,char *argv[])
wpp_add_include_path(DEFAULT_INCLUDE_DIR);
#endif
/* if nothing specified, try to guess output type from the output file name */
if (output_name && do_everything && !do_header && !do_typelib && !do_proxies &&
!do_client && !do_server && !do_regscript && !do_idfile && !do_dlldata)
{
do_everything = 0;
if (strendswith( output_name, ".h" )) do_header = 1;
else if (strendswith( output_name, ".tlb" )) do_typelib = 1;
else if (strendswith( output_name, "_p.c" )) do_proxies = 1;
else if (strendswith( output_name, "_c.c" )) do_client = 1;
else if (strendswith( output_name, "_s.c" )) do_server = 1;
else if (strendswith( output_name, "_i.c" )) do_idfile = 1;
else if (strendswith( output_name, "_r.res" )) do_regscript = 1;
else if (strendswith( output_name, "_t.res" )) do_typelib = 1;
else if (strendswith( output_name, "dlldata.c" )) do_dlldata = 1;
else do_everything = 1;
}
if(do_everything) {
set_everything(TRUE);
}
if (!output_name) output_name = dup_basename(input_name, ".idl");
if (!do_everything &&
do_header + do_typelib + do_proxies + do_client +
if (do_header + do_typelib + do_proxies + do_client +
do_server + do_regscript + do_idfile + do_dlldata == 1)
{
if (do_header) header_name = output_name;
@@ -688,7 +755,7 @@ int main(int argc,char *argv[])
for ( ; optind < argc; ++optind)
add_filename_node(&filenames, argv[optind]);
write_dlldata_list(&filenames);
write_dlldata_list(&filenames, 0 /* FIXME */ );
free_filename_nodes(&filenames);
return 0;
}
@@ -697,7 +764,7 @@ int main(int argc,char *argv[])
return 1;
}
else
input_name = xstrdup(argv[optind]);
input_idl_name = input_name = xstrdup(argv[optind]);
}
else {
fprintf(stderr, "%s", usage);
+2
View File
@@ -49,8 +49,10 @@ extern int do_win32;
extern int do_win64;
extern int win32_packing;
extern int win64_packing;
extern int do_rt_extension;
extern char *input_name;
extern char *input_idl_name;
extern char *header_name;
extern char *header_token;
extern char *local_stubs_name;
+2 -3
View File
@@ -79,6 +79,7 @@ enum attr_type
ATTR_ANNOTATION,
ATTR_APPOBJECT,
ATTR_ASYNC,
ATTR_ASYNCUUID,
ATTR_AUTO_HANDLE,
ATTR_BINDABLE,
ATTR_BROADCAST,
@@ -251,6 +252,7 @@ enum statement_type
STMT_TYPEDEF,
STMT_IMPORT,
STMT_IMPORTLIB,
STMT_PRAGMA,
STMT_CPPQUOTE
};
@@ -551,9 +553,6 @@ type_t *alloc_type(void);
void set_all_tfswrite(int val);
void clear_all_offsets(void);
int is_ptr(const type_t *t);
int is_array(const type_t *t);
#define tsENUM 1
#define tsSTRUCT 2
#define tsUNION 3
+65 -29
View File
@@ -172,7 +172,7 @@ static void ctl2_init_segdir(
segdir = &typelib->typelib_segdir[MSFT_SEG_TYPEINFO];
for (i = 0; i < 15; i++) {
for (i = 0; i < MSFT_SEG_MAX; i++) {
segdir[i].offset = -1;
segdir[i].length = 0;
segdir[i].res08 = -1;
@@ -825,7 +825,6 @@ static int encode_type(
case VT_UI4:
case VT_R4:
case VT_ERROR:
case VT_BSTR:
case VT_HRESULT:
*encoded_type = default_type;
*width = 4;
@@ -861,8 +860,9 @@ static int encode_type(
case VT_UNKNOWN:
case VT_DISPATCH:
case VT_BSTR:
*encoded_type = default_type;
*width = 4;
*width = pointer_size;
*alignment = 4;
break;
@@ -873,7 +873,7 @@ static int encode_type(
case VT_LPSTR:
case VT_LPWSTR:
*encoded_type = 0xfffe0000 | vt;
*width = 4;
*width = pointer_size;
*alignment = 4;
break;
@@ -896,7 +896,7 @@ static int encode_type(
if(next_vt == VT_DISPATCH || next_vt == VT_UNKNOWN) {
chat("encode_type: skipping ptr\n");
*encoded_type = target_type;
*width = 4;
*width = pointer_size;
*alignment = 4;
*decoded_size = child_size;
break;
@@ -926,13 +926,12 @@ static int encode_type(
*encoded_type = typeoffset;
*width = 4;
*width = pointer_size;
*alignment = 4;
*decoded_size = 8 /*sizeof(TYPEDESC)*/ + child_size;
break;
}
case VT_SAFEARRAY:
{
type_t *element_type = type_alias_get_aliasee(type_array_get_element(type));
@@ -964,13 +963,12 @@ static int encode_type(
*encoded_type = typeoffset;
*width = 4;
*width = pointer_size;
*alignment = 4;
*decoded_size = 8 /*sizeof(TYPEDESC)*/ + child_size;
break;
}
case VT_USERDEFINED:
{
int typeinfo_offset;
@@ -1117,7 +1115,7 @@ static int encode_var(
chat("encode_var: skipping ptr\n");
*encoded_type = target_type;
*decoded_size = child_size;
*width = 4;
*width = pointer_size;
*alignment = 4;
return 0;
}
@@ -1146,7 +1144,7 @@ static int encode_var(
*encoded_type = typeoffset;
*width = 4;
*width = pointer_size;
*alignment = 4;
*decoded_size = 8 /*sizeof(TYPEDESC)*/ + child_size;
return 0;
@@ -1191,6 +1189,8 @@ static void write_value(msft_typelib_t* typelib, int *out, int vt, const void *v
case VT_UINT:
case VT_HRESULT:
case VT_PTR:
case VT_UNKNOWN:
case VT_DISPATCH:
{
const unsigned int lv = get_ulong_val(*(const unsigned int *)value, vt);
if((lv & 0x3ffffff) == lv) {
@@ -1230,7 +1230,7 @@ static void write_value(msft_typelib_t* typelib, int *out, int vt, const void *v
}
static HRESULT set_custdata(msft_typelib_t *typelib, REFGUID guid,
int vt, int value, int *offset)
int vt, const void *value, int *offset)
{
MSFT_GuidEntry guidentry;
int guidoffset;
@@ -1244,7 +1244,7 @@ static HRESULT set_custdata(msft_typelib_t *typelib, REFGUID guid,
guidentry.next_hash = -1;
guidoffset = ctl2_alloc_guid(typelib, &guidentry);
write_value(typelib, &data_out, vt, &value);
write_value(typelib, &data_out, vt, value);
custoffset = ctl2_alloc_segment(typelib, MSFT_SEG_CUSTDATAGUID, 12, 0);
@@ -1257,6 +1257,33 @@ static HRESULT set_custdata(msft_typelib_t *typelib, REFGUID guid,
return S_OK;
}
/* It's possible to have a default value for pointer arguments too.
In this case default value has a referenced type, e.g.
'LONG*' argument gets VT_I4, 'DOUBLE*' - VT_R8. IUnknown* and IDispatch*
are recognised too and stored as VT_UNKNOWN and VT_DISPATCH.
But IUnknown/IDispatch arguments can only have default value of 0
(or expression that resolves to zero) while other pointers can have
any default value. */
static int get_defaultvalue_vt(type_t *type)
{
int vt = get_type_vt(type);
if (type_get_type(type) == TYPE_ENUM)
vt = VT_I4;
else
{
vt = get_type_vt(type);
if (vt == VT_PTR && is_ptr(type)) {
vt = get_type_vt(type_pointer_get_ref(type));
/* The only acceptable value for pointers to non-basic types
is NULL, it's stored as VT_I4 for both 32 and 64 bit typelibs. */
if (vt == VT_USERDEFINED)
vt = VT_I4;
}
}
return vt;
}
static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
{
int offset, name_offset;
@@ -1481,10 +1508,7 @@ static HRESULT add_func_desc(msft_typeinfo_t* typeinfo, var_t *func, int index)
{
int vt;
expr_t *expr = (expr_t *)attr->u.pval;
if (type_get_type(arg->type) == TYPE_ENUM)
vt = VT_INT;
else
vt = get_type_vt(arg->type);
vt = get_defaultvalue_vt(arg->type);
paramflags |= 0x30; /* PARAMFLAG_FHASDEFAULT | PARAMFLAG_FOPT */
if (expr->type == EXPR_STRLIT || expr->type == EXPR_WSTRLIT)
{
@@ -1726,7 +1750,7 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var)
break;
case TKIND_DISPATCH:
var_kind = 3; /* VAR_DISPATCH */
typeinfo->datawidth = 4;
typeinfo->datawidth = pointer_size;
var_alignment = 4;
break;
default:
@@ -1979,7 +2003,7 @@ static void add_dispinterface_typeinfo(msft_typelib_t *typelib, type_t *dispinte
msft_typeinfo = create_msft_typeinfo(typelib, TKIND_DISPATCH, dispinterface->name,
dispinterface->attrs);
msft_typeinfo->typeinfo->size = 4;
msft_typeinfo->typeinfo->size = pointer_size;
msft_typeinfo->typeinfo->typekind |= 0x2100;
msft_typeinfo->typeinfo->flags |= 0x1000; /* TYPEFLAG_FDISPATCHABLE */
@@ -2024,8 +2048,7 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface)
return;
}
if (is_attr(interface->attrs, ATTR_DISPINTERFACE))
{
if (is_attr(interface->attrs, ATTR_DISPINTERFACE)) {
add_dispinterface_typeinfo(typelib, interface);
return;
}
@@ -2045,7 +2068,7 @@ static void add_interface_typeinfo(msft_typelib_t *typelib, type_t *interface)
interface->typelib_idx = typelib->typelib_header.nrtypeinfos;
msft_typeinfo = create_msft_typeinfo(typelib, TKIND_INTERFACE, interface->name, interface->attrs);
msft_typeinfo->typeinfo->size = 4;
msft_typeinfo->typeinfo->size = pointer_size;
msft_typeinfo->typeinfo->typekind |= 0x2200;
for (derived = inherit; derived; derived = type_iface_get_inherit(derived))
@@ -2102,6 +2125,9 @@ static void add_enum_typeinfo(msft_typelib_t *typelib, type_t *enumeration)
var_t *cur;
msft_typeinfo_t *msft_typeinfo;
if (-1 < enumeration->typelib_idx)
return;
enumeration->typelib_idx = typelib->typelib_header.nrtypeinfos;
msft_typeinfo = create_msft_typeinfo(typelib, TKIND_ENUM, enumeration->name, enumeration->attrs);
msft_typeinfo->typeinfo->size = 0;
@@ -2209,7 +2235,7 @@ static void add_coclass_typeinfo(msft_typelib_t *typelib, type_t *cls)
first_source->flags |= 0x1;
msft_typeinfo->typeinfo->cImplTypes = num_ifaces;
msft_typeinfo->typeinfo->size = 4;
msft_typeinfo->typeinfo->size = pointer_size;
msft_typeinfo->typeinfo->typekind |= 0x2200;
}
@@ -2265,6 +2291,7 @@ static void add_entry(msft_typelib_t *typelib, const statement_t *stmt)
switch(stmt->type) {
case STMT_LIBRARY:
case STMT_IMPORT:
case STMT_PRAGMA:
case STMT_CPPQUOTE:
case STMT_DECLARATION:
/* not included in typelib */
@@ -2546,7 +2573,12 @@ static void save_all_changes(msft_typelib_t *typelib)
if (strendswith( typelib_name, ".res" )) /* create a binary resource file */
{
add_output_to_resources( "TYPELIB", "#1" );
char typelib_id[13] = "#1";
expr_t *expr = get_attrp( typelib->typelib->attrs, ATTR_ID );
if (expr)
sprintf( typelib_id, "#%d", expr->cval );
add_output_to_resources( "TYPELIB", typelib_id );
output_typelib_regscript( typelib->typelib );
flush_output_resources( typelib_name );
}
@@ -2560,9 +2592,11 @@ int create_msft_typelib(typelib_t *typelib)
const statement_t *stmt;
time_t cur_time;
char *time_override;
unsigned int version = 5 << 24 | 1 << 16 | 164; /* 5.01.0164 */
GUID midl_time_guid = {0xde77ba63,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}};
GUID midl_version_guid = {0xde77ba64,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}};
unsigned int version = 7 << 24 | 555; /* 7.00.0555 */
GUID midl_time_guid = {0xde77ba63,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}};
GUID midl_version_guid = {0xde77ba64,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}};
GUID midl_info_guid = {0xde77ba65,0x517c,0x11d1,{0xa2,0xda,0x00,0x00,0xf8,0x77,0x3c,0xe9}};
char info_string[128];
pointer_size = (typelib_kind == SYS_WIN64) ? 8 : 4;
@@ -2609,8 +2643,10 @@ int create_msft_typelib(typelib_t *typelib)
and midl's version number */
time_override = getenv( "WIDL_TIME_OVERRIDE");
cur_time = time_override ? atol( time_override) : time(NULL);
set_custdata(msft, &midl_time_guid, VT_UI4, cur_time, &msft->typelib_header.CustomDataOffset);
set_custdata(msft, &midl_version_guid, VT_UI4, version, &msft->typelib_header.CustomDataOffset);
sprintf(info_string, "Created by WIDL version %s at %s\n", PACKAGE_VERSION, ctime(&cur_time));
set_custdata(msft, &midl_info_guid, VT_BSTR, info_string, &msft->typelib_header.CustomDataOffset);
set_custdata(msft, &midl_time_guid, VT_UI4, &cur_time, &msft->typelib_header.CustomDataOffset);
set_custdata(msft, &midl_version_guid, VT_UI4, &version, &msft->typelib_header.CustomDataOffset);
if (typelib->stmts)
LIST_FOR_EACH_ENTRY( stmt, typelib->stmts, const statement_t, entry )
+1 -1
View File
@@ -209,7 +209,7 @@ static void wpp_default_write( const char *buffer, unsigned int len ) {
fwrite(buffer, 1, len, ppy_out);
}
/* Don't comment on the hash, its primitive but functional... */
/* Don't comment on the hash, it's primitive but functional... */
static int pphash(const char *str)
{
int sum = 0;