-int Verbose = 0; /* Verbose operation flag */
-
-
-
-extern int Verbose; /* Verbose operation flag */
-
-
-
/* End of global.h */
#endif
#include "exprdefs.h"
#include "filepos.h"
#include "libdefs.h"
+#include "print.h"
#include "symdefs.h"
#include "xmalloc.h"
unsigned Count = GetVar (&Exports);
/* Read the exports */
- if (Verbose > 1) {
- printf ("Module `%s' (%u exports):\n", O->Name, Count);
- }
+ Print (stdout, 1, "Module `%s' (%u exports):\n", O->Name, Count);
while (Count--) {
-
+
unsigned char Tag;
unsigned Len;
char* Name;
SkipFilePos (&Exports);
/* Insert the name into the hash table */
- if (Verbose > 1) {
- printf (" %s\n", Name);
- }
+ Print (stdout, 1, " %s\n", Name);
ExpInsert (Name, O->Index);
/* Free the name */
/* common */
#include "cmdline.h"
+#include "print.h"
#include "version.h"
#include "global.h"
int I;
/* Initialize the cmdline module */
- InitCmdLine (&argc, &argv, "ar65");
+ InitCmdLine (&argc, &argv, "ar65");
/* We must have a file name */
if (ArgCount < 2) {
break;
case 'v':
- ++Verbose;
+ ++Verbosity;
break;
case 'x':
/* common */
#include "check.h"
#include "exprdefs.h"
+#include "print.h"
#include "tgttrans.h"
#include "xmalloc.h"
case EXPR_SYMBOL:
Sym = Root->V.Sym;
if (SymHasUserMark (Sym)) {
- if (Verbose) {
+ if (Verbosity > 0) {
DumpExpr (Root);
}
PError (GetSymPos (Sym), ERR_CIRCULAR_REFERENCE);
SymEntry* Sym = Expr->V.Sym;
if (SymHasUserMark (Sym)) {
/* Circular definition */
- if (Verbose) {
+ if (Verbosity) {
DumpExpr (Expr);
}
PError (GetSymPos (Sym), ERR_CIRCULAR_REFERENCE);
unsigned char IgnoreCase = 0; /* Ignore case on identifiers? */
unsigned char AutoImport = 0; /* Mark unresolveds as import */
-unsigned char Verbose = 0; /* Verbose operation flag */
unsigned char SmartMode = 0; /* Smart mode */
unsigned char DbgSyms = 0; /* Add debug symbols */
unsigned char Listing = 0; /* Create listing file */
extern unsigned char IgnoreCase; /* Ignore case on identifiers? */
extern unsigned char AutoImport; /* Mark unresolveds as import */
-extern unsigned char Verbose; /* Verbose operation flag */
extern unsigned char SmartMode; /* Smart mode */
extern unsigned char DbgSyms; /* Add debug symbols */
extern unsigned char Listing; /* Create listing file */
/* common */
#include "chartype.h"
#include "cmdline.h"
+#include "print.h"
#include "target.h"
#include "tgttrans.h"
#include "version.h"
static void OptVerbose (const char* Opt, const char* Arg)
/* Increase verbosity */
{
- ++Verbose;
+ ++Verbosity;
}
}
/* Dump the data */
- if (Verbose >= 2) {
+ if (Verbosity >= 2) {
SymDump (stdout);
SegDump ();
}
#include <stdlib.h>
#include <stdarg.h>
+/* common */
+#include "print.h"
+
+/* cc65 */
#include "global.h"
#include "input.h"
#include "scanner.h"
vfprintf (stderr, Msg, ap);
fprintf (stderr, "\n");
- if (Verbose) {
- fprintf (stderr, "Line: %s\n", line);
- }
+ Print (stderr, 1, "Line: %s\n", line);
++WarningCount;
}
}
vfprintf (stderr, Msg, ap);
fprintf (stderr, "\n");
- if (Verbose) {
- fprintf (stderr, "Line: %s\n", line);
- }
+ Print (stderr, 1, "Line: %s\n", line);
++ErrorCount;
if (ErrorCount > 10) {
Fatal ("Too many errors");
va_end (ap);
fprintf (stderr, "\n");
- if (Verbose) {
- fprintf (stderr, "Line: %s\n", line);
- }
+ Print (stderr, 1, "Line: %s\n", line);
exit (EXIT_FAILURE);
}
void ErrorReport (void)
/* Report errors (called at end of compile) */
{
- if (ErrorCount == 0 && Verbose) {
+ if (ErrorCount == 0 && Verbosity > 0) {
printf ("No errors.\n");
}
}
unsigned char RegVarsToCallStack= 0; /* Save reg variables on call stack */
unsigned char StaticLocals = 0; /* Make local variables static */
unsigned char SignedChars = 0; /* Make characters signed by default */
-unsigned char Verbose = 0; /* Verbose flag */
unsigned char AddSource = 0; /* Add source lines as comments */
unsigned char DebugInfo = 0; /* Add debug info to the obj */
unsigned char Debug = 0; /* Debug mode */
extern unsigned char RegVarsToCallStack; /* Save reg variables on call stack */
extern unsigned char StaticLocals; /* Make local variables static */
extern unsigned char SignedChars; /* Make characters signed by default */
-extern unsigned char Verbose; /* Verbose flag */
extern unsigned char AddSource; /* Add source lines as comments */
extern unsigned char DebugInfo; /* Add debug info to the obj */
extern unsigned char Debug; /* Debug mode */
#include "chartype.h"
#include "cmdline.h"
#include "fname.h"
+#include "print.h"
#include "target.h"
#include "tgttrans.h"
#include "version.h"
static void OptVerbose (const char* Opt, const char* Arg)
/* Increase verbosity */
{
- ++Verbose;
+ ++Verbosity;
}
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
-//#include <ctype.h>
/* common */
#include "attrib.h"
#include "chartype.h"
#include "check.h"
+#include "print.h"
#include "xmalloc.h"
#include "xsprintf.h"
for (I = 0; I < sizeof(OptFuncs)/sizeof(OptFuncs[0]); ++I, Flags <<= 1) {
if ((OptDisable & Flags) == 0) {
OptFuncs[I] ();
- } else if (Verbose || Debug) {
+ } else if (Verbosity > 0 || Debug) {
printf ("Optimizer pass %u skipped\n", I);
}
}
/* common */
#include "chartype.h"
+#include "print.h"
#include "xmalloc.h"
/* cc65 */
Done:
xlateline ();
- if (Verbose > 1) {
- printf ("line: %s\n", line);
- }
+ Print (stdout, 2, "line: %s\n", line);
}
/* Our default target is the C64 instead of "none" */
Target = TGT_C64;
-
+
/* Check the parameters */
I = 1;
while (I < ArgCount) {
-#include <stdio.h>
#include <stdarg.h>
/* common */
-void Print (unsigned V, const char* Format, ...)
+void Print (FILE* F, unsigned V, const char* Format, ...)
/* Output according to Verbosity */
{
va_list ap;
/* Output */
va_start (ap, Format);
- vprintf (Format, ap);
+ vfprintf (F, Format, ap);
va_end (ap);
}
+#include <stdio.h>
+
/* common */
#include "attrib.h"
/*****************************************************************************/
-/* Data */
+/* Data */
/*****************************************************************************/
-void Print (unsigned V, const char* Format, ...) attribute ((format (printf, 2, 3)));
+void Print (FILE* F, unsigned V, const char* Format, ...)
+ attribute ((format (printf, 3, 4)));
/* Output according to Verbosity */
const char CfgExt[] = ".cfg"; /* Config file extension */
/* Flags and other command line stuff */
-unsigned char Verbosity = 4; /* Verbosity of the output file */
unsigned char FormFeeds = 0; /* Add form feeds to the output? */
unsigned char PassCount = 2; /* How many passed do we do? */
unsigned long StartAddr = 0xC000; /* Start/load address of the program */
extern const char CfgExt[]; /* Config file extension */
/* Flags and other command line stuff */
-extern unsigned char Verbosity; /* Verbosity of the output file */
extern unsigned char FormFeeds; /* Add form feeds to the output? */
extern unsigned char PassCount; /* How many passed do we do? */
extern unsigned long StartAddr; /* Start/load address of the program */
#include "abend.h"
#include "cmdline.h"
#include "fname.h"
+#include "print.h"
#include "version.h"
/* da65 */
#include <errno.h>
/* common */
+#include "print.h"
#include "version.h"
/* da65 */
#include <errno.h>
/* common */
+#include "print.h"
#include "xmalloc.h"
/* ld65 */
SegDesc* S = N->Seg;
/* Keep the user happy */
- if (Verbose) {
- printf (" Writing `%s'\n", S->Name);
- }
+ Print (stdout, 1, " Writing `%s'\n", S->Name);
/* Writes do only occur in the load area and not for BSS segments */
DoWrite = (S->Flags & SF_BSS) == 0 && /* No BSS segment */
S->Seg->Dumped == 0; /* Not already written */
/* Output the DoWrite flag for debugging */
- if (Verbose > 1) {
+ if (Verbosity > 1) {
PrintBoolVal ("bss", S->Flags & SF_BSS);
PrintBoolVal ("LoadArea", S->Load == M);
PrintBoolVal ("Dumped", S->Seg->Dumped);
}
/* Keep the user happy */
- if (Verbose) {
- printf ("Opened `%s'...\n", F->Name);
- }
+ Print (stdout, 1, "Opened `%s'...\n", F->Name);
/* Dump all memory areas */
M = F->MemList;
while (M) {
- if (Verbose) {
- printf (" Dumping `%s'\n", M->Name);
- }
+ Print (stdout, 1, " Dumping `%s'\n", M->Name);
BinWriteMem (D, M);
M = M->FNext;
}
/* common */
#include "check.h"
#include "bitops.h"
+#include "print.h"
#include "xmalloc.h"
/* ld65 */
MemListNode* N;
/* Debugging */
- if (Verbose > 1) {
- printf ("Skipping `%s'...\n", M->Name);
- }
+ Print (stdout, 2, "Skipping `%s'...\n", M->Name);
/* Walk throught the segments */
N = M->SegList;
unsigned long StartAddr = 0x200; /* Start address */
-unsigned char Verbose = 0; /* Verbose operation flag */
unsigned char VerboseMap = 0; /* Verbose map file */
const char* MapFileName = 0; /* Name of the map file */
const char* LabelFileName = 0; /* Name of the label file */
extern unsigned long StartAddr; /* Start address */
-extern unsigned char Verbose; /* Verbose operation flag */
extern unsigned char VerboseMap; /* Verbose map file */
extern const char* MapFileName; /* Name of the map file */
extern const char* LabelFileName; /* Name of the label file */
#include "cmdline.h"
#include "libdefs.h"
#include "objdefs.h"
+#include "print.h"
#include "target.h"
#include "version.h"
#include "xmalloc.h"
case 'v':
switch (Arg [2]) {
case 'm': VerboseMap = 1; break;
- case '\0': ++Verbose; break;
+ case '\0': ++Verbosity; break;
default: UnknownOption (Arg);
}
break;
}
/* Dump the data for debugging */
- if (Verbose > 1) {
+ if (Verbosity > 1) {
SegDump ();
ConDesDump ();
}
/* common */
#include "check.h"
+#include "print.h"
#include "version.h"
#include "xmalloc.h"
S = Seg [I];
/* Keep the user happy */
- if (Verbose) {
- printf (" Writing `%s'\n", S->Name);
- }
+ Print (stdout, 1, " Writing `%s'\n", S->Name);
/* Write this segment */
if (DoWrite) {
}
/* Keep the user happy */
- if (Verbose) {
- printf ("Opened `%s'...\n", F->Name);
- }
+ Print (stdout, 1, "Opened `%s'...\n", F->Name);
/* Define some more options: A timestamp and the linker version */
T = time (0);
#include "check.h"
#include "exprdefs.h"
#include "hashstr.h"
+#include "print.h"
#include "segdefs.h"
#include "symdefs.h"
#include "xmalloc.h"
Type = Read8 (F);
/* Print some data */
- if (Verbose > 1) {
- printf ("Module `%s': Found segment `%s', size = %lu, align = %u, type = %u\n",
- GetObjFileName (O), Name, Size, Align, Type);
- }
+ Print (stdout, 1, "Module `%s': Found segment `%s', size = %lu, align = %u, type = %u\n",
+ GetObjFileName (O), Name, Size, Align, Type);
/* Get the segment for this section */
S = GetSegment (Name, Type, GetObjFileName (O));