comparison toys.h @ 25:eb46bb5626cb

New option parsing infrastructure (doesn't use getopt). Hook it up to existing applets. Still a bit buggy, but bits of it work.
author Rob Landley <rob@landley.net>
date Sun, 19 Nov 2006 02:49:22 -0500
parents 6475d6c46066
children f2c7f0799ebe
comparison
equal deleted inserted replaced
24:c8d0f1876c40 25:eb46bb5626cb
36 // Global context for any applet. 36 // Global context for any applet.
37 37
38 extern struct toy_context { 38 extern struct toy_context {
39 struct toy_list *which; // Which entry in toy_list is this one? 39 struct toy_list *which; // Which entry in toy_list is this one?
40 int exitval; // Value error_exit feeds to exit() 40 int exitval; // Value error_exit feeds to exit()
41 int optflags; // Command line option flags
42 char **argv; // Command line arguments 41 char **argv; // Command line arguments
43 char buf[4096]; 42 unsigned optflags; // Command line option flags from get_optflags()
43 char **optargs; // Arguments left over from get_optflags()
44 } toys; 44 } toys;
45
46 // One big temporary buffer, for use by applets (not library functions).
47
48 char buf[4096];