widl: Support multiple interfaces per file.

This commit is contained in:
Eric Kohl 2005-12-12 12:11:44 +01:00 committed by Alexandre Julliard
parent f4356a64e3
commit 6744d4e3ea
2 changed files with 53 additions and 33 deletions

View File

@ -386,37 +386,47 @@ static void init_client(void)
void write_client(ifref_t *ifaces)
{
ifref_t *lcur = ifaces;
ifref_t *iface = ifaces;
if (!do_client)
return;
if (!lcur)
if (!iface)
return;
END_OF_LIST(lcur);
END_OF_LIST(iface);
init_client();
if (!client)
return;
write_formatstringsdecl(lcur->iface);
write_implicithandledecl(lcur->iface);
while (iface)
{
fprintf(client, "/*****************************************************************************\n");
fprintf(client, " * %s interface\n", iface->iface->name);
fprintf(client, " */\n");
fprintf(client, "\n");
write_clientinterfacedecl(lcur->iface);
write_stubdescdecl(lcur->iface);
write_bindinghandledecl(lcur->iface);
write_formatstringsdecl(iface->iface);
write_implicithandledecl(iface->iface);
write_function_stubs(lcur->iface);
write_stubdescriptor(lcur->iface);
write_clientinterfacedecl(iface->iface);
write_stubdescdecl(iface->iface);
write_bindinghandledecl(iface->iface);
print_client("#if !defined(__RPC_WIN32__)\n");
print_client("#error Invalid build platform for this stub.\n");
print_client("#endif\n");
fprintf(client, "\n");
write_function_stubs(iface->iface);
write_stubdescriptor(iface->iface);
write_procformatstring(client, lcur->iface);
write_typeformatstring(client);
print_client("#if !defined(__RPC_WIN32__)\n");
print_client("#error Invalid build platform for this stub.\n");
print_client("#endif\n");
fprintf(client, "\n");
fprintf(client, "\n");
write_procformatstring(client, iface->iface);
write_typeformatstring(client);
fprintf(client, "\n");
iface = PREV_LINK(iface);
}
fclose(client);
}

View File

@ -432,36 +432,46 @@ static void init_server(void)
void write_server(ifref_t *ifaces)
{
ifref_t *lcur = ifaces;
ifref_t *iface = ifaces;
if (!do_server)
return;
if (!lcur)
if (!iface)
return;
END_OF_LIST(lcur);
END_OF_LIST(iface);
init_server();
if (!server)
return;
write_formatstringsdecl(lcur->iface);
write_serverinterfacedecl(lcur->iface);
write_stubdescdecl(lcur->iface);
while (iface)
{
fprintf(server, "/*****************************************************************************\n");
fprintf(server, " * %s interface\n", iface->iface->name);
fprintf(server, " */\n");
fprintf(server, "\n");
write_function_stubs(lcur->iface);
write_formatstringsdecl(iface->iface);
write_serverinterfacedecl(iface->iface);
write_stubdescdecl(iface->iface);
write_stubdescriptor(lcur->iface);
write_dispatchtable(lcur->iface);
write_function_stubs(iface->iface);
print_server("#if !defined(__RPC_WIN32__)\n");
print_server("#error Invalid build platform for this stub.\n");
print_server("#endif\n");
fprintf(server, "\n");
write_stubdescriptor(iface->iface);
write_dispatchtable(iface->iface);
write_procformatstring(server, lcur->iface);
write_typeformatstring(server);
print_server("#if !defined(__RPC_WIN32__)\n");
print_server("#error Invalid build platform for this stub.\n");
print_server("#endif\n");
fprintf(server, "\n");
fprintf(server, "\n");
write_procformatstring(server, iface->iface);
write_typeformatstring(server);
fprintf(server, "\n");
iface = PREV_LINK(iface);
}
fclose(server);
}