Reactos
1/*
2 * IDL Compiler
3 *
4 * Copyright 2002 Ove Kaaven
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 */
20
21#ifndef __WIDL_WIDL_H
22#define __WIDL_WIDL_H
23
24#include "../tools.h"
25#include "widltypes.h"
26
27#include <time.h>
28
29extern int debuglevel;
30#define DEBUGLEVEL_NONE 0x0000
31#define DEBUGLEVEL_CHAT 0x0001
32#define DEBUGLEVEL_DUMP 0x0002
33#define DEBUGLEVEL_TRACE 0x0004
34#define DEBUGLEVEL_PPMSG 0x0008
35#define DEBUGLEVEL_PPLEX 0x0010
36#define DEBUGLEVEL_PPTRACE 0x0020
37
38extern int pedantic;
39extern int do_everything;
40extern int do_header;
41extern int do_typelib;
42extern int do_proxies;
43extern int do_client;
44extern int do_server;
45extern int do_regscript;
46extern int do_idfile;
47extern int do_dlldata;
48extern int old_names;
49extern int old_typelib;
50extern int winrt_mode;
51extern int interpreted_mode;
52extern int use_abi_namespace;
53
54extern char *input_name;
55extern char *idl_name;
56extern char *acf_name;
57extern char *header_name;
58extern char *header_token;
59extern char *local_stubs_name;
60extern char *typelib_name;
61extern char *dlldata_name;
62extern char *proxy_name;
63extern char *proxy_token;
64extern char *client_name;
65extern char *client_token;
66extern char *server_name;
67extern char *server_token;
68extern char *regscript_name;
69extern char *regscript_token;
70extern const char *prefix_client;
71extern const char *prefix_server;
72extern unsigned int packing;
73extern unsigned int pointer_size;
74extern struct target target;
75extern time_t now;
76
77extern int open_typelib( const char *name );
78
79extern void write_header(const statement_list_t *stmts);
80extern void write_id_data(const statement_list_t *stmts);
81extern void write_proxies(const statement_list_t *stmts);
82extern void write_client(const statement_list_t *stmts);
83extern void write_server(const statement_list_t *stmts);
84extern void write_regscript(const statement_list_t *stmts);
85extern void write_typelib_regscript(const statement_list_t *stmts);
86extern void output_typelib_regscript( const typelib_t *typelib );
87extern void write_local_stubs(const statement_list_t *stmts);
88extern void write_dlldata(const statement_list_t *stmts);
89
90extern void start_cplusplus_guard(FILE *fp);
91extern void end_cplusplus_guard(FILE *fp);
92
93/* attribute.c */
94
95extern attr_t *attr_int( struct location where, enum attr_type attr_type, unsigned int val );
96extern attr_t *attr_ptr( struct location where, enum attr_type attr_type, void *val );
97
98extern int is_attr( const attr_list_t *list, enum attr_type attr_type );
99extern int is_ptrchain_attr( const var_t *var, enum attr_type attr_type );
100extern int is_aliaschain_attr( const type_t *type, enum attr_type attr_type );
101
102extern unsigned int get_attrv( const attr_list_t *list, enum attr_type attr_type );
103extern void *get_attrp( const attr_list_t *list, enum attr_type attr_type );
104extern void *get_aliaschain_attrp( const type_t *type, enum attr_type attr_type );
105
106typedef int (*map_attrs_filter_t)( attr_list_t *, const attr_t * );
107extern attr_list_t *append_attr( attr_list_t *list, attr_t *attr );
108extern attr_list_t *append_attr_list( attr_list_t *new_list, attr_list_t *old_list );
109extern attr_list_t *append_attribs( attr_list_t *, attr_list_t * );
110extern attr_list_t *map_attrs( const attr_list_t *list, map_attrs_filter_t filter );
111extern attr_list_t *move_attr( attr_list_t *dst, attr_list_t *src, enum attr_type type );
112
113extern attr_list_t *check_apicontract_attrs( const char *name, attr_list_t *attrs );
114extern attr_list_t *check_coclass_attrs( const char *name, attr_list_t *attrs );
115extern attr_list_t *check_dispiface_attrs( const char *name, attr_list_t *attrs );
116extern attr_list_t *check_enum_attrs( attr_list_t *attrs );
117extern attr_list_t *check_enum_member_attrs( attr_list_t *attrs );
118extern attr_list_t *check_field_attrs( const char *name, attr_list_t *attrs );
119extern attr_list_t *check_function_attrs( const char *name, attr_list_t *attrs );
120extern attr_list_t *check_interface_attrs( const char *name, attr_list_t *attrs );
121extern attr_list_t *check_library_attrs( const char *name, attr_list_t *attrs );
122extern attr_list_t *check_module_attrs( const char *name, attr_list_t *attrs );
123extern attr_list_t *check_runtimeclass_attrs( const char *name, attr_list_t *attrs );
124extern attr_list_t *check_struct_attrs( attr_list_t *attrs );
125extern attr_list_t *check_typedef_attrs( attr_list_t *attrs );
126extern attr_list_t *check_union_attrs( attr_list_t *attrs );
127extern void check_arg_attrs( const var_t *arg );
128
129#endif