[2235] 2009-05-23 Colin D Bennett <[email protected]>

Colin Bennett <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2235
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2235
Author:   cbennett
Date:     2009-05-24 08:39:29 +0000 (Sun, 24 May 2009)
Log Message:
-----------
2009-05-23  Colin D Bennett  <[email protected]>

	Cleaned up `include/grub/normal.h'.  Grouped prototypes by
	definition file, and functions defined in `normal/menu.c' have had
	their prototypes moved to `include/grub/menu.h' for consistency.

	* include/grub/menu.h (grub_menu_execute_callback): Added; moved
	from normal.h.
	(grub_menu_get_entry): Likewise.
	(grub_menu_get_timeout): Likewise.
	(grub_menu_set_timeout): Likewise.
	(grub_menu_execute_entry): Likewise.
	(grub_menu_execute_with_fallback): Likewise.
	(grub_menu_entry_run): Likewise.

	* include/grub/normal.h: Re-ordered and grouped function
	prototypes by file that the function is defined in.
	(grub_menu_execute_callback): Removed; moved to menu.h.
	(grub_menu_get_entry): Likewise.
	(grub_menu_get_timeout): Likewise.
	(grub_menu_set_timeout): Likewise.
	(grub_menu_execute_entry): Likewise.
	(grub_menu_execute_with_fallback): Likewise.
	(grub_menu_entry_run): Likewise.
	(grub_menu_addentry): Renamed from this ...
	(grub_normal_add_menu_entry): ... to this.

	* normal/main.c (grub_menu_addentry): Renamed from this ...
	(grub_normal_add_menu_entry): ... to this.

	* script/sh/execute.c (grub_script_execute_menuentry): Update
	reference to renamed grub_menu_addentry function.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/include/grub/menu.h
    trunk/grub2/include/grub/normal.h
    trunk/grub2/normal/main.c
    trunk/grub2/script/sh/execute.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-05-23 20:51:09 UTC (rev 2234)
+++ trunk/grub2/ChangeLog	2009-05-24 08:39:29 UTC (rev 2235)
@@ -1,3 +1,36 @@
+2009-05-23  Colin D Bennett  <[email protected]>
+
+	Cleaned up `include/grub/normal.h'.  Grouped prototypes by
+	definition file, and functions defined in `normal/menu.c' have had
+	their prototypes moved to `include/grub/menu.h' for consistency.
+
+	* include/grub/menu.h (grub_menu_execute_callback): Added; moved
+	from normal.h.
+	(grub_menu_get_entry): Likewise.
+	(grub_menu_get_timeout): Likewise.
+	(grub_menu_set_timeout): Likewise.
+	(grub_menu_execute_entry): Likewise.
+	(grub_menu_execute_with_fallback): Likewise.
+	(grub_menu_entry_run): Likewise.
+
+	* include/grub/normal.h: Re-ordered and grouped function
+	prototypes by file that the function is defined in.
+	(grub_menu_execute_callback): Removed; moved to menu.h.
+	(grub_menu_get_entry): Likewise.
+	(grub_menu_get_timeout): Likewise.
+	(grub_menu_set_timeout): Likewise.
+	(grub_menu_execute_entry): Likewise.
+	(grub_menu_execute_with_fallback): Likewise.
+	(grub_menu_entry_run): Likewise.
+	(grub_menu_addentry): Renamed from this ...
+	(grub_normal_add_menu_entry): ... to this.
+
+	* normal/main.c (grub_menu_addentry): Renamed from this ...
+	(grub_normal_add_menu_entry): ... to this.
+
+	* script/sh/execute.c (grub_script_execute_menuentry): Update
+	reference to renamed grub_menu_addentry function.
+
 2009-05-23  Felix Zielcke  <[email protected]>
 
 	* commands/i386/pc/drivemap.c (MODNAME): Remove. Update all users.

Modified: trunk/grub2/include/grub/menu.h
===================================================================
--- trunk/grub2/include/grub/menu.h	2009-05-23 20:51:09 UTC (rev 2234)
+++ trunk/grub2/include/grub/menu.h	2009-05-24 08:39:29 UTC (rev 2235)
@@ -1,4 +1,4 @@
-/* menu.h - Menu and menu entry model declarations. */
+/* menu.h - Menu model function prototypes and data structures. */
 /*
  *  GRUB  --  GRand Unified Bootloader
  *  Copyright (C) 2009  Free Software Foundation, Inc.
@@ -57,4 +57,35 @@
 };
 typedef struct grub_menu *grub_menu_t;
 
+/* Callback structure menu viewers can use to provide user feedback when
+   default entries are executed, possibly including fallback entries.  */
+typedef struct grub_menu_execute_callback
+{
+  /* Called immediately before ENTRY is booted.  */
+  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);
+
+  /* Called when executing one entry has failed, and another entry, ENTRY, will
+     be executed as a fallback.  The implementation of this function should
+     delay for a period of at least 2 seconds before returning in order to
+     allow the user time to read the information before it can be lost by
+     executing ENTRY.  */
+  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);
+
+  /* Called when an entry has failed to execute and there is no remaining
+     fallback entry to attempt.  */
+  void (*notify_failure) (void *userdata);
+}
+*grub_menu_execute_callback_t;
+
+
+grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
+int grub_menu_get_timeout (void);
+void grub_menu_set_timeout (int timeout);
+void grub_menu_execute_entry (grub_menu_entry_t entry);
+void grub_menu_execute_with_fallback (grub_menu_t menu,
+				      grub_menu_entry_t entry,
+				      grub_menu_execute_callback_t callback,
+				      void *callback_data);
+void grub_menu_entry_run (grub_menu_entry_t entry);
+
 #endif /* GRUB_MENU_HEADER */

Modified: trunk/grub2/include/grub/normal.h
===================================================================
--- trunk/grub2/include/grub/normal.h	2009-05-23 20:51:09 UTC (rev 2234)
+++ trunk/grub2/include/grub/normal.h	2009-05-24 08:39:29 UTC (rev 2235)
@@ -43,59 +43,48 @@
 
 extern struct grub_menu_viewer grub_normal_text_menu_viewer;
 
-/* Callback structure menu viewers can use to provide user feedback when
-   default entries are executed, possibly including fallback entries.  */
-typedef struct grub_menu_execute_callback
-{
-  /* Called immediately before ENTRY is booted.  */
-  void (*notify_booting) (grub_menu_entry_t entry, void *userdata);
 
-  /* Called when executing one entry has failed, and another entry, ENTRY, will
-     be executed as a fallback.  The implementation of this function should
-     delay for a period of at least 2 seconds before returning in order to
-     allow the user time to read the information before it can be lost by
-     executing ENTRY.  */
-  void (*notify_fallback) (grub_menu_entry_t entry, void *userdata);
-
-  /* Called when an entry has failed to execute and there is no remaining
-     fallback entry to attempt.  */
-  void (*notify_failure) (void *userdata);
-}
-*grub_menu_execute_callback_t;
-
+/* Defined in `main.c'.  */
 void grub_enter_normal_mode (const char *config);
 void grub_normal_execute (const char *config, int nested, int batch);
-void grub_menu_execute_with_fallback (grub_menu_t menu,
-				      grub_menu_entry_t entry,
-				      grub_menu_execute_callback_t callback,
-				      void *callback_data);
-void grub_menu_entry_run (grub_menu_entry_t entry);
-void grub_menu_execute_entry(grub_menu_entry_t entry);
-grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no);
-int grub_menu_get_timeout (void);
-void grub_menu_set_timeout (int timeout);
+void grub_normal_init_page (void);
+void grub_menu_init_page (int nested, int edit);
+grub_err_t grub_normal_add_menu_entry (int argc, const char **args,
+				       const char *sourcecode);
+char *grub_file_getline (grub_file_t file);
+void grub_cmdline_run (int nested);
+
+/* Defined in `cmdline.c'.  */
 int grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len,
 		      int echo_char, int readline);
 grub_err_t grub_set_history (int newsize);
-void grub_normal_init_page (void);
-void grub_menu_init_page (int nested, int edit);
+
+/* Defined in `completion.c'.  */
 char *grub_normal_do_completion (char *buf, int *restore,
 				 void (*hook) (const char *item, grub_completion_type_t type, int count));
+
+/* Defined in `misc.c'.  */
 grub_err_t grub_normal_print_device_info (const char *name);
+
+/* Defined in `color.c'.  */
 char *grub_env_write_color_normal (struct grub_env_var *var, const char *val);
 char *grub_env_write_color_highlight (struct grub_env_var *var, const char *val);
 void grub_parse_color_name_pair (grub_uint8_t *ret, const char *name);
+
+/* Defined in `menu_text.c'.  */
 void grub_wait_after_message (void);
 
-char *grub_file_getline (grub_file_t file);
+/* Defined in `handler.c'.  */
 void read_handler_list (void);
 void free_handler_list (void);
+
+/* Defined in `dyncmd.c'.  */
 void read_command_list (void);
+
+/* Defined in `autofs.c'.  */
 void read_fs_list (void);
-void grub_cmdline_run (int nested);
-grub_err_t grub_menu_addentry (int argc, const char **args,
-			       const char *sourcecode);
 
+
 #ifdef GRUB_UTIL
 void grub_normal_init (void);
 void grub_normal_fini (void);

Modified: trunk/grub2/normal/main.c
===================================================================
--- trunk/grub2/normal/main.c	2009-05-23 20:51:09 UTC (rev 2234)
+++ trunk/grub2/normal/main.c	2009-05-24 08:39:29 UTC (rev 2235)
@@ -149,9 +149,12 @@
     }
 }
 
+/* Add a menu entry to the current menu context (as given by the environment
+   variable data slot `menu').  As the configuration file is read, the script
+   parser calls this when a menu entry is to be created.  */
 grub_err_t
-grub_menu_addentry (int argc, const char **args,
-		    const char *sourcecode)
+grub_normal_add_menu_entry (int argc, const char **args,
+			    const char *sourcecode)
 {
   const char *menutitle = 0;
   const char *menusourcecode;

Modified: trunk/grub2/script/sh/execute.c
===================================================================
--- trunk/grub2/script/sh/execute.c	2009-05-23 20:51:09 UTC (rev 2234)
+++ trunk/grub2/script/sh/execute.c	2009-05-24 08:39:29 UTC (rev 2235)
@@ -222,8 +222,8 @@
 	}
     }
 
-  grub_menu_addentry (argcount, (const char **) args,
-		      cmd_menuentry->sourcecode);
+  grub_normal_add_menu_entry (argcount, (const char **) args,
+			      cmd_menuentry->sourcecode);
 
   /* Free arguments.  */
   for (i = 0; i < argcount; i++)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.