=?UTF-8?Q?Fr=C3=A9d=C3=A9ric=20Delanoy=20?=: cmd: Improve WCMD_volume documentation.

Alexandre Julliard julliard at winehq.org
Fri Sep 23 10:56:51 CDT 2011


Module: wine
Branch: master
Commit: a536004f34cdb4ce7b1b6afbdc4b635f3289f4b2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a536004f34cdb4ce7b1b6afbdc4b635f3289f4b2

Author: Frédéric Delanoy <frederic.delanoy at gmail.com>
Date:   Wed Sep 21 21:17:18 2011 +0200

cmd: Improve WCMD_volume documentation.

---

 programs/cmd/builtins.c |   10 ++++++----
 programs/cmd/wcmd.h     |    2 +-
 programs/cmd/wcmdmain.c |    4 ++--
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
index 99a2314..d8c69ba 100644
--- a/programs/cmd/builtins.c
+++ b/programs/cmd/builtins.c
@@ -2644,11 +2644,13 @@ void WCMD_version (void) {
 /****************************************************************************
  * WCMD_volume
  *
- * Display volume info and/or set volume label. Returns 0 if error.
+ * Display volume information (set_label = FALSE)
+ * Additionally set volume label (set_label = TRUE)
+ * Returns 1 on success, 0 otherwise
  */
 
-int WCMD_volume (int mode, const WCHAR *path) {
-
+int WCMD_volume(BOOL set_label, const WCHAR *path)
+{
   DWORD count, serial;
   WCHAR string[MAX_PATH], label[MAX_PATH], curdir[MAX_PATH];
   BOOL status;
@@ -2679,7 +2681,7 @@ int WCMD_volume (int mode, const WCHAR *path) {
   }
   WCMD_output (WCMD_LoadMessage(WCMD_VOLUMEDETAIL),
     	curdir[0], label, HIWORD(serial), LOWORD(serial));
-  if (mode) {
+  if (set_label) {
     WCMD_output (WCMD_LoadMessage(WCMD_VOLUMEPROMPT));
     WCMD_ReadFile (GetStdHandle(STD_INPUT_HANDLE), string,
                    sizeof(string)/sizeof(WCHAR), &count, NULL);
diff --git a/programs/cmd/wcmd.h b/programs/cmd/wcmd.h
index b7bc175..940cb6e 100644
--- a/programs/cmd/wcmd.h
+++ b/programs/cmd/wcmd.h
@@ -94,7 +94,7 @@ void WCMD_title (const WCHAR *);
 void WCMD_type (WCHAR *);
 void WCMD_verify (const WCHAR *command);
 void WCMD_version (void);
-int  WCMD_volume (int mode, const WCHAR *command);
+int  WCMD_volume (BOOL set_label, const WCHAR *command);
 
 WCHAR *WCMD_fgets (WCHAR *s, int n, HANDLE stream);
 WCHAR *WCMD_parameter (WCHAR *s, int n, WCHAR **where, WCHAR **end);
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
index 92b76fc..26f377a 100644
--- a/programs/cmd/wcmdmain.c
+++ b/programs/cmd/wcmdmain.c
@@ -1502,7 +1502,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
 	WCMD_if (p, cmdList);
         break;
       case WCMD_LABEL:
-        WCMD_volume (1, p);
+        WCMD_volume (TRUE, p);
         break;
       case WCMD_MD:
       case WCMD_MKDIR:
@@ -1560,7 +1560,7 @@ void WCMD_execute (const WCHAR *command, const WCHAR *redirects,
         WCMD_verify (p);
         break;
       case WCMD_VOL:
-        WCMD_volume (0, p);
+        WCMD_volume (FALSE, p);
         break;
       case WCMD_PUSHD:
         WCMD_pushd(p);




More information about the wine-cvs mailing list