merge with mainline
authorBVK Chaitanya <bvk.groups@gmail.com>
Sun, 18 Jul 2010 16:33:28 +0000 (22:03 +0530)
committerBVK Chaitanya <bvk.groups@gmail.com>
Sun, 18 Jul 2010 16:33:28 +0000 (22:03 +0530)
12 files changed:
1  2 
commands/cat.c
commands/help.c
commands/ls.c
conf/common.rmk
include/grub/command.h
include/grub/script_sh.h
script/function.c
script/parser.y
term/gfxterm.c
term/serial.c
tests/lib/functional_test.c
util/grub-script-check.c

diff --cc commands/cat.c
  #include <grub/term.h>
  #include <grub/misc.h>
  #include <grub/gzio.h>
- #include <grub/command.h>
+ #include <grub/extcmd.h>
  #include <grub/i18n.h>
  
- static grub_err_t
- grub_cmd_cat (grub_command_t cmd __attribute__ ((unused)),
-             int argc, char **args)
+ static const struct grub_arg_option options[] =
+   {
+     {"dos", -1, 0, N_("Accept DOS-style CR/NL line endings."), 0, 0},
+     {0, 0, 0, 0, 0, 0}
+   };
  
 -grub_cmd_cat (grub_extcmd_t cmd, int argc, char **args)
+ static grub_err_t
++grub_cmd_cat (grub_extcmd_context_t ctxt, int argc, char **args)
  {
 -  struct grub_arg_list *state = cmd->state;
++  struct grub_arg_list *state = ctxt->state;
+   int dos = 0;
    grub_file_t file;
    char buf[GRUB_DISK_SECTOR_SIZE];
    grub_ssize_t size;
diff --cc commands/help.c
Simple merge
diff --cc commands/ls.c
Simple merge
diff --cc conf/common.rmk
@@@ -637,19 -628,18 +628,18 @@@ keystatus_mod_CFLAGS = $(COMMON_CFLAGS
  keystatus_mod_LDFLAGS = $(COMMON_LDFLAGS)
  
  # For normal.mod.
+ ifneq (, $(FONT_SOURCE))
+ normal/charset.c_DEPENDENCIES = widthspec.h
+ endif
  normal_mod_SOURCES = normal/main.c normal/cmdline.c normal/dyncmd.c \
-       normal/auth.c normal/autofs.c normal/handler.c \
+       normal/auth.c normal/autofs.c  \
        normal/color.c normal/completion.c normal/datetime.c normal/menu.c \
-       normal/menu_entry.c normal/menu_text.c \
-       normal/misc.c normal/crypto.c normal/term.c normal/context.c
- normal_mod_CFLAGS = $(COMMON_CFLAGS)
- normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
- # For sh.mod.
- sh_mod_SOURCES = script/main.c script/script.c script/argv.c script/execute.c \
+       normal/menu_entry.c normal/menu_text.c normal/charset.c \
+       normal/misc.c normal/crypto.c normal/term.c normal/context.c \
 -      script/main.c script/script.c script/execute.c unidata.c \
++      script/main.c script/script.c script/execute.c script/argv.c unidata.c \
        script/function.c script/lexer.c grub_script.tab.c grub_script.yy.c
sh_mod_CFLAGS = $(COMMON_CFLAGS) $(POSIX_CFLAGS) -Wno-error
sh_mod_LDFLAGS = $(COMMON_LDFLAGS)
normal_mod_CFLAGS = $(COMMON_CFLAGS) $(POSIX_CFLAGS) -Wno-error
normal_mod_LDFLAGS = $(COMMON_LDFLAGS)
  
  ifneq (, $(FONT_SOURCE))
  font/font.c_DEPENDENCIES = ascii.h
Simple merge
@@@ -328,27 -344,13 +333,29 @@@ grub_script_function_t grub_script_func
                                                    struct grub_script *cmd);
  void grub_script_function_remove (const char *name);
  grub_script_function_t grub_script_function_find (char *functionname);
- int grub_script_function_iterate (int (*iterate) (grub_script_function_t));
 -int grub_script_function_call (grub_script_function_t func,
 -                             int argc, char **args);
 +grub_err_t grub_script_function_call (grub_script_function_t func,
 +                                    int argc, char **args);
  
  char **
  grub_script_execute_arglist_to_argv (struct grub_script_arglist *arglist, int *count);
  
 +static inline struct grub_script *
 +grub_script_get (struct grub_script *script)
 +{
 +  script->refcnt++;
 +  return script;
 +}
 +
 +static inline void
 +grub_script_put (struct grub_script *script)
 +{
 +  if (script->refcnt == 0)
 +    grub_script_free (script);
 +  else
 +    script->refcnt--;
 +}
 +
+ grub_err_t
+ grub_normal_parse_line (char *line, grub_reader_getline_t getline);
  #endif /* ! GRUB_NORMAL_PARSER_HEADER */
@@@ -103,15 -103,12 +103,3 @@@ grub_script_function_find (char *functi
  
    return func;
  }
--
--int
- grub_script_function_iterate (int (*iterate) (grub_script_function_t))
 -grub_script_function_call (grub_script_function_t func,
 -                         int argc __attribute__((unused)),
 -                         char **args __attribute__((unused)))
--{
-   grub_script_function_t func;
-   for (func = grub_script_function_list; func; func = func->next)
-     if (iterate (func))
-       return 1;
-   return 0;
 -  /* XXX: Arguments are not supported yet.  */
 -  return grub_script_execute (func->func);
--}
diff --cc script/parser.y
@@@ -20,6 -20,6 +20,7 @@@
  %{
  #include <grub/script_sh.h>
  #include <grub/mm.h>
++#include <grub/misc.h>
  
  #define YYFREE          grub_free
  #define YYMALLOC        grub_malloc
@@@ -126,7 -126,9 +128,8 @@@ word: GRUB_PARSER_TOKEN_NAME { $$ = gru
  
  statement: command   { $$ = $1; }
           | function  { $$ = 0;  }
 -         | menuentry { $$ = $1; }
  ;
  argument : "case"      { $$ = grub_script_add_arglist (state, 0, $1); }
           | "do"        { $$ = grub_script_add_arglist (state, 0, $1); }
           | "done"      { $$ = grub_script_add_arglist (state, 0, $1); }
diff --cc term/gfxterm.c
Simple merge
diff --cc term/serial.c
Simple merge
Simple merge
Simple merge