2 /* Toybox infrastructure.
4 * Copyright 2006 Rob Landley <rob@landley.net>
6 * Licensed under GPL version 2, see file LICENSE in this tarball for details.
9 #include "gen_config.h"
11 #include "lib/portability.h"
27 #include <sys/ioctl.h>
29 #include <sys/mount.h>
31 #include <sys/statvfs.h>
32 #include <sys/types.h>
37 #define _XOPEN_SOURCE 600
41 #include "toys/e2fs.h"
42 #include "toys/toylist.h"
44 // These live in main.c
46 struct toy_list *toy_find(char *name);
47 void toy_init(struct toy_list *which, char *argv[]);
48 void toy_exec(char *argv[]);
50 // Global context for any applet.
52 extern struct toy_context {
53 struct toy_list *which; // Which entry in toy_list is this one?
54 int exitval; // Value error_exit feeds to exit()
55 char **argv; // Original command line arguments
56 unsigned optflags; // Command line option flags from get_optflags()
57 char **optargs; // Arguments left over from get_optflags()
58 int exithelp; // Should error_exit print a usage message first? (Option parsing.)
61 // One big temporary buffer, for use by applets (not library functions).
63 extern char toybuf[4096];