annotate tests/test-pipe-filter-gi2-child.c @ 18079:4c948fd76734 default tip master

autoupdate
author Karl Berry <karl@freefriends.org>
date Mon, 24 Aug 2015 06:09:19 -0700
parents ab58d4870664
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11761
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Child program invoked by test-pipe-filter-gi2-main.
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2
17848
ab58d4870664 version-etc: new year
Paul Eggert <eggert@cs.ucla.edu>
parents: 17587
diff changeset
3 Copyright (C) 2009-2015 Free Software Foundation, Inc.
11761
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 Written by Paolo Bonzini <bonzini@gnu.org>, 2009.
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 This program is free software: you can redistribute it and/or modify
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 it under the terms of the GNU General Public License as published by
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 the Free Software Foundation; either version 3 of the License, or
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 (at your option) any later version.
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 This program is distributed in the hope that it will be useful,
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 GNU General Public License for more details.
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19 #include <config.h>
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21 #include <stdio.h>
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 #include <stdlib.h>
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 int
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 main ()
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26 {
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 /* Repeatedly: Read two integers i and j, then output all integers in the
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 range i..j, one per line. */
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29 for (;;)
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 {
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 int i, j;
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33 if (scanf (" %d", &i) != 1)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11761
diff changeset
34 break;
11761
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35 if (scanf (" %d", &j) != 1)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11761
diff changeset
36 break;
11761
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 if (j == -1)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11761
diff changeset
38 exit (i);
11761
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 while (i <= j)
12421
e8d2c6fc33ad Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents: 11761
diff changeset
40 printf ("abcdefghijklmnopqrstuvwxyz%d\n", i++);
11761
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 }
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42 exit (0);
9c955c3f7bdc Tests for module 'pipe-filter-gi'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43 }