blob: 2612e81006ba767315aa3f9f270fe730f61ab2e7 [file] [log] [blame]
Rob Landley28964802008-01-19 17:08:39 -06001/* vi: set sw=4 ts=4:
2 *
Rob Landley9b3fc7d2006-11-01 22:23:58 -05003 * hello.c - A hello world program.
Rob Landleyfece5cb2007-12-03 20:05:57 -06004 *
Rob Landley28964802008-01-19 17:08:39 -06005 * Copyright 2006 Rob Landley <rob@landley.net>
6 *
Rob Landleyfece5cb2007-12-03 20:05:57 -06007 * Not in SUSv3.
Rob Landleybe92b3f2011-11-15 01:09:27 -06008 * See http://opengroup.org/onlinepubs/9699919799/utilities/
Rob Landley28964802008-01-19 17:08:39 -06009
Rob Landley7c04f012008-01-20 19:00:16 -060010USE_HELLO(NEWTOY(hello, "e@d*c#b:a", TOYFLAG_USR|TOYFLAG_BIN))
Rob Landley55928b12008-01-19 17:43:27 -060011
Rob Landley28964802008-01-19 17:08:39 -060012config HELLO
13 bool "hello"
Rob Landleyd3e61fc2009-01-14 20:41:37 -060014 default n
Rob Landley28964802008-01-19 17:08:39 -060015 help
16 A hello world program. You don't need this.
17
18 Mostly used as an example/skeleton file for adding new commands,
19 occasionally nice to test kernel booting via "init=/bin/hello".
20*/
Rob Landley9b3fc7d2006-11-01 22:23:58 -050021
22#include "toys.h"
23
Rob Landley7c04f012008-01-20 19:00:16 -060024// Hello doesn't use these globals, they're here for example/skeleton purposes.
25
26DEFINE_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
Rob Landleyefda21c2007-11-29 18:14:37 -060037void hello_main(void)
Rob Landley9b3fc7d2006-11-01 22:23:58 -050038{
39 printf("Hello world\n");
Rob Landley9b3fc7d2006-11-01 22:23:58 -050040}