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
88fd90b4
Commit
88fd90b4
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: Add helper functions that return the size of procformat and
typeformat strings for variables.
parent
e6fa3619
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
8 deletions
+33
-8
client.c
tools/widl/client.c
+3
-2
server.c
tools/widl/server.c
+3
-2
typegen.c
tools/widl/typegen.c
+25
-4
typegen.h
tools/widl/typegen.h
+2
-0
No files found.
tools/widl/client.c
View file @
88fd90b4
...
@@ -270,11 +270,12 @@ static void write_function_stubs(type_t *iface)
...
@@ -270,11 +270,12 @@ static void write_function_stubs(type_t *iface)
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
while
(
var
)
{
{
proc_offset
+=
2
;
/* FIXME */
proc_offset
+=
get_size_procformatstring_var
(
var
);
var
=
PREV_LINK
(
var
);
var
=
PREV_LINK
(
var
);
}
}
}
}
proc_offset
+=
2
;
/* FIXME */
if
(
!
is_void
(
def
->
type
,
NULL
))
proc_offset
+=
get_size_procformatstring_var
(
def
);
indent
--
;
indent
--
;
print_client
(
"}
\n
"
);
print_client
(
"}
\n
"
);
...
...
tools/widl/server.c
View file @
88fd90b4
...
@@ -299,11 +299,12 @@ static void write_function_stubs(type_t *iface)
...
@@ -299,11 +299,12 @@ static void write_function_stubs(type_t *iface)
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
NEXT_LINK
(
var
))
var
=
NEXT_LINK
(
var
);
while
(
var
)
while
(
var
)
{
{
proc_offset
+=
2
;
/* FIXME */
proc_offset
+=
get_size_procformatstring_var
(
var
);
var
=
PREV_LINK
(
var
);
var
=
PREV_LINK
(
var
);
}
}
}
}
proc_offset
+=
2
;
/* FIXME */
if
(
!
is_void
(
def
->
type
,
NULL
))
proc_offset
+=
get_size_procformatstring_var
(
def
);
func
=
PREV_LINK
(
func
);
func
=
PREV_LINK
(
func
);
}
}
...
...
tools/widl/typegen.c
View file @
88fd90b4
...
@@ -46,6 +46,8 @@ static int print_file(FILE *file, int indent, const char *format, ...)
...
@@ -46,6 +46,8 @@ static int print_file(FILE *file, int indent, const char *format, ...)
va_list
va
;
va_list
va
;
int
i
,
r
;
int
i
,
r
;
if
(
!
file
)
return
0
;
va_start
(
va
,
format
);
va_start
(
va
,
format
);
for
(
i
=
0
;
i
<
indent
;
i
++
)
for
(
i
=
0
;
i
<
indent
;
i
++
)
fprintf
(
file
,
" "
);
fprintf
(
file
,
" "
);
...
@@ -54,13 +56,15 @@ static int print_file(FILE *file, int indent, const char *format, ...)
...
@@ -54,13 +56,15 @@ static int print_file(FILE *file, int indent, const char *format, ...)
return
r
;
return
r
;
}
}
static
void
write_procformatstring_var
(
FILE
*
file
,
int
indent
,
var_t
*
var
)
static
size_t
write_procformatstring_var
(
FILE
*
file
,
int
indent
,
var_t
*
var
)
{
{
size_t
size
;
switch
(
var
->
type
->
type
)
switch
(
var
->
type
->
type
)
{
{
#define CASE_BASETYPE(fctype) \
#define CASE_BASETYPE(fctype) \
case RPC_##fctype: \
case RPC_##fctype: \
print_file(file, indent, "0x%02x,
/* " #fctype " */
\n", var->type->type); \
print_file(file, indent, "0x%02x,
/* " #fctype " */
\n", var->type->type); \
size = 2;
/* includes param type prefix */
\
break
break
CASE_BASETYPE
(
FC_BYTE
);
CASE_BASETYPE
(
FC_BYTE
);
...
@@ -80,7 +84,9 @@ static void write_procformatstring_var(FILE *file, int indent, var_t *var)
...
@@ -80,7 +84,9 @@ static void write_procformatstring_var(FILE *file, int indent, var_t *var)
#undef CASE_BASETYPE
#undef CASE_BASETYPE
default:
default:
error
(
"Unknown/unsupported type: %s (0x%02x)
\n
"
,
var
->
name
,
var
->
type
->
type
);
error
(
"Unknown/unsupported type: %s (0x%02x)
\n
"
,
var
->
name
,
var
->
type
->
type
);
size
=
0
;
}
}
return
size
;
}
}
void
write_procformatstring
(
FILE
*
file
,
type_t
*
iface
)
void
write_procformatstring
(
FILE
*
file
,
type_t
*
iface
)
...
@@ -137,13 +143,13 @@ void write_procformatstring(FILE *file, type_t *iface)
...
@@ -137,13 +143,13 @@ void write_procformatstring(FILE *file, type_t *iface)
}
}
static
void
write_typeformatstring_var
(
FILE
*
file
,
int
indent
,
var_t
*
var
)
static
size_t
write_typeformatstring_var
(
FILE
*
file
,
int
indent
,
var_t
*
var
)
{
{
int
ptr_level
=
var
->
ptr_level
;
int
ptr_level
=
var
->
ptr_level
;
/* basic types don't need a type format string */
/* basic types don't need a type format string */
if
(
ptr_level
==
0
)
if
(
ptr_level
==
0
)
return
;
return
0
;
if
(
ptr_level
==
1
)
if
(
ptr_level
==
1
)
{
{
...
@@ -154,7 +160,7 @@ static void write_typeformatstring_var(FILE *file, int indent, var_t *var)
...
@@ -154,7 +160,7 @@ static void write_typeformatstring_var(FILE *file, int indent, var_t *var)
print_file(file, indent, "0x11, 0x08,
/* FC_RP [simple_pointer] */
\n"); \
print_file(file, indent, "0x11, 0x08,
/* FC_RP [simple_pointer] */
\n"); \
print_file(file, indent, "0x%02x,
/* " #fctype " */
\n", var->type->type); \
print_file(file, indent, "0x%02x,
/* " #fctype " */
\n", var->type->type); \
print_file(file, indent, "0x5c,
/* FC_PAD */
\n"); \
print_file(file, indent, "0x5c,
/* FC_PAD */
\n"); \
break
return 4
CASE_BASETYPE
(
FC_BYTE
);
CASE_BASETYPE
(
FC_BYTE
);
CASE_BASETYPE
(
FC_CHAR
);
CASE_BASETYPE
(
FC_CHAR
);
CASE_BASETYPE
(
FC_SMALL
);
CASE_BASETYPE
(
FC_SMALL
);
...
@@ -175,8 +181,11 @@ static void write_typeformatstring_var(FILE *file, int indent, var_t *var)
...
@@ -175,8 +181,11 @@ static void write_typeformatstring_var(FILE *file, int indent, var_t *var)
error
(
"write_typeformatstring_var: Unknown/unsupported type: %s (0x%02x)
\n
"
,
var
->
name
,
var
->
type
->
type
);
error
(
"write_typeformatstring_var: Unknown/unsupported type: %s (0x%02x)
\n
"
,
var
->
name
,
var
->
type
->
type
);
}
}
}
}
error
(
"write_typeformatstring_var: Pointer level %d not supported for variable %s
\n
"
,
ptr_level
,
var
->
name
);
return
0
;
}
}
void
write_typeformatstring
(
FILE
*
file
,
type_t
*
iface
)
void
write_typeformatstring
(
FILE
*
file
,
type_t
*
iface
)
{
{
int
indent
=
0
;
int
indent
=
0
;
...
@@ -389,3 +398,15 @@ void unmarshall_arguments(FILE *file, int indent, func_t *func)
...
@@ -389,3 +398,15 @@ void unmarshall_arguments(FILE *file, int indent, func_t *func)
var
=
PREV_LINK
(
var
);
var
=
PREV_LINK
(
var
);
}
}
}
}
size_t
get_size_procformatstring_var
(
var_t
*
var
)
{
return
write_procformatstring_var
(
NULL
,
0
,
var
);
}
size_t
get_size_typeformatstring_var
(
var_t
*
var
)
{
return
write_typeformatstring_var
(
NULL
,
0
,
var
);
}
tools/widl/typegen.h
View file @
88fd90b4
...
@@ -25,3 +25,5 @@ void write_typeformatstring(FILE *file, type_t *iface);
...
@@ -25,3 +25,5 @@ void write_typeformatstring(FILE *file, type_t *iface);
unsigned
int
get_required_buffer_size
(
type_t
*
type
);
unsigned
int
get_required_buffer_size
(
type_t
*
type
);
void
marshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
);
void
marshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
);
void
unmarshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
);
void
unmarshall_arguments
(
FILE
*
file
,
int
indent
,
func_t
*
func
);
size_t
get_size_procformatstring_var
(
var_t
*
var
);
size_t
get_size_typeformatstring_var
(
var_t
*
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