Commit 9b16916e authored by Dan Hipschman's avatar Dan Hipschman Committed by Alexandre Julliard

widl: Allow format-string functions to work with objects.

parent e8e501f4
......@@ -440,7 +440,7 @@ void write_client(ifref_t *ifaces)
if (!client)
return;
write_formatstringsdecl(client, indent, ifaces);
write_formatstringsdecl(client, indent, ifaces, 0);
for (; iface; iface = PREV_LINK(iface))
{
......@@ -479,8 +479,8 @@ void write_client(ifref_t *ifaces)
fprintf(client, "\n");
write_procformatstring(client, ifaces);
write_typeformatstring(client, ifaces);
write_procformatstring(client, ifaces, 0);
write_typeformatstring(client, ifaces, 0);
fclose(client);
}
......@@ -110,7 +110,7 @@ static void init_proxy(ifref_t *ifaces)
print_proxy( "\n");
print_proxy( "#include \"%s\"\n", header_name);
print_proxy( "\n");
write_formatstringsdecl(proxy, indent, ifaces);
write_formatstringsdecl(proxy, indent, ifaces, 1);
write_stubdescproto();
}
......@@ -1031,8 +1031,8 @@ void write_proxies(ifref_t *ifaces)
print_proxy( "#error Currently only Wine and WIN32 are supported.\n");
print_proxy( "#endif\n");
print_proxy( "\n");
write_procformatstring(proxy, ifaces);
write_typeformatstring(proxy, ifaces);
write_procformatstring(proxy, ifaces, 1);
write_typeformatstring(proxy, ifaces, 1);
fprintf(proxy, "const CInterfaceProxyVtbl* _%s_ProxyVtblList[] =\n", file_id);
fprintf(proxy, "{\n");
......
......@@ -582,7 +582,7 @@ void write_server(ifref_t *ifaces)
if (!server)
return;
write_formatstringsdecl(server, indent, ifaces);
write_formatstringsdecl(server, indent, ifaces, 0);
for (; iface; iface = PREV_LINK(iface))
{
......@@ -620,8 +620,8 @@ void write_server(ifref_t *ifaces)
fprintf(server, "\n");
write_procformatstring(server, ifaces);
write_typeformatstring(server, ifaces);
write_procformatstring(server, ifaces, 0);
write_typeformatstring(server, ifaces, 0);
fclose(server);
}
......@@ -142,13 +142,13 @@ static void write_formatdesc(FILE *f, int indent, const char *str)
print_file(f, indent, "\n");
}
void write_formatstringsdecl(FILE *f, int indent, ifref_t *ifaces)
void write_formatstringsdecl(FILE *f, int indent, ifref_t *ifaces, int for_objects)
{
print_file(f, indent, "#define TYPE_FORMAT_STRING_SIZE %d\n",
get_size_typeformatstring(ifaces));
get_size_typeformatstring(ifaces, for_objects));
print_file(f, indent, "#define PROC_FORMAT_STRING_SIZE %d\n",
get_size_procformatstring(ifaces));
get_size_procformatstring(ifaces, for_objects));
fprintf(f, "\n");
write_formatdesc(f, indent, "TYPE");
......@@ -275,7 +275,7 @@ static size_t write_procformatstring_var(FILE *file, int indent,
return size;
}
void write_procformatstring(FILE *file, const ifref_t *ifaces)
void write_procformatstring(FILE *file, const ifref_t *ifaces, int for_objects)
{
const ifref_t *iface = ifaces;
int indent = 0;
......@@ -293,7 +293,7 @@ void write_procformatstring(FILE *file, const ifref_t *ifaces)
for (; iface; iface = PREV_LINK(iface))
{
if (is_object(iface->iface->attrs) || is_local(iface->iface->attrs))
if (for_objects != is_object(iface->iface->attrs) || is_local(iface->iface->attrs))
continue;
if (iface->iface->funcs)
......@@ -1385,7 +1385,7 @@ static size_t write_typeformatstring_var(FILE *file, int indent,
}
void write_typeformatstring(FILE *file, const ifref_t *ifaces)
void write_typeformatstring(FILE *file, const ifref_t *ifaces, int for_objects)
{
int indent = 0;
var_t *var;
......@@ -1405,7 +1405,7 @@ void write_typeformatstring(FILE *file, const ifref_t *ifaces)
for (; iface; iface = PREV_LINK(iface))
{
if (is_object(iface->iface->attrs) || is_local(iface->iface->attrs))
if (for_objects != is_object(iface->iface->attrs) || is_local(iface->iface->attrs))
continue;
if (iface->iface->funcs)
......@@ -1900,7 +1900,7 @@ size_t get_size_typeformatstring_var(const var_t *var)
return type_offset;
}
size_t get_size_procformatstring(const ifref_t *ifaces)
size_t get_size_procformatstring(const ifref_t *ifaces, int for_objects)
{
const ifref_t *iface = ifaces;
size_t size = 1;
......@@ -1911,7 +1911,7 @@ size_t get_size_procformatstring(const ifref_t *ifaces)
for (; iface; iface = PREV_LINK(iface))
{
if (is_object(iface->iface->attrs) || is_local(iface->iface->attrs))
if (for_objects != is_object(iface->iface->attrs) || is_local(iface->iface->attrs))
continue;
if (iface->iface->funcs)
......@@ -1946,7 +1946,7 @@ size_t get_size_procformatstring(const ifref_t *ifaces)
return size;
}
size_t get_size_typeformatstring(const ifref_t *ifaces)
size_t get_size_typeformatstring(const ifref_t *ifaces, int for_objects)
{
const ifref_t *iface = ifaces;
size_t size = 3;
......@@ -1957,7 +1957,7 @@ size_t get_size_typeformatstring(const ifref_t *ifaces)
for (; iface; iface = PREV_LINK(iface))
{
if (is_object(iface->iface->attrs) || is_local(iface->iface->attrs))
if (for_objects != is_object(iface->iface->attrs) || is_local(iface->iface->attrs))
continue;
if (iface->iface->funcs)
......
......@@ -35,16 +35,16 @@ enum remoting_phase
PHASE_FREE
};
void write_formatstringsdecl(FILE *f, int indent, ifref_t *ifaces);
void write_procformatstring(FILE *file, const ifref_t *ifaces);
void write_typeformatstring(FILE *file, const ifref_t *ifaces);
void write_formatstringsdecl(FILE *f, int indent, ifref_t *ifaces, int for_objects);
void write_procformatstring(FILE *file, const ifref_t *ifaces, int for_objects);
void write_typeformatstring(FILE *file, const ifref_t *ifaces, int for_objects);
size_t get_type_memsize(const type_t *type);
unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment, enum pass pass);
void print_phase_basetype(FILE *file, int indent, enum remoting_phase phase, enum pass pass, const var_t *var, const char *varname);
void write_remoting_arguments(FILE *file, int indent, const func_t *func, unsigned int *type_offset, enum pass pass, enum remoting_phase phase);
size_t get_size_procformatstring_var(const var_t *var);
size_t get_size_typeformatstring_var(const var_t *var);
size_t get_size_procformatstring(const ifref_t *ifaces);
size_t get_size_typeformatstring(const ifref_t *ifaces);
size_t get_size_procformatstring(const ifref_t *ifaces, int for_objects);
size_t get_size_typeformatstring(const ifref_t *ifaces, int for_objects);
int write_expr_eval_routines(FILE *file, const char *iface);
void write_expr_eval_routine_list(FILE *file, const char *iface);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment