diff toys/hello.c @ 239:4f1ca01db000

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).
author Rob Landley <rob@landley.net>
date Sun, 20 Jan 2008 19:00:16 -0600
parents 163498bf547b
children 157eab6dcdd2
line wrap: on
line diff
--- a/toys/hello.c	Sun Jan 20 17:34:53 2008 -0600
+++ b/toys/hello.c	Sun Jan 20 19:00:16 2008 -0600
@@ -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 @@
 
 #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");