summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorroot <devnull@localhost>1995-11-27 22:31:21 +0000
committerroot <devnull@localhost>1995-11-27 22:31:21 +0000
commit7153c160969d70a083f791bf75f9b4d09d2f2a45 (patch)
tree8548631eab9ea9afa933aba9ef1ec7d48a5bb5d4 /rpmio
downloadrpm-7153c160969d70a083f791bf75f9b4d09d2f2a45.tar.gz
Initial revision
CVS patchset: 1 CVS date: 1995/11/27 22:31:21
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/messages.c49
-rw-r--r--rpmio/rpmerr.c8
2 files changed, 57 insertions, 0 deletions
diff --git a/rpmio/messages.c b/rpmio/messages.c
new file mode 100644
index 000000000..81ba0196b
--- /dev/null
+++ b/rpmio/messages.c
@@ -0,0 +1,49 @@
+#include <stdarg.h>
+#include <stdio.h>
+
+#include "messages.h"
+
+static minLevel = MESS_NORMAL;
+
+void increaseVerbosity(void) {
+ minLevel--;
+}
+
+void setVerbosity(int level) {
+ minLevel = level;
+}
+
+void message(int level, char * format, ...) {
+ va_list args;
+
+ va_start(args, format);
+ if (level >= minLevel) {
+ switch (level) {
+ case MESS_VERBOSE:
+ case MESS_NORMAL:
+ vfprintf(stdout, format, args);
+ break;
+
+ case MESS_DEBUG:
+ fprintf(stdout, "D: ");
+ vfprintf(stdout, format, args);
+ break;
+
+ case MESS_WARNING:
+ fprintf(stderr, "warning: ");
+ vfprintf(stderr, format, args);
+ break;
+
+ case MESS_ERROR:
+ fprintf(stderr, "error: ");
+ vfprintf(stderr, format, args);
+ break;
+
+ case MESS_FATALERROR:
+ fprintf(stderr, "fatal error: ");
+ vfprintf(stderr, format, args);
+ exit(1);
+ break;
+ }
+ }
+}
diff --git a/rpmio/rpmerr.c b/rpmio/rpmerr.c
new file mode 100644
index 000000000..84f743ceb
--- /dev/null
+++ b/rpmio/rpmerr.c
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+#include "rpmerr.h"
+
+void error(int code, ...)
+{
+ fprintf(stderr, "error, error, error\n");
+}