Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
73dff5c4
Commit
73dff5c4
authored
Dec 26, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Dec 26, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Prepare marshall and unmarshall code generation functions for
accepting pointers.
parent
86c3a2e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
117 additions
and
102 deletions
+117
-102
typegen.c
tools/widl/typegen.c
+117
-102
No files found.
tools/widl/typegen.c
View file @
73dff5c4
...
...
@@ -146,7 +146,7 @@ void write_procformatstring(FILE *file, type_t *iface)
var
=
PREV_LINK
(
var
);
}
}
/* emit return value data */
var
=
func
->
def
;
if
(
is_void
(
var
->
type
,
NULL
))
...
...
@@ -283,8 +283,6 @@ unsigned int get_required_buffer_size(type_t *type)
void
marshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
)
{
unsigned
int
alignment
;
unsigned
int
size
;
unsigned
int
last_size
=
0
;
var_t
*
var
;
...
...
@@ -295,60 +293,69 @@ void marshall_arguments(FILE *file, int indent, func_t *func)
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
alignment
=
0
;
switch
(
var
->
type
->
type
)
if
(
var
->
ptr_level
==
0
)
{
case
RPC_FC_BYTE
:
case
RPC_FC_CHAR
:
case
RPC_FC_SMALL
:
case
RPC_FC_USMALL
:
size
=
1
;
alignment
=
0
;
break
;
case
RPC_FC_WCHAR
:
case
RPC_FC_USHORT
:
case
RPC_FC_SHORT
:
size
=
2
;
if
(
last_size
!=
0
&&
last_size
<
2
)
alignment
=
(
2
-
last_size
);
break
;
unsigned
int
size
;
unsigned
int
alignment
=
0
;
switch
(
var
->
type
->
type
)
{
case
RPC_FC_BYTE
:
case
RPC_FC_CHAR
:
case
RPC_FC_SMALL
:
case
RPC_FC_USMALL
:
size
=
1
;
alignment
=
0
;
break
;
case
RPC_FC_WCHAR
:
case
RPC_FC_USHORT
:
case
RPC_FC_SHORT
:
size
=
2
;
if
(
last_size
!=
0
&&
last_size
<
2
)
alignment
=
(
2
-
last_size
);
break
;
case
RPC_FC_ULONG
:
case
RPC_FC_LONG
:
case
RPC_FC_FLOAT
:
case
RPC_FC_ERROR_STATUS_T
:
size
=
4
;
if
(
last_size
!=
0
&&
last_size
<
4
)
alignment
=
(
4
-
last_size
);
break
;
case
RPC_FC_HYPER
:
case
RPC_FC_DOUBLE
:
size
=
8
;
if
(
last_size
!=
0
&&
last_size
<
4
)
alignment
=
(
4
-
last_size
);
break
;
default:
size
=
0
;
error
(
"Unknown/unsupported type: %s (0x%02x)
\n
"
,
var
->
name
,
var
->
type
->
type
);
}
case
RPC_FC_ULONG
:
case
RPC_FC_LONG
:
case
RPC_FC_FLOAT
:
case
RPC_FC_ERROR_STATUS_T
:
size
=
4
;
if
(
last_size
!=
0
&&
last_size
<
4
)
alignment
=
(
4
-
last_size
);
break
;
if
(
alignment
!=
0
)
print_file
(
file
,
indent
,
"_StubMsg.Buffer += %u;
\n
"
,
alignment
);
case
RPC_FC_HYPER
:
case
RPC_FC_DOUBLE
:
size
=
8
;
if
(
last_size
!=
0
&&
last_size
<
4
)
alignment
=
(
4
-
last_size
);
break
;
print_file
(
file
,
indent
,
"*("
);
write_type
(
file
,
var
->
type
,
var
,
var
->
tname
);
fprintf
(
file
,
" *)_StubMsg.Buffer = "
);
write_name
(
file
,
var
);
fprintf
(
file
,
";
\n
"
);
fprintf
(
file
,
"_StubMsg.Buffer += sizeof("
);
write_type
(
file
,
var
->
type
,
var
,
var
->
tname
);
fprintf
(
file
,
");
\n
"
);
fprintf
(
file
,
"
\n
"
);
default:
size
=
0
;
error
(
"Unknown/unsupported type: %s (0x%02x)
\n
"
,
var
->
name
,
var
->
type
->
type
);
last_size
=
size
;
}
else
{
error
(
"marshall_arguments: Pointer level %d not supported for variable %s
\n
"
,
var
->
ptr_level
,
var
->
name
);
last_size
=
0
;
}
if
(
alignment
!=
0
)
print_file
(
file
,
indent
,
"_StubMsg.Buffer += %u;
\n
"
,
alignment
);
print_file
(
file
,
indent
,
"*("
);
write_type
(
file
,
var
->
type
,
var
,
var
->
tname
);
fprintf
(
file
,
" *)_StubMsg.Buffer = "
);
write_name
(
file
,
var
);
fprintf
(
file
,
";
\n
"
);
fprintf
(
file
,
"_StubMsg.Buffer += sizeof("
);
write_type
(
file
,
var
->
type
,
var
,
var
->
tname
);
fprintf
(
file
,
");
\n
"
);
fprintf
(
file
,
"
\n
"
);
last_size
=
size
;
var
=
PREV_LINK
(
var
);
}
...
...
@@ -356,8 +363,6 @@ void marshall_arguments(FILE *file, int indent, func_t *func)
void
unmarshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
)
{
unsigned
int
alignment
;
unsigned
int
size
;
unsigned
int
last_size
=
0
;
var_t
*
var
;
...
...
@@ -368,60 +373,70 @@ void unmarshall_arguments(FILE *file, int indent, func_t *func)
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
{
alignment
=
0
;
switch
(
var
->
type
->
type
)
if
(
var
->
ptr_level
==
0
)
{
case
RPC_FC_BYTE
:
case
RPC_FC_CHAR
:
case
RPC_FC_SMALL
:
case
RPC_FC_USMALL
:
size
=
1
;
alignment
=
0
;
break
;
unsigned
int
size
;
unsigned
int
alignment
=
0
;
case
RPC_FC_WCHAR
:
case
RPC_FC_USHORT
:
case
RPC_FC_SHORT
:
size
=
2
;
if
(
last_size
!=
0
&&
last_size
<
2
)
alignment
=
(
2
-
last_size
);
break
;
switch
(
var
->
type
->
type
)
{
case
RPC_FC_BYTE
:
case
RPC_FC_CHAR
:
case
RPC_FC_SMALL
:
case
RPC_FC_USMALL
:
size
=
1
;
alignment
=
0
;
break
;
case
RPC_FC_WCHAR
:
case
RPC_FC_USHORT
:
case
RPC_FC_SHORT
:
size
=
2
;
if
(
last_size
!=
0
&&
last_size
<
2
)
alignment
=
(
2
-
last_size
);
break
;
case
RPC_FC_ULONG
:
case
RPC_FC_LONG
:
case
RPC_FC_FLOAT
:
case
RPC_FC_ERROR_STATUS_T
:
size
=
4
;
if
(
last_size
!=
0
&&
last_size
<
4
)
alignment
=
(
4
-
last_size
);
break
;
case
RPC_FC_HYPER
:
case
RPC_FC_DOUBLE
:
size
=
8
;
if
(
last_size
!=
0
&&
last_size
<
4
)
alignment
=
(
4
-
last_size
);
break
;
default:
size
=
0
;
error
(
"Unknown/unsupported type: %s (0x%02x)
\n
"
,
var
->
name
,
var
->
type
->
type
);
}
case
RPC_FC_ULONG
:
case
RPC_FC_LONG
:
case
RPC_FC_FLOAT
:
case
RPC_FC_ERROR_STATUS_T
:
size
=
4
;
if
(
last_size
!=
0
&&
last_size
<
4
)
alignment
=
(
4
-
last_size
);
break
;
if
(
alignment
!=
0
)
print_file
(
file
,
indent
,
"_StubMsg.Buffer += %u;
\n
"
,
alignment
);
case
RPC_FC_HYPER
:
case
RPC_FC_DOUBLE
:
size
=
8
;
if
(
last_size
!=
0
&&
last_size
<
4
)
alignment
=
(
4
-
last_size
);
break
;
print_file
(
file
,
indent
,
""
);
write_name
(
file
,
var
);
fprintf
(
file
,
" = *("
);
write_type
(
file
,
var
->
type
,
var
,
var
->
tname
);
fprintf
(
file
,
" *)_StubMsg.Buffer;
\n
"
);
fprintf
(
file
,
"_StubMsg.Buffer += sizeof("
);
write_type
(
file
,
var
->
type
,
var
,
var
->
tname
);
fprintf
(
file
,
");
\n
"
);
fprintf
(
file
,
"
\n
"
);
default:
size
=
0
;
error
(
"Unknown/unsupported type: %s (0x%02x)
\n
"
,
var
->
name
,
var
->
type
->
type
);
last_size
=
size
;
}
else
{
error
(
"unmarshall_arguments: Pointer level %d not supported for variable %s
\n
"
,
var
->
ptr_level
,
var
->
name
);
last_size
=
0
;
}
if
(
alignment
!=
0
)
print_file
(
file
,
indent
,
"_StubMsg.Buffer += %u;
\n
"
,
alignment
);
print_file
(
file
,
indent
,
""
);
write_name
(
file
,
var
);
fprintf
(
file
,
" = *("
);
write_type
(
file
,
var
->
type
,
var
,
var
->
tname
);
fprintf
(
file
,
" *)_StubMsg.Buffer;
\n
"
);
fprintf
(
file
,
"_StubMsg.Buffer += sizeof("
);
write_type
(
file
,
var
->
type
,
var
,
var
->
tname
);
fprintf
(
file
,
");
\n
"
);
fprintf
(
file
,
"
\n
"
);
last_size
=
size
;
var
=
PREV_LINK
(
var
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment