mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-23 15:49:23 +00:00
add example usage to hello command
This commit is contained in:
1 parent
3db1c9eee4
commit
28be0e94db
34 files changed
+220
-102
No files matched your search
+19
-3
@@ -21,10 +21,12 @@
|
||||
|
||||
#include <grub/lib/arg.h>
|
||||
#include <grub/command.h>
|
||||
#include <grub/script_sh.h>
|
||||
|
||||
struct grub_extcmd;
|
||||
struct grub_extcmd_context;
|
||||
|
||||
typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd *cmd,
|
||||
typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd_context *ctxt,
|
||||
int argc, char **args);
|
||||
|
||||
/* The argcmd description. */
|
||||
@@ -38,11 +40,21 @@ struct grub_extcmd
|
||||
const struct grub_arg_option *options;
|
||||
|
||||
void *data;
|
||||
|
||||
struct grub_arg_list *state;
|
||||
};
|
||||
typedef struct grub_extcmd *grub_extcmd_t;
|
||||
|
||||
/* Command context for each instance of execution. */
|
||||
struct grub_extcmd_context
|
||||
{
|
||||
struct grub_extcmd *extcmd;
|
||||
|
||||
struct grub_arg_list *state;
|
||||
|
||||
/* Script parameters, if any. */
|
||||
struct grub_script **script_params;
|
||||
};
|
||||
typedef struct grub_extcmd_context *grub_extcmd_context_t;
|
||||
|
||||
grub_extcmd_t grub_register_extcmd (const char *name,
|
||||
grub_extcmd_func_t func,
|
||||
unsigned flags,
|
||||
@@ -52,4 +64,8 @@ grub_extcmd_t grub_register_extcmd (const char *name,
|
||||
|
||||
void grub_unregister_extcmd (grub_extcmd_t cmd);
|
||||
|
||||
grub_err_t
|
||||
grub_extcmd_dispatcher (struct grub_command *cmd, int argc, char **args,
|
||||
struct grub_script **scripts);
|
||||
|
||||
#endif /* ! GRUB_EXTCMD_HEADER */
|
||||
Reference in new issue
Block a user