23
23
#include <grub/err.h>
24
24
#include <grub/list.h>
26
/* Can be run in the command-line. */
27
#define GRUB_COMMAND_FLAG_CMDLINE 0x1
28
/* Can be run in the menu. */
29
#define GRUB_COMMAND_FLAG_MENU 0x2
30
/* Can be run in both interfaces. */
31
#define GRUB_COMMAND_FLAG_BOTH 0x3
32
/* Only for the command title. */
33
#define GRUB_COMMAND_FLAG_TITLE 0x4
34
/* Don't print the command on booting. */
35
#define GRUB_COMMAND_FLAG_NO_ECHO 0x8
36
/* This is an extended command. */
37
#define GRUB_COMMAND_FLAG_EXTCMD 0x10
38
/* This is an dynamic command. */
39
#define GRUB_COMMAND_FLAG_DYNCMD 0x20
26
typedef enum grub_command_flags
28
/* This is an extended command. */
29
GRUB_COMMAND_FLAG_EXTCMD = 0x10,
30
/* This is an dynamic command. */
31
GRUB_COMMAND_FLAG_DYNCMD = 0x20,
32
/* This command accepts block arguments. */
33
GRUB_COMMAND_FLAG_BLOCKS = 0x40,
34
/* This command accepts unknown arguments as direct parameters. */
35
GRUB_COMMAND_ACCEPT_DASH = 0x80,
36
/* This command accepts only options preceding direct arguments. */
37
GRUB_COMMAND_OPTIONS_AT_START = 0x100,
38
/* Can be executed in an entries extractor. */
39
GRUB_COMMAND_FLAG_EXTRACTOR = 0x200
40
} grub_command_flags_t;
41
42
struct grub_command;
115
116
return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND;
119
grub_command_iterate (int (*func) (grub_command_t))
121
return grub_list_iterate (GRUB_AS_LIST (grub_command_list),
122
(grub_list_hook_t) func);
119
#define FOR_COMMANDS(var) FOR_LIST_ELEMENTS((var), grub_command_list)
125
121
void grub_register_core_commands (void);