+// Flags describing command behavior.
+
+#define TOYFLAG_USR (1<<0)
+#define TOYFLAG_BIN (1<<1)
+#define TOYFLAG_SBIN (1<<2)
+#define TOYMASK_LOCATION ((1<<4)-1)
+
+// This is a shell built-in function, running in the same process context.
+#define TOYFLAG_NOFORK (1<<4)
+
+// Start command with a umask of 0 (saves old umask in this.old_umask)
+#define TOYFLAG_UMASK (1<<5)
+
+// This command runs as root.
+#define TOYFLAG_STAYROOT (1<<6)
+#define TOYFLAG_NEEDROOT (1<<7)
+#define TOYFLAG_ROOTONLY (TOYFLAG_STAYROOT|TOYFLAG_NEEDROOT)
+
+// Call setlocale to listen to environment variables.
+// This invalidates sprintf("%.*s", size, string) as a valid length constraint.
+#define TOYFLAG_LOCALE (1<<8)
+
+// Array of available commands
+
+extern struct toy_list {
+ char *name;
+ void (*toy_main)(void);
+ char *options;
+ int flags;
+} toy_list[];
+
+// Global context shared by all commands.