summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1999-12-08 21:03:01 +0000
committerWerner Koch <wk@gnupg.org>1999-12-08 21:03:01 +0000
commit2af22dd84e396dc2baf12d37d4642ceba4dffc83 (patch)
treefc2c24de49bf8615b8a2c0958711cf8d1231fcce /src/misc.c
parent5d68aaccefcb3e9c7ff515096a240712962b72c9 (diff)
downloadlibgcrypt-2af22dd84e396dc2baf12d37d4642ceba4dffc83.tar.gz
See ChangeLog: Wed Dec 8 21:58:32 CET 1999 Werner Koch
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/misc.c b/src/misc.c
index 15a01fd5..8f750c75 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -1,5 +1,5 @@
-/* misc.c - symmetric cipher function interface
- * Copyright (C) 1998 Free Software Foundation, Inc.
+/* misc.c
+ * Copyright (C) 1999 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -28,6 +28,8 @@
#include "g10lib.h"
+static int verbosity_level = 0; /* fixme: add a function to set it */
+
static void (*fatal_error_handler)(void*,int, const char*) = NULL;
static void *fatal_error_handler_value = 0;
static void (*log_handler)(void*,int, const char*, va_list) = NULL;
@@ -92,6 +94,17 @@ gcry_set_log_handler( void (*logf)(void*,int, const char*, va_list ),
log_handler_value = opaque;
}
+void
+g10_set_log_verbosity( int level )
+{
+ verbosity_level = level;
+}
+
+int
+g10_log_verbosity( int level )
+{
+ return verbosity_level >= level;
+}
/****************
* This is our log function which prints all log messages to stderr or
@@ -139,7 +152,7 @@ g10_bug( const char *file, int line, const char *func )
{
g10_log( GCRY_LOG_BUG,
("... this is a bug (%s:%d:%s)\n"), file, line, func );
- abort(); /* never called, bugs it makes the compiler happy */
+ abort(); /* never called, but it makes the compiler happy */
}
#else
void
@@ -147,7 +160,7 @@ g10_bug( const char *file, int line )
{
g10_log( GCRY_LOG_BUG,
_("you found a bug ... (%s:%d)\n"), file, line);
- abort(); /* never called, bugs it makes the compiler happy */
+ abort(); /* never called, but it makes the compiler happy */
}
#endif