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
f32511cf
Commit
f32511cf
authored
Oct 16, 2008
by
Christian Costa
Committed by
Alexandre Julliard
Oct 17, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dxof: Add support for string parsing.
parent
94ae7ab4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
68 additions
and
0 deletions
+68
-0
d3dxof.c
dlls/d3dxof/d3dxof.c
+68
-0
No files found.
dlls/d3dxof/d3dxof.c
View file @
f32511cf
...
@@ -639,6 +639,43 @@ static BOOL is_integer(parse_buffer* buf)
...
@@ -639,6 +639,43 @@ static BOOL is_integer(parse_buffer* buf)
return
TRUE
;
return
TRUE
;
}
}
static
BOOL
is_string
(
parse_buffer
*
buf
)
{
char
tmp
[
32
];
DWORD
pos
=
1
;
char
c
;
BOOL
ok
=
0
;
if
(
*
buf
->
buffer
!=
'"'
)
return
FALSE
;
tmp
[
0
]
=
'"'
;
while
(
!
is_separator
(
c
=
*
(
buf
->
buffer
+
pos
))
&&
(
pos
<
32
))
{
tmp
[
pos
++
]
=
c
;
if
(
c
==
'"'
)
{
ok
=
1
;
break
;
}
}
tmp
[
pos
]
=
0
;
if
(
!
ok
)
{
TRACE
(
"Wrong string %s
\n
"
,
tmp
);
return
FALSE
;
}
buf
->
buffer
+=
pos
;
buf
->
rem_bytes
-=
pos
;
TRACE
(
"Found string %s
\n
"
,
tmp
);
strcpy
((
char
*
)
buf
->
value
,
tmp
);
return
TRUE
;
}
static
WORD
parse_TOKEN
(
parse_buffer
*
buf
)
static
WORD
parse_TOKEN
(
parse_buffer
*
buf
)
{
{
WORD
token
;
WORD
token
;
...
@@ -704,6 +741,11 @@ static WORD parse_TOKEN(parse_buffer * buf)
...
@@ -704,6 +741,11 @@ static WORD parse_TOKEN(parse_buffer * buf)
token
=
TOKEN_FLOAT
;
token
=
TOKEN_FLOAT
;
break
;
break
;
}
}
if
(
is_string
(
buf
))
{
token
=
TOKEN_LPSTR
;
break
;
}
if
(
is_name
(
buf
))
if
(
is_name
(
buf
))
{
{
token
=
TOKEN_NAME
;
token
=
TOKEN_NAME
;
...
@@ -1811,8 +1853,34 @@ static BOOL parse_object_members_list(parse_buffer * buf)
...
@@ -1811,8 +1853,34 @@ static BOOL parse_object_members_list(parse_buffer * buf)
return
FALSE
;
return
FALSE
;
}
}
}
}
else
if
(
token
==
TOKEN_LPSTR
)
{
static
char
fake_string
[]
=
"Fake string"
;
get_TOKEN
(
buf
);
TRACE
(
"%s = %s
\n
"
,
pt
->
members
[
i
].
name
,
(
char
*
)
buf
->
value
);
/* Assume larger size */
if
((
buf
->
cur_pdata
-
buf
->
pxo
->
pdata
+
4
)
>
MAX_DATA_SIZE
)
{
WARN
(
"Buffer too small
\n
"
);
return
FALSE
;
}
if
(
pt
->
members
[
i
].
type
==
TOKEN_LPSTR
)
{
/* Use a fake string for now */
*
(((
LPCSTR
*
)(
buf
->
cur_pdata
)))
=
fake_string
;
buf
->
cur_pdata
+=
4
;
}
else
{
FIXME
(
"Token %d not supported
\n
"
,
pt
->
members
[
i
].
type
);
return
FALSE
;
}
}
else
else
{
FIXME
(
"Unexpected token %d
\n
"
,
token
);
return
FALSE
;
return
FALSE
;
}
}
}
}
}
...
...
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