diff options
author | Roland McGrath <roland@gnu.org> | 1995-09-27 18:04:18 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1995-09-27 18:04:18 +0000 |
commit | f5aebc81e112801adad6826a5a1e5f75f7803d2b (patch) | |
tree | 5b6d031d48b6c8b7534e728660e86bb92086d01a /boot | |
parent | c78fc7796c837df611d7014b5e13a03d98624818 (diff) |
(read_file): New function.
(builtin_symbols): Add $(read-file) builtin.
Diffstat (limited to 'boot')
-rw-r--r-- | boot/boot_script.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/boot/boot_script.c b/boot/boot_script.c index a94b90d2..56b5f9ab 100644 --- a/boot/boot_script.c +++ b/boot/boot_script.c @@ -116,11 +116,21 @@ resume_task (struct cmd *cmd, int *val) return 0; } +static int +read_file (struct cmd *cmd, int *val) +{ + *val = boot_script_read_file (cmd->args[0]); + if (*val == 0) + return BOOT_SCRIPT_MACH_ERROR; + return 0; +} + /* List of builtin symbols. */ static struct sym builtin_symbols[] = { { "task-create", VAL_FUNC, (int) create_task, VAL_PORT, 0 }, - { "task-resume", VAL_FUNC, (int) resume_task, VAL_NONE, 1 } + { "task-resume", VAL_FUNC, (int) resume_task, VAL_NONE, 1 }, + { "read-file", VAL_FUNC, (int) read_file, VAL_PORT, 0 }, }; #define NUM_BUILTIN (sizeof (builtin_symbols) / sizeof (builtin_symbols[0])) |