diff options
author | Elliott Hughes <enh@google.com> | 2020-06-11 15:47:22 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2020-06-11 15:47:50 -0700 |
commit | 574e49ea35ef9a59245a72a28d39f711a3625fee (patch) | |
tree | c0a0a86d3c6bb2c57666b395bb9ef33a0e5427c4 /android | |
parent | 32f2892530d40d8698a1803bc20104ca2fd5dbf3 (diff) | |
parent | 70e2232ce61c87f1dca869107b2998b7a4dfd0d2 (diff) | |
download | toybox-574e49ea35ef9a59245a72a28d39f711a3625fee.tar.gz |
Merge remote-tracking branch 'toybox/master' into HEAD
Change-Id: I6b50c34ce814170b16a588f22deb5809e9991275
Diffstat (limited to 'android')
-rw-r--r-- | android/device/generated/globals.h | 56 | ||||
-rw-r--r-- | android/device/generated/help.h | 4 | ||||
-rw-r--r-- | android/linux/generated/globals.h | 56 | ||||
-rw-r--r-- | android/linux/generated/help.h | 4 | ||||
-rw-r--r-- | android/mac/generated/globals.h | 56 | ||||
-rw-r--r-- | android/mac/generated/help.h | 4 |
6 files changed, 96 insertions, 84 deletions
diff --git a/android/device/generated/globals.h b/android/device/generated/globals.h index 677caf47..975da9af 100644 --- a/android/device/generated/globals.h +++ b/android/device/generated/globals.h @@ -828,42 +828,44 @@ struct sh_data { } exec; }; - // keep lineno here, we use it to work around a compiler bug + // keep lineno here, we use it to work around a compiler limitation long lineno; char *ifs, *isexec; - struct double_list functions; unsigned options, jobcnt; - int hfd, pid, varslen, shift, cdcount; - unsigned long long SECONDS; + int hfd, pid, bangpid, varslen, shift, cdcount; + long long SECONDS; struct sh_vars { long flags; char *str; } *vars; - // Running jobs for job control. - struct sh_job { - struct sh_job *next, *prev; - unsigned jobno; - - // Every pipeline has at least one set of arguments or it's Not A Thing - struct sh_arg { - char **v; - int c; - } pipeline; - - // null terminated array of running processes in pipeline - struct sh_process { - struct sh_process *next, *prev; - struct arg_list *delete; // expanded strings - // undo redirects, a=b at start, child PID, exit status, has ! - int *urd, envlen, pid, exit, not; - struct sh_arg arg; - } *procs, *proc; - } *jobs, *job; - - struct sh_process *pp; - struct sh_arg *arg; + // Parsed function + struct sh_function { + char *name; + struct sh_pipeline { // pipeline segments + struct sh_pipeline *next, *prev, *end; + int count, here, type; // TODO abuse type to replace count during parsing + struct sh_arg { + char **v; + int c; + } arg[1]; + } *pipeline; + struct double_list *expect; // should be zero at end of parsing + } *functions; + +// TODO ctrl-Z suspend should stop script + struct sh_process { + struct sh_process *next, *prev; // | && || + struct arg_list *delete; // expanded strings + // undo redirects, a=b at start, child PID, exit status, has !, job # + int *urd, envlen, pid, exit, not, job; + long long when; // when job backgrounded/suspended +// TODO struct sh_arg *raw; // for display + struct sh_arg arg; + } *pp; // currently running process + + struct sh_arg jobs, *arg; // job list, command line args for $* etc }; // toys/pending/stty.c diff --git a/android/device/generated/help.h b/android/device/generated/help.h index df3defa8..ca5a4a6e 100644 --- a/android/device/generated/help.h +++ b/android/device/generated/help.h @@ -260,7 +260,7 @@ #define HELP_i2cdetect "usage: i2cdetect [-ary] BUS [FIRST LAST]\nusage: i2cdetect -F BUS\nusage: i2cdetect -l\n\nDetect i2c devices.\n\n-a All addresses (0x00-0x7f rather than 0x03-0x77)\n-F Show functionality\n-l List all buses\n-r Probe with SMBus Read Byte\n-y Answer \"yes\" to confirmation prompts (for script use)" -#define HELP_hwclock "usage: hwclock [-rswtluf]\n\nGet/set the hardware clock.\n\n-f FILE Use specified device file instead of /dev/rtc (--rtc)\n-l Hardware clock uses localtime (--localtime)\n-r Show hardware clock time (--show)\n-s Set system time from hardware clock (--hctosys)\n-t Set the system time based on the current timezone (--systz)\n-u Hardware clock uses UTC (--utc)\n-w Set hardware clock from system time (--systohc)" +#define HELP_hwclock "usage: hwclock [-rswtluf]\n\nGet/set the hardware clock.\n\n-f FILE Use specified device file instead of /dev/rtc0 (--rtc)\n-l Hardware clock uses localtime (--localtime)\n-r Show hardware clock time (--show)\n-s Set system time from hardware clock (--hctosys)\n-t Set the system time based on the current timezone (--systz)\n-u Hardware clock uses UTC (--utc)\n-w Set hardware clock from system time (--systohc)" #define HELP_hexedit "usage: hexedit FILENAME\n\nHexadecimal file editor. All changes are written to disk immediately.\n\n-r Read only (display but don't edit)\n\nKeys:\nArrows Move left/right/up/down by one line/column\nPg Up/Pg Dn Move up/down by one page\n0-9, a-f Change current half-byte to hexadecimal value\nu Undo\nq/^c/^d/<esc> Quit" @@ -352,6 +352,8 @@ #define HELP_shift "usage: shift [N]\n\nSkip N (default 1) positional parameters, moving $1 and friends along the list.\nDoes not affect $0." +#define HELP_jobs "usage: jobs [-lnprs] [%JOB | -x COMMAND...]\n\nList running/stopped background jobs.\n\n-l Include process ID in list\n-n Show only new/changed processes\n-p Show process IDs only\n-r Show running processes\n-s Show stopped processes" + #define HELP_export "usage: export [-n] [NAME[=VALUE]...]\n\nMake variables available to child processes. NAME exports existing local\nvariable(s), NAME=VALUE sets and exports.\n\n-n Unexport. Turn listed variable(s) into local variables.\n\nWith no arguments list exported variables/attributes as \"declare\" statements." #define HELP_exec "usage: exec [-cl] [-a NAME] COMMAND...\n\n-a set argv[0] to NAME\n-c clear environment\n-l prepend - to argv[0]" diff --git a/android/linux/generated/globals.h b/android/linux/generated/globals.h index 677caf47..975da9af 100644 --- a/android/linux/generated/globals.h +++ b/android/linux/generated/globals.h @@ -828,42 +828,44 @@ struct sh_data { } exec; }; - // keep lineno here, we use it to work around a compiler bug + // keep lineno here, we use it to work around a compiler limitation long lineno; char *ifs, *isexec; - struct double_list functions; unsigned options, jobcnt; - int hfd, pid, varslen, shift, cdcount; - unsigned long long SECONDS; + int hfd, pid, bangpid, varslen, shift, cdcount; + long long SECONDS; struct sh_vars { long flags; char *str; } *vars; - // Running jobs for job control. - struct sh_job { - struct sh_job *next, *prev; - unsigned jobno; - - // Every pipeline has at least one set of arguments or it's Not A Thing - struct sh_arg { - char **v; - int c; - } pipeline; - - // null terminated array of running processes in pipeline - struct sh_process { - struct sh_process *next, *prev; - struct arg_list *delete; // expanded strings - // undo redirects, a=b at start, child PID, exit status, has ! - int *urd, envlen, pid, exit, not; - struct sh_arg arg; - } *procs, *proc; - } *jobs, *job; - - struct sh_process *pp; - struct sh_arg *arg; + // Parsed function + struct sh_function { + char *name; + struct sh_pipeline { // pipeline segments + struct sh_pipeline *next, *prev, *end; + int count, here, type; // TODO abuse type to replace count during parsing + struct sh_arg { + char **v; + int c; + } arg[1]; + } *pipeline; + struct double_list *expect; // should be zero at end of parsing + } *functions; + +// TODO ctrl-Z suspend should stop script + struct sh_process { + struct sh_process *next, *prev; // | && || + struct arg_list *delete; // expanded strings + // undo redirects, a=b at start, child PID, exit status, has !, job # + int *urd, envlen, pid, exit, not, job; + long long when; // when job backgrounded/suspended +// TODO struct sh_arg *raw; // for display + struct sh_arg arg; + } *pp; // currently running process + + struct sh_arg jobs, *arg; // job list, command line args for $* etc }; // toys/pending/stty.c diff --git a/android/linux/generated/help.h b/android/linux/generated/help.h index 8626d908..187fe9f8 100644 --- a/android/linux/generated/help.h +++ b/android/linux/generated/help.h @@ -262,7 +262,7 @@ #define HELP_i2cdetect "usage: i2cdetect [-ary] BUS [FIRST LAST]\nusage: i2cdetect -F BUS\nusage: i2cdetect -l\n\nDetect i2c devices.\n\n-a All addresses (0x00-0x7f rather than 0x03-0x77)\n-F Show functionality\n-l List all buses\n-r Probe with SMBus Read Byte\n-y Answer \"yes\" to confirmation prompts (for script use)" -#define HELP_hwclock "usage: hwclock [-rswtluf]\n\nGet/set the hardware clock.\n\n-f FILE Use specified device file instead of /dev/rtc (--rtc)\n-l Hardware clock uses localtime (--localtime)\n-r Show hardware clock time (--show)\n-s Set system time from hardware clock (--hctosys)\n-t Set the system time based on the current timezone (--systz)\n-u Hardware clock uses UTC (--utc)\n-w Set hardware clock from system time (--systohc)" +#define HELP_hwclock "usage: hwclock [-rswtluf]\n\nGet/set the hardware clock.\n\n-f FILE Use specified device file instead of /dev/rtc0 (--rtc)\n-l Hardware clock uses localtime (--localtime)\n-r Show hardware clock time (--show)\n-s Set system time from hardware clock (--hctosys)\n-t Set the system time based on the current timezone (--systz)\n-u Hardware clock uses UTC (--utc)\n-w Set hardware clock from system time (--systohc)" #define HELP_hexedit "usage: hexedit FILENAME\n\nHexadecimal file editor. All changes are written to disk immediately.\n\n-r Read only (display but don't edit)\n\nKeys:\nArrows Move left/right/up/down by one line/column\nPg Up/Pg Dn Move up/down by one page\n0-9, a-f Change current half-byte to hexadecimal value\nu Undo\nq/^c/^d/<esc> Quit" @@ -354,6 +354,8 @@ #define HELP_shift "usage: shift [N]\n\nSkip N (default 1) positional parameters, moving $1 and friends along the list.\nDoes not affect $0." +#define HELP_jobs "usage: jobs [-lnprs] [%JOB | -x COMMAND...]\n\nList running/stopped background jobs.\n\n-l Include process ID in list\n-n Show only new/changed processes\n-p Show process IDs only\n-r Show running processes\n-s Show stopped processes" + #define HELP_export "usage: export [-n] [NAME[=VALUE]...]\n\nMake variables available to child processes. NAME exports existing local\nvariable(s), NAME=VALUE sets and exports.\n\n-n Unexport. Turn listed variable(s) into local variables.\n\nWith no arguments list exported variables/attributes as \"declare\" statements." #define HELP_exec "usage: exec [-cl] [-a NAME] COMMAND...\n\n-a set argv[0] to NAME\n-c clear environment\n-l prepend - to argv[0]" diff --git a/android/mac/generated/globals.h b/android/mac/generated/globals.h index 677caf47..975da9af 100644 --- a/android/mac/generated/globals.h +++ b/android/mac/generated/globals.h @@ -828,42 +828,44 @@ struct sh_data { } exec; }; - // keep lineno here, we use it to work around a compiler bug + // keep lineno here, we use it to work around a compiler limitation long lineno; char *ifs, *isexec; - struct double_list functions; unsigned options, jobcnt; - int hfd, pid, varslen, shift, cdcount; - unsigned long long SECONDS; + int hfd, pid, bangpid, varslen, shift, cdcount; + long long SECONDS; struct sh_vars { long flags; char *str; } *vars; - // Running jobs for job control. - struct sh_job { - struct sh_job *next, *prev; - unsigned jobno; - - // Every pipeline has at least one set of arguments or it's Not A Thing - struct sh_arg { - char **v; - int c; - } pipeline; - - // null terminated array of running processes in pipeline - struct sh_process { - struct sh_process *next, *prev; - struct arg_list *delete; // expanded strings - // undo redirects, a=b at start, child PID, exit status, has ! - int *urd, envlen, pid, exit, not; - struct sh_arg arg; - } *procs, *proc; - } *jobs, *job; - - struct sh_process *pp; - struct sh_arg *arg; + // Parsed function + struct sh_function { + char *name; + struct sh_pipeline { // pipeline segments + struct sh_pipeline *next, *prev, *end; + int count, here, type; // TODO abuse type to replace count during parsing + struct sh_arg { + char **v; + int c; + } arg[1]; + } *pipeline; + struct double_list *expect; // should be zero at end of parsing + } *functions; + +// TODO ctrl-Z suspend should stop script + struct sh_process { + struct sh_process *next, *prev; // | && || + struct arg_list *delete; // expanded strings + // undo redirects, a=b at start, child PID, exit status, has !, job # + int *urd, envlen, pid, exit, not, job; + long long when; // when job backgrounded/suspended +// TODO struct sh_arg *raw; // for display + struct sh_arg arg; + } *pp; // currently running process + + struct sh_arg jobs, *arg; // job list, command line args for $* etc }; // toys/pending/stty.c diff --git a/android/mac/generated/help.h b/android/mac/generated/help.h index 8626d908..187fe9f8 100644 --- a/android/mac/generated/help.h +++ b/android/mac/generated/help.h @@ -262,7 +262,7 @@ #define HELP_i2cdetect "usage: i2cdetect [-ary] BUS [FIRST LAST]\nusage: i2cdetect -F BUS\nusage: i2cdetect -l\n\nDetect i2c devices.\n\n-a All addresses (0x00-0x7f rather than 0x03-0x77)\n-F Show functionality\n-l List all buses\n-r Probe with SMBus Read Byte\n-y Answer \"yes\" to confirmation prompts (for script use)" -#define HELP_hwclock "usage: hwclock [-rswtluf]\n\nGet/set the hardware clock.\n\n-f FILE Use specified device file instead of /dev/rtc (--rtc)\n-l Hardware clock uses localtime (--localtime)\n-r Show hardware clock time (--show)\n-s Set system time from hardware clock (--hctosys)\n-t Set the system time based on the current timezone (--systz)\n-u Hardware clock uses UTC (--utc)\n-w Set hardware clock from system time (--systohc)" +#define HELP_hwclock "usage: hwclock [-rswtluf]\n\nGet/set the hardware clock.\n\n-f FILE Use specified device file instead of /dev/rtc0 (--rtc)\n-l Hardware clock uses localtime (--localtime)\n-r Show hardware clock time (--show)\n-s Set system time from hardware clock (--hctosys)\n-t Set the system time based on the current timezone (--systz)\n-u Hardware clock uses UTC (--utc)\n-w Set hardware clock from system time (--systohc)" #define HELP_hexedit "usage: hexedit FILENAME\n\nHexadecimal file editor. All changes are written to disk immediately.\n\n-r Read only (display but don't edit)\n\nKeys:\nArrows Move left/right/up/down by one line/column\nPg Up/Pg Dn Move up/down by one page\n0-9, a-f Change current half-byte to hexadecimal value\nu Undo\nq/^c/^d/<esc> Quit" @@ -354,6 +354,8 @@ #define HELP_shift "usage: shift [N]\n\nSkip N (default 1) positional parameters, moving $1 and friends along the list.\nDoes not affect $0." +#define HELP_jobs "usage: jobs [-lnprs] [%JOB | -x COMMAND...]\n\nList running/stopped background jobs.\n\n-l Include process ID in list\n-n Show only new/changed processes\n-p Show process IDs only\n-r Show running processes\n-s Show stopped processes" + #define HELP_export "usage: export [-n] [NAME[=VALUE]...]\n\nMake variables available to child processes. NAME exports existing local\nvariable(s), NAME=VALUE sets and exports.\n\n-n Unexport. Turn listed variable(s) into local variables.\n\nWith no arguments list exported variables/attributes as \"declare\" statements." #define HELP_exec "usage: exec [-cl] [-a NAME] COMMAND...\n\n-a set argv[0] to NAME\n-c clear environment\n-l prepend - to argv[0]" |