aboutsummaryrefslogtreecommitdiff
path: root/toys/hello.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2008-01-20 19:00:16 -0600
committerRob Landley <rob@landley.net>2008-01-20 19:00:16 -0600
commit7c04f01bc73082a170c9a1988bf62c2428acc4f9 (patch)
tree3e4a628bc473b8e2e0d3fda48cf5f291f0616442 /toys/hello.c
parent6ef04efa853b80c76ead2d252b3f4771f4c25d5d (diff)
downloadtoybox-7c04f01bc73082a170c9a1988bf62c2428acc4f9.tar.gz
Fluff out hello.c to supply more example code as a skeleton for new commands,
and update a chunk of code.html (much more to do there).
Diffstat (limited to 'toys/hello.c')
-rw-r--r--toys/hello.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/toys/hello.c b/toys/hello.c
index a8caeefe..e5d78f6a 100644
--- a/toys/hello.c
+++ b/toys/hello.c
@@ -7,7 +7,7 @@
* Not in SUSv3.
* See http://www.opengroup.org/onlinepubs/009695399/utilities/
-USE_HELLO(NEWTOY(hello, NULL, TOYFLAG_USR|TOYFLAG_BIN))
+USE_HELLO(NEWTOY(hello, "e@d*c#b:a", TOYFLAG_USR|TOYFLAG_BIN))
config HELLO
bool "hello"
@@ -21,6 +21,19 @@ config HELLO
#include "toys.h"
+// Hello doesn't use these globals, they're here for example/skeleton purposes.
+
+DEFINE_GLOBALS(
+ char *b_string;
+ long c_number;
+ struct arg_list *d_list;
+ long e_count;
+
+ int more_globals;
+)
+
+#define TT this.hello
+
void hello_main(void)
{
printf("Hello world\n");