ReactOS 0.4.16-dev-1946-g52006dd
widl.h File Reference
#include "../tools.h"
#include "widltypes.h"
#include <time.h>
Include dependency graph for widl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEBUGLEVEL_NONE   0x0000
 
#define DEBUGLEVEL_CHAT   0x0001
 
#define DEBUGLEVEL_DUMP   0x0002
 
#define DEBUGLEVEL_TRACE   0x0004
 
#define DEBUGLEVEL_PPMSG   0x0008
 
#define DEBUGLEVEL_PPLEX   0x0010
 
#define DEBUGLEVEL_PPTRACE   0x0020
 

Typedefs

typedef int(* map_attrs_filter_t) (attr_list_t *, const attr_t *)
 

Functions

int open_typelib (const char *name)
 
void write_header (const statement_list_t *stmts)
 
void write_id_data (const statement_list_t *stmts)
 
void write_proxies (const statement_list_t *stmts)
 
void write_client (const statement_list_t *stmts)
 
void write_server (const statement_list_t *stmts)
 
void write_regscript (const statement_list_t *stmts)
 
void write_typelib_regscript (const statement_list_t *stmts)
 
void output_typelib_regscript (const typelib_t *typelib)
 
void write_local_stubs (const statement_list_t *stmts)
 
void write_dlldata (const statement_list_t *stmts)
 
void start_cplusplus_guard (FILE *fp)
 
void end_cplusplus_guard (FILE *fp)
 
attr_tattr_int (struct location where, enum attr_type attr_type, unsigned int val)
 
attr_tattr_ptr (struct location where, enum attr_type attr_type, void *val)
 
int is_attr (const attr_list_t *list, enum attr_type attr_type)
 
int is_ptrchain_attr (const var_t *var, enum attr_type attr_type)
 
int is_aliaschain_attr (const type_t *type, enum attr_type attr_type)
 
unsigned int get_attrv (const attr_list_t *list, enum attr_type attr_type)
 
voidget_attrp (const attr_list_t *list, enum attr_type attr_type)
 
voidget_aliaschain_attrp (const type_t *type, enum attr_type attr_type)
 
attr_list_tappend_attr (attr_list_t *list, attr_t *attr)
 
attr_list_tappend_attr_list (attr_list_t *new_list, attr_list_t *old_list)
 
attr_list_tappend_attribs (attr_list_t *, attr_list_t *)
 
attr_list_tmap_attrs (const attr_list_t *list, map_attrs_filter_t filter)
 
attr_list_tmove_attr (attr_list_t *dst, attr_list_t *src, enum attr_type type)
 
attr_list_tcheck_apicontract_attrs (const char *name, attr_list_t *attrs)
 
attr_list_tcheck_coclass_attrs (const char *name, attr_list_t *attrs)
 
attr_list_tcheck_dispiface_attrs (const char *name, attr_list_t *attrs)
 
attr_list_tcheck_enum_attrs (attr_list_t *attrs)
 
attr_list_tcheck_enum_member_attrs (attr_list_t *attrs)
 
attr_list_tcheck_field_attrs (const char *name, attr_list_t *attrs)
 
attr_list_tcheck_function_attrs (const char *name, attr_list_t *attrs)
 
attr_list_tcheck_interface_attrs (const char *name, attr_list_t *attrs)
 
attr_list_tcheck_library_attrs (const char *name, attr_list_t *attrs)
 
attr_list_tcheck_module_attrs (const char *name, attr_list_t *attrs)
 
attr_list_tcheck_runtimeclass_attrs (const char *name, attr_list_t *attrs)
 
attr_list_tcheck_struct_attrs (attr_list_t *attrs)
 
attr_list_tcheck_typedef_attrs (attr_list_t *attrs)
 
attr_list_tcheck_union_attrs (attr_list_t *attrs)
 
void check_arg_attrs (const var_t *arg)
 

Variables

int debuglevel
 
int pedantic
 
int do_everything
 
int do_header
 
int do_typelib
 
int do_proxies
 
int do_client
 
int do_server
 
int do_regscript
 
int do_idfile
 
int do_dlldata
 
int old_names
 
int old_typelib
 
int winrt_mode
 
int interpreted_mode
 
int use_abi_namespace
 
charinput_name
 
charidl_name
 
characf_name
 
charheader_name
 
charheader_token
 
charlocal_stubs_name
 
chartypelib_name
 
chardlldata_name
 
charproxy_name
 
charproxy_token
 
charclient_name
 
charclient_token
 
charserver_name
 
charserver_token
 
charregscript_name
 
charregscript_token
 
const charprefix_client
 
const charprefix_server
 
unsigned int packing
 
unsigned int pointer_size
 
struct target target
 
time_t now
 

Macro Definition Documentation

◆ DEBUGLEVEL_CHAT

#define DEBUGLEVEL_CHAT   0x0001

Definition at line 31 of file widl.h.

◆ DEBUGLEVEL_DUMP

#define DEBUGLEVEL_DUMP   0x0002

Definition at line 32 of file widl.h.

◆ DEBUGLEVEL_NONE

#define DEBUGLEVEL_NONE   0x0000

Definition at line 30 of file widl.h.

◆ DEBUGLEVEL_PPLEX

#define DEBUGLEVEL_PPLEX   0x0010

Definition at line 35 of file widl.h.

◆ DEBUGLEVEL_PPMSG

#define DEBUGLEVEL_PPMSG   0x0008

Definition at line 34 of file widl.h.

◆ DEBUGLEVEL_PPTRACE

#define DEBUGLEVEL_PPTRACE   0x0020

Definition at line 36 of file widl.h.

◆ DEBUGLEVEL_TRACE

#define DEBUGLEVEL_TRACE   0x0004

Definition at line 33 of file widl.h.

Typedef Documentation

◆ map_attrs_filter_t

typedef int(* map_attrs_filter_t) (attr_list_t *, const attr_t *)

Definition at line 106 of file widl.h.

Function Documentation

◆ append_attr()

attr_list_t * append_attr ( attr_list_t list,
attr_t attr 
)

Definition at line 255 of file attribute.c.

256{
257 attr_t *attr_existing;
258 if (!attr) return list;
259 if (!list)
260 {
261 list = xmalloc( sizeof(*list) );
262 list_init( list );
263 }
264 if (!allowed_attr[attr->type].multiple)
265 {
266 LIST_FOR_EACH_ENTRY( attr_existing, list, attr_t, entry )
267 {
268 if (attr_existing->type != attr->type) continue;
269 warning_at( &attr->where, "duplicate attribute %s\n", get_attr_display_name( attr->type ) );
270 /* use the last attribute, like MIDL does */
271 list_remove( &attr_existing->entry );
272 break;
273 }
274 }
275 list_add_tail( list, &attr->entry );
276 return list;
277}
void * xmalloc(int size)
Definition: uimain.c:747
static void list_remove(struct list_entry *entry)
Definition: list.h:90
static void list_add_tail(struct list_entry *head, struct list_entry *entry)
Definition: list.h:83
static void list_init(struct list_entry *head)
Definition: list.h:51
Definition: list.h:37
uint32_t entry
Definition: isohybrid.c:63
#define list
Definition: rosglue.h:35
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
Definition: list.h:198
static const char * get_attr_display_name(enum attr_type attr_type)
Definition: attribute.c:250
void warning_at(const struct location *where, const char *s,...)
Definition: utils.c:67
struct list entry
Definition: widltypes.h:347
enum attr_type type
Definition: widltypes.h:341
unsigned int multiple
Definition: attribute.c:110
Definition: cookie.c:202

Referenced by append_attr_list(), compute_interface_signature_uuid(), and move_attr().

◆ append_attr_list()

attr_list_t * append_attr_list ( attr_list_t new_list,
attr_list_t old_list 
)

Definition at line 279 of file attribute.c.

280{
281 struct list *entry;
282
283 if (!old_list) return new_list;
284
285 while ((entry = list_head( old_list )))
286 {
289 new_list = append_attr( new_list, attr );
290 }
291 return new_list;
292}
attr_list_t * append_attr(attr_list_t *list, attr_t *attr)
Definition: attribute.c:255
Definition: list.h:15
#define LIST_ENTRY(type)
Definition: queue.h:175

◆ append_attribs()

attr_list_t * append_attribs ( attr_list_t l1,
attr_list_t l2 
)

Definition at line 294 of file attribute.c.

295{
296 if (!l2) return l1;
297 if (!l1 || l1 == l2) return l2;
298 list_move_tail( l1, l2 );
299 return l1;
300}
static void list_move_tail(struct list_head *list, struct list_head *head)
Definition: list.h:122

◆ attr_int()

attr_t * attr_int ( struct location  where,
enum attr_type  attr_type,
unsigned int  val 
)

Definition at line 27 of file attribute.c.

28{
29 attr_t *a = xmalloc( sizeof(attr_t) );
30 a->where = where;
31 a->type = attr_type;
32 a->u.ival = val;
33 return a;
34}
GLuint GLfloat * val
Definition: glext.h:7180
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define a
Definition: ke_i.h:78
attr_type
Definition: widltypes.h:72

◆ attr_ptr()

attr_t * attr_ptr ( struct location  where,
enum attr_type  attr_type,
void val 
)

Definition at line 36 of file attribute.c.

37{
38 attr_t *a = xmalloc( sizeof(attr_t) );
39 a->where = where;
40 a->type = attr_type;
41 a->u.pval = val;
42 return a;
43}

Referenced by compute_interface_signature_uuid().

◆ check_apicontract_attrs()

attr_list_t * check_apicontract_attrs ( const char name,
attr_list_t attrs 
)

Definition at line 337 of file attribute.c.

338{
339 const attr_t *attr;
340 if (!attrs) return NULL;
341 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
342 {
343 if (!allowed_attr[attr->type].on_apicontract)
344 error_at( &attr->where, "inapplicable attribute %s for apicontract %s\n",
346 }
347 return attrs;
348}
#define NULL
Definition: types.h:112
void error_at(const struct location *where, const char *s,...)
Definition: utils.c:35
const char * display_name
Definition: attribute.c:127
unsigned int on_apicontract
Definition: attribute.c:125
Definition: name.c:39

Referenced by type_apicontract_define().

◆ check_arg_attrs()

void check_arg_attrs ( const var_t arg)

Definition at line 530 of file attribute.c.

531{
532 const attr_t *attr;
533 if (!arg->attrs) return;
534 LIST_FOR_EACH_ENTRY( attr, arg->attrs, const attr_t, entry )
535 {
536 if (!allowed_attr[attr->type].on_arg)
537 error_at( &attr->where, "inapplicable attribute %s for argument %s\n",
538 allowed_attr[attr->type].display_name, arg->name );
539 }
540}
unsigned int on_arg
Definition: attribute.c:114

◆ check_coclass_attrs()

attr_list_t * check_coclass_attrs ( const char name,
attr_list_t attrs 
)

Definition at line 350 of file attribute.c.

351{
352 const attr_t *attr;
353 if (!attrs) return NULL;
354 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
355 {
356 if (!allowed_attr[attr->type].on_coclass)
357 error_at( &attr->where, "inapplicable attribute %s for coclass %s\n",
359 }
360 return attrs;
361}
unsigned int on_coclass
Definition: attribute.c:124

Referenced by type_coclass_define().

◆ check_dispiface_attrs()

attr_list_t * check_dispiface_attrs ( const char name,
attr_list_t attrs 
)

Definition at line 363 of file attribute.c.

364{
365 const attr_t *attr;
366 if (!attrs) return NULL;
367 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
368 {
370 error_at( &attr->where, "inapplicable attribute %s for dispinterface %s\n",
372 }
373 return attrs;
374}
unsigned int on_dispinterface
Definition: attribute.c:122

Referenced by type_dispinterface_define(), and type_dispinterface_define_from_iface().

◆ check_enum_attrs()

attr_list_t * check_enum_attrs ( attr_list_t attrs)

Definition at line 376 of file attribute.c.

377{
378 const attr_t *attr;
379 if (!attrs) return NULL;
380 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
381 {
382 if (!allowed_attr[attr->type].on_enum)
383 error_at( &attr->where, "inapplicable attribute %s for enum\n",
385 }
386 return attrs;
387}
unsigned int on_enum
Definition: attribute.c:116

◆ check_enum_member_attrs()

attr_list_t * check_enum_member_attrs ( attr_list_t attrs)

Definition at line 389 of file attribute.c.

390{
391 const attr_t *attr;
392 if (!attrs) return NULL;
393 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
394 {
395 if (!allowed_attr[attr->type].on_enum_member)
396 error_at( &attr->where, "inapplicable attribute %s for enum member\n",
398 }
399 return attrs;
400}
unsigned int on_enum_member
Definition: attribute.c:117

◆ check_field_attrs()

attr_list_t * check_field_attrs ( const char name,
attr_list_t attrs 
)

Definition at line 402 of file attribute.c.

403{
404 const attr_t *attr;
405 if (!attrs) return NULL;
406 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
407 {
408 if (!allowed_attr[attr->type].on_field)
409 error_at( &attr->where, "inapplicable attribute %s for field %s\n",
411 }
412 return attrs;
413}
unsigned int on_field
Definition: attribute.c:120

◆ check_function_attrs()

attr_list_t * check_function_attrs ( const char name,
attr_list_t attrs 
)

Definition at line 415 of file attribute.c.

416{
417 const attr_t *attr;
418 if (!attrs) return NULL;
419 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
420 {
421 if (!allowed_attr[attr->type].on_function)
422 error_at( &attr->where, "inapplicable attribute %s for function %s\n",
424 }
425 return attrs;
426}
unsigned int on_function
Definition: attribute.c:113

◆ check_interface_attrs()

attr_list_t * check_interface_attrs ( const char name,
attr_list_t attrs 
)

Definition at line 428 of file attribute.c.

429{
430 const attr_t *attr;
431 if (!attrs) return NULL;
432 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
433 {
434 if (!allowed_attr[attr->type].on_interface)
435 error_at( &attr->where, "inapplicable attribute %s for interface %s\n",
437 if (attr->type == ATTR_IMPLICIT_HANDLE)
438 {
439 const var_t *var = attr->u.pval;
440 if (type_get_type( var->declspec.type ) == TYPE_BASIC &&
441 type_basic_get_type( var->declspec.type ) == TYPE_BASIC_HANDLE)
442 continue;
443 if (is_aliaschain_attr( var->declspec.type, ATTR_HANDLE )) continue;
444 error_at( &attr->where, "attribute %s requires a handle type in interface %s\n",
446 }
447 }
448 return attrs;
449}
const char * var
Definition: shader.c:5666
int is_aliaschain_attr(const type_t *type, enum attr_type attr_type)
Definition: attribute.c:67
unsigned int on_interface
Definition: attribute.c:112
static enum type_type type_get_type(const type_t *type)
Definition: typetree.h:113
static enum type_basic_type type_basic_get_type(const type_t *type)
Definition: typetree.h:118
@ TYPE_BASIC
Definition: widltypes.h:479
@ ATTR_HANDLE
Definition: widltypes.h:118
@ ATTR_IMPLICIT_HANDLE
Definition: widltypes.h:130
@ TYPE_BASIC_HANDLE
Definition: widltypes.h:310

Referenced by type_delegate_define(), type_interface_define(), type_parameterized_delegate_define(), and type_parameterized_interface_define().

◆ check_library_attrs()

attr_list_t * check_library_attrs ( const char name,
attr_list_t attrs 
)

Definition at line 451 of file attribute.c.

452{
453 const attr_t *attr;
454 if (!attrs) return NULL;
455 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
456 {
457 if (!allowed_attr[attr->type].on_library)
458 error_at( &attr->where, "inapplicable attribute %s for library %s\n",
460 }
461 return attrs;
462}
unsigned int on_library
Definition: attribute.c:121

◆ check_module_attrs()

attr_list_t * check_module_attrs ( const char name,
attr_list_t attrs 
)

Definition at line 464 of file attribute.c.

465{
466 const attr_t *attr;
467 if (!attrs) return NULL;
468 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
469 {
470 if (!allowed_attr[attr->type].on_module)
471 error_at( &attr->where, "inapplicable attribute %s for module %s\n",
473 }
474 return attrs;
475}
unsigned int on_module
Definition: attribute.c:123

Referenced by type_module_define().

◆ check_runtimeclass_attrs()

attr_list_t * check_runtimeclass_attrs ( const char name,
attr_list_t attrs 
)

Definition at line 477 of file attribute.c.

478{
479 const attr_t *attr;
480 if (!attrs) return NULL;
481 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
482 {
484 error_at( &attr->where, "inapplicable attribute %s for runtimeclass %s\n",
486 }
487 return attrs;
488}
unsigned int on_runtimeclass
Definition: attribute.c:126

Referenced by type_runtimeclass_define().

◆ check_struct_attrs()

attr_list_t * check_struct_attrs ( attr_list_t attrs)

Definition at line 490 of file attribute.c.

491{
492 int mask = winrt_mode ? 3 : 1;
493 const attr_t *attr;
494 if (!attrs) return NULL;
495 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
496 {
497 if (!(allowed_attr[attr->type].on_struct & mask))
498 error_at( &attr->where, "inapplicable attribute %s for struct\n",
500 }
501 return attrs;
502}
GLenum GLint GLuint mask
Definition: glext.h:6028
unsigned int on_struct
Definition: attribute.c:118
int winrt_mode
Definition: widl.c:111

◆ check_typedef_attrs()

attr_list_t * check_typedef_attrs ( attr_list_t attrs)

Definition at line 504 of file attribute.c.

505{
506 const attr_t *attr;
507 if (!attrs) return NULL;
508 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
509 {
510 if (!allowed_attr[attr->type].on_type)
511 error_at( &attr->where, "inapplicable attribute %s for typedef\n",
513 }
514 return attrs;
515}
unsigned int on_type
Definition: attribute.c:115

◆ check_union_attrs()

attr_list_t * check_union_attrs ( attr_list_t attrs)

Definition at line 517 of file attribute.c.

518{
519 const attr_t *attr;
520 if (!attrs) return NULL;
521 LIST_FOR_EACH_ENTRY( attr, attrs, const attr_t, entry )
522 {
523 if (!allowed_attr[attr->type].on_union)
524 error_at( &attr->where, "inapplicable attribute %s for union\n",
526 }
527 return attrs;
528}
unsigned int on_union
Definition: attribute.c:119

◆ end_cplusplus_guard()

void end_cplusplus_guard ( FILE fp)

Definition at line 275 of file widl.c.

276{
277 fprintf(fp, "#ifdef __cplusplus\n");
278 fprintf(fp, "}\n");
279 fprintf(fp, "#endif\n\n");
280}
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)

Referenced by write_dlldata_list(), write_header(), and write_id_data().

◆ get_aliaschain_attrp()

void * get_aliaschain_attrp ( const type_t type,
enum attr_type  attr_type 
)

Definition at line 96 of file attribute.c.

97{
98 for (;;)
99 {
100 if (is_attr( type->attrs, attr_type )) return get_attrp( type->attrs, attr_type );
101 if (!type_is_alias( type )) return NULL;
103 }
104}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void * get_attrp(const attr_list_t *list, enum attr_type attr_type)
Definition: attribute.c:87
int is_attr(const attr_list_t *list, enum attr_type attr_type)
Definition: attribute.c:45
static type_t * type_alias_get_aliasee_type(const type_t *type)
Definition: typetree.h:373
static int type_is_alias(const type_t *type)
Definition: typetree.h:357

Referenced by write_remoting_arg(), and write_type_tfs().

◆ get_attrp()

void * get_attrp ( const attr_list_t list,
enum attr_type  attr_type 
)

Definition at line 87 of file attribute.c.

88{
89 const attr_t *attr;
90 if (!list) return NULL;
92 if (attr->type == attr_type) return attr->u.pval;
93 return NULL;
94}

Referenced by add_typeinfo_block(), append_type_signature(), cmp_iid(), compute_interface_signature_uuid(), do_write_c_method_def(), encode_type(), format_parameterized_type_signature(), gen_proxy(), get_aliaschain_attrp(), get_func_handle_var(), get_user_type(), is_callas(), is_interpreted_func(), output_typelib_regscript(), save_all_changes(), set_doc_string(), set_guid(), set_help_context(), set_help_file_name(), set_help_string_context(), set_help_string_dll(), set_lcid(), type_runtimeclass_define(), write_args(), write_client_func_decl(), write_clientinterfacedecl(), write_coclass(), write_com_interface_end(), write_com_interface_start(), write_cpp_method_def(), write_descriptors(), write_enums(), write_fields(), write_function_proto(), write_function_stubs(), write_id_data_stmts(), write_implicithandledecl(), write_interface(), write_ip_tfs(), write_library(), write_method_proto(), write_parameter_conf_or_var_exprs(), write_pointer_left(), write_progid(), write_remoting_arg(), write_rpc_interface_end(), write_rpc_interface_start(), write_runtimeclass(), write_runtimeclasses_registry(), write_serverinterfacedecl(), write_stubdescriptor(), write_type_definition(), write_type_left(), write_type_tfs(), write_typelib_interface(), write_union_tfs(), and write_widl_using_macros().

◆ get_attrv()

◆ is_aliaschain_attr()

int is_aliaschain_attr ( const type_t type,
enum attr_type  attr_type 
)

Definition at line 67 of file attribute.c.

68{
69 const type_t *t = type;
70 for (;;)
71 {
72 if (is_attr( t->attrs, attr_type )) return 1;
74 else return 0;
75 }
76}
GLdouble GLdouble t
Definition: gl.h:2047

Referenced by check_interface_attrs(), get_enum_fc(), is_string_type(), typegen_detect_type(), write_function_stub(), and write_remoting_arg().

◆ is_attr()

◆ is_ptrchain_attr()

int is_ptrchain_attr ( const var_t var,
enum attr_type  attr_type 
)

Definition at line 54 of file attribute.c.

55{
56 type_t *type = var->declspec.type;
57 if (is_attr( var->attrs, attr_type )) return 1;
58 for (;;)
59 {
60 if (is_attr( type->attrs, attr_type )) return 1;
63 else return 0;
64 }
65}
static int type_is_ptr(const type_t *type)
Definition: typetree.h:362
static type_t * type_pointer_get_ref_type(const type_t *type)
Definition: typetree.h:424

Referenced by get_required_buffer_size().

◆ map_attrs()

attr_list_t * map_attrs ( const attr_list_t list,
map_attrs_filter_t  filter 
)

Definition at line 302 of file attribute.c.

303{
304 attr_list_t *new_list;
305 const attr_t *attr;
306 attr_t *new_attr;
307
308 if (!list) return NULL;
309
310 new_list = xmalloc( sizeof(*list) );
311 list_init( new_list );
313 {
314 if (filter && !filter( new_list, attr )) continue;
315 new_attr = xmalloc( sizeof(*new_attr) );
316 *new_attr = *attr;
317 list_add_tail( new_list, &new_attr->entry );
318 }
319 return new_list;
320}
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005

◆ move_attr()

attr_list_t * move_attr ( attr_list_t dst,
attr_list_t src,
enum attr_type  type 
)

Definition at line 322 of file attribute.c.

323{
324 attr_t *attr;
325 if (!src) return dst;
327 {
328 if (attr->type == type)
329 {
330 list_remove( &attr->entry );
331 return append_attr( dst, attr );
332 }
333 }
334 return dst;
335}
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340

◆ open_typelib()

int open_typelib ( const char name)

Definition at line 650 of file widl.c.

651{
652#ifndef __REACTOS__
653 static const char *default_dirs[] = { LIBDIR "/wine", "/usr/lib/wine", "/usr/local/lib/wine" };
654#endif
655 struct target win_target = { target.cpu, PLATFORM_WINDOWS };
656 const char *pe_dir = get_arch_dir( win_target );
657 int fd;
658 unsigned int i;
659
660#define TRYOPEN(str) do { \
661 char *file = str; \
662 if ((fd = open( file, O_RDONLY | O_BINARY )) != -1) return fd; \
663 free( file ); } while(0)
664
665 for (i = 0; i < dlldirs.count; i++)
666 {
667 if (strendswith( dlldirs.str[i], "/*" )) /* special case for wine build tree */
668 {
669 int namelen = strlen( name );
670 if (strendswith( name, ".dll" )) namelen -= 4;
671 TRYOPEN( strmake( "%.*s/%.*s%s/%s", (int)strlen(dlldirs.str[i]) - 2, dlldirs.str[i],
672 namelen, name, pe_dir, name ));
673 }
674 else
675 {
676 TRYOPEN( strmake( "%s%s/%s", dlldirs.str[i], pe_dir, name ));
677 TRYOPEN( strmake( "%s/%s", dlldirs.str[i], name ));
678 }
679 }
680
681#ifndef __REACTOS__
682 if (stdinc)
683 {
684 if (libdir)
685 {
686 TRYOPEN( strmake( "%s/wine%s/%s", libdir, pe_dir, name ));
687 TRYOPEN( strmake( "%s/wine/%s", libdir, name ));
688 }
689 for (i = 0; i < ARRAY_SIZE(default_dirs); i++)
690 {
691 if (i && !strcmp( default_dirs[i], default_dirs[0] )) continue;
692 TRYOPEN( strmake( "%s%s/%s", default_dirs[i], pe_dir, name ));
693 }
694 }
695#endif
696
697 error( "cannot find %s\n", name );
698#undef TRYOPEN
699
700#ifdef __REACTOS__
701 return 1;
702#endif
703}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define ARRAY_SIZE(A)
Definition: main.h:20
#define LIBDIR
Definition: create_nls.c:23
GLint namelen
Definition: glext.h:7232
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define error(str)
Definition: mkdosfs.c:1605
char * strmake(size_t *lenp,...)
Definition: util.c:82
static int fd
Definition: io.c:51
static int strendswith(const char *str, const char *end)
Definition: tools.h:145
static const char * get_arch_dir(struct target target)
Definition: tools.h:616
Definition: tools.h:99
@ PLATFORM_WINDOWS
Definition: tools.h:110
enum target::@5352 cpu
static struct strarray dlldirs
Definition: widl.c:140
static const char * libdir
Definition: widl.c:138
static int stdinc
Definition: widl.c:114
#define TRYOPEN(str)

Referenced by read_importlib().

◆ output_typelib_regscript()

void output_typelib_regscript ( const typelib_t typelib)

Definition at line 334 of file register.c.

335{
336 const struct uuid *typelib_uuid = get_attrp( typelib->attrs, ATTR_UUID );
337 const char *descr = get_attrp( typelib->attrs, ATTR_HELPSTRING );
338 const expr_t *lcid_expr = get_attrp( typelib->attrs, ATTR_LIBLCID );
339 unsigned int version = get_attrv( typelib->attrs, ATTR_VERSION );
340 unsigned int flags = 0;
341 char id_part[12] = "";
342 char *resname = typelib_name;
343 expr_t *expr;
344
345 if (is_attr( typelib->attrs, ATTR_RESTRICTED )) flags |= 1; /* LIBFLAG_FRESTRICTED */
346 if (is_attr( typelib->attrs, ATTR_CONTROL )) flags |= 2; /* LIBFLAG_FCONTROL */
347 if (is_attr( typelib->attrs, ATTR_HIDDEN )) flags |= 4; /* LIBFLAG_FHIDDEN */
348
349 put_str( indent, "HKCR\n" );
350 put_str( indent++, "{\n" );
351
352 put_str( indent, "NoRemove Typelib\n" );
353 put_str( indent++, "{\n" );
354 put_str( indent, "NoRemove '%s'\n", format_uuid( typelib_uuid ));
355 put_str( indent++, "{\n" );
356 put_str( indent, "'%u.%u' = s '%s'\n",
358 put_str( indent++, "{\n" );
359 expr = get_attrp( typelib->attrs, ATTR_ID );
360 if (expr)
361 {
362 snprintf(id_part, sizeof(id_part), "\\%d", expr->cval);
363 resname = strmake("%s\\%d", typelib_name, expr->cval);
364 }
365 put_str( indent, "'%x' { %s = s '%%MODULE%%%s' }\n",
366 lcid_expr ? lcid_expr->cval : 0, pointer_size == 8 ? "win64" : "win32", id_part );
367 put_str( indent, "FLAGS = s '%u'\n", flags );
368 put_str( --indent, "}\n" );
369 put_str( --indent, "}\n" );
370 put_str( --indent, "}\n" );
371
372 put_str( indent, "NoRemove Interface\n" );
373 put_str( indent++, "{\n" );
375 put_str( --indent, "}\n" );
376
377 put_str( indent, "NoRemove CLSID\n" );
378 put_str( indent++, "{\n" );
380 put_str( --indent, "}\n" );
381
382 write_progids( typelib->stmts );
383 put_str( --indent, "}\n" );
384
385 add_output_to_resources( "WINE_REGISTRY", resname );
386}
static const WCHAR version[]
Definition: asmname.c:66
GLbitfield flags
Definition: glext.h:7161
Definition: msctf.idl:532
#define ATTR_HIDDEN
Definition: mkdosfs.c:367
const char * descr
Definition: boot.c:45
unsigned int get_attrv(const attr_list_t *list, enum attr_type attr_type)
Definition: attribute.c:78
static void write_coclasses(const statement_list_t *stmts, const typelib_t *typelib)
Definition: register.c:171
static const char * format_uuid(const struct uuid *uuid)
Definition: register.c:37
static void write_progids(const statement_list_t *stmts)
Definition: register.c:230
static int indent
Definition: register.c:35
static void write_typelib_interfaces(const typelib_t *typelib)
Definition: register.c:133
void add_output_to_resources(const char *type, const char *name)
Definition: utils.c:192
void put_str(int indent, const char *format,...)
Definition: utils.c:261
#define MINORVERSION(version)
Definition: utils.h:49
#define MAJORVERSION(version)
Definition: utils.h:48
int cval
Definition: widltypes.h:371
Definition: query.h:86
char * typelib_name
Definition: widl.c:122
unsigned int pointer_size
Definition: widl.c:147
@ ATTR_UUID
Definition: widltypes.h:182
@ ATTR_VERSION
Definition: widltypes.h:185
@ ATTR_CONTROL
Definition: widltypes.h:92
@ ATTR_LIBLCID
Definition: widltypes.h:134
@ ATTR_RESTRICTED
Definition: widltypes.h:168
@ ATTR_ID
Definition: widltypes.h:125
@ ATTR_HELPSTRING
Definition: widltypes.h:121
#define snprintf
Definition: wintirpc.h:48

Referenced by save_all_changes().

◆ start_cplusplus_guard()

void start_cplusplus_guard ( FILE fp)

Definition at line 268 of file widl.c.

269{
270 fprintf(fp, "#ifdef __cplusplus\n");
271 fprintf(fp, "extern \"C\" {\n");
272 fprintf(fp, "#endif\n\n");
273}

Referenced by write_dlldata_list(), write_header(), and write_id_data().

◆ write_client()

void write_client ( const statement_list_t stmts)

Definition at line 613 of file client.c.

614{
615 if (!do_client)
616 return;
617 if (do_everything && !need_stub_files(stmts))
618 return;
619
620 init_client();
621 if (!client)
622 return;
623
624 write_client_routines( stmts );
625 fclose(client);
626}
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
static void init_client(void)
Definition: client.c:495
static FILE * client
Definition: client.c:37
static void write_client_routines(const statement_list_t *stmts)
Definition: client.c:587
int need_stub_files(const statement_list_t *stmts)
Definition: proxy.c:845
int do_everything
Definition: widl.c:98
int do_client
Definition: widl.c:103

◆ write_dlldata()

void write_dlldata ( const statement_list_t stmts)

Definition at line 329 of file widl.c.

330{
331 struct strarray filenames = empty_strarray;
332 int define_proxy_delegation = 0;
333 FILE *dlldata;
334
335 if (!do_dlldata || !need_proxy_file(stmts))
336 return;
337
338 define_proxy_delegation = need_proxy_delegation(stmts);
339
340 dlldata = fopen(dlldata_name, "r");
341 if (dlldata) {
342 static const char marker[] = "REFERENCE_PROXY_FILE";
343 static const char delegation_define[] = "#define PROXY_DELEGATION";
344 char *line = NULL;
345 size_t len = 0;
346
347 while (widl_getline(&line, &len, dlldata)) {
348 char *start, *end;
350 if (strncmp(start, marker, sizeof marker - 1) == 0) {
351 start = eat_space(start + sizeof marker - 1);
352 if (*start != '(')
353 continue;
354 end = start = eat_space(start + 1);
355 while (*end && *end != ')')
356 ++end;
357 if (*end != ')')
358 continue;
359 while (isspace((unsigned char) end[-1]))
360 --end;
361 *end = '\0';
362 if (start < end)
363 strarray_add(&filenames, replace_extension( get_basename( start ), ".idl", "" ));
364 }else if (!define_proxy_delegation && strncmp(start, delegation_define, sizeof(delegation_define)-1)) {
365 define_proxy_delegation = 1;
366 }
367 }
368
369 if (ferror(dlldata))
370 error("couldn't read from %s: %s\n", dlldata_name, strerror(errno));
371
372 free(line);
373 fclose(dlldata);
374 }
375
376 if (strarray_exists( &filenames, proxy_token ))
377 /* We're already in the list, no need to regenerate this file. */
378 return;
379
380 strarray_add(&filenames, proxy_token);
381 write_dlldata_list(filenames, define_proxy_delegation);
382}
#define isspace(c)
Definition: acclib.h:69
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define free
Definition: debug_ros.c:5
GLuint start
Definition: gl.h:1545
GLuint GLuint end
Definition: gl.h:1545
GLenum GLsizei len
Definition: glext.h:6722
_Check_return_ _CRTIMP int __cdecl ferror(_In_ FILE *_File)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
int marker
Definition: jpeglib.h:1030
const char * strerror(int err)
Definition: compat_str.c:23
#define errno
Definition: errno.h:18
static void strarray_add(struct strarray *array, const char *str)
Definition: tools.h:183
static char * get_basename(const char *file)
Definition: tools.h:307
static const struct strarray empty_strarray
Definition: tools.h:181
static char * replace_extension(const char *name, const char *old_ext, const char *new_ext)
Definition: tools.h:328
static int strarray_exists(const struct strarray *array, const char *str)
Definition: tools.h:201
int need_proxy_delegation(const statement_list_t *stmts)
Definition: proxy.c:809
int need_proxy_file(const statement_list_t *stmts)
Definition: proxy.c:804
size_t widl_getline(char **linep, size_t *lenp, FILE *fp)
Definition: utils.c:91
Definition: parser.c:49
static void write_dlldata_list(struct strarray filenames, int define_proxy_delegation)
Definition: widl.c:282
char * dlldata_name
Definition: widl.c:123
static char * eat_space(char *s)
Definition: widl.c:322
char * proxy_token
Definition: widl.c:125
int do_dlldata
Definition: widl.c:107

◆ write_header()

void write_header ( const statement_list_t stmts)

Definition at line 2083 of file header.c.

2084{
2085 FILE *header;
2086
2087 if (!do_header) return;
2088
2089 if(!(header = fopen(header_name, "w"))) {
2090 error("Could not open %s for output\n", header_name);
2091 return;
2092 }
2093 fprintf(header, "/*** Autogenerated by WIDL %s from %s - Do not edit ***/\n\n", PACKAGE_VERSION, input_name);
2094
2095 fprintf(header, "#ifdef _WIN32\n");
2096 fprintf(header, "#ifndef __REQUIRED_RPCNDR_H_VERSION__\n");
2097 fprintf(header, "#define __REQUIRED_RPCNDR_H_VERSION__ 475\n");
2098#ifdef __REACTOS__
2099 fprintf(header, "#endif\n\n");
2100
2101 fprintf(header, "#ifdef __REACTOS__\n");
2102 fprintf(header, "#define WIN32_LEAN_AND_MEAN\n");
2103 fprintf(header, "#endif\n\n");
2104#else
2105 fprintf(header, "#endif\n");
2106#endif
2107 fprintf(header, "#include <rpc.h>\n" );
2108 fprintf(header, "#include <rpcndr.h>\n" );
2110 fprintf(header, "#include <midles.h>\n" );
2111 fprintf(header, "#endif\n\n");
2112
2113 fprintf(header, "#ifndef COM_NO_WINDOWS_H\n");
2114 fprintf(header, "#include <windows.h>\n");
2115 fprintf(header, "#include <ole2.h>\n");
2116 fprintf(header, "#endif\n\n");
2117
2118 fprintf(header, "#ifndef __%s__\n", header_token);
2119 fprintf(header, "#define __%s__\n\n", header_token);
2120
2121 fprintf(header, "/* Forward declarations */\n\n");
2123
2124 fprintf(header, "/* Headers for imported files */\n\n");
2125 write_imports(header, stmts);
2126 fprintf(header, "\n");
2128
2130
2131 fprintf(header, "/* Begin additional prototypes for all interfaces */\n");
2132 fprintf(header, "\n");
2137 fprintf(header, "\n");
2138 fprintf(header, "/* End additional prototypes */\n");
2139 fprintf(header, "\n");
2140
2142 fprintf(header, "#endif /* __%s__ */\n", header_token);
2143
2144 fclose(header);
2145}
#define FALSE
Definition: types.h:117
static void write_generic_handle_routines(FILE *header)
Definition: header.c:805
static void write_imports(FILE *header, const statement_list_t *stmts)
Definition: header.c:1899
static int for_each_serializable(const statement_list_t *stmts, FILE *header, int(*proc)(FILE *, const type_t *))
Definition: header.c:752
static int write_serialize_function_decl(FILE *header, const type_t *type)
Definition: header.c:741
static void write_user_types(FILE *header)
Definition: header.c:782
static void write_context_handle_rundowns(FILE *header)
Definition: header.c:795
static void write_header_stmts(FILE *header, const statement_list_t *stmts, const type_t *iface, int ignore_funcs)
Definition: header.c:1976
static void write_forward_decls(FILE *header, const statement_list_t *stmts)
Definition: header.c:1931
static int serializable_exists(FILE *header, const type_t *type)
Definition: header.c:747
void start_cplusplus_guard(FILE *fp)
Definition: widl.c:268
int do_header
Definition: widl.c:100
char * header_token
Definition: widl.c:121
void end_cplusplus_guard(FILE *fp)
Definition: widl.c:275
char * header_name
Definition: widl.c:119
char * input_name
Definition: widl.c:116

◆ write_id_data()

void write_id_data ( const statement_list_t stmts)

Definition at line 431 of file widl.c.

432{
433 if (!do_idfile) return;
434
435 idfile = fopen(idfile_name, "w");
436 if (! idfile) {
437 error("Could not open %s for output\n", idfile_name);
438 return;
439 }
440
441 fprintf(idfile, "/*** Autogenerated by WIDL %s ", PACKAGE_VERSION);
442 fprintf(idfile, "from %s - Do not edit ***/\n\n", idl_name);
443#ifdef __REACTOS__
444 fprintf(idfile, "#ifdef __REACTOS__\n");
445 fprintf(idfile, "#define WIN32_NO_STATUS\n");
446 fprintf(idfile, "#define WIN32_LEAN_AND_MEAN\n");
447 fprintf(idfile, "#endif\n\n");
448#endif
449 fprintf(idfile, "#include <rpc.h>\n");
450 fprintf(idfile, "#include <rpcndr.h>\n\n");
451
452 fprintf(idfile, "#ifdef _MIDL_USE_GUIDDEF_\n\n");
453
454 fprintf(idfile, "#ifndef INITGUID\n");
455 fprintf(idfile, "#define INITGUID\n");
456 fprintf(idfile, "#include <guiddef.h>\n");
457 fprintf(idfile, "#undef INITGUID\n");
458 fprintf(idfile, "#else\n");
459 fprintf(idfile, "#include <guiddef.h>\n");
460 fprintf(idfile, "#endif\n\n");
461
462 fprintf(idfile, "#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \\\n");
463 fprintf(idfile, " DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)\n\n");
464
465 fprintf(idfile, "#elif defined(__cplusplus)\n\n");
466
467 fprintf(idfile, "#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \\\n");
468 fprintf(idfile, " EXTERN_C const type DECLSPEC_SELECTANY name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}\n\n");
469
470 fprintf(idfile, "#else\n\n");
471
472 fprintf(idfile, "#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \\\n");
473 fprintf(idfile, " const type DECLSPEC_SELECTANY name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}\n\n");
474
475 fprintf(idfile, "#endif\n\n");
477
478 write_id_data_stmts(stmts);
479
480 fprintf(idfile, "\n");
482 fprintf(idfile, "#undef MIDL_DEFINE_GUID\n" );
483
484 fclose(idfile);
485}
int do_idfile
Definition: widl.c:106
char * idl_name
Definition: widl.c:117
static void write_id_data_stmts(const statement_list_t *stmts)
Definition: widl.c:394
static FILE * idfile
Definition: widl.c:144
static char * idfile_name
Definition: widl.c:132

◆ write_local_stubs()

void write_local_stubs ( const statement_list_t stmts)

Definition at line 1448 of file header.c.

1449{
1450 FILE *local_stubs;
1451
1452 if (!local_stubs_name) return;
1453
1454 local_stubs = fopen(local_stubs_name, "w");
1455 if (!local_stubs) {
1456 error("Could not open %s for output\n", local_stubs_name);
1457 return;
1458 }
1459 fprintf(local_stubs, "/* call_as/local stubs for %s */\n\n", input_name);
1460 fprintf(local_stubs, "#include <objbase.h>\n");
1461 fprintf(local_stubs, "#include \"%s\"\n\n", header_name);
1462
1463 write_local_stubs_stmts(local_stubs, stmts);
1464
1465 fclose(local_stubs);
1466}
static void write_local_stubs_stmts(FILE *local_stubs, const statement_list_t *stmts)
Definition: header.c:1438
char * local_stubs_name
Definition: widl.c:120

◆ write_proxies()

void write_proxies ( const statement_list_t stmts)

Definition at line 1072 of file proxy.c.

1073{
1074 if (!do_proxies) return;
1075 if (do_everything && !need_proxy_file(stmts)) return;
1076
1077 init_proxy(stmts);
1078 if(!proxy) return;
1079
1080 write_proxy_routines( stmts );
1081 fclose(proxy);
1082}
static void write_proxy_routines(const statement_list_t *stmts)
Definition: proxy.c:917
int need_proxy_file(const statement_list_t *stmts)
Definition: proxy.c:804
static FILE * proxy
Definition: proxy.c:36
static void init_proxy(const statement_list_t *stmts)
Definition: proxy.c:79
int do_proxies
Definition: widl.c:102

◆ write_regscript()

void write_regscript ( const statement_list_t stmts)

Definition at line 244 of file register.c.

245{
246 const type_t *ps_factory;
247
248 if (!do_regscript) return;
249 if (do_everything && !need_proxy_file( stmts )) return;
250
252
253 if (winrt_mode)
254 {
255 put_str( indent, "HKLM\n" );
256 put_str( indent++, "{\n" );
257 put_str( indent, "NoRemove Software\n" );
258 put_str( indent++, "{\n" );
259 put_str( indent, "NoRemove Microsoft\n" );
260 put_str( indent++, "{\n" );
261 put_str( indent, "NoRemove WindowsRuntime\n" );
262 put_str( indent++, "{\n" );
263 put_str( indent, "NoRemove ActivatableClassId\n" );
264 put_str( indent++, "{\n" );
266 put_str( --indent, "}\n" );
267 put_str( --indent, "}\n" );
268 put_str( --indent, "}\n" );
269 put_str( --indent, "}\n" );
270 put_str( --indent, "}\n" );
271 }
272 else
273 {
274 put_str( indent, "HKCR\n" );
275 put_str( indent++, "{\n" );
276
277 ps_factory = find_ps_factory( stmts );
278 if (ps_factory)
279 {
280 put_str( indent, "NoRemove Interface\n" );
281 put_str( indent++, "{\n" );
282 write_interfaces( stmts, ps_factory );
283 put_str( --indent, "}\n" );
284 }
285
286 put_str( indent, "NoRemove CLSID\n" );
287 put_str( indent++, "{\n" );
288 write_coclasses( stmts, NULL );
289 put_str( --indent, "}\n" );
290
291 write_progids( stmts );
292 put_str( --indent, "}\n" );
293 }
294
295 if (strendswith( regscript_name, ".res" )) /* create a binary resource file */
296 {
297 add_output_to_resources( "WINE_REGISTRY", regscript_token );
299 }
300 else
301 {
302 FILE *f = fopen( regscript_name, "w" );
303 if (!f) error( "Could not open %s for output\n", regscript_name );
305 error( "Failed to write to %s\n", regscript_name );
306 if (fclose( f ))
307 error( "Failed to write to %s\n", regscript_name );
308 }
309}
GLfloat f
Definition: glext.h:7540
size_t output_buffer_pos
Definition: utils.c:164
static void init_output_buffer(void)
Definition: tools.h:791
static const type_t * find_ps_factory(const statement_list_t *stmts)
Definition: register.c:62
static void write_interfaces(const statement_list_t *stmts, const type_t *ps_factory)
Definition: register.c:100
static void write_runtimeclasses_registry(const statement_list_t *stmts)
Definition: register.c:185
void flush_output_resources(const char *name)
Definition: utils.c:226
size_t fwrite(const void *, size_t, size_t, FILE *)
Definition: file.c:3077
int do_regscript
Definition: widl.c:105
char * regscript_name
Definition: widl.c:130
char * regscript_token
Definition: widl.c:131

◆ write_server()

void write_server ( const statement_list_t stmts)

Definition at line 541 of file server.c.

542{
543 if (!do_server)
544 return;
545 if (do_everything && !need_stub_files(stmts))
546 return;
547
548 init_server();
549 if (!server)
550 return;
551
552 write_server_routines( stmts );
553 fclose(server);
554}
static void server(void)
Definition: server.c:2301
static void init_server(void)
Definition: server.c:450
static void write_server_routines(const statement_list_t *stmts)
Definition: server.c:503
int do_server
Definition: widl.c:104

◆ write_typelib_regscript()

void write_typelib_regscript ( const statement_list_t stmts)

Definition at line 311 of file register.c.

312{
313 const statement_t *stmt;
314 unsigned int count = 0;
315
316 if (!do_typelib) return;
317 if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry )
318 {
319 if (stmt->type != STMT_LIBRARY) continue;
320 if (count && !strendswith( typelib_name, ".res" ))
321 error( "Cannot store multiple typelibs into %s\n", typelib_name );
322 else
323 {
324 if (old_typelib)
325 create_sltg_typelib( stmt->u.lib );
326 else
327 create_msft_typelib( stmt->u.lib );
328 }
329 count++;
330 }
332}
GLuint GLuint GLsizei count
Definition: gl.h:1545
int create_msft_typelib(typelib_t *typelib)
Definition: write_msft.c:2755
int create_sltg_typelib(typelib_t *typelib)
Definition: write_sltg.c:1777
statement_type_t type
Definition: parser.h:124
typelib_t * lib
Definition: widltypes.h:632
union _statement_t::@5358 u
int do_typelib
Definition: widl.c:101
int old_typelib
Definition: widl.c:110
@ STMT_LIBRARY
Definition: widltypes.h:265

Variable Documentation

◆ acf_name

char* acf_name
extern

Definition at line 118 of file widl.c.

Referenced by option_callback().

◆ client_name

char* client_name
extern

Definition at line 126 of file widl.c.

Referenced by init_client(), main(), option_callback(), and rm_tempfile().

◆ client_token

char* client_token
extern

Definition at line 127 of file widl.c.

Referenced by main(), and write_client_routines().

◆ debuglevel

int debuglevel
extern

Definition at line 94 of file widl.c.

Referenced by chat(), dump_var_desc(), main(), and option_callback().

◆ dlldata_name

char* dlldata_name
extern

Definition at line 123 of file widl.c.

Referenced by main(), option_callback(), write_dlldata(), and write_dlldata_list().

◆ do_client

int do_client
extern

Definition at line 103 of file widl.c.

Referenced by main(), option_callback(), rm_tempfile(), set_everything(), and write_client().

◆ do_dlldata

int do_dlldata
extern

Definition at line 107 of file widl.c.

Referenced by main(), option_callback(), set_everything(), and write_dlldata().

◆ do_everything

int do_everything
extern

Definition at line 98 of file widl.c.

Referenced by main(), option_callback(), write_client(), write_proxies(), write_regscript(), and write_server().

◆ do_header

int do_header
extern

Definition at line 100 of file widl.c.

Referenced by main(), option_callback(), rm_tempfile(), set_everything(), and write_header().

◆ do_idfile

int do_idfile
extern

Definition at line 106 of file widl.c.

Referenced by main(), option_callback(), rm_tempfile(), set_everything(), and write_id_data().

◆ do_proxies

int do_proxies
extern

Definition at line 102 of file widl.c.

Referenced by main(), option_callback(), rm_tempfile(), set_everything(), and write_proxies().

◆ do_regscript

int do_regscript
extern

Definition at line 105 of file widl.c.

Referenced by main(), option_callback(), rm_tempfile(), set_everything(), and write_regscript().

◆ do_server

int do_server
extern

Definition at line 104 of file widl.c.

Referenced by main(), option_callback(), rm_tempfile(), set_everything(), and write_server().

◆ do_typelib

int do_typelib
extern

Definition at line 101 of file widl.c.

Referenced by main(), option_callback(), rm_tempfile(), set_everything(), and write_typelib_regscript().

◆ header_name

◆ header_token

char* header_token
extern

Definition at line 121 of file widl.c.

Referenced by main(), and write_header().

◆ idl_name

char* idl_name
extern

Definition at line 117 of file widl.c.

Referenced by main(), and write_id_data().

◆ input_name

char* input_name
extern

Definition at line 116 of file widl.c.

Referenced by init_client(), init_proxy(), init_server(), main(), write_header(), and write_local_stubs().

◆ interpreted_mode

◆ local_stubs_name

char* local_stubs_name
extern

Definition at line 120 of file widl.c.

Referenced by main(), option_callback(), rm_tempfile(), and write_local_stubs().

◆ now

time_t now
extern

Definition at line 65 of file finger.c.

Referenced by __attribute__(), __drv_requiresIRQL(), _Dispatch_type_(), add_special_defines(), adns__fdevents(), adns__internal_submit(), adns__must_gettimeofday(), adns__procdgram(), adns__query_send(), adns__search_next(), adns__tcp_tryconnect(), adns__timeouts(), adns__update_expires(), adns_afterselect(), adns_beforeselect(), adns_check(), adns_firsttimeout(), adns_processany(), adns_processreadable(), adns_processtimeouts(), adns_processwriteable(), adns_submit(), authunix_create(), authunix_refresh(), CertDllVerifyRevocation(), ClasspRetryRequestDpc(), clnt_dg_create(), clnt_vc_create(), collect_connections(), connection_collector(), CoWaitForMultipleHandles(), create_cache_entry(), create_directory_fcb(), create_stream(), create_subvol(), delete_fileref(), delete_reparse_point(), do_create_snapshot(), DSoundRender_DoRenderSample(), duplicate_extents(), Ext2FirstUnusedMcb(), Ext2QueryUnusedBH(), Ext2QueryUnusedFcb(), fd_event(), file_create2(), FTPGetOneF(), FTPUpdateIOTimer(), get_test_year(), GetDynamicTimeZoneInformation(), GetStartSpoolDate(), gettimeofday(), InitLsMonths(), inter_maxtoabs(), LogOpen(), look_for_roots(), LsCacheLookup(), main(), MediaControl_Run(), mknod(), move_across_subvols(), NetBTWaitForNameResponse(), open_file3(), print_ttl(), QualityControlRender_WaitFor(), query_alloc(), query_simple(), query_submit(), query_usetcp(), queue_current_time(), queue_timer_expire(), readclock_GetTime(), recvd_subvol(), NotifyArea::Refresh(), run_child_process(), SClose(), set_basic_information(), set_file_security(), set_link_information(), set_rename_information(), set_reparse_point2(), set_symlink(), set_zero_data(), SnmpSvcGetUptime(), SRead(), SRecv(), SRecvfrom(), SSend(), SSendto(), SSendtoByName(), stream_set_end_of_file_information(), sw_check_timers(), SWaitUntilReadyForReading(), SWaitUntilReadyForWriting(), SWrite(), tcp_connected(), tcp_events(), test_buffer(), test_buffer8(), test_cache_read(), test_get_state(), test_urlcacheA(), timeouts_queue(), timerqueue_thread_proc(), TpSetTimer(), TpSetWait(), UnDate(), UnLslR(), UnLslRLine(), UnMDTMDate(), UNUSED(), update_chunk_cache(), update_chunk_caches(), urlcache_entry_is_expired(), waitqueue_thread_proc(), warp_check(), write_one_file(), write_volume_label(), and WriteDefaultFirewallPrefs().

◆ old_names

int old_names
extern

◆ old_typelib

int old_typelib
extern

Definition at line 110 of file widl.c.

Referenced by option_callback(), and write_typelib_regscript().

◆ packing

unsigned int packing
extern

◆ pedantic

int pedantic
extern

Definition at line 97 of file widl.c.

◆ pointer_size

◆ prefix_client

◆ prefix_server

◆ proxy_name

char* proxy_name
extern

Definition at line 124 of file widl.c.

Referenced by init_proxy(), main(), option_callback(), and rm_tempfile().

◆ proxy_token

char* proxy_token
extern

Definition at line 125 of file widl.c.

Referenced by main(), write_dlldata(), and write_proxy_routines().

◆ regscript_name

char* regscript_name
extern

Definition at line 130 of file widl.c.

Referenced by main(), rm_tempfile(), and write_regscript().

◆ regscript_token

char* regscript_token
extern

Definition at line 131 of file widl.c.

Referenced by main(), and write_regscript().

◆ server_name

◆ server_token

char* server_token
extern

Definition at line 129 of file widl.c.

Referenced by main(), and write_server_routines().

◆ target

Definition at line 190 of file glfuncs.h.

◆ typelib_name

char* typelib_name
extern

◆ use_abi_namespace

◆ winrt_mode