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
6a927ef7
Commit
6a927ef7
authored
Jun 03, 2016
by
Hugh McMaster
Committed by
Alexandre Julliard
Jun 03, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reg: Parse the registry operation using an enum.
Signed-off-by:
Hugh McMaster
<
hugh.mcmaster@outlook.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
6ce85242
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
8 deletions
+31
-8
reg.c
programs/reg/reg.c
+31
-8
No files found.
programs/reg/reg.c
View file @
6a927ef7
...
...
@@ -888,13 +888,34 @@ static BOOL is_help_switch(const WCHAR *s)
return
FALSE
;
}
int
wmain
(
int
argc
,
WCHAR
*
argvW
[])
enum
operations
{
REG_ADD
,
REG_DELETE
,
REG_QUERY
,
REG_INVALID
};
static
const
WCHAR
addW
[]
=
{
'a'
,
'd'
,
'd'
,
0
};
static
const
WCHAR
deleteW
[]
=
{
'd'
,
'e'
,
'l'
,
'e'
,
't'
,
'e'
,
0
};
static
const
WCHAR
queryW
[]
=
{
'q'
,
'u'
,
'e'
,
'r'
,
'y'
,
0
};
static
enum
operations
get_operation
(
const
WCHAR
*
str
)
{
int
i
;
if
(
!
lstrcmpiW
(
str
,
addW
))
return
REG_ADD
;
if
(
!
lstrcmpiW
(
str
,
deleteW
))
return
REG_DELETE
;
static
const
WCHAR
addW
[]
=
{
'a'
,
'd'
,
'd'
,
0
};
static
const
WCHAR
deleteW
[]
=
{
'd'
,
'e'
,
'l'
,
'e'
,
't'
,
'e'
,
0
};
static
const
WCHAR
queryW
[]
=
{
'q'
,
'u'
,
'e'
,
'r'
,
'y'
,
0
};
if
(
!
lstrcmpiW
(
str
,
queryW
))
return
REG_QUERY
;
return
REG_INVALID
;
}
int
wmain
(
int
argc
,
WCHAR
*
argvW
[])
{
int
i
,
op
;
static
const
WCHAR
slashDW
[]
=
{
'/'
,
'd'
,
0
};
static
const
WCHAR
slashFW
[]
=
{
'/'
,
'f'
,
0
};
static
const
WCHAR
slashSW
[]
=
{
'/'
,
's'
,
0
};
...
...
@@ -916,7 +937,9 @@ int wmain(int argc, WCHAR *argvW[])
return
0
;
}
if
(
!
lstrcmpiW
(
argvW
[
1
],
addW
))
op
=
get_operation
(
argvW
[
1
]);
if
(
op
==
REG_ADD
)
{
WCHAR
*
key_name
,
*
value_name
=
NULL
,
*
type
=
NULL
,
separator
=
'\0'
,
*
data
=
NULL
;
BOOL
value_empty
=
FALSE
,
force
=
FALSE
;
...
...
@@ -973,7 +996,7 @@ int wmain(int argc, WCHAR *argvW[])
return
reg_add
(
key_name
,
value_name
,
value_empty
,
type
,
separator
,
data
,
force
);
}
else
if
(
!
lstrcmpiW
(
argvW
[
1
],
deleteW
)
)
else
if
(
op
==
REG_DELETE
)
{
WCHAR
*
key_name
,
*
value_name
=
NULL
;
BOOL
value_empty
=
FALSE
,
value_all
=
FALSE
,
force
=
FALSE
;
...
...
@@ -1010,7 +1033,7 @@ int wmain(int argc, WCHAR *argvW[])
}
return
reg_delete
(
key_name
,
value_name
,
value_empty
,
value_all
,
force
);
}
else
if
(
!
lstrcmpiW
(
argvW
[
1
],
queryW
)
)
else
if
(
op
==
REG_QUERY
)
{
WCHAR
*
key_name
,
*
value_name
=
NULL
;
BOOL
value_empty
=
FALSE
,
recurse
=
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