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
42418fbb
Commit
42418fbb
authored
Sep 12, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wrc: Change the prefix on bison-generated names to avoid the name-prefix directive.
parent
4f0fa260
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
77 additions
and
76 deletions
+77
-76
newstruc.c
tools/wrc/newstruc.c
+22
-22
parser.h
tools/wrc/parser.h
+5
-5
parser.l
tools/wrc/parser.l
+39
-38
parser.y
tools/wrc/parser.y
+0
-0
utils.c
tools/wrc/utils.c
+4
-4
utils.h
tools/wrc/utils.h
+2
-2
wrc.c
tools/wrc/wrc.c
+5
-5
No files found.
tools/wrc/newstruc.c
View file @
42418fbb
...
...
@@ -327,7 +327,7 @@ static int convert_bitmap(char *data, int size)
type
|=
FL_SIZEBE
|
FL_OS2
;
}
else
yy
error
(
"Invalid bitmap format, bih->biSize = %ld"
,
bih
->
biSize
);
parser_
error
(
"Invalid bitmap format, bih->biSize = %ld"
,
bih
->
biSize
);
switch
(
type
)
{
...
...
@@ -336,12 +336,12 @@ static int convert_bitmap(char *data, int size)
case
FL_SIZEBE
:
case
FL_SIZEBE
|
FL_V4
:
case
FL_SIZEBE
|
FL_OS2
:
yy
warning
(
"Bitmap v%c signature little-endian, but size big-endian"
,
type
&
FL_V4
?
'4'
:
'3'
);
parser_
warning
(
"Bitmap v%c signature little-endian, but size big-endian"
,
type
&
FL_V4
?
'4'
:
'3'
);
break
;
case
FL_SIGBE
:
case
FL_SIGBE
|
FL_V4
:
case
FL_SIGBE
|
FL_OS2
:
yy
warning
(
"Bitmap v%c signature big-endian, but size little-endian"
,
type
&
FL_V4
?
'4'
:
'3'
);
parser_
warning
(
"Bitmap v%c signature big-endian, but size little-endian"
,
type
&
FL_V4
?
'4'
:
'3'
);
break
;
}
...
...
@@ -461,7 +461,7 @@ static void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico)
else
if
(
BYTESWAP_WORD
(
ih
->
type
)
==
1
)
swap
=
1
;
else
yy
error
(
"Icon resource data has invalid type id %d"
,
ih
->
type
);
parser_
error
(
"Icon resource data has invalid type id %d"
,
ih
->
type
);
cnt
=
swap
?
BYTESWAP_WORD
(
ih
->
count
)
:
ih
->
count
;
for
(
i
=
0
;
i
<
cnt
;
i
++
)
...
...
@@ -481,7 +481,7 @@ static void split_icons(raw_data_t *rd, icon_group_t *icog, int *nico)
}
if
(
ide
.
offset
>
rd
->
size
||
ide
.
offset
+
ide
.
ressize
>
rd
->
size
)
yy
error
(
"Icon resource data corrupt"
);
parser_
error
(
"Icon resource data corrupt"
);
ico
->
width
=
ide
.
width
;
ico
->
height
=
ide
.
height
;
ico
->
nclr
=
ide
.
nclr
;
...
...
@@ -556,7 +556,7 @@ static void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur)
else
if
(
BYTESWAP_WORD
(
ch
->
type
)
==
2
)
swap
=
1
;
else
yy
error
(
"Cursor resource data has invalid type id %d"
,
ch
->
type
);
parser_
error
(
"Cursor resource data has invalid type id %d"
,
ch
->
type
);
cnt
=
swap
?
BYTESWAP_WORD
(
ch
->
count
)
:
ch
->
count
;
for
(
i
=
0
;
i
<
cnt
;
i
++
)
{
...
...
@@ -575,7 +575,7 @@ static void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur)
}
if
(
cde
.
offset
>
rd
->
size
||
cde
.
offset
+
cde
.
ressize
>
rd
->
size
)
yy
error
(
"Cursor resource data corrupt"
);
parser_
error
(
"Cursor resource data corrupt"
);
cur
->
width
=
cde
.
width
;
cur
->
height
=
cde
.
height
;
cur
->
nclr
=
cde
.
nclr
;
...
...
@@ -598,7 +598,7 @@ static void split_cursors(raw_data_t *rd, cursor_group_t *curg, int *ncur)
cur
->
bits
=
info
.
biBitCount
;
}
if
(
!
win32
&&
(
cur
->
planes
!=
1
||
cur
->
bits
!=
1
))
yy
warning
(
"Win16 cursor contains colors"
);
parser_
warning
(
"Win16 cursor contains colors"
);
cur
->
xhot
=
swap
?
BYTESWAP_WORD
(
cde
.
xhot
)
:
cde
.
xhot
;
cur
->
yhot
=
swap
?
BYTESWAP_WORD
(
cde
.
yhot
)
:
cde
.
yhot
;
cur
->
data
=
new_raw_data
();
...
...
@@ -745,21 +745,21 @@ static void handle_ani_icon(riff_tag_t *rtp, enum res_e type, int isswapped)
if
(
type
==
res_anicur
&&
ctype
!=
2
&&
!
once
)
{
yy
warning
(
"Animated cursor contains invalid
\"
icon
\"
tag cursor-file (%d->%s)"
,
parser_
warning
(
"Animated cursor contains invalid
\"
icon
\"
tag cursor-file (%d->%s)"
,
ctype
,
ctype
==
1
?
"icontype"
:
"?"
);
once
++
;
}
else
if
(
type
==
res_aniico
&&
ctype
!=
1
&&
!
once
)
{
yy
warning
(
"Animated icon contains invalid
\"
icon
\"
tag icon-file (%d->%s)"
,
parser_
warning
(
"Animated icon contains invalid
\"
icon
\"
tag icon-file (%d->%s)"
,
ctype
,
ctype
==
2
?
"cursortype"
:
"?"
);
once
++
;
}
else
if
(
ctype
!=
1
&&
ctype
!=
2
&&
!
once
)
{
yy
warning
(
"Animated %s contains invalid
\"
icon
\"
tag file-type (%d; neither icon nor cursor)"
,
anistr
,
ctype
);
parser_
warning
(
"Animated %s contains invalid
\"
icon
\"
tag file-type (%d; neither icon nor cursor)"
,
anistr
,
ctype
);
once
++
;
}
...
...
@@ -768,7 +768,7 @@ static void handle_ani_icon(riff_tag_t *rtp, enum res_e type, int isswapped)
DWORD
ofs
=
isswapped
?
BYTESWAP_DWORD
(
cdp
[
i
].
offset
)
:
cdp
[
i
].
offset
;
DWORD
sze
=
isswapped
?
BYTESWAP_DWORD
(
cdp
[
i
].
ressize
)
:
cdp
[
i
].
ressize
;
if
(
ofs
>
rtp
->
size
||
ofs
+
sze
>
rtp
->
size
)
yy
error
(
"Animated %s's data corrupt"
,
anistr
);
parser_
error
(
"Animated %s's data corrupt"
,
anistr
);
convert_bitmap
((
char
*
)
chp
+
ofs
,
0
);
cdp
[
i
].
xhot
=
BYTESWAP_WORD
(
cdp
->
xhot
);
cdp
[
i
].
yhot
=
BYTESWAP_WORD
(
cdp
->
yhot
);
...
...
@@ -840,7 +840,7 @@ ani_curico_t *new_ani_curico(enum res_e type, raw_data_t *rd, int *memopt)
else
if
(
rtp
->
size
+
2
*
sizeof
(
DWORD
)
==
rd
->
size
)
isswapped
=
0
;
else
yy
error
(
"Animated %s has an invalid RIFF length"
,
anistr
);
parser_
error
(
"Animated %s has an invalid RIFF length"
,
anistr
);
switch
(
byteorder
)
{
...
...
@@ -933,7 +933,7 @@ ani_curico_t *new_ani_curico(enum res_e type, raw_data_t *rd, int *memopt)
/* We must end correctly here */
if
((
char
*
)
rtp
!=
(
char
*
)
rd
->
data
+
rd
->
size
)
yy
error
(
"Animated %s contains invalid field size(s)"
,
anistr
);
parser_
error
(
"Animated %s contains invalid field size(s)"
,
anistr
);
}
ani
->
data
=
rd
;
...
...
@@ -1002,7 +1002,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
msg
->
memopt
=
WRC_MO_MOVEABLE
|
WRC_MO_PURE
;
if
(
rd
->
size
<
sizeof
(
DWORD
))
yy
error
(
"Invalid messagetable, size too small"
);
parser_
error
(
"Invalid messagetable, size too small"
);
nblk
=
*
(
DWORD
*
)
rd
->
data
;
lo
=
WRC_LOWORD
(
nblk
);
...
...
@@ -1019,7 +1019,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
if
(
hi
&&
lo
)
internal_error
(
__FILE__
,
__LINE__
,
"Messagetable contains more than 65535 blocks; cannot determine endian"
);
if
(
!
hi
&&
!
lo
)
yy
error
(
"Invalid messagetable block count 0"
);
parser_
error
(
"Invalid messagetable block count 0"
);
if
(
!
hi
&&
lo
)
/* Messagetable byteorder == native byteorder */
{
...
...
@@ -1032,7 +1032,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
mbp
=
(
msgtab_block_t
*
)
&
(((
DWORD
*
)
rd
->
data
)[
1
]);
if
(
MSGTAB_BAD_PTR
(
mbp
,
rd
->
data
,
rd
->
size
,
nblk
*
sizeof
(
*
mbp
)))
yy
error
(
"Messagetable's blocks are outside of defined data"
);
parser_
error
(
"Messagetable's blocks are outside of defined data"
);
for
(
i
=
0
;
i
<
nblk
;
i
++
)
{
msgtab_entry_t
*
mep
,
*
next_mep
;
...
...
@@ -1043,7 +1043,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
for
(
id
=
mbp
[
i
].
idlo
;
id
<=
mbp
[
i
].
idhi
;
id
++
)
{
if
(
MSGTAB_BAD_PTR
(
mep
,
rd
->
data
,
rd
->
size
,
mep
->
length
))
yy
error
(
"Messagetable's data for block %d, ID 0x%08lx is outside of defined data"
,
(
int
)
i
,
id
);
parser_
error
(
"Messagetable's data for block %d, ID 0x%08lx is outside of defined data"
,
(
int
)
i
,
id
);
if
(
mep
->
flags
==
1
)
/* Docu says 'flags == 0x0001' for unicode */
{
WORD
*
wp
=
(
WORD
*
)
&
mep
[
1
];
...
...
@@ -1051,7 +1051,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
int
n
;
if
(
mep
->
length
&
1
)
yy
error
(
"Message 0x%08lx is unicode (block %d), but has odd length (%d)"
,
id
,
(
int
)
i
,
mep
->
length
);
parser_
error
(
"Message 0x%08lx is unicode (block %d), but has odd length (%d)"
,
id
,
(
int
)
i
,
mep
->
length
);
for
(
n
=
0
;
n
<
l
;
n
++
)
wp
[
n
]
=
BYTESWAP_WORD
(
wp
[
n
]);
...
...
@@ -1079,7 +1079,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
mbp
=
(
msgtab_block_t
*
)
&
(((
DWORD
*
)
rd
->
data
)[
1
]);
nblk
=
BYTESWAP_DWORD
(
nblk
);
if
(
MSGTAB_BAD_PTR
(
mbp
,
rd
->
data
,
rd
->
size
,
nblk
*
sizeof
(
*
mbp
)))
yy
error
(
"Messagetable's blocks are outside of defined data"
);
parser_
error
(
"Messagetable's blocks are outside of defined data"
);
for
(
i
=
0
;
i
<
nblk
;
i
++
)
{
msgtab_entry_t
*
mep
;
...
...
@@ -1096,7 +1096,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
mep
->
flags
=
BYTESWAP_WORD
(
mep
->
flags
);
if
(
MSGTAB_BAD_PTR
(
mep
,
rd
->
data
,
rd
->
size
,
mep
->
length
))
yy
error
(
"Messagetable's data for block %d, ID 0x%08lx is outside of defined data"
,
(
int
)
i
,
id
);
parser_
error
(
"Messagetable's data for block %d, ID 0x%08lx is outside of defined data"
,
(
int
)
i
,
id
);
if
(
mep
->
flags
==
1
)
/* Docu says 'flags == 0x0001' for unicode */
{
WORD
*
wp
=
(
WORD
*
)
&
mep
[
1
];
...
...
@@ -1104,7 +1104,7 @@ messagetable_t *new_messagetable(raw_data_t *rd, int *memopt)
int
n
;
if
(
mep
->
length
&
1
)
yy
error
(
"Message 0x%08lx is unicode (block %d), but has odd length (%d)"
,
id
,
(
int
)
i
,
mep
->
length
);
parser_
error
(
"Message 0x%08lx is unicode (block %d), but has odd length (%d)"
,
id
,
(
int
)
i
,
mep
->
length
);
for
(
n
=
0
;
n
<
l
;
n
++
)
wp
[
n
]
=
BYTESWAP_WORD
(
wp
[
n
]);
...
...
tools/wrc/parser.h
View file @
42418fbb
...
...
@@ -22,18 +22,18 @@
#define __WRC_PARSER_H
/* From parser.y */
extern
int
yy
debug
;
extern
int
parser_
debug
;
extern
int
want_nl
;
/* Set when getting line-numers */
extern
int
want_id
;
/* Set when getting the resource name */
int
yy
parse
(
void
);
int
parser_
parse
(
void
);
/* From parser.l */
extern
FILE
*
yy
in
;
extern
char
*
yy
text
;
extern
FILE
*
parser_
in
;
extern
char
*
parser_
text
;
extern
int
yy_flex_debug
;
int
yy
lex
(
void
);
int
parser_
lex
(
void
);
#endif
tools/wrc/parser.l
View file @
42418fbb
This diff is collapsed.
Click to expand it.
tools/wrc/parser.y
View file @
42418fbb
This diff is collapsed.
Click to expand it.
tools/wrc/utils.c
View file @
42418fbb
...
...
@@ -68,21 +68,21 @@ static void generic_msg(const char *s, const char *t, const char *n, va_list ap)
}
int
yy
error
(
const
char
*
s
,
...)
int
parser_
error
(
const
char
*
s
,
...)
{
va_list
ap
;
va_start
(
ap
,
s
);
generic_msg
(
s
,
"Error"
,
yy
text
,
ap
);
generic_msg
(
s
,
"Error"
,
parser_
text
,
ap
);
va_end
(
ap
);
exit
(
1
);
return
1
;
}
int
yy
warning
(
const
char
*
s
,
...)
int
parser_
warning
(
const
char
*
s
,
...)
{
va_list
ap
;
va_start
(
ap
,
s
);
generic_msg
(
s
,
"Warning"
,
yy
text
,
ap
);
generic_msg
(
s
,
"Warning"
,
parser_
text
,
ap
);
va_end
(
ap
);
return
0
;
}
...
...
tools/wrc/utils.h
View file @
42418fbb
...
...
@@ -33,8 +33,8 @@ char *xstrdup(const char *str);
#define __attribute__(X)
#endif
int
yy
error
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
int
yy
warning
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
int
parser_
error
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
int
parser_
warning
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
void
internal_error
(
const
char
*
file
,
int
line
,
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
3
,
4
),
noreturn
));
void
error
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
void
warning
(
const
char
*
s
,
...)
__attribute__
((
format
(
printf
,
1
,
2
)));
...
...
tools/wrc/wrc.c
View file @
42418fbb
...
...
@@ -166,7 +166,7 @@ int char_number = 1; /* The current char pos within the line */
char
*
cmdline
;
/* The entire commandline */
time_t
now
;
/* The time of start of wrc */
int
yy
debug
,
yy_flex_debug
;
int
parser_
debug
,
yy_flex_debug
;
resource_t
*
resource_top
;
/* The top of the parsed resources */
...
...
@@ -424,7 +424,7 @@ int main(int argc,char *argv[])
setbuf
(
stderr
,
0
);
}
yy
debug
=
debuglevel
&
DEBUGLEVEL_TRACE
?
1
:
0
;
parser_
debug
=
debuglevel
&
DEBUGLEVEL_TRACE
?
1
:
0
;
yy_flex_debug
=
debuglevel
&
DEBUGLEVEL_TRACE
?
1
:
0
;
wpp_set_debug
(
(
debuglevel
&
DEBUGLEVEL_PPLEX
)
!=
0
,
...
...
@@ -486,12 +486,12 @@ int main(int argc,char *argv[])
/* Go from .rc to .res */
chat
(
"Starting parse"
);
if
(
!
(
yy
in
=
fopen
(
input_name
,
"rb"
)))
if
(
!
(
parser_
in
=
fopen
(
input_name
,
"rb"
)))
error
(
"Could not open %s for input
\n
"
,
input_name
);
ret
=
yy
parse
();
ret
=
parser_
parse
();
if
(
input_name
)
fclose
(
yy
in
);
if
(
input_name
)
fclose
(
parser_
in
);
if
(
ret
)
exit
(
1
);
/* Error during parse */
...
...
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