case atAddrTab:
AddrTable ();
break;
-
+
case atRtsTab:
RtsTable ();
break;
AbEnd ("No input file");
}
- /* Make the output file name from the input file name if none was given */
- if (OutFile == 0) {
- OutFile = MakeFilename (InFile, OutExt);
- }
-
/* If no CPU given, use the default CPU */
if (CPU == CPU_UNKNOWN) {
CPU = CPU_6502;
void OpenOutput (const char* Name)
/* Open the given file for output */
{
- /* Open the output file */
- F = fopen (Name, "w");
- if (F == 0) {
- Error ("Cannot open `%s': %s", Name, strerror (errno));
+ /* If we have a name given, open the output file, otherwise use stdout */
+ if (Name != 0) {
+ F = fopen (Name, "w");
+ if (F == 0) {
+ Error ("Cannot open `%s': %s", Name, strerror (errno));
+ }
+ } else {
+ F = stdout;
}
+
+ /* Output the header and initialize stuff */
PageHeader ();
Line = 4;
Col = 1;
void CloseOutput (void)
/* Close the output file */
{
- if (fclose (F) != 0) {
+ if (F != stdout && fclose (F) != 0) {
Error ("Error closing output file: %s", strerror (errno));
}
}