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
e7b12570
Commit
e7b12570
authored
Jan 05, 2009
by
Francois Gouget
Committed by
Alexandre Julliard
Jan 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Make WCMD_ask_confirm() static.
parent
b82caec7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
54 deletions
+54
-54
builtins.c
programs/cmd/builtins.c
+54
-53
wcmd.h
programs/cmd/wcmd.h
+0
-1
No files found.
programs/cmd/builtins.c
View file @
e7b12570
...
...
@@ -66,6 +66,60 @@ static const WCHAR parmY[] = {'/','Y','\0'};
static
const
WCHAR
parmNoY
[]
=
{
'/'
,
'-'
,
'Y'
,
'\0'
};
static
const
WCHAR
nullW
[]
=
{
'\0'
};
/**************************************************************************
* WCMD_ask_confirm
*
* Issue a message and ask 'Are you sure (Y/N)', waiting on a valid
* answer.
*
* Returns True if Y (or A) answer is selected
* If optionAll contains a pointer, ALL is allowed, and if answered
* set to TRUE
*
*/
static
BOOL
WCMD_ask_confirm
(
WCHAR
*
message
,
BOOL
showSureText
,
BOOL
*
optionAll
)
{
WCHAR
msgbuffer
[
MAXSTRING
];
WCHAR
Ybuffer
[
MAXSTRING
];
WCHAR
Nbuffer
[
MAXSTRING
];
WCHAR
Abuffer
[
MAXSTRING
];
WCHAR
answer
[
MAX_PATH
]
=
{
'\0'
};
DWORD
count
=
0
;
/* Load the translated 'Are you sure', plus valid answers */
LoadString
(
hinst
,
WCMD_CONFIRM
,
msgbuffer
,
sizeof
(
msgbuffer
)
/
sizeof
(
WCHAR
));
LoadString
(
hinst
,
WCMD_YES
,
Ybuffer
,
sizeof
(
Ybuffer
)
/
sizeof
(
WCHAR
));
LoadString
(
hinst
,
WCMD_NO
,
Nbuffer
,
sizeof
(
Nbuffer
)
/
sizeof
(
WCHAR
));
LoadString
(
hinst
,
WCMD_ALL
,
Abuffer
,
sizeof
(
Abuffer
)
/
sizeof
(
WCHAR
));
/* Loop waiting on a Y or N */
while
(
answer
[
0
]
!=
Ybuffer
[
0
]
&&
answer
[
0
]
!=
Nbuffer
[
0
])
{
static
const
WCHAR
startBkt
[]
=
{
' '
,
'('
,
'\0'
};
static
const
WCHAR
endBkt
[]
=
{
')'
,
'?'
,
'\0'
};
WCMD_output_asis
(
message
);
if
(
showSureText
)
{
WCMD_output_asis
(
msgbuffer
);
}
WCMD_output_asis
(
startBkt
);
WCMD_output_asis
(
Ybuffer
);
WCMD_output_asis
(
fslashW
);
WCMD_output_asis
(
Nbuffer
);
if
(
optionAll
)
{
WCMD_output_asis
(
fslashW
);
WCMD_output_asis
(
Abuffer
);
}
WCMD_output_asis
(
endBkt
);
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
answer
,
sizeof
(
answer
)
/
sizeof
(
WCHAR
),
&
count
,
NULL
);
answer
[
0
]
=
toupperW
(
answer
[
0
]);
}
/* Return the answer */
return
((
answer
[
0
]
==
Ybuffer
[
0
])
||
(
optionAll
&&
(
answer
[
0
]
==
Abuffer
[
0
])));
}
/****************************************************************************
* WCMD_clear_screen
*
...
...
@@ -2482,59 +2536,6 @@ void WCMD_exit (CMD_LIST **cmdList) {
}
}
/**************************************************************************
* WCMD_ask_confirm
*
* Issue a message and ask 'Are you sure (Y/N)', waiting on a valid
* answer.
*
* Returns True if Y (or A) answer is selected
* If optionAll contains a pointer, ALL is allowed, and if answered
* set to TRUE
*
*/
BOOL
WCMD_ask_confirm
(
WCHAR
*
message
,
BOOL
showSureText
,
BOOL
*
optionAll
)
{
WCHAR
msgbuffer
[
MAXSTRING
];
WCHAR
Ybuffer
[
MAXSTRING
];
WCHAR
Nbuffer
[
MAXSTRING
];
WCHAR
Abuffer
[
MAXSTRING
];
WCHAR
answer
[
MAX_PATH
]
=
{
'\0'
};
DWORD
count
=
0
;
/* Load the translated 'Are you sure', plus valid answers */
LoadString
(
hinst
,
WCMD_CONFIRM
,
msgbuffer
,
sizeof
(
msgbuffer
)
/
sizeof
(
WCHAR
));
LoadString
(
hinst
,
WCMD_YES
,
Ybuffer
,
sizeof
(
Ybuffer
)
/
sizeof
(
WCHAR
));
LoadString
(
hinst
,
WCMD_NO
,
Nbuffer
,
sizeof
(
Nbuffer
)
/
sizeof
(
WCHAR
));
LoadString
(
hinst
,
WCMD_ALL
,
Abuffer
,
sizeof
(
Abuffer
)
/
sizeof
(
WCHAR
));
/* Loop waiting on a Y or N */
while
(
answer
[
0
]
!=
Ybuffer
[
0
]
&&
answer
[
0
]
!=
Nbuffer
[
0
])
{
static
const
WCHAR
startBkt
[]
=
{
' '
,
'('
,
'\0'
};
static
const
WCHAR
endBkt
[]
=
{
')'
,
'?'
,
'\0'
};
WCMD_output_asis
(
message
);
if
(
showSureText
)
{
WCMD_output_asis
(
msgbuffer
);
}
WCMD_output_asis
(
startBkt
);
WCMD_output_asis
(
Ybuffer
);
WCMD_output_asis
(
fslashW
);
WCMD_output_asis
(
Nbuffer
);
if
(
optionAll
)
{
WCMD_output_asis
(
fslashW
);
WCMD_output_asis
(
Abuffer
);
}
WCMD_output_asis
(
endBkt
);
WCMD_ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
answer
,
sizeof
(
answer
)
/
sizeof
(
WCHAR
),
&
count
,
NULL
);
answer
[
0
]
=
toupperW
(
answer
[
0
]);
}
/* Return the answer */
return
((
answer
[
0
]
==
Ybuffer
[
0
])
||
(
optionAll
&&
(
answer
[
0
]
==
Abuffer
[
0
])));
}
/*****************************************************************************
* WCMD_assoc
...
...
programs/cmd/wcmd.h
View file @
e7b12570
...
...
@@ -101,7 +101,6 @@ WCHAR *WCMD_strtrim_leading_spaces (WCHAR *string);
void
WCMD_strtrim_trailing_spaces
(
WCHAR
*
string
);
void
WCMD_opt_s_strip_quotes
(
WCHAR
*
cmd
);
void
WCMD_HandleTildaModifiers
(
WCHAR
**
start
,
WCHAR
*
forVariable
,
WCHAR
*
forValue
,
BOOL
justFors
);
BOOL
WCMD_ask_confirm
(
WCHAR
*
message
,
BOOL
showSureText
,
BOOL
*
optionAll
);
void
WCMD_splitpath
(
const
WCHAR
*
path
,
WCHAR
*
drv
,
WCHAR
*
dir
,
WCHAR
*
name
,
WCHAR
*
ext
);
WCHAR
*
WCMD_LoadMessage
(
UINT
id
);
...
...
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