diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/asshelp.c | 2 | ||||
-rw-r--r-- | common/asshelp.h | 4 | ||||
-rw-r--r-- | common/audit.c | 6 | ||||
-rw-r--r-- | common/homedir.c | 2 | ||||
-rw-r--r-- | common/logging.c | 62 | ||||
-rw-r--r-- | common/logging.h | 44 | ||||
-rw-r--r-- | common/membuf.h | 2 | ||||
-rw-r--r-- | common/miscellaneous.c | 16 | ||||
-rw-r--r-- | common/mischelp.h | 22 | ||||
-rw-r--r-- | common/util.h | 4 |
10 files changed, 82 insertions, 82 deletions
diff --git a/common/asshelp.c b/common/asshelp.c index d7125ad22..44476074c 100644 --- a/common/asshelp.c +++ b/common/asshelp.c @@ -85,7 +85,7 @@ my_libassuan_log_handler (assuan_context_t ctx, void *hook, return 0; /* Assuan debugging is not enabled. */ if (msg) - log_string (JNLIB_LOG_DEBUG, msg); + log_string (GPGRT_LOG_DEBUG, msg); return 1; } diff --git a/common/asshelp.h b/common/asshelp.h index 7b305856b..c685564a6 100644 --- a/common/asshelp.h +++ b/common/asshelp.h @@ -81,11 +81,11 @@ start_new_dirmngr (assuan_context_t *r_ctx, gpg_error_t print_assuan_status (assuan_context_t ctx, const char *keyword, const char *format, - ...) JNLIB_GCC_A_PRINTF(3,4); + ...) GPGRT_GCC_A_PRINTF(3,4); gpg_error_t vprint_assuan_status (assuan_context_t ctx, const char *keyword, const char *format, - va_list arg_ptr) JNLIB_GCC_A_PRINTF(3,0); + va_list arg_ptr) GPGRT_GCC_A_PRINTF(3,0); #endif /*GNUPG_COMMON_ASSHELP_H*/ diff --git a/common/audit.c b/common/audit.c index 875e59583..9ed5708de 100644 --- a/common/audit.c +++ b/common/audit.c @@ -72,11 +72,11 @@ struct audit_ctx_s static void writeout_para (audit_ctx_t ctx, - const char *format, ...) JNLIB_GCC_A_PRINTF(2,3); + const char *format, ...) GPGRT_GCC_A_PRINTF(2,3); static void writeout_li (audit_ctx_t ctx, const char *oktext, - const char *format, ...) JNLIB_GCC_A_PRINTF(3,4); + const char *format, ...) GPGRT_GCC_A_PRINTF(3,4); static void writeout_rem (audit_ctx_t ctx, - const char *format, ...) JNLIB_GCC_A_PRINTF(2,3); + const char *format, ...) GPGRT_GCC_A_PRINTF(2,3); /* Add NAME to the list of help tags. NAME needs to be a const string diff --git a/common/homedir.c b/common/homedir.c index e3efcee7b..8c73e99e0 100644 --- a/common/homedir.c +++ b/common/homedir.c @@ -268,7 +268,7 @@ check_portable_app (const char *dir) { unsigned int flags; log_get_prefix (&flags); - log_set_prefix (NULL, (flags | JNLIB_LOG_NO_REGISTRY)); + log_set_prefix (NULL, (flags | GPGRT_LOG_NO_REGISTRY)); } /* FIXME: We should read the file to detect special flags and print a warning if we don't understand them */ diff --git a/common/logging.c b/common/logging.c index 66cd09a68..f4dfc1522 100644 --- a/common/logging.c +++ b/common/logging.c @@ -570,12 +570,12 @@ log_set_prefix (const char *text, unsigned int flags) prefix_buffer[sizeof (prefix_buffer)-1] = 0; } - with_prefix = (flags & JNLIB_LOG_WITH_PREFIX); - with_time = (flags & JNLIB_LOG_WITH_TIME); - with_pid = (flags & JNLIB_LOG_WITH_PID); - running_detached = (flags & JNLIB_LOG_RUN_DETACHED); + with_prefix = (flags & GPGRT_LOG_WITH_PREFIX); + with_time = (flags & GPGRT_LOG_WITH_TIME); + with_pid = (flags & GPGRT_LOG_WITH_PID); + running_detached = (flags & GPGRT_LOG_RUN_DETACHED); #ifdef HAVE_W32_SYSTEM - no_registry = (flags & JNLIB_LOG_NO_REGISTRY); + no_registry = (flags & GPGRT_LOG_NO_REGISTRY); #endif } @@ -587,16 +587,16 @@ log_get_prefix (unsigned int *flags) { *flags = 0; if (with_prefix) - *flags |= JNLIB_LOG_WITH_PREFIX; + *flags |= GPGRT_LOG_WITH_PREFIX; if (with_time) - *flags |= JNLIB_LOG_WITH_TIME; + *flags |= GPGRT_LOG_WITH_TIME; if (with_pid) - *flags |= JNLIB_LOG_WITH_PID; + *flags |= GPGRT_LOG_WITH_PID; if (running_detached) - *flags |= JNLIB_LOG_RUN_DETACHED; + *flags |= GPGRT_LOG_RUN_DETACHED; #ifdef HAVE_W32_SYSTEM if (no_registry) - *flags |= JNLIB_LOG_NO_REGISTRY; + *flags |= GPGRT_LOG_NO_REGISTRY; #endif } return prefix_buffer; @@ -657,11 +657,11 @@ do_logv (int level, int ignore_arg_ptr, const char *fmt, va_list arg_ptr) } es_flockfile (logstream); - if (missing_lf && level != JNLIB_LOG_CONT) + if (missing_lf && level != GPGRT_LOG_CONT) es_putc_unlocked ('\n', logstream ); missing_lf = 0; - if (level != JNLIB_LOG_CONT) + if (level != GPGRT_LOG_CONT) { /* Note this does not work for multiple line logging as we would * need to print to a buffer first */ if (with_time && !force_prefixes) @@ -699,14 +699,14 @@ do_logv (int level, int ignore_arg_ptr, const char *fmt, va_list arg_ptr) switch (level) { - case JNLIB_LOG_BEGIN: break; - case JNLIB_LOG_CONT: break; - case JNLIB_LOG_INFO: break; - case JNLIB_LOG_WARN: break; - case JNLIB_LOG_ERROR: break; - case JNLIB_LOG_FATAL: es_fputs_unlocked ("Fatal: ",logstream ); break; - case JNLIB_LOG_BUG: es_fputs_unlocked ("Ohhhh jeeee: ", logstream); break; - case JNLIB_LOG_DEBUG: es_fputs_unlocked ("DBG: ", logstream ); break; + case GPGRT_LOG_BEGIN: break; + case GPGRT_LOG_CONT: break; + case GPGRT_LOG_INFO: break; + case GPGRT_LOG_WARN: break; + case GPGRT_LOG_ERROR: break; + case GPGRT_LOG_FATAL: es_fputs_unlocked ("Fatal: ",logstream ); break; + case GPGRT_LOG_BUG: es_fputs_unlocked ("Ohhhh jeeee: ", logstream); break; + case GPGRT_LOG_DEBUG: es_fputs_unlocked ("DBG: ", logstream ); break; default: es_fprintf_unlocked (logstream,"[Unknown log level %d]: ", level); break; @@ -722,14 +722,14 @@ do_logv (int level, int ignore_arg_ptr, const char *fmt, va_list arg_ptr) missing_lf = 1; } - if (level == JNLIB_LOG_FATAL) + if (level == GPGRT_LOG_FATAL) { if (missing_lf) es_putc_unlocked ('\n', logstream); es_funlockfile (logstream); exit (2); } - else if (level == JNLIB_LOG_BUG) + else if (level == GPGRT_LOG_BUG) { if (missing_lf) es_putc_unlocked ('\n', logstream ); @@ -785,7 +785,7 @@ log_info (const char *fmt, ...) va_list arg_ptr ; va_start (arg_ptr, fmt); - do_logv (JNLIB_LOG_INFO, 0, fmt, arg_ptr); + do_logv (GPGRT_LOG_INFO, 0, fmt, arg_ptr); va_end (arg_ptr); } @@ -796,7 +796,7 @@ log_error (const char *fmt, ...) va_list arg_ptr ; va_start (arg_ptr, fmt); - do_logv (JNLIB_LOG_ERROR, 0, fmt, arg_ptr); + do_logv (GPGRT_LOG_ERROR, 0, fmt, arg_ptr); va_end (arg_ptr); /* Protect against counter overflow. */ if (errorcount < 30000) @@ -810,7 +810,7 @@ log_fatal (const char *fmt, ...) va_list arg_ptr ; va_start (arg_ptr, fmt); - do_logv (JNLIB_LOG_FATAL, 0, fmt, arg_ptr); + do_logv (GPGRT_LOG_FATAL, 0, fmt, arg_ptr); va_end (arg_ptr); abort (); /* Never called; just to make the compiler happy. */ } @@ -822,7 +822,7 @@ log_bug (const char *fmt, ...) va_list arg_ptr ; va_start (arg_ptr, fmt); - do_logv (JNLIB_LOG_BUG, 0, fmt, arg_ptr); + do_logv (GPGRT_LOG_BUG, 0, fmt, arg_ptr); va_end (arg_ptr); abort (); /* Never called; just to make the compiler happy. */ } @@ -834,7 +834,7 @@ log_debug (const char *fmt, ...) va_list arg_ptr ; va_start (arg_ptr, fmt); - do_logv (JNLIB_LOG_DEBUG, 0, fmt, arg_ptr); + do_logv (GPGRT_LOG_DEBUG, 0, fmt, arg_ptr); va_end (arg_ptr); } @@ -845,7 +845,7 @@ log_printf (const char *fmt, ...) va_list arg_ptr; va_start (arg_ptr, fmt); - do_logv (fmt ? JNLIB_LOG_CONT : JNLIB_LOG_BEGIN, 0, fmt, arg_ptr); + do_logv (fmt ? GPGRT_LOG_CONT : GPGRT_LOG_BEGIN, 0, fmt, arg_ptr); va_end (arg_ptr); } @@ -855,7 +855,7 @@ log_printf (const char *fmt, ...) void log_flush (void) { - do_log_ignore_arg (JNLIB_LOG_CONT, NULL); + do_log_ignore_arg (GPGRT_LOG_CONT, NULL); } @@ -923,14 +923,14 @@ log_clock (const char *string) void bug_at( const char *file, int line, const char *func ) { - log_log (JNLIB_LOG_BUG, ("... this is a bug (%s:%d:%s)\n"), file, line, func); + log_log (GPGRT_LOG_BUG, ("... this is a bug (%s:%d:%s)\n"), file, line, func); abort (); /* Never called; just to make the compiler happy. */ } #else void bug_at( const char *file, int line ) { - log_log (JNLIB_LOG_BUG, _("you found a bug ... (%s:%d)\n"), file, line); + log_log (GPGRT_LOG_BUG, _("you found a bug ... (%s:%d)\n"), file, line); abort (); /* Never called; just to make the compiler happy. */ } #endif diff --git a/common/logging.h b/common/logging.h index da7a36653..477b9b3f3 100644 --- a/common/logging.h +++ b/common/logging.h @@ -48,8 +48,8 @@ int log_test_fd (int fd); int log_get_fd(void); estream_t log_get_stream (void); -#ifdef JNLIB_GCC_M_FUNCTION - void bug_at( const char *file, int line, const char *func ) JNLIB_GCC_A_NR; +#ifdef GPGRT_GCC_M_FUNCTION + void bug_at( const char *file, int line, const char *func ) GPGRT_GCC_A_NR; # define BUG() bug_at( __FILE__ , __LINE__, __FUNCTION__ ) #else void bug_at( const char *file, int line ); @@ -57,34 +57,34 @@ estream_t log_get_stream (void); #endif /* 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 +#define GPGRT_LOG_WITH_PREFIX 1 +#define GPGRT_LOG_WITH_TIME 2 +#define GPGRT_LOG_WITH_PID 4 +#define GPGRT_LOG_RUN_DETACHED 256 +#define GPGRT_LOG_NO_REGISTRY 512 /* Log levels as used by log_log. */ enum jnlib_log_levels { - JNLIB_LOG_BEGIN, - JNLIB_LOG_CONT, - JNLIB_LOG_INFO, - JNLIB_LOG_WARN, - JNLIB_LOG_ERROR, - JNLIB_LOG_FATAL, - JNLIB_LOG_BUG, - JNLIB_LOG_DEBUG + GPGRT_LOG_BEGIN, + GPGRT_LOG_CONT, + GPGRT_LOG_INFO, + GPGRT_LOG_WARN, + GPGRT_LOG_ERROR, + GPGRT_LOG_FATAL, + GPGRT_LOG_BUG, + GPGRT_LOG_DEBUG }; -void log_log (int level, const char *fmt, ...) JNLIB_GCC_A_PRINTF(2,3); +void log_log (int level, const char *fmt, ...) GPGRT_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); -void log_bug( const char *fmt, ... ) JNLIB_GCC_A_NR_PRINTF(1,2); -void log_fatal( const char *fmt, ... ) JNLIB_GCC_A_NR_PRINTF(1,2); -void log_error( const char *fmt, ... ) JNLIB_GCC_A_PRINTF(1,2); -void log_info( const char *fmt, ... ) JNLIB_GCC_A_PRINTF(1,2); -void log_debug( const char *fmt, ... ) JNLIB_GCC_A_PRINTF(1,2); -void log_printf( const char *fmt, ... ) JNLIB_GCC_A_PRINTF(1,2); +void log_bug( const char *fmt, ... ) GPGRT_GCC_A_NR_PRINTF(1,2); +void log_fatal( const char *fmt, ... ) GPGRT_GCC_A_NR_PRINTF(1,2); +void log_error( const char *fmt, ... ) GPGRT_GCC_A_PRINTF(1,2); +void log_info( const char *fmt, ... ) GPGRT_GCC_A_PRINTF(1,2); +void log_debug( const char *fmt, ... ) GPGRT_GCC_A_PRINTF(1,2); +void log_printf( const char *fmt, ... ) GPGRT_GCC_A_PRINTF(1,2); void log_flush (void); /* Print a hexdump of BUFFER. With TEXT passes as NULL print just the diff --git a/common/membuf.h b/common/membuf.h index dfa236d82..32d4f90a2 100644 --- a/common/membuf.h +++ b/common/membuf.h @@ -55,7 +55,7 @@ void clear_membuf (membuf_t *mb, size_t amount); void put_membuf (membuf_t *mb, const void *buf, size_t len); void put_membuf_str (membuf_t *mb, const char *string); void put_membuf_printf (membuf_t *mb, const char *format, - ...) JNLIB_GCC_A_PRINTF(2,3); + ...) GPGRT_GCC_A_PRINTF(2,3); void *get_membuf (membuf_t *mb, size_t *len); void *get_membuf_shrink (membuf_t *mb, size_t *len); const void *peek_membuf (membuf_t *mb, size_t *len); diff --git a/common/miscellaneous.c b/common/miscellaneous.c index 95dbb670d..a0dae8fb1 100644 --- a/common/miscellaneous.c +++ b/common/miscellaneous.c @@ -44,14 +44,14 @@ my_gcry_logger (void *dummy, int level, const char *fmt, va_list arg_ptr) /* Map the log levels. */ switch (level) { - case GCRY_LOG_CONT: level = JNLIB_LOG_CONT; break; - case GCRY_LOG_INFO: level = JNLIB_LOG_INFO; break; - case GCRY_LOG_WARN: level = JNLIB_LOG_WARN; break; - case GCRY_LOG_ERROR:level = JNLIB_LOG_ERROR; break; - case GCRY_LOG_FATAL:level = JNLIB_LOG_FATAL; break; - case GCRY_LOG_BUG: level = JNLIB_LOG_BUG; break; - case GCRY_LOG_DEBUG:level = JNLIB_LOG_DEBUG; break; - default: level = JNLIB_LOG_ERROR; break; + case GCRY_LOG_CONT: level = GPGRT_LOG_CONT; break; + case GCRY_LOG_INFO: level = GPGRT_LOG_INFO; break; + case GCRY_LOG_WARN: level = GPGRT_LOG_WARN; break; + case GCRY_LOG_ERROR:level = GPGRT_LOG_ERROR; break; + case GCRY_LOG_FATAL:level = GPGRT_LOG_FATAL; break; + case GCRY_LOG_BUG: level = GPGRT_LOG_BUG; break; + case GCRY_LOG_DEBUG:level = GPGRT_LOG_DEBUG; break; + default: level = GPGRT_LOG_ERROR; break; } log_logv (level, fmt, arg_ptr); } diff --git a/common/mischelp.h b/common/mischelp.h index df009ad5e..940651f5e 100644 --- a/common/mischelp.h +++ b/common/mischelp.h @@ -48,25 +48,25 @@ time_t timegm (struct tm *tm); #define DIMof(type,member) DIM(((type *)0)->member) -#undef JNLIB_GCC_HAVE_PUSH_PRAGMA +#undef GPGRT_GCC_HAVE_PUSH_PRAGMA #if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 5 ) -# define JNLIB_GCC_M_FUNCTION 1 -# define JNLIB_GCC_A_NR __attribute__ ((noreturn)) +# define GPGRT_GCC_M_FUNCTION 1 /* __FUNCTION__ macro is available. */ +# define GPGRT_GCC_A_NR __attribute__ ((noreturn)) # if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4 ) -# define JNLIB_GCC_HAVE_PUSH_PRAGMA 1 -# define JNLIB_GCC_A_PRINTF( f, a ) \ +# define GPGRT_GCC_HAVE_PUSH_PRAGMA 1 +# define GPGRT_GCC_A_PRINTF( f, a ) \ __attribute__ ((format (__gnu_printf__,f,a))) -# define JNLIB_GCC_A_NR_PRINTF( f, a ) \ +# define GPGRT_GCC_A_NR_PRINTF( f, a ) \ __attribute__ ((noreturn, format (__gnu_printf__,f,a))) # else -# define JNLIB_GCC_A_PRINTF( f, a ) __attribute__ ((format (printf,f,a))) -# define JNLIB_GCC_A_NR_PRINTF( f, a ) \ +# define GPGRT_GCC_A_PRINTF( f, a ) __attribute__ ((format (printf,f,a))) +# define GPGRT_GCC_A_NR_PRINTF( f, a ) \ __attribute__ ((noreturn, format (printf,f,a))) # endif #else -# define JNLIB_GCC_A_NR -# define JNLIB_GCC_A_PRINTF( f, a ) -# define JNLIB_GCC_A_NR_PRINTF( f, a ) +# define GPGRT_GCC_A_NR +# define GPGRT_GCC_A_PRINTF( f, a ) +# define GPGRT_GCC_A_NR_PRINTF( f, a ) #endif diff --git a/common/util.h b/common/util.h index d22820d86..89f8bf28c 100644 --- a/common/util.h +++ b/common/util.h @@ -363,9 +363,9 @@ const char *gnupg_messages_locale_name (void); void setup_libgcrypt_logging (void); /* Same as estream_asprintf but die on memory failure. */ -char *xasprintf (const char *fmt, ...) JNLIB_GCC_A_PRINTF(1,2); +char *xasprintf (const char *fmt, ...) GPGRT_GCC_A_PRINTF(1,2); /* This is now an alias to estream_asprintf. */ -char *xtryasprintf (const char *fmt, ...) JNLIB_GCC_A_PRINTF(1,2); +char *xtryasprintf (const char *fmt, ...) GPGRT_GCC_A_PRINTF(1,2); /* Replacement for gcry_cipher_algo_name. */ const char *gnupg_cipher_algo_name (int algo); |