Commit 55df46ab authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

widl: Merge marshall_arguments and unmarshall_arguments into one

function to remove the large amount of duplicated code.
parent f1bb0a47
......@@ -199,7 +199,7 @@ static void write_function_stubs(type_t *iface)
type_offset_func = type_offset;
/* marshal arguments */
marshall_arguments(client, indent, func, &type_offset_func, PASS_IN);
write_remoting_arguments(client, indent, func, &type_offset_func, PASS_IN, PHASE_MARSHAL);
/* send/receive message */
/* print_client("NdrNsSendReceive(\n"); */
......@@ -214,7 +214,8 @@ static void write_function_stubs(type_t *iface)
print_client("_StubMsg.BufferStart = (unsigned char *)_RpcMessage.Buffer;\n");
print_client("_StubMsg.BufferEnd = _StubMsg.BufferStart + _RpcMessage.BufferLength;\n\n");
unmarshall_arguments(client, indent, func, &type_offset, PASS_OUT);
/* unmarshall arguments */
write_remoting_arguments(client, indent, func, &type_offset, PASS_OUT, PHASE_UNMARSHAL);
/* unmarshal return value */
if (!is_void(def->type, NULL))
......
......@@ -204,7 +204,8 @@ static void write_function_stubs(type_t *iface)
/* make a copy so we don't increment the type offset twice */
type_offset_func = type_offset;
unmarshall_arguments(server, indent, func, &type_offset_func, PASS_IN);
/* unmarshall arguments */
write_remoting_arguments(server, indent, func, &type_offset_func, PASS_IN, PHASE_UNMARSHAL);
}
print_server("if (_StubMsg.Buffer > _StubMsg.BufferEnd)\n");
......@@ -298,7 +299,8 @@ static void write_function_stubs(type_t *iface)
fprintf(server, "\n");
}
marshall_arguments(server, indent, func, &type_offset, PASS_OUT);
/* marshall arguments */
write_remoting_arguments(server, indent, func, &type_offset, PASS_OUT, PHASE_MARSHAL);
/* marshall the return value */
if (!is_void(def->type, NULL))
......
......@@ -27,11 +27,18 @@ enum pass
PASS_RETURN
};
enum remoting_phase
{
PHASE_BUFFERSIZE,
PHASE_MARSHAL,
PHASE_UNMARSHAL,
PHASE_FREE
};
void write_procformatstring(FILE *file, type_t *iface);
void write_typeformatstring(FILE *file, type_t *iface);
unsigned int get_required_buffer_size(const var_t *var, unsigned int *alignment);
void marshall_arguments(FILE *file, int indent, const func_t *func, unsigned int *type_offset, enum pass pass);
void unmarshall_arguments(FILE *file, int indent, const func_t *func, unsigned int *type_offset, enum pass pass);
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);
int write_expr_eval_routines(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