comparison 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
comparison
equal deleted inserted replaced
238:630b2e12db16 239:4f1ca01db000
5 * Copyright 2006 Rob Landley <rob@landley.net> 5 * Copyright 2006 Rob Landley <rob@landley.net>
6 * 6 *
7 * Not in SUSv3. 7 * Not in SUSv3.
8 * See http://www.opengroup.org/onlinepubs/009695399/utilities/ 8 * See http://www.opengroup.org/onlinepubs/009695399/utilities/
9 9
10 USE_HELLO(NEWTOY(hello, NULL, TOYFLAG_USR|TOYFLAG_BIN)) 10 USE_HELLO(NEWTOY(hello, "e@d*c#b:a", TOYFLAG_USR|TOYFLAG_BIN))
11 11
12 config HELLO 12 config HELLO
13 bool "hello" 13 bool "hello"
14 default y 14 default y
15 help 15 help
19 occasionally nice to test kernel booting via "init=/bin/hello". 19 occasionally nice to test kernel booting via "init=/bin/hello".
20 */ 20 */
21 21
22 #include "toys.h" 22 #include "toys.h"
23 23
24 // Hello doesn't use these globals, they're here for example/skeleton purposes.
25
26 DEFINE_GLOBALS(
27 char *b_string;
28 long c_number;
29 struct arg_list *d_list;
30 long e_count;
31
32 int more_globals;
33 )
34
35 #define TT this.hello
36
24 void hello_main(void) 37 void hello_main(void)
25 { 38 {
26 printf("Hello world\n"); 39 printf("Hello world\n");
27 } 40 }