annotate toys/yes.c @ 151:bb6048c923ec

Add or correct file descriptions
author Charlie Shepherd <masterdriverz@gentoo.org>
date Tue, 06 Nov 2007 20:47:18 +0000
parents dfe99495acbc
children 25447caf1b4b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
74
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
1 /* vi: set sw=4 ts=4: */
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
2 /*
151
bb6048c923ec Add or correct file descriptions
Charlie Shepherd <masterdriverz@gentoo.org>
parents: 74
diff changeset
3 * yes.c - Repeatedly output a string.
74
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
4 */
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
5
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
6 #include "toys.h"
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
7
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
8 int yes_main(void)
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
9 {
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
10 for (;;) {
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
11 int i;
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
12 for (i=0; toys.optargs[i]; i++) {
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
13 if (i) xputc(' ');
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
14 xprintf("%s", toys.optargs[i]);
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
15 }
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
16 if (!i) xputc('y');
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
17 xputc('\n');
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
18 }
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
19
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
20 return 0;
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
21 }