pass pointer to term to term functions

This commit is contained in:
Vladimir 'phcoder' Serbinenko committed 2010-05-07 02:30:44 +02:00
1 parent 82e32bc310
commit 58664b94b7
19 files changed
+230 -181

No files matched your search

+6 -6
View File
@@ -30,8 +30,8 @@ struct abstract_terminal
{
struct abstract_terminal *next;
const char *name;
grub_err_t (*init) (void);
grub_err_t (*fini) (void);
grub_err_t (*init) (struct abstract_terminal *term);
grub_err_t (*fini) (struct abstract_terminal *term);
};
static grub_err_t
@@ -123,7 +123,7 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
break;
if (term)
{
if (term->init && term->init () != GRUB_ERR_NONE)
if (term->init && term->init (term) != GRUB_ERR_NONE)
return grub_errno;
grub_list_remove (GRUB_AS_LIST_P (disabled), GRUB_AS_LIST (term));
@@ -147,7 +147,7 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
"can't remove the last terminal");
grub_list_remove (GRUB_AS_LIST_P (enabled), GRUB_AS_LIST (term));
if (term->fini)
term->fini ();
term->fini (term);
grub_list_push (GRUB_AS_LIST_P (disabled), GRUB_AS_LIST (term));
}
}
@@ -160,7 +160,7 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
break;
if (term)
{
if (term->init && term->init () != GRUB_ERR_NONE)
if (term->init && term->init (term) != GRUB_ERR_NONE)
return grub_errno;
grub_list_remove (GRUB_AS_LIST_P (disabled), GRUB_AS_LIST (term));
@@ -183,7 +183,7 @@ handle_command (int argc, char **args, struct abstract_terminal **enabled,
"can't remove the last terminal");
grub_list_remove (GRUB_AS_LIST_P (enabled), GRUB_AS_LIST (term));
if (term->fini)
term->fini ();
term->fini (term);
grub_list_push (GRUB_AS_LIST_P (disabled), GRUB_AS_LIST (term));
}
}