The R Project SVN R

Rev

Rev 53594 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
53594 ripley 1
#include <stdlib.h>
2
#include <stdio.h>
53611 ripley 3
#include <string.h>
53594 ripley 4
 
5
int main(int argc, char* argv[])
6
{
7
    int status = 0;
8
    char line[1000];
9
 
10
    printf("stdout 1\n"); fflush(stdout);
11
    fprintf(stderr, "stderr 1\n");
12
    fflush(stderr);
13
 
53611 ripley 14
    if (argc > 1 && strcmp(argv[1], "1") == 0) {
53594 ripley 15
	while(fgets(line, 1000, stdin)) printf("stdin: %s", line);
16
	fflush(stdout);
17
    }
53611 ripley 18
    if (argc > 1 && strcmp(argv[1], "1")) {
19
	status = atof(argv[1]);
20
    }
53594 ripley 21
 
22
    exit(status);
23
}