aboutsummaryrefslogtreecommitdiffstats
path: root/common/logging.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-04-24 13:19:10 +0000
committerWerner Koch <[email protected]>2015-04-24 13:19:10 +0000
commit17bcd087082d01c48c60ff20d7f9a40f34c6969f (patch)
tree0fe57bea4c9827cd9bd6b49562c68b36c7046a02 /common/logging.h
parentgpg: Move all DNS access to Dirmngr. (diff)
downloadgnupg-17bcd087082d01c48c60ff20d7f9a40f34c6969f.tar.gz
gnupg-17bcd087082d01c48c60ff20d7f9a40f34c6969f.zip
common: Remove libjnlib-config.h (jnlib merge).
* common/libjnlib-config.h: Remove. * common/common-defs.h (getenv) [HAVE_GETENV]: New. From removed header. (getpid) [HAVE_W32CE_SYSTEM]: New. From removed header. * common/argparse.c: Include util.h and common-defs.h. Replace jnlib_ macro names for non-GNUPG builds by x* names. * common/dotlock.c: Ditto. * common/logging.c: Include util.h and common-defs.h. Replace jnlib_ symbol names by x* names. * common/strlist.c: Ditto. * common/utf8conv.c: Ditto. * common/w32-reg.c: Ditto. * common/mischelp.c: Ditto. Also remove _jnlib_free. * common/stringhelp.c: Ditto. (JNLIB_LOG_WITH_PREFIX): Do not depend on this macro. * common/logging.h (JNLIB_LOG_WITH_PREFIX): Do not depend on this macro. -- This is part 1 of the patches to merge the jnlib files into common/. It does not make much sense to keep jnlib/ files separate. They are not often use elsewhere and maintaining the complex marcos stuff is too troublesome for the future. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r--common/logging.h21
1 files changed, 9 insertions, 12 deletions
diff --git a/common/logging.h b/common/logging.h
index 7487b35d4..da7a36653 100644
--- a/common/logging.h
+++ b/common/logging.h
@@ -33,16 +33,10 @@
#define LIBJNLIB_LOGGING_H
#include <stdio.h>
+#include <stdarg.h>
#include "mischelp.h"
#include "w32help.h"
-/* Flag values for log_set_prefix. */
-#define JNLIB_LOG_WITH_PREFIX 1
-#define JNLIB_LOG_WITH_TIME 2
-#define JNLIB_LOG_WITH_PID 4
-#define JNLIB_LOG_RUN_DETACHED 256
-#define JNLIB_LOG_NO_REGISTRY 512
-
int log_get_errorcount (int clear);
void log_inc_errorcount (void);
void log_set_file( const char *name );
@@ -62,10 +56,14 @@ estream_t log_get_stream (void);
# define BUG() bug_at( __FILE__ , __LINE__ )
#endif
-/* To avoid mandatory inclusion of stdarg and other stuff, do it only
- if explicitly requested to do so. */
-#ifdef JNLIB_NEED_LOG_LOGV
-#include <stdarg.h>
+/* Flag values for log_set_prefix. */
+#define JNLIB_LOG_WITH_PREFIX 1
+#define JNLIB_LOG_WITH_TIME 2
+#define JNLIB_LOG_WITH_PID 4
+#define JNLIB_LOG_RUN_DETACHED 256
+#define JNLIB_LOG_NO_REGISTRY 512
+
+/* Log levels as used by log_log. */
enum jnlib_log_levels {
JNLIB_LOG_BEGIN,
JNLIB_LOG_CONT,
@@ -79,7 +77,6 @@ enum jnlib_log_levels {
void log_log (int level, const char *fmt, ...) JNLIB_GCC_A_PRINTF(2,3);
void log_logv (int level, const char *fmt, va_list arg_ptr);
void log_string (int level, const char *string);
-#endif /*JNLIB_NEED_LOG_LOGV*/
void log_bug( const char *fmt, ... ) JNLIB_GCC_A_NR_PRINTF(1,2);