4 * Revision 1.1 2001/04/04 05:43:39 wang
5 * First commit: compiles on Linux, Amiga, Windows, Windows CE, generic gcc
7 * Revision 1.4 1999/11/26 13:13:47 bnv
8 * Added: A filter option.
10 * Revision 1.3 1999/05/26 16:48:06 bnv
11 * Gene corrections in RXCONIO
13 * Revision 1.2 1999/02/10 15:43:16 bnv
14 * Additions from Generoso Martello
16 * Revision 1.1 1998/07/02 17:34:50 bnv
27 /* ------- Includes for any other external library ------- */
29 extern RxConIOInitialize();
32 /* --------------------- main ---------------------- */
34 main(int ac
, char *av
[])
36 Lstr args
, tracestr
, file
;
38 bool input
, loop_over_stdin
;
40 input
= loop_over_stdin
= FALSE
;
46 puts("\nsyntax: rexx [-[trace]|-F] <filename> <args>...\n\trexx -\tto use stdin\n\trexx -F\tloop over standard input\n\t\t\'linein\' contains each line from stdin.\n");
48 puts("Author: "AUTHOR
);
49 puts("To be distributed with AROS Operating System.\n");
56 /* --- Initialise --- */
59 /* --- Register functions of external libraries --- */
64 /* --- scan arguments --- */
71 loop_over_stdin
= input
= TRUE
;
73 Lscpy(&tracestr
,av
[ia
]+1);
76 if (av
[ia
][0]=='?' || av
[ia
][0]=='!') {
77 Lscpy(&tracestr
,av
[ia
]);
81 /* --- let's read a normal file --- */
82 if (!input
&& ia
<ac
) {
83 /* prepare arguments for program */
84 for (ir
=ia
+1; ir
<ac
; ir
++) {
86 if (ir
<ac
-1) Lcat(&args
," ");
88 RxRun(av
[ia
],NULL
,&args
,&tracestr
,NULL
);
91 Lread(STDIN
,&file
,LREADFILE
);
93 /* Copy a small header */
95 Lcat(&file
,"do forever;"
97 "if eof(0) then exit;");
100 if (ia
<ac
-1) Lcat(&file
," ");
106 RxRun(NULL
,&file
,&args
,&tracestr
,NULL
);
109 /* --- Free everything --- */
116 if (mem_allocated()!=0) {
117 fprintf(STDERR
,"\nMemory left allocated: %ld\n",mem_allocated());