/* */
/* */
/* */
-/* (C) 2009, Ullrich von Bassewitz */
-/* Roemerstrasse 52 */
-/* D-70794 Filderstadt */
-/* EMail: uz@cc65.org */
+/* (C) 2009-2012, Ullrich von Bassewitz */
+/* Roemerstrasse 52 */
+/* D-70794 Filderstadt */
+/* EMail: uz@cc65.org */
/* */
/* */
/* This software is provided 'as-is', without any expressed or implied */
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
+void OpenDebugOutputFile (const char* Name)
+/* Open an output file for debugging purposes. Will call Fatal() in case of
+ * failures.
+ */
+{
+ /* Output file must not be open and we must have a name*/
+ PRECONDITION (OutputFile == 0);
+
+ /* Open the file */
+ OutputFile = fopen (Name, "w");
+ if (OutputFile == 0) {
+ Fatal ("Cannot open debug output file `%s': %s", Name, strerror (errno));
+ }
+ Print (stdout, 1, "Opened debug output file `%s'\n", Name);
+}
+
+
+
void CloseOutputFile ()
/* Close the output file. Will call Fatal() in case of failures. */
{
Fatal ("Cannot write to output file (disk full?)");
}
Print (stdout, 1, "Closed output file `%s'\n", OutputFilename);
+
+ OutputFile = 0;
}
/* Return the number of chars written */
return CharCount;
}
-
-
-