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
e6398a55
Commit
e6398a55
authored
May 16, 2012
by
Huw Davies
Committed by
Alexandre Julliard
May 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wineps: Add a helper to perform duplex lookup by name.
parent
cd770d90
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
19 deletions
+25
-19
ppd.c
dlls/wineps.drv/ppd.c
+25
-19
No files found.
dlls/wineps.drv/ppd.c
View file @
e6398a55
...
...
@@ -481,6 +481,19 @@ static PAGESIZE *get_pagesize( PPD *ppd, char *name, BOOL create )
return
page
;
}
static
DUPLEX
*
get_duplex
(
PPD
*
ppd
,
const
char
*
name
)
{
DUPLEX
*
duplex
;
LIST_FOR_EACH_ENTRY
(
duplex
,
&
ppd
->
Duplexes
,
DUPLEX
,
entry
)
{
if
(
!
strcmp
(
duplex
->
Name
,
name
))
return
duplex
;
}
return
NULL
;
}
/**********************************************************************
*
* PSDRV_PPDGetWord
...
...
@@ -896,13 +909,13 @@ PPD *PSDRV_ParsePPD(char *fname)
list_add_tail
(
&
ppd
->
Duplexes
,
&
duplex
->
entry
);
}
else
if
(
!
strcmp
(
"*DefaultDuplex"
,
tuple
.
key
))
{
if
(
default_duplex
)
{
WARN
(
"Already set default duplex
\n
"
);
}
else
{
else
if
(
!
strcmp
(
"*DefaultDuplex"
,
tuple
.
key
))
{
if
(
!
default_duplex
)
{
default_duplex
=
tuple
.
value
;
tuple
.
value
=
NULL
;
}
}
}
HeapFree
(
PSDRV_Heap
,
0
,
tuple
.
key
);
...
...
@@ -946,24 +959,17 @@ PPD *PSDRV_ParsePPD(char *fname)
ppd
->
DefaultDuplex
=
NULL
;
if
(
default_duplex
)
{
DUPLEX
*
duplex
;
LIST_FOR_EACH_ENTRY
(
duplex
,
&
ppd
->
Duplexes
,
DUPLEX
,
entry
)
{
if
(
!
strcmp
(
duplex
->
Name
,
default_duplex
))
{
ppd
->
DefaultDuplex
=
duplex
;
TRACE
(
"DefaultDuplex: %s
\n
"
,
duplex
->
Name
);
break
;
}
}
HeapFree
(
PSDRV_Heap
,
0
,
default_duplex
);
}
ppd
->
DefaultDuplex
=
get_duplex
(
ppd
,
default_duplex
);
if
(
!
ppd
->
DefaultDuplex
)
{
ppd
->
DefaultDuplex
=
LIST_ENTRY
(
list_head
(
&
ppd
->
Duplexes
),
DUPLEX
,
entry
);
struct
list
*
head
=
list_head
(
&
ppd
->
Duplexes
);
if
(
head
)
ppd
->
DefaultDuplex
=
LIST_ENTRY
(
head
,
DUPLEX
,
entry
);
TRACE
(
"Setting DefaultDuplex to first in list
\n
"
);
}
TRACE
(
"DefaultDuplex: %s
\n
"
,
ppd
->
DefaultDuplex
?
ppd
->
DefaultDuplex
->
Name
:
"<not set>"
);
HeapFree
(
PSDRV_Heap
,
0
,
default_duplex
);
{
...
...
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