]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2006-05-29 Vesa Jaaskelainen <chaac@nic.fi>
authorchaac <chaac@localhost>
Sun, 28 May 2006 21:58:35 +0000 (21:58 +0000)
committerchaac <chaac@localhost>
Sun, 28 May 2006 21:58:35 +0000 (21:58 +0000)
        * include/grub/script.h (grub_script_cmdif): Renamed field 'bool' to
        'exec_to_evaluate'.  Renamed field 'true' to 'exec_on_true'.  Renamed
        field 'false' to 'exec_on_false'.
        (grub_script_create_cmdif): Renamed argument names to reflect above
        changes.

        * normal/execute.c (grub_script_execute_cmdif): Likewise.

        * normal/script.c (grub_script_create_cmdif): Likewise.

ChangeLog
include/grub/script.h
normal/execute.c
normal/script.c

index d8e56e540656137825ec1654369c3de4915a62b3..f6c20402bfba78772b22edbd55ee3a862bd9b49b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-05-29  Vesa Jaaskelainen  <chaac@nic.fi>
+
+       * include/grub/script.h (grub_script_cmdif): Renamed field 'bool' to
+       'exec_to_evaluate'.  Renamed field 'true' to 'exec_on_true'.  Renamed
+       field 'false' to 'exec_on_false'.
+       (grub_script_create_cmdif): Renamed argument names to reflect above
+       changes.
+
+       * normal/execute.c (grub_script_execute_cmdif): Likewise.
+
+       * normal/script.c (grub_script_create_cmdif): Likewise.
+
 2006-05-28  Yoshinori K. Okuji  <okuji@enbug.org>
 
        * fs/hfsplus.c (grub_hfsplus_btree_recoffset): Moved to near the
index 661d0ee33555e4d11e7b020c8a43bec4ef62899d..f00fdcd3d2c82d03d939f0a5874f1fa762ed6782 100644 (file)
@@ -100,14 +100,14 @@ struct grub_script_cmdif
 {
   struct grub_script_cmd cmd;
 
-  /* The command used to check if the if is true or false.  */
-  struct grub_script_cmd *bool;
+  /* The command used to check if the 'if' is true or false.  */
+  struct grub_script_cmd *exec_to_evaluate;
 
-  /* The code executed in case the result if bool was true.  */
-  struct grub_script_cmd *true;
+  /* The code executed in case the result of 'if' was true.  */
+  struct grub_script_cmd *exec_on_true;
 
-  /* The code executed in case the result if bool was false.  */
-  struct grub_script_cmd *false;
+  /* The code executed in case the result of 'if' was false.  */
+  struct grub_script_cmd *exec_on_false;
 };
 
 /* A menu entry generate statement.  */
@@ -200,9 +200,9 @@ grub_script_create_cmdblock (struct grub_parser_param *state);
 
 struct grub_script_cmd *
 grub_script_create_cmdif (struct grub_parser_param *state,
-                         struct grub_script_cmd *bool,
-                         struct grub_script_cmd *true,
-                         struct grub_script_cmd *false);
+                         struct grub_script_cmd *exec_to_evaluate,
+                         struct grub_script_cmd *exec_on_true,
+                         struct grub_script_cmd *exec_on_false);
 
 struct grub_script_cmd *
 grub_script_create_cmdmenu (struct grub_parser_param *state,
index 9f28bd3a69a4742d11f21bceced9b014ded8be0c..bcb8a214bd09e8b6620dae3290c7314940bed2f6 100644 (file)
@@ -192,19 +192,19 @@ grub_err_t
 grub_script_execute_cmdif (struct grub_script_cmd *cmd)
 {
   struct grub_script_cmdif *cmdif = (struct grub_script_cmdif *) cmd;
-  char *bool;
+  char *result;
 
   /* Check if the commands results in a true or a false.  The value is
-     read from the env variable `RESULT'.  */
-  grub_script_execute_cmd (cmdif->bool);
-  bool = grub_env_get ("?");
+     read from the env variable `?'.  */
+  grub_script_execute_cmd (cmdif->exec_to_evaluate);
+  result = grub_env_get ("?");
 
   /* Execute the `if' or the `else' part depending on the value of
-     `RESULT'.  */
-  if (bool && ! grub_strcmp (bool, "0"))
-    return grub_script_execute_cmd (cmdif->true);
+     `?'.  */
+  if (result && ! grub_strcmp (result, "0"))
+    return grub_script_execute_cmd (cmdif->exec_on_true);
   else
-    return grub_script_execute_cmd (cmdif->false);
+    return grub_script_execute_cmd (cmdif->exec_on_false);
 }
 
 /* Execute the menu entry generate statement.  */
index e4ce01dc88808b6cf0f0530757a49ab7f3db815a..033ab976bdb26e192d3d9e02b08c01b371b7a2dd 100644 (file)
@@ -178,14 +178,14 @@ grub_script_create_cmdline (struct grub_parser_param *state,
 }
 
 /* Create a command that functions as an if statement.  If BOOL is
-   evaluated to true (the value is returned in envvar RESULT), the
+   evaluated to true (the value is returned in envvar '?'), the
    interpreter will run the command TRUE, otherwise the interpreter
    runs the command FALSE.  */
 struct grub_script_cmd *
 grub_script_create_cmdif (struct grub_parser_param *state,
-                         struct grub_script_cmd *bool,
-                         struct grub_script_cmd *true,
-                         struct grub_script_cmd *false)
+                         struct grub_script_cmd *exec_to_evaluate,
+                         struct grub_script_cmd *exec_on_true,
+                         struct grub_script_cmd *exec_on_false)
 {
   struct grub_script_cmdif *cmd;
 
@@ -194,9 +194,9 @@ grub_script_create_cmdif (struct grub_parser_param *state,
   cmd = grub_script_malloc (state, sizeof (*cmd));
   cmd->cmd.exec = grub_script_execute_cmdif;
   cmd->cmd.next = 0;
-  cmd->bool = bool;
-  cmd->true = true;
-  cmd->false = false;
+  cmd->exec_to_evaluate = exec_to_evaluate;
+  cmd->exec_on_true = exec_on_true;
+  cmd->exec_on_false = exec_on_false;
 
   return (struct grub_script_cmd *) cmd;
 }