mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-10 06:30:41 +00:00
Merge pull request #69 from ZornsLemma/plasm-stdout
Add new -S option to "plasm" to output to stdout
This commit is contained in:
commit
9cb7d29bfa
@ -34,6 +34,10 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 'W':
|
||||
outflags |= WARNINGS;
|
||||
break;
|
||||
case 'S':
|
||||
outflags |= STREAM;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -56,11 +60,18 @@ int main(int argc, char **argv)
|
||||
j--;
|
||||
}
|
||||
asmfile[j+1] = 'a';
|
||||
outputfile = fopen(asmfile, "w");
|
||||
if (!outputfile)
|
||||
if (outflags & STREAM)
|
||||
{
|
||||
printf("Error opening output file %s\n", asmfile);
|
||||
exit(1);
|
||||
outputfile = stdout;
|
||||
}
|
||||
else
|
||||
{
|
||||
outputfile = fopen(asmfile, "w");
|
||||
if (!outputfile)
|
||||
{
|
||||
printf("Error opening output file %s\n", asmfile);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
while (j && asmfile[j-1] != '/')
|
||||
j--;
|
||||
@ -79,7 +90,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
if (inputfile == NULL)
|
||||
{
|
||||
printf("Usage: %s [-AMONW] <inputfile>", argv[0]);
|
||||
printf("Usage: %s [-AMONWS] <inputfile>\n", argv[0]);
|
||||
return (0);
|
||||
}
|
||||
emit_flags(outflags);
|
||||
|
@ -9,6 +9,7 @@
|
||||
#define SYSFLAGS (1<<5)
|
||||
#define WARNINGS (1<<6)
|
||||
#define NO_COMBINE (1<<7)
|
||||
#define STREAM (1<<8)
|
||||
#define FALSE 0
|
||||
#define TRUE (!FALSE)
|
||||
extern int outflags;
|
||||
|
Loading…
x
Reference in New Issue
Block a user