Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
304852f9
Commit
304852f9
authored
Oct 02, 2007
by
Dan Hipschman
Committed by
Alexandre Julliard
Oct 03, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Write types in the format string comments.
parent
32a2477e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
10 deletions
+23
-10
header.c
tools/widl/header.c
+9
-3
typegen.c
tools/widl/typegen.c
+14
-7
No files found.
tools/widl/header.c
View file @
304852f9
...
@@ -195,6 +195,8 @@ int needs_space_after(type_t *t)
...
@@ -195,6 +195,8 @@ int needs_space_after(type_t *t)
void
write_type_left
(
FILE
*
h
,
type_t
*
t
,
int
declonly
)
void
write_type_left
(
FILE
*
h
,
type_t
*
t
,
int
declonly
)
{
{
if
(
!
h
)
return
;
if
(
t
->
is_const
)
fprintf
(
h
,
"const "
);
if
(
t
->
is_const
)
fprintf
(
h
,
"const "
);
if
(
t
->
kind
==
TKIND_ALIAS
)
fprintf
(
h
,
"%s"
,
t
->
name
);
if
(
t
->
kind
==
TKIND_ALIAS
)
fprintf
(
h
,
"%s"
,
t
->
name
);
...
@@ -214,7 +216,7 @@ void write_type_left(FILE *h, type_t *t, int declonly)
...
@@ -214,7 +216,7 @@ void write_type_left(FILE *h, type_t *t, int declonly)
indent
(
h
,
-
1
);
indent
(
h
,
-
1
);
fprintf
(
h
,
"}"
);
fprintf
(
h
,
"}"
);
}
}
else
fprintf
(
h
,
"enum %s"
,
t
->
name
);
else
fprintf
(
h
,
"enum %s"
,
t
->
name
?
t
->
name
:
""
);
break
;
break
;
case
RPC_FC_STRUCT
:
case
RPC_FC_STRUCT
:
case
RPC_FC_CVSTRUCT
:
case
RPC_FC_CVSTRUCT
:
...
@@ -232,7 +234,7 @@ void write_type_left(FILE *h, type_t *t, int declonly)
...
@@ -232,7 +234,7 @@ void write_type_left(FILE *h, type_t *t, int declonly)
indent
(
h
,
-
1
);
indent
(
h
,
-
1
);
fprintf
(
h
,
"}"
);
fprintf
(
h
,
"}"
);
}
}
else
fprintf
(
h
,
"struct %s"
,
t
->
name
);
else
fprintf
(
h
,
"struct %s"
,
t
->
name
?
t
->
name
:
""
);
break
;
break
;
case
RPC_FC_NON_ENCAPSULATED_UNION
:
case
RPC_FC_NON_ENCAPSULATED_UNION
:
if
(
!
declonly
&&
t
->
defined
&&
!
t
->
written
&&
!
t
->
ignore
)
{
if
(
!
declonly
&&
t
->
defined
&&
!
t
->
written
&&
!
t
->
ignore
)
{
...
@@ -244,7 +246,7 @@ void write_type_left(FILE *h, type_t *t, int declonly)
...
@@ -244,7 +246,7 @@ void write_type_left(FILE *h, type_t *t, int declonly)
indent
(
h
,
-
1
);
indent
(
h
,
-
1
);
fprintf
(
h
,
"}"
);
fprintf
(
h
,
"}"
);
}
}
else
fprintf
(
h
,
"union %s"
,
t
->
name
);
else
fprintf
(
h
,
"union %s"
,
t
->
name
?
t
->
name
:
""
);
break
;
break
;
case
RPC_FC_RP
:
case
RPC_FC_RP
:
case
RPC_FC_UP
:
case
RPC_FC_UP
:
...
@@ -264,6 +266,8 @@ void write_type_left(FILE *h, type_t *t, int declonly)
...
@@ -264,6 +266,8 @@ void write_type_left(FILE *h, type_t *t, int declonly)
void
write_type_right
(
FILE
*
h
,
type_t
*
t
,
int
is_field
)
void
write_type_right
(
FILE
*
h
,
type_t
*
t
,
int
is_field
)
{
{
if
(
!
h
)
return
;
if
(
t
->
declarray
)
{
if
(
t
->
declarray
)
{
if
(
is_conformant_array
(
t
))
{
if
(
is_conformant_array
(
t
))
{
fprintf
(
h
,
"[%s]"
,
is_field
?
"1"
:
""
);
fprintf
(
h
,
"[%s]"
,
is_field
?
"1"
:
""
);
...
@@ -277,6 +281,8 @@ void write_type_right(FILE *h, type_t *t, int is_field)
...
@@ -277,6 +281,8 @@ void write_type_right(FILE *h, type_t *t, int is_field)
void
write_type_v
(
FILE
*
h
,
type_t
*
t
,
int
is_field
,
int
declonly
,
void
write_type_v
(
FILE
*
h
,
type_t
*
t
,
int
is_field
,
int
declonly
,
const
char
*
fmt
,
va_list
args
)
const
char
*
fmt
,
va_list
args
)
{
{
if
(
!
h
)
return
;
write_type_left
(
h
,
t
,
declonly
);
write_type_left
(
h
,
t
,
declonly
);
if
(
fmt
)
{
if
(
fmt
)
{
if
(
needs_space_after
(
t
))
if
(
needs_space_after
(
t
))
...
...
tools/widl/typegen.c
View file @
304852f9
...
@@ -868,11 +868,18 @@ static unsigned int write_simple_pointer(FILE *file, const type_t *type)
...
@@ -868,11 +868,18 @@ static unsigned int write_simple_pointer(FILE *file, const type_t *type)
return
4
;
return
4
;
}
}
static
void
print_start_tfs_comment
(
FILE
*
file
,
type_t
*
t
,
unsigned
int
tfsoff
)
{
print_file
(
file
,
0
,
"/* %u ("
,
tfsoff
);
write_type_decl
(
file
,
t
,
NULL
);
print_file
(
file
,
0
,
") */
\n
"
);
}
static
size_t
write_pointer_tfs
(
FILE
*
file
,
type_t
*
type
,
unsigned
int
*
typestring_offset
)
static
size_t
write_pointer_tfs
(
FILE
*
file
,
type_t
*
type
,
unsigned
int
*
typestring_offset
)
{
{
unsigned
int
offset
=
*
typestring_offset
;
unsigned
int
offset
=
*
typestring_offset
;
print_
file
(
file
,
0
,
"/* %d */
\n
"
,
offset
);
print_
start_tfs_comment
(
file
,
type
,
offset
);
update_tfsoff
(
type
,
offset
,
file
);
update_tfsoff
(
type
,
offset
,
file
);
if
(
type
->
ref
->
typestring_offset
)
if
(
type
->
ref
->
typestring_offset
)
...
@@ -904,7 +911,7 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
...
@@ -904,7 +911,7 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
if
(
is_base_type
(
utype
->
type
))
if
(
is_base_type
(
utype
->
type
))
{
{
absoff
=
*
tfsoff
;
absoff
=
*
tfsoff
;
print_
file
(
file
,
0
,
"/* %d */
\n
"
,
absoff
);
print_
start_tfs_comment
(
file
,
utype
,
absoff
);
print_file
(
file
,
2
,
"0x%x,
\t
/* %s */
\n
"
,
utype
->
type
,
string_of_type
(
utype
->
type
));
print_file
(
file
,
2
,
"0x%x,
\t
/* %s */
\n
"
,
utype
->
type
,
string_of_type
(
utype
->
type
));
print_file
(
file
,
2
,
"0x5c,
\t
/* FC_PAD */
\n
"
);
print_file
(
file
,
2
,
"0x5c,
\t
/* FC_PAD */
\n
"
);
*
tfsoff
+=
2
;
*
tfsoff
+=
2
;
...
@@ -925,7 +932,7 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
...
@@ -925,7 +932,7 @@ static void write_user_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
start
=
*
tfsoff
;
start
=
*
tfsoff
;
update_tfsoff
(
type
,
start
,
file
);
update_tfsoff
(
type
,
start
,
file
);
print_
file
(
file
,
0
,
"/* %d */
\n
"
,
start
);
print_
start_tfs_comment
(
file
,
type
,
start
);
print_file
(
file
,
2
,
"0x%x,
\t
/* FC_USER_MARSHAL */
\n
"
,
RPC_FC_USER_MARSHAL
);
print_file
(
file
,
2
,
"0x%x,
\t
/* FC_USER_MARSHAL */
\n
"
,
RPC_FC_USER_MARSHAL
);
print_file
(
file
,
2
,
"0x%x,
\t
/* Alignment= %d, Flags= %02x */
\n
"
,
print_file
(
file
,
2
,
"0x%x,
\t
/* Alignment= %d, Flags= %02x */
\n
"
,
flags
|
(
align
-
1
),
align
-
1
,
flags
);
flags
|
(
align
-
1
),
align
-
1
,
flags
);
...
@@ -1486,7 +1493,7 @@ static size_t write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *type
...
@@ -1486,7 +1493,7 @@ static size_t write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *type
start_offset
=
*
typestring_offset
;
start_offset
=
*
typestring_offset
;
update_tfsoff
(
type
,
start_offset
,
file
);
update_tfsoff
(
type
,
start_offset
,
file
);
print_
file
(
file
,
0
,
"/* %lu */
\n
"
,
start_offset
);
print_
start_tfs_comment
(
file
,
type
,
start_offset
);
print_file
(
file
,
2
,
"0x%02x,
\t
/* %s */
\n
"
,
type
->
type
,
string_of_type
(
type
->
type
));
print_file
(
file
,
2
,
"0x%02x,
\t
/* %s */
\n
"
,
type
->
type
,
string_of_type
(
type
->
type
));
print_file
(
file
,
2
,
"0x%x,
\t
/* %d */
\n
"
,
align
-
1
,
align
-
1
);
print_file
(
file
,
2
,
"0x%x,
\t
/* %d */
\n
"
,
align
-
1
,
align
-
1
);
*
typestring_offset
+=
2
;
*
typestring_offset
+=
2
;
...
@@ -1672,7 +1679,7 @@ static size_t write_struct_tfs(FILE *file, type_t *type,
...
@@ -1672,7 +1679,7 @@ static size_t write_struct_tfs(FILE *file, type_t *type,
start_offset
=
*
tfsoff
;
start_offset
=
*
tfsoff
;
update_tfsoff
(
type
,
start_offset
,
file
);
update_tfsoff
(
type
,
start_offset
,
file
);
print_
file
(
file
,
0
,
"/* %d */
\n
"
,
start_offset
);
print_
start_tfs_comment
(
file
,
type
,
start_offset
);
print_file
(
file
,
2
,
"0x%x,
\t
/* %s */
\n
"
,
type
->
type
,
string_of_type
(
type
->
type
));
print_file
(
file
,
2
,
"0x%x,
\t
/* %s */
\n
"
,
type
->
type
,
string_of_type
(
type
->
type
));
print_file
(
file
,
2
,
"0x%x,
\t
/* %d */
\n
"
,
align
-
1
,
align
-
1
);
print_file
(
file
,
2
,
"0x%x,
\t
/* %d */
\n
"
,
align
-
1
,
align
-
1
);
print_file
(
file
,
2
,
"NdrFcShort(0x%x),
\t
/* %d */
\n
"
,
total_size
,
total_size
);
print_file
(
file
,
2
,
"NdrFcShort(0x%x),
\t
/* %d */
\n
"
,
total_size
,
total_size
);
...
@@ -1825,7 +1832,7 @@ static size_t write_union_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
...
@@ -1825,7 +1832,7 @@ static size_t write_union_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
start_offset
=
*
tfsoff
;
start_offset
=
*
tfsoff
;
update_tfsoff
(
type
,
start_offset
,
file
);
update_tfsoff
(
type
,
start_offset
,
file
);
print_
file
(
file
,
0
,
"/* %d */
\n
"
,
start_offset
);
print_
start_tfs_comment
(
file
,
type
,
start_offset
);
if
(
type
->
type
==
RPC_FC_ENCAPSULATED_UNION
)
if
(
type
->
type
==
RPC_FC_ENCAPSULATED_UNION
)
{
{
const
var_t
*
sv
=
LIST_ENTRY
(
list_head
(
type
->
fields
),
const
var_t
,
entry
);
const
var_t
*
sv
=
LIST_ENTRY
(
list_head
(
type
->
fields
),
const
var_t
,
entry
);
...
@@ -1926,7 +1933,7 @@ static size_t write_ip_tfs(FILE *file, const attr_list_t *attrs, type_t *type,
...
@@ -1926,7 +1933,7 @@ static size_t write_ip_tfs(FILE *file, const attr_list_t *attrs, type_t *type,
error
(
"%s: interface %s missing UUID
\n
"
,
__FUNCTION__
,
base
->
name
);
error
(
"%s: interface %s missing UUID
\n
"
,
__FUNCTION__
,
base
->
name
);
update_tfsoff
(
type
,
start_offset
,
file
);
update_tfsoff
(
type
,
start_offset
,
file
);
print_
file
(
file
,
0
,
"/* %d */
\n
"
,
start_offset
);
print_
start_tfs_comment
(
file
,
type
,
start_offset
);
print_file
(
file
,
2
,
"0x2f,
\t
/* FC_IP */
\n
"
);
print_file
(
file
,
2
,
"0x2f,
\t
/* FC_IP */
\n
"
);
print_file
(
file
,
2
,
"0x5a,
\t
/* FC_CONSTANT_IID */
\n
"
);
print_file
(
file
,
2
,
"0x5a,
\t
/* FC_CONSTANT_IID */
\n
"
);
print_file
(
file
,
2
,
"NdrFcLong(0x%08lx),
\n
"
,
uuid
->
Data1
);
print_file
(
file
,
2
,
"NdrFcLong(0x%08lx),
\n
"
,
uuid
->
Data1
);
...
...
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