}
}
-void write_locals(FILE *fp, const type_t *iface, int body)
+static void write_locals(FILE *fp, const type_t *iface, int body)
{
static const char comment[]
= "/* WIDL-generated stub. You must provide an implementation for this. */";
}
}
+static void write_local_stubs_stmts(FILE *local_stubs, const statement_list_t *stmts)
+{
+ const statement_t *stmt;
+ if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry )
+ {
+ if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP)
+ write_locals(local_stubs, stmt->u.type, TRUE);
+ else if (stmt->type == STMT_LIBRARY)
+ write_local_stubs_stmts(local_stubs, stmt->u.lib->stmts);
+ }
+}
+
+void write_local_stubs(const statement_list_t *stmts)
+{
+ FILE *local_stubs;
+
+ if (!local_stubs_name) return;
+
+ local_stubs = fopen(local_stubs_name, "w");
+ if (!local_stubs) {
+ error("Could not open %s for output\n", local_stubs_name);
+ return;
+ }
+ fprintf(local_stubs, "/* call_as/local stubs for %s */\n\n", input_name);
+ fprintf(local_stubs, "#include <objbase.h>\n");
+ fprintf(local_stubs, "#include \"%s\"\n\n", header_name);
+
+ write_local_stubs_stmts(local_stubs, stmts);
+
+ fclose(local_stubs);
+}
+
static void write_function_proto(FILE *header, const type_t *iface, const func_t *fun, const char *prefix)
{
var_t *def = fun->def;
extern void write_import(const char *fname);
extern void write_forward(type_t *iface);
extern void write_interface(type_t *iface);
-extern void write_locals(FILE *fp, const type_t *iface, int body);
extern void write_coclass(type_t *cocl);
extern void write_coclass_forward(type_t *cocl);
extern void write_typedef(type_t *type);
write_client($1);
write_server($1);
write_dlldata($1);
+ write_local_stubs($1);
}
;
'{' int_statements '}' semicolon_opt { $$ = $1.interface;
type_interface_define($$, $2, $4);
if (!parse_only && do_header) write_interface($$);
- if (!parse_only && local_stubs) write_locals(local_stubs, $$, TRUE);
pointer_default = $1.old_pointer_default;
is_in_interface = FALSE;
}
semicolon_opt { $$ = $1.interface;
type_interface_define($$, find_type_or_error2($3, 0), $6);
if (!parse_only && do_header) write_interface($$);
- if (!parse_only && local_stubs) write_locals(local_stubs, $$, TRUE);
pointer_default = $1.old_pointer_default;
is_in_interface = FALSE;
}
int line_number = 1;
FILE *header;
-FILE *local_stubs;
-FILE *proxy;
FILE *idfile;
size_t pointer_size = 0;
start_cplusplus_guard(header);
}
- if (local_stubs_name) {
- local_stubs = fopen(local_stubs_name, "w");
- if (!local_stubs) {
- fprintf(stderr, "Could not open %s for output\n", local_stubs_name);
- return 1;
- }
- fprintf(local_stubs, "/* call_as/local stubs for %s */\n\n", input_name);
- fprintf(local_stubs, "#include <objbase.h>\n");
- fprintf(local_stubs, "#include \"%s\"\n\n", header_name);
- }
-
init_types();
ret = parser_parse();
fclose(header);
}
- if (local_stubs) {
- fclose(local_stubs);
- }
-
fclose(parser_in);
if(ret) {
extern int char_number;
extern FILE* header;
-extern FILE* local_stubs;
extern FILE* idfile;
extern void write_id_data(const statement_list_t *stmts);
extern void write_proxies(const statement_list_t *stmts);
extern void write_client(const statement_list_t *stmts);
extern void write_server(const statement_list_t *stmts);
+extern void write_local_stubs(const statement_list_t *stmts);
extern void write_dlldata(const statement_list_t *stmts);
#endif