/* * commands.h – Interactive shell command interface. * * Defines the Command structure used by the command registry and the * public API for command execution and help display. */ #ifndef COMMANDS_H #define COMMANDS_H #include "boot_info.h" #include "task.h" /* Handler function signature: receives BootInfo and any argument text. */ typedef void (*CommandHandlerFn)(BootInfo *Boot, CHAR16 *Args); /* * Command – describes a single shell command. * * An array of these (terminated by a sentinel with name == NULL) forms * the command registry in commands.c. */ typedef struct { const CHAR16 *name; /* command keyword (e.g. L"help") */ const CHAR16 *description; /* one-line summary for `help` */ const CHAR16 *usage; /* detailed text shown by `man` */ CommandHandlerFn handler; /* function that executes the cmd */ } Command; /* Parse and dispatch a line of user input. * * Returns: * - Pointer to a Task representing the spawned command process, * or NULL if the command was not found or ran synchronously. */ Task *execute_command(BootInfo *Boot, CHAR16 *Input); /* Print a formatted list of all registered commands. */ void show_help(BootInfo *Boot); #endif /* COMMANDS_H */