Whamcloud - gitweb
e2fsck: map PROMPT_* values to prompt messages
authorAndreas Dilger <adilger@dilger.ca>
Wed, 8 Dec 2021 07:51:12 +0000 (00:51 -0700)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 3 May 2022 00:39:37 +0000 (20:39 -0400)
It isn't totally clear when searching the code for PROMPT_*
constants from problem codes where these messages come from.
Similarly, there isn't a direct mapping from the prompt string
to the constant.

Add comments that make this mapping more clear.

Signed-off-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/problem.c

index 757b5d5..2d02468 100644 (file)
  * to fix a problem.
  */
 static const char *prompt[] = {
-       N_("(no prompt)"),      /* 0 */
-       N_("Fix"),              /* 1 */
-       N_("Clear"),            /* 2 */
-       N_("Relocate"),         /* 3 */
-       N_("Allocate"),         /* 4 */
-       N_("Expand"),           /* 5 */
-       N_("Connect to /lost+found"), /* 6 */
-       N_("Create"),           /* 7 */
-       N_("Salvage"),          /* 8 */
-       N_("Truncate"),         /* 9 */
-       N_("Clear inode"),      /* 10 */
-       N_("Abort"),            /* 11 */
-       N_("Split"),            /* 12 */
-       N_("Continue"),         /* 13 */
-       N_("Clone multiply-claimed blocks"), /* 14 */
-       N_("Delete file"),      /* 15 */
-       N_("Suppress messages"),/* 16 */
-       N_("Unlink"),           /* 17 */
-       N_("Clear HTree index"),/* 18 */
-       N_("Recreate"),         /* 19 */
-       N_("Optimize"),         /* 20 */
-       N_("Clear flag"),       /* 21 */
-       "",                     /* 22 */
+       N_("(no prompt)"),                      /* PROMPT_NONE          =  0 */
+       N_("Fix"),                              /* PROMPT_FIX           =  1 */
+       N_("Clear"),                            /* PROMPT_CLEAR         =  2 */
+       N_("Relocate"),                         /* PROMPT_RELOCATE      =  3 */
+       N_("Allocate"),                         /* PROMPT_CREATE        =  4 */
+       N_("Expand"),                           /* PROMPT_EXPAND        =  5 */
+       N_("Connect to /lost+found"),           /* PROMPT_CONNECT       =  6 */
+       N_("Create"),                           /* PROMPT_CREATE        =  7 */
+       N_("Salvage"),                          /* PROMPT_SALVAGE       =  8 */
+       N_("Truncate"),                         /* PROMPT_TRUNCATE      =  9 */
+       N_("Clear inode"),                      /* PROMPT_CLEAR_INODE   = 10 */
+       N_("Abort"),                            /* PROMPT_ABORT         = 11 */
+       N_("Split"),                            /* PROMPT_SPLIT         = 12 */
+       N_("Continue"),                         /* PROMPT_CONTINUE      = 13 */
+       N_("Clone multiply-claimed blocks"),    /* PROMPT_CLONE         = 14 */
+       N_("Delete file"),                      /* PROMPT_DELETE        = 15 */
+       N_("Suppress messages"),                /* PROMPT_SUPPRESS      = 16 */
+       N_("Unlink"),                           /* PROMPT_UNLINK        = 17 */
+       N_("Clear HTree index"),                /* PROMPT_CLEAR_HTREE   = 18 */
+       N_("Recreate"),                         /* PROMPT_RECREATE      = 19 */
+       N_("Optimize"),                         /* PROMPT_OPTIMIZE      = 20 */
+       N_("Clear flag"),                       /* PROMPT_CLEAR_FLAG    = 21 */
+       "",                                     /* PROMPT_NULL          = 22 */
 };
 
 /*