From f5aebc81e112801adad6826a5a1e5f75f7803d2b Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 27 Sep 1995 18:04:18 +0000 Subject: (read_file): New function. (builtin_symbols): Add $(read-file) builtin. --- boot/boot_script.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'boot') 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])) -- cgit v1.2.3