Files
Operator-system/commands.h

36 lines
1.1 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* 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"
/* 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. */
void execute_command(BootInfo *Boot, CHAR16 *Input);
/* Print a formatted list of all registered commands. */
void show_help(BootInfo *Boot);
#endif /* COMMANDS_H */