summaryrefslogtreecommitdiff
path: root/n/avr/modules/host/host.host.c
diff options
context:
space:
mode:
Diffstat (limited to 'n/avr/modules/host/host.host.c')
-rw-r--r--n/avr/modules/host/host.host.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/n/avr/modules/host/host.host.c b/n/avr/modules/host/host.host.c
index bcfd7d2..7967e9c 100644
--- a/n/avr/modules/host/host.host.c
+++ b/n/avr/modules/host/host.host.c
@@ -36,7 +36,7 @@
static int host_saved_argc;
static char **host_saved_argv;
-/** Initialise host modules. */
+/** Initialise host module. */
void
host_init (int argc, char **argv)
{
@@ -44,6 +44,16 @@ host_init (int argc, char **argv)
host_saved_argv = argv;
}
+/** Retrieve saved program arguments. Program name and used parameters are
+ * stripped. */
+void
+host_get_program_arguments (int *argc, char ***argv)
+{
+ assert (host_saved_argc);
+ *argc = host_saved_argc - 1;
+ *argv = host_saved_argv + 1;
+}
+
/** Register a host integer. */
void
host_register_integer (const char *name, int val)
@@ -84,6 +94,7 @@ host_fetch_string (const char *name)
void
host_reset (void)
{
+ assert (host_saved_argv);
execv (program_invocation_name, host_saved_argv);
assert_perror (errno);
abort ();