]> git.sur5r.net Git - cc65/commitdiff
Added module for program output.
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 10 Mar 2001 10:04:42 +0000 (10:04 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 10 Mar 2001 10:04:42 +0000 (10:04 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@618 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/common/make/gcc.mak
src/common/make/watcom.mak
src/common/print.c [new file with mode: 0644]
src/common/print.h [new file with mode: 0644]

index 7ae5818b36f0dc4ffba41ce45a04cd10141f6c5f..45f3940f5c5efbb147a986f6f38a5e3d7dd6dd20 100644 (file)
@@ -19,6 +19,7 @@ OBJS =        abend.o         \
        filepos.o       \
        fname.o         \
        hashstr.o       \
+       print.o         \
        target.o        \
        tgttrans.o      \
        xmalloc.o       \
index 65b18eff8cf2f154c497028c65db131fbce4af89..b122be10a9189111349791e3d0e326e7df26eb40 100644 (file)
@@ -61,7 +61,7 @@ CCCFG  = -bt=$(TARGET) -d1 -onatx -zp4 -5 -zq -w2
 .c.obj:
   $(CC) $(CCCFG) $<
 
-                        
+
 # ------------------------------------------------------------------------------
 # All library OBJ files
 
@@ -75,9 +75,10 @@ OBJS =       abend.obj       \
        filepos.obj     \
        fname.obj       \
        hashstr.obj     \
-       wildargv.obj    \
+       print.obj       \
        target.obj      \
        tgttrans.obj    \
+       wildargv.obj    \
        xmalloc.obj     \
        xsprintf.obj
 
diff --git a/src/common/print.c b/src/common/print.c
new file mode 100644 (file)
index 0000000..52080e7
--- /dev/null
@@ -0,0 +1,78 @@
+/*****************************************************************************/
+/*                                                                           */
+/*                                 print.c                                  */
+/*                                                                           */
+/*                             Program output                               */
+/*                                                                           */
+/*                                                                           */
+/*                                                                           */
+/* (C) 2001     Ullrich von Bassewitz                                       */
+/*               Wacholderweg 14                                             */
+/*               D-70597 Stuttgart                                           */
+/* EMail:        uz@musoftware.de                                            */
+/*                                                                           */
+/*                                                                           */
+/* This software is provided 'as-is', without any expressed or implied       */
+/* warranty.  In no event will the authors be held liable for any damages    */
+/* arising from the use of this software.                                    */
+/*                                                                           */
+/* Permission is granted to anyone to use this software for any purpose,     */
+/* including commercial applications, and to alter it and redistribute it    */
+/* freely, subject to the following restrictions:                            */
+/*                                                                           */
+/* 1. The origin of this software must not be misrepresented; you must not   */
+/*    claim that you wrote the original software. If you use this software   */
+/*    in a product, an acknowledgment in the product documentation would be  */
+/*    appreciated but is not required.                                       */
+/* 2. Altered source versions must be plainly marked as such, and must not   */
+/*    be misrepresented as being the original software.                      */
+/* 3. This notice may not be removed or altered from any source              */
+/*    distribution.                                                          */
+/*                                                                           */
+/*****************************************************************************/
+
+
+
+#include <stdio.h>
+#include <stdarg.h>
+
+/* common */
+#include "print.h"
+
+
+
+/*****************************************************************************/
+/*                                          Data                                    */
+/*****************************************************************************/
+
+
+
+unsigned char Verbosity = 0;           /* Verbose operation flag */
+
+
+
+/*****************************************************************************/
+/*                                          Code                                    */
+/*****************************************************************************/
+
+
+
+void Print (unsigned V, const char* Format, ...)
+/* Output according to Verbosity */
+{
+    va_list ap;
+
+    /* Check the verbosity */
+    if (V > Verbosity) {
+               /* Don't output this message */
+               return;
+    }
+
+    /* Output */
+    va_start (ap, Format);
+    vprintf (Format, ap);
+    va_end (ap);
+}
+
+
+
diff --git a/src/common/print.h b/src/common/print.h
new file mode 100644 (file)
index 0000000..4def4c9
--- /dev/null
@@ -0,0 +1,73 @@
+/*****************************************************************************/
+/*                                                                           */
+/*                                 print.h                                  */
+/*                                                                           */
+/*                             Program output                               */
+/*                                                                           */
+/*                                                                           */
+/*                                                                           */
+/* (C) 2001     Ullrich von Bassewitz                                       */
+/*               Wacholderweg 14                                             */
+/*               D-70597 Stuttgart                                           */
+/* EMail:        uz@musoftware.de                                            */
+/*                                                                           */
+/*                                                                           */
+/* This software is provided 'as-is', without any expressed or implied       */
+/* warranty.  In no event will the authors be held liable for any damages    */
+/* arising from the use of this software.                                    */
+/*                                                                           */
+/* Permission is granted to anyone to use this software for any purpose,     */
+/* including commercial applications, and to alter it and redistribute it    */
+/* freely, subject to the following restrictions:                            */
+/*                                                                           */
+/* 1. The origin of this software must not be misrepresented; you must not   */
+/*    claim that you wrote the original software. If you use this software   */
+/*    in a product, an acknowledgment in the product documentation would be  */
+/*    appreciated but is not required.                                       */
+/* 2. Altered source versions must be plainly marked as such, and must not   */
+/*    be misrepresented as being the original software.                      */
+/* 3. This notice may not be removed or altered from any source              */
+/*    distribution.                                                          */
+/*                                                                           */
+/*****************************************************************************/
+
+
+
+#ifndef PRINT_H
+#define PRINT_H
+
+
+
+/* common */
+#include "attrib.h"
+
+
+
+/*****************************************************************************/
+/*                                          Data                                    */
+/*****************************************************************************/
+
+
+
+extern unsigned char Verbosity;        /* Verbose operation flag */
+
+
+
+/*****************************************************************************/
+/*                                          Code                                    */
+/*****************************************************************************/
+
+
+
+void Print (unsigned V, const char* Format, ...) attribute ((format (printf, 2, 3)));
+/* Output according to Verbosity */
+
+
+
+/* End of print.h */
+
+#endif
+
+
+
+