Mercurial > hg > toybox
diff toys.h @ 7:fc9c0503d5e2
Implement df. Add -Wall to build and fix up warnings. Add copyright notices.
Add error_msg() and itoa() to library. Remove argc from globals (since argv is
null terminated), add optflags to globals.
author | landley@driftwood |
---|---|
date | Mon, 30 Oct 2006 01:38:00 -0500 |
parents | 732b055e17f7 |
children | d87d8a056295 |
line wrap: on
line diff
--- a/toys.h Thu Oct 26 12:04:37 2006 -0400 +++ b/toys.h Mon Oct 30 01:38:00 2006 -0500 @@ -6,13 +6,21 @@ * Licensed under GPL version 2, see file LICENSE in this tarball for details. */ +#include <ctype.h> +#include <errno.h> +#include <fcntl.h> +#include <inttypes.h> #include <limits.h> #include <stdarg.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <strings.h> #include <sys/stat.h> +#include <sys/statvfs.h> +#include <sys/types.h> +#include <sys/wait.h> #include <unistd.h> #include "lib/lib.h" @@ -44,8 +52,8 @@ extern struct toy_context { struct toy_list *which; // Which entry in toy_list is this one? int exitval; // Value error_exit feeds to exit() - int argc; - char **argv; + int optflags; // Command line option flags + char **argv; // Command line arguments char buf[4096]; } toys; @@ -53,7 +61,10 @@ struct cd_data {;}; struct toybox_data {;}; struct toysh_data {;}; -struct df_data {;}; +struct df_data { + struct string_list *fstype; + long units; +}; union toy_union { struct exit_data exit; @@ -73,3 +84,5 @@ #define CFG_TOYSH_ENVVARS 0 // Environment variables #define CFG_TOYSH_LOCVARS 0 // Local, synthetic, fancy prompts, set, $? #define CFG_TOYSH_PIPES 0 // Pipes and redirects: | > < >> << && || & () ; + +#define CFG_DF_PEDANTIC 1 // Support -P and -k in df