From 3549d8275503943dcfaf30634a6ddf9b3e966bf1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 21 Mar 2015 11:24:30 +0000 Subject: avoiding module duplicate during linking git-svn-id: http://svn.miranda-ng.org/main/trunk@12461 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/Dbx_mdb_12.vcxproj | 6 +- plugins/MirOTR/Libgcrypt/Libgcrypt_10.vcxproj | 4 +- .../MirOTR/Libgcrypt/Libgcrypt_10.vcxproj.filters | 19 +- plugins/MirOTR/Libgcrypt/Libgcrypt_12.vcxproj | 4 +- .../MirOTR/Libgcrypt/Libgcrypt_12.vcxproj.filters | 19 +- plugins/MirOTR/Libgpg-error/err-visibility.c | 689 +++++++++++++++++++++ plugins/MirOTR/Libgpg-error/err-visibility.h | 253 ++++++++ plugins/MirOTR/Libgpg-error/gpgrt-int.h | 2 +- plugins/MirOTR/Libgpg-error/visibility.c | 689 --------------------- plugins/MirOTR/Libgpg-error/visibility.h | 253 -------- plugins/MirOTR/ekhtml/ekhtml_12.vcxproj.filters | 4 - plugins/MirOTR/src/otr.cpp | 88 ++- 12 files changed, 1004 insertions(+), 1026 deletions(-) create mode 100644 plugins/MirOTR/Libgpg-error/err-visibility.c create mode 100644 plugins/MirOTR/Libgpg-error/err-visibility.h delete mode 100644 plugins/MirOTR/Libgpg-error/visibility.c delete mode 100644 plugins/MirOTR/Libgpg-error/visibility.h diff --git a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj index 69409a3a09..ec22d8b299 100644 --- a/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj +++ b/plugins/Dbx_mdb/Dbx_mdb_12.vcxproj @@ -20,7 +20,7 @@ Dbx_mdb - {6D25A8AD-5251-4DAE-AA49-0E819F6A615A} + {E0ACDEA0-0AC9-4431-8CA3-6B0CCACB2E18} @@ -205,10 +205,10 @@ - NotUsing + NotUsing - NotUsing + NotUsing Create diff --git a/plugins/MirOTR/Libgcrypt/Libgcrypt_10.vcxproj b/plugins/MirOTR/Libgcrypt/Libgcrypt_10.vcxproj index 8b53b68889..c192cfe7ac 100644 --- a/plugins/MirOTR/Libgcrypt/Libgcrypt_10.vcxproj +++ b/plugins/MirOTR/Libgcrypt/Libgcrypt_10.vcxproj @@ -126,6 +126,7 @@ + @@ -241,12 +242,12 @@ - + @@ -297,7 +298,6 @@ - diff --git a/plugins/MirOTR/Libgcrypt/Libgcrypt_10.vcxproj.filters b/plugins/MirOTR/Libgcrypt/Libgcrypt_10.vcxproj.filters index 60739541cb..fb66464cf4 100644 --- a/plugins/MirOTR/Libgcrypt/Libgcrypt_10.vcxproj.filters +++ b/plugins/MirOTR/Libgcrypt/Libgcrypt_10.vcxproj.filters @@ -198,9 +198,6 @@ cipher - - compat - mpi @@ -306,9 +303,6 @@ src - - src - src @@ -372,9 +366,6 @@ error - - error - error @@ -384,6 +375,10 @@ error + + + error + @@ -422,9 +417,6 @@ cipher - - compat - mpi @@ -536,7 +528,8 @@ error - + + error diff --git a/plugins/MirOTR/Libgcrypt/Libgcrypt_12.vcxproj b/plugins/MirOTR/Libgcrypt/Libgcrypt_12.vcxproj index 94a453af74..dcb6926569 100644 --- a/plugins/MirOTR/Libgcrypt/Libgcrypt_12.vcxproj +++ b/plugins/MirOTR/Libgcrypt/Libgcrypt_12.vcxproj @@ -114,6 +114,7 @@ + @@ -229,12 +230,12 @@ - + @@ -285,7 +286,6 @@ - diff --git a/plugins/MirOTR/Libgcrypt/Libgcrypt_12.vcxproj.filters b/plugins/MirOTR/Libgcrypt/Libgcrypt_12.vcxproj.filters index 60739541cb..fb66464cf4 100644 --- a/plugins/MirOTR/Libgcrypt/Libgcrypt_12.vcxproj.filters +++ b/plugins/MirOTR/Libgcrypt/Libgcrypt_12.vcxproj.filters @@ -198,9 +198,6 @@ cipher - - compat - mpi @@ -306,9 +303,6 @@ src - - src - src @@ -372,9 +366,6 @@ error - - error - error @@ -384,6 +375,10 @@ error + + + error + @@ -422,9 +417,6 @@ cipher - - compat - mpi @@ -536,7 +528,8 @@ error - + + error diff --git a/plugins/MirOTR/Libgpg-error/err-visibility.c b/plugins/MirOTR/Libgpg-error/err-visibility.c new file mode 100644 index 0000000000..9213ce92f5 --- /dev/null +++ b/plugins/MirOTR/Libgpg-error/err-visibility.c @@ -0,0 +1,689 @@ +/* visibility.c - Wrapper for all public functions. + * Copyright (C) 2014 g10 Code GmbH + * + * This file is part of libgpg-error. + * + * libgpg-error is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * libgpg-error is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + */ + +#include +#include + +#define _GPGRT_INCL_BY_VISIBILITY_C 1 +#include "gpgrt-int.h" + +const char * +gpg_strerror (gpg_error_t err) +{ + return _gpg_strerror (err); +} + +int +gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen) +{ + return _gpg_strerror_r (err, buf, buflen); +} + +const char * +gpg_strsource (gpg_error_t err) +{ + return _gpg_strsource (err); +} + +gpg_err_code_t +gpg_err_code_from_errno (int err) +{ + return _gpg_err_code_from_errno (err); +} + +int +gpg_err_code_to_errno (gpg_err_code_t code) +{ + return _gpg_err_code_to_errno (code); +} + +gpg_err_code_t +gpg_err_code_from_syserror (void) +{ + return _gpg_err_code_from_syserror (); +} + +void +gpg_err_set_errno (int err) +{ + _gpg_err_set_errno (err); +} + + +gpg_error_t +gpg_err_init (void) +{ + return _gpg_err_init (); +} + +void +gpg_err_deinit (int mode) +{ + _gpg_err_deinit (mode); +} + +const char * +gpg_error_check_version (const char *req_version) +{ + return _gpg_error_check_version (req_version); +} + +const char * +gpgrt_check_version (const char *req_version) +{ + return _gpg_error_check_version (req_version); +} + +void +gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void)) +{ + _gpgrt_set_syscall_clamp (pre, post); +} + +void +gpgrt_set_alloc_func (void *(*f)(void *a, size_t n)) +{ + _gpgrt_set_alloc_func (f); +} + + +gpg_err_code_t +gpgrt_lock_init (gpgrt_lock_t *lockhd) +{ + return _gpgrt_lock_init (lockhd); +} + +gpg_err_code_t +gpgrt_lock_lock (gpgrt_lock_t *lockhd) +{ + return _gpgrt_lock_lock (lockhd); +} + +gpg_err_code_t +gpgrt_lock_trylock (gpgrt_lock_t *lockhd) +{ + return _gpgrt_lock_trylock (lockhd); +} + +gpg_err_code_t +gpgrt_lock_unlock (gpgrt_lock_t *lockhd) +{ + return _gpgrt_lock_unlock (lockhd); +} + +gpg_err_code_t +gpgrt_lock_destroy (gpgrt_lock_t *lockhd) +{ + return _gpgrt_lock_destroy (lockhd); +} + +gpg_err_code_t +gpgrt_yield (void) +{ + return _gpgrt_yield (); +} + + + +estream_t +gpgrt_fopen (const char *_GPGRT__RESTRICT path, + const char *_GPGRT__RESTRICT mode) +{ + return _gpgrt_fopen (path, mode); +} + +estream_t +gpgrt_mopen (void *_GPGRT__RESTRICT data, size_t data_n, size_t data_len, + unsigned int grow, + void *(*func_realloc) (void *mem, size_t size), + void (*func_free) (void *mem), + const char *_GPGRT__RESTRICT mode) +{ + return _gpgrt_mopen (data, data_n, data_len, grow, func_realloc, func_free, + mode); +} + +estream_t +gpgrt_fopenmem (size_t memlimit, const char *_GPGRT__RESTRICT mode) +{ + return _gpgrt_fopenmem (memlimit, mode); +} + +estream_t +gpgrt_fopenmem_init (size_t memlimit, const char *_GPGRT__RESTRICT mode, + const void *data, size_t datalen) +{ + return _gpgrt_fopenmem_init (memlimit, mode, data, datalen); +} + +estream_t +gpgrt_fdopen (int filedes, const char *mode) +{ + return _gpgrt_fdopen (filedes, mode); +} + +estream_t +gpgrt_fdopen_nc (int filedes, const char *mode) +{ + return _gpgrt_fdopen_nc (filedes, mode); +} + +estream_t +gpgrt_sysopen (es_syshd_t *syshd, const char *mode) +{ + return _gpgrt_sysopen (syshd, mode); +} + +estream_t +gpgrt_sysopen_nc (es_syshd_t *syshd, const char *mode) +{ + return _gpgrt_sysopen_nc (syshd, mode); +} + +estream_t +gpgrt_fpopen (FILE *fp, const char *mode) +{ + return _gpgrt_fpopen (fp, mode); +} + +estream_t +gpgrt_fpopen_nc (FILE *fp, const char *mode) +{ + return _gpgrt_fpopen_nc (fp, mode); +} + +estream_t +gpgrt_freopen (const char *_GPGRT__RESTRICT path, + const char *_GPGRT__RESTRICT mode, + estream_t _GPGRT__RESTRICT stream) +{ + return _gpgrt_freopen (path, mode, stream); +} + +estream_t +gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie, + const char *_GPGRT__RESTRICT mode, + gpgrt_cookie_io_functions_t functions) +{ + return _gpgrt_fopencookie (cookie, mode, functions); +} + +int +gpgrt_fclose (estream_t stream) +{ + return _gpgrt_fclose (stream); +} + +int +gpgrt_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen) +{ + return _gpgrt_fclose_snatch (stream, r_buffer, r_buflen); +} + +int +gpgrt_onclose (estream_t stream, int mode, + void (*fnc) (estream_t, void*), void *fnc_value) +{ + return _gpgrt_onclose (stream, mode, fnc, fnc_value); +} + +int +gpgrt_fileno (estream_t stream) +{ + return _gpgrt_fileno (stream); +} + +int +gpgrt_fileno_unlocked (estream_t stream) +{ + return _gpgrt_fileno_unlocked (stream); +} + +int +gpgrt_syshd (estream_t stream, es_syshd_t *syshd) +{ + return _gpgrt_syshd (stream, syshd); +} + +int +gpgrt_syshd_unlocked (estream_t stream, es_syshd_t *syshd) +{ + return _gpgrt_syshd_unlocked (stream, syshd); +} + +void +_gpgrt_set_std_fd (int no, int fd) +{ + _gpgrt__set_std_fd (no, fd); /* (double dash in name) */ +} + +estream_t +_gpgrt_get_std_stream (int fd) +{ + return _gpgrt__get_std_stream (fd); /* (double dash in name) */ +} + +void +gpgrt_flockfile (estream_t stream) +{ + _gpgrt_flockfile (stream); +} + +int +gpgrt_ftrylockfile (estream_t stream) +{ + return _gpgrt_ftrylockfile (stream); +} + +void +gpgrt_funlockfile (estream_t stream) +{ + _gpgrt_funlockfile (stream); +} + +int +_gpgrt_pending (estream_t stream) +{ + return _gpgrt__pending (stream); +} + +int +_gpgrt_pending_unlocked (estream_t stream) +{ + return _gpgrt__pending_unlocked (stream); +} + +int +gpgrt_feof (estream_t stream) +{ + return _gpgrt_feof (stream); +} + +int +gpgrt_feof_unlocked (estream_t stream) +{ + return _gpgrt_feof_unlocked (stream); +} + +int +gpgrt_ferror (estream_t stream) +{ + return _gpgrt_ferror (stream); +} + +int +gpgrt_ferror_unlocked (estream_t stream) +{ + return _gpgrt_ferror_unlocked (stream); +} + +void +gpgrt_clearerr (estream_t stream) +{ + _gpgrt_clearerr (stream); +} + +void +gpgrt_clearerr_unlocked (estream_t stream) +{ + _gpgrt_clearerr_unlocked (stream); +} + +int +gpgrt_fflush (estream_t stream) +{ + return _gpgrt_fflush (stream); +} + +int +gpgrt_fseek (estream_t stream, long int offset, int whence) +{ + return _gpgrt_fseek (stream, offset, whence); +} + +int +gpgrt_fseeko (estream_t stream, gpgrt_off_t offset, int whence) +{ + return _gpgrt_fseeko (stream, offset, whence); +} + +long int +gpgrt_ftell (estream_t stream) +{ + return _gpgrt_ftell (stream); +} + +gpgrt_off_t +gpgrt_ftello (estream_t stream) +{ + return _gpgrt_ftello (stream); +} + +void +gpgrt_rewind (estream_t stream) +{ + _gpgrt_rewind (stream); +} + +int +gpgrt_fgetc (estream_t stream) +{ + return _gpgrt_fgetc (stream); +} + +int +_gpgrt_getc_underflow (estream_t stream) +{ + return _gpgrt__getc_underflow (stream); +} + +int +gpgrt_fputc (int c, estream_t stream) +{ + return _gpgrt_fputc (c, stream); +} + +int +_gpgrt_putc_overflow (int c, estream_t stream) +{ + return _gpgrt__putc_overflow (c, stream); +} + +int +gpgrt_ungetc (int c, estream_t stream) +{ + return _gpgrt_ungetc (c, stream); +} + +int +gpgrt_read (estream_t _GPGRT__RESTRICT stream, + void *_GPGRT__RESTRICT buffer, size_t bytes_to_read, + size_t *_GPGRT__RESTRICT bytes_read) +{ + return _gpgrt_read (stream, buffer, bytes_to_read, bytes_read); +} + +int +gpgrt_write (estream_t _GPGRT__RESTRICT stream, + const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write, + size_t *_GPGRT__RESTRICT bytes_written) +{ + return _gpgrt_write (stream, buffer, bytes_to_write, bytes_written); +} + +int +gpgrt_write_sanitized (estream_t _GPGRT__RESTRICT stream, + const void * _GPGRT__RESTRICT buffer, size_t length, + const char * delimiters, + size_t * _GPGRT__RESTRICT bytes_written) +{ + return _gpgrt_write_sanitized (stream, buffer, length, delimiters, + bytes_written); +} + +int +gpgrt_write_hexstring (estream_t _GPGRT__RESTRICT stream, + const void *_GPGRT__RESTRICT buffer, size_t length, + int reserved, size_t *_GPGRT__RESTRICT bytes_written ) +{ + return _gpgrt_write_hexstring (stream, buffer, length, reserved, + bytes_written); +} + +size_t +gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems, + estream_t _GPGRT__RESTRICT stream) +{ + return _gpgrt_fread (ptr, size, nitems, stream); +} + +size_t +gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems, + estream_t _GPGRT__RESTRICT stream) +{ + return _gpgrt_fwrite (ptr, size, nitems, stream); +} + +char * +gpgrt_fgets (char *_GPGRT__RESTRICT buffer, int length, + estream_t _GPGRT__RESTRICT stream) +{ + return _gpgrt_fgets (buffer, length, stream); +} + +int +gpgrt_fputs (const char *_GPGRT__RESTRICT s, estream_t _GPGRT__RESTRICT stream) +{ + return _gpgrt_fputs (s, stream); +} + +int +gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s, + estream_t _GPGRT__RESTRICT stream) +{ + return _gpgrt_fputs_unlocked (s, stream); +} + +gpgrt_ssize_t +gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr, + size_t *_GPGRT__RESTRICT n, estream_t _GPGRT__RESTRICT stream) +{ + return _gpgrt_getline (lineptr, n, stream); +} + +gpgrt_ssize_t +gpgrt_read_line (estream_t stream, + char **addr_of_buffer, size_t *length_of_buffer, + size_t *max_length) +{ + return _gpgrt_read_line (stream, addr_of_buffer, length_of_buffer, + max_length); +} + +void +gpgrt_free (void *a) +{ + if (a) + _gpgrt_free (a); +} + +int +gpgrt_vfprintf (estream_t _GPGRT__RESTRICT stream, + const char *_GPGRT__RESTRICT format, + va_list ap) +{ + return _gpgrt_vfprintf (stream, format, ap); +} + +int +gpgrt_vfprintf_unlocked (estream_t _GPGRT__RESTRICT stream, + const char *_GPGRT__RESTRICT format, + va_list ap) +{ + return _gpgrt_vfprintf_unlocked (stream, format, ap); +} + +int +gpgrt_printf (const char *_GPGRT__RESTRICT format, ...) +{ + va_list ap; + int rc; + + va_start (ap, format); + rc = _gpgrt_vfprintf (es_stdout, format, ap); + va_end (ap); + + return rc; +} + +int +gpgrt_printf_unlocked (const char *_GPGRT__RESTRICT format, ...) +{ + va_list ap; + int rc; + + va_start (ap, format); + rc = _gpgrt_vfprintf_unlocked (es_stdout, format, ap); + va_end (ap); + + return rc; +} + +int +gpgrt_fprintf (estream_t _GPGRT__RESTRICT stream, + const char *_GPGRT__RESTRICT format, ...) +{ + va_list ap; + int rc; + + va_start (ap, format); + rc = _gpgrt_vfprintf (stream, format, ap); + va_end (ap); + + return rc; +} + +int +gpgrt_fprintf_unlocked (estream_t _GPGRT__RESTRICT stream, + const char *_GPGRT__RESTRICT format, ...) +{ + va_list ap; + int rc; + + va_start (ap, format); + rc = _gpgrt_vfprintf_unlocked (stream, format, ap); + va_end (ap); + + return rc; +} + +int +gpgrt_setvbuf (estream_t _GPGRT__RESTRICT stream, + char *_GPGRT__RESTRICT buf, int type, size_t size) +{ + return _gpgrt_setvbuf (stream, buf, type, size); +} + +void +gpgrt_setbuf (estream_t _GPGRT__RESTRICT stream, char *_GPGRT__RESTRICT buf) +{ + _gpgrt_setvbuf (stream, buf, buf? _IOFBF : _IONBF, BUFSIZ); +} + +void +gpgrt_set_binary (estream_t stream) +{ + _gpgrt_set_binary (stream); +} + +estream_t +gpgrt_tmpfile (void) +{ + return _gpgrt_tmpfile (); +} + +void +gpgrt_opaque_set (estream_t stream, void *opaque) +{ + _gpgrt_opaque_set (stream, opaque); +} + +void * +gpgrt_opaque_get (estream_t stream) +{ + return _gpgrt_opaque_get (stream); +} + +void +gpgrt_fname_set (estream_t stream, const char *fname) +{ + _gpgrt_fname_set (stream, fname); +} + +const char * +gpgrt_fname_get (estream_t stream) +{ + return _gpgrt_fname_get (stream); +} + +int +gpgrt_asprintf (char **r_buf, const char *_GPGRT__RESTRICT format, ...) +{ + va_list ap; + int rc; + + va_start (ap, format); + rc = _gpgrt_estream_vasprintf (r_buf, format, ap); + va_end (ap); + + return rc; +} + +int +gpgrt_vasprintf (char **r_buf, const char *_GPGRT__RESTRICT format, va_list ap) +{ + return _gpgrt_estream_vasprintf (r_buf, format, ap); +} + +char * +gpgrt_bsprintf (const char *_GPGRT__RESTRICT format, ...) +{ + int rc; + va_list ap; + char *buf; + + va_start (ap, format); + rc = _gpgrt_estream_vasprintf (&buf, format, ap); + va_end (ap); + if (rc < 0) + return NULL; + return buf; +} + +char * +gpgrt_vbsprintf (const char *_GPGRT__RESTRICT format, va_list ap) +{ + int rc; + char *buf; + + rc = _gpgrt_estream_vasprintf (&buf, format, ap); + if (rc < 0) + return NULL; + return buf; +} + +int +gpgrt_snprintf (char *buf, size_t bufsize, const char *format, ...) +{ + int rc; + va_list arg_ptr; + + va_start (arg_ptr, format); + rc = _gpgrt_estream_vsnprintf (buf, bufsize, format, arg_ptr); + va_end (arg_ptr); + + return rc; +} + +int +gpgrt_vsnprintf (char *buf, size_t bufsize, + const char *format, va_list arg_ptr) +{ + return _gpgrt_estream_vsnprintf (buf, bufsize, format, arg_ptr); +} diff --git a/plugins/MirOTR/Libgpg-error/err-visibility.h b/plugins/MirOTR/Libgpg-error/err-visibility.h new file mode 100644 index 0000000000..a75bb9b857 --- /dev/null +++ b/plugins/MirOTR/Libgpg-error/err-visibility.h @@ -0,0 +1,253 @@ +/* err-visibility.h - Set visibility attribute + * Copyright (C) 2014 g10 Code GmbH + * + * This file is part of libgpg-error. + * + * libgpg-error is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * libgpg-error is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this program; if not, see . + */ + +#ifndef _GPGRT_VISIBILITY_H +#define _GPGRT_VISIBILITY_H + +/* Include the main header here so that public symbols are mapped to + the internal underscored ones. */ +#ifdef _GPGRT_INCL_BY_VISIBILITY_C +# include "gpgrt-int.h" +#endif + + +/* Our use of the ELF visibility feature works by passing + -fvisibiliy=hidden on the command line and by explicitly marking + all exported functions as visible. + + NOTE: When adding new functions, please make sure to add them to + gpg-error.vers and gpg-error.def.in as well. */ + +#ifdef _GPGRT_INCL_BY_VISIBILITY_C + +# ifdef GPGRT_USE_VISIBILITY +# define MARK_VISIBLE(name) \ + extern __typeof__ (name) name __attribute__ ((visibility("default"))); +# else +# define MARK_VISIBLE(name) /* */ +# endif + +MARK_VISIBLE (gpg_strerror) +MARK_VISIBLE (gpg_strerror_r) +MARK_VISIBLE (gpg_strsource) +MARK_VISIBLE (gpg_err_code_from_errno) +MARK_VISIBLE (gpg_err_code_to_errno) +MARK_VISIBLE (gpg_err_code_from_syserror) +MARK_VISIBLE (gpg_err_set_errno) + +MARK_VISIBLE (gpg_err_init) +MARK_VISIBLE (gpg_err_deinit) +MARK_VISIBLE (gpg_error_check_version) +MARK_VISIBLE (gpgrt_check_version) + +MARK_VISIBLE (gpgrt_lock_init) +MARK_VISIBLE (gpgrt_lock_lock) +MARK_VISIBLE (gpgrt_lock_unlock) +MARK_VISIBLE (gpgrt_lock_destroy) +MARK_VISIBLE (gpgrt_yield) +MARK_VISIBLE (gpgrt_lock_trylock) + +MARK_VISIBLE (gpgrt_fopen) +MARK_VISIBLE (gpgrt_mopen) +MARK_VISIBLE (gpgrt_fopenmem) +MARK_VISIBLE (gpgrt_fopenmem_init) +MARK_VISIBLE (gpgrt_fdopen) +MARK_VISIBLE (gpgrt_fdopen_nc) +MARK_VISIBLE (gpgrt_sysopen) +MARK_VISIBLE (gpgrt_sysopen_nc) +MARK_VISIBLE (gpgrt_fpopen) +MARK_VISIBLE (gpgrt_fpopen_nc) +MARK_VISIBLE (gpgrt_freopen) +MARK_VISIBLE (gpgrt_fopencookie) +MARK_VISIBLE (gpgrt_fclose) +MARK_VISIBLE (gpgrt_fclose_snatch) +MARK_VISIBLE (gpgrt_onclose) +MARK_VISIBLE (gpgrt_fileno) +MARK_VISIBLE (gpgrt_fileno_unlocked) +MARK_VISIBLE (gpgrt_syshd) +MARK_VISIBLE (gpgrt_syshd_unlocked) +MARK_VISIBLE (_gpgrt_set_std_fd) +MARK_VISIBLE (_gpgrt_get_std_stream) +MARK_VISIBLE (gpgrt_flockfile) +MARK_VISIBLE (gpgrt_ftrylockfile) +MARK_VISIBLE (gpgrt_funlockfile) +MARK_VISIBLE (_gpgrt_pending) +MARK_VISIBLE (_gpgrt_pending_unlocked) +MARK_VISIBLE (gpgrt_feof) +MARK_VISIBLE (gpgrt_feof_unlocked) +MARK_VISIBLE (gpgrt_ferror) +MARK_VISIBLE (gpgrt_ferror_unlocked) +MARK_VISIBLE (gpgrt_clearerr) +MARK_VISIBLE (gpgrt_clearerr_unlocked) +MARK_VISIBLE (gpgrt_fflush) +MARK_VISIBLE (gpgrt_fseek) +MARK_VISIBLE (gpgrt_fseeko) +MARK_VISIBLE (gpgrt_ftell) +MARK_VISIBLE (gpgrt_ftello) +MARK_VISIBLE (gpgrt_rewind) +MARK_VISIBLE (gpgrt_fgetc) +MARK_VISIBLE (_gpgrt_getc_underflow) +MARK_VISIBLE (gpgrt_fputc) +MARK_VISIBLE (_gpgrt_putc_overflow) +MARK_VISIBLE (gpgrt_ungetc) +MARK_VISIBLE (gpgrt_read) +MARK_VISIBLE (gpgrt_write) +MARK_VISIBLE (gpgrt_write_sanitized) +MARK_VISIBLE (gpgrt_write_hexstring) +MARK_VISIBLE (gpgrt_fread) +MARK_VISIBLE (gpgrt_fwrite) +MARK_VISIBLE (gpgrt_fgets) +MARK_VISIBLE (gpgrt_fputs) +MARK_VISIBLE (gpgrt_fputs_unlocked) +MARK_VISIBLE (gpgrt_getline) +MARK_VISIBLE (gpgrt_read_line) +MARK_VISIBLE (gpgrt_free) +MARK_VISIBLE (gpgrt_fprintf) +MARK_VISIBLE (gpgrt_fprintf_unlocked) +MARK_VISIBLE (gpgrt_printf) +MARK_VISIBLE (gpgrt_printf_unlocked) +MARK_VISIBLE (gpgrt_vfprintf) +MARK_VISIBLE (gpgrt_vfprintf_unlocked) +MARK_VISIBLE (gpgrt_setvbuf) +MARK_VISIBLE (gpgrt_setbuf) +MARK_VISIBLE (gpgrt_set_binary) +MARK_VISIBLE (gpgrt_tmpfile) +MARK_VISIBLE (gpgrt_opaque_set) +MARK_VISIBLE (gpgrt_opaque_get) +MARK_VISIBLE (gpgrt_fname_set) +MARK_VISIBLE (gpgrt_fname_get) +MARK_VISIBLE (gpgrt_asprintf) +MARK_VISIBLE (gpgrt_vasprintf) +MARK_VISIBLE (gpgrt_bsprintf) +MARK_VISIBLE (gpgrt_vbsprintf) +MARK_VISIBLE (gpgrt_snprintf) +MARK_VISIBLE (gpgrt_vsnprintf) +MARK_VISIBLE (gpgrt_set_syscall_clamp) +MARK_VISIBLE (gpgrt_set_alloc_func) + +#undef MARK_VISIBLE + +#else /*!_GPGRT_INCL_BY_VISIBILITY_C*/ + +/* To avoid accidental use of the public functions inside Libgpg-error, + we redefine them to catch such errors. */ + +#define gpg_strerror _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpg_strerror_r _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpg_strsource _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpg_err_code_from_errno _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpg_err_code_to_errno _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpg_err_code_from_syserror _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpg_err_set_errno _gpgrt_USE_UNDERSCORED_FUNCTION + +#define gpg_err_init _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpg_err_deinit _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpg_error_check_version _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_check_version _gpgrt_USE_OTHER_FUNCTION + +#define gpgrt_lock_init _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_lock_lock _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_lock_unlock _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_lock_destroy _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_yield _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_lock_trylock _gpgrt_USE_UNDERSCORED_FUNCTION + +#define gpgrt_fopen _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_mopen _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fopenmem _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fopenmem_init _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fdopen _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fdopen_nc _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_sysopen _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_sysopen_nc _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fpopen _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fpopen_nc _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_freopen _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fopencookie _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fclose _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fclose_snatch _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_onclose _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fileno _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fileno_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_syshd _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_syshd_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION +#define _gpgrt_set_std_fd _gpgrt_USE_UNDERSCORED_FUNCTION +#define _gpgrt_get_std_stream _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_flockfile _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_ftrylockfile _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_funlockfile _gpgrt_USE_UNDERSCORED_FUNCTION +#define _gpgrt_pending _gpgrt_USE_UNDERSCORED_FUNCTION +#define _gpgrt_pending_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_feof _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_feof_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_ferror _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_ferror_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_clearerr _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_clearerr_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fflush _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fseek _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fseeko _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_ftell _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_ftello _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_rewind _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fgetc _gpgrt_USE_UNDERSCORED_FUNCTION +#define _gpgrt_getc_underflow _gpgrt_USE_DBLUNDERSCO_FUNCTION +#define gpgrt_fputc _gpgrt_USE_UNDERSCORED_FUNCTION +#define _gpgrt_putc_overflow _gpgrt_USE_DBLUNDERSCO_FUNCTION +#define gpgrt_ungetc _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_read _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_write _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_write_sanitized _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_write_hexstring _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fread _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fwrite _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fgets _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fputs _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fputs_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_getline _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_read_line _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_free _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fprintf _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fprintf_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_printf _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_printf_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_vfprintf _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_vfprintf_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_setvbuf _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_setbuf _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_set_binary _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_tmpfile _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_opaque_set _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_opaque_get _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fname_set _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_fname_get _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_asprintf _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_vasprintf _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_bsprintf _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_vbsprintf _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_snprintf _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_vsnprintf _gpgrt_USE_UNDERSCORED_FUNCTION + +#define gpgrt_set_syscall_clamp _gpgrt_USE_UNDERSCORED_FUNCTION +#define gpgrt_set_alloc_func _gpgrt_USE_UNDERSCORED_FUNCTION + + +#endif /*!_GPGRT_INCL_BY_VISIBILITY_C*/ + +#endif /*_GPGRT_VISIBILITY_H*/ diff --git a/plugins/MirOTR/Libgpg-error/gpgrt-int.h b/plugins/MirOTR/Libgpg-error/gpgrt-int.h index bc2db8b83a..5a05b9968b 100644 --- a/plugins/MirOTR/Libgpg-error/gpgrt-int.h +++ b/plugins/MirOTR/Libgpg-error/gpgrt-int.h @@ -21,7 +21,7 @@ #define _GPGRT_GPGRT_INT_H #include "gpg-error.h" -#include "visibility.h" +#include "err-visibility.h" /* Local error function prototypes. */ const char *_gpg_strerror (gpg_error_t err); diff --git a/plugins/MirOTR/Libgpg-error/visibility.c b/plugins/MirOTR/Libgpg-error/visibility.c deleted file mode 100644 index 9213ce92f5..0000000000 --- a/plugins/MirOTR/Libgpg-error/visibility.c +++ /dev/null @@ -1,689 +0,0 @@ -/* visibility.c - Wrapper for all public functions. - * Copyright (C) 2014 g10 Code GmbH - * - * This file is part of libgpg-error. - * - * libgpg-error is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * libgpg-error is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, see . - */ - -#include -#include - -#define _GPGRT_INCL_BY_VISIBILITY_C 1 -#include "gpgrt-int.h" - -const char * -gpg_strerror (gpg_error_t err) -{ - return _gpg_strerror (err); -} - -int -gpg_strerror_r (gpg_error_t err, char *buf, size_t buflen) -{ - return _gpg_strerror_r (err, buf, buflen); -} - -const char * -gpg_strsource (gpg_error_t err) -{ - return _gpg_strsource (err); -} - -gpg_err_code_t -gpg_err_code_from_errno (int err) -{ - return _gpg_err_code_from_errno (err); -} - -int -gpg_err_code_to_errno (gpg_err_code_t code) -{ - return _gpg_err_code_to_errno (code); -} - -gpg_err_code_t -gpg_err_code_from_syserror (void) -{ - return _gpg_err_code_from_syserror (); -} - -void -gpg_err_set_errno (int err) -{ - _gpg_err_set_errno (err); -} - - -gpg_error_t -gpg_err_init (void) -{ - return _gpg_err_init (); -} - -void -gpg_err_deinit (int mode) -{ - _gpg_err_deinit (mode); -} - -const char * -gpg_error_check_version (const char *req_version) -{ - return _gpg_error_check_version (req_version); -} - -const char * -gpgrt_check_version (const char *req_version) -{ - return _gpg_error_check_version (req_version); -} - -void -gpgrt_set_syscall_clamp (void (*pre)(void), void (*post)(void)) -{ - _gpgrt_set_syscall_clamp (pre, post); -} - -void -gpgrt_set_alloc_func (void *(*f)(void *a, size_t n)) -{ - _gpgrt_set_alloc_func (f); -} - - -gpg_err_code_t -gpgrt_lock_init (gpgrt_lock_t *lockhd) -{ - return _gpgrt_lock_init (lockhd); -} - -gpg_err_code_t -gpgrt_lock_lock (gpgrt_lock_t *lockhd) -{ - return _gpgrt_lock_lock (lockhd); -} - -gpg_err_code_t -gpgrt_lock_trylock (gpgrt_lock_t *lockhd) -{ - return _gpgrt_lock_trylock (lockhd); -} - -gpg_err_code_t -gpgrt_lock_unlock (gpgrt_lock_t *lockhd) -{ - return _gpgrt_lock_unlock (lockhd); -} - -gpg_err_code_t -gpgrt_lock_destroy (gpgrt_lock_t *lockhd) -{ - return _gpgrt_lock_destroy (lockhd); -} - -gpg_err_code_t -gpgrt_yield (void) -{ - return _gpgrt_yield (); -} - - - -estream_t -gpgrt_fopen (const char *_GPGRT__RESTRICT path, - const char *_GPGRT__RESTRICT mode) -{ - return _gpgrt_fopen (path, mode); -} - -estream_t -gpgrt_mopen (void *_GPGRT__RESTRICT data, size_t data_n, size_t data_len, - unsigned int grow, - void *(*func_realloc) (void *mem, size_t size), - void (*func_free) (void *mem), - const char *_GPGRT__RESTRICT mode) -{ - return _gpgrt_mopen (data, data_n, data_len, grow, func_realloc, func_free, - mode); -} - -estream_t -gpgrt_fopenmem (size_t memlimit, const char *_GPGRT__RESTRICT mode) -{ - return _gpgrt_fopenmem (memlimit, mode); -} - -estream_t -gpgrt_fopenmem_init (size_t memlimit, const char *_GPGRT__RESTRICT mode, - const void *data, size_t datalen) -{ - return _gpgrt_fopenmem_init (memlimit, mode, data, datalen); -} - -estream_t -gpgrt_fdopen (int filedes, const char *mode) -{ - return _gpgrt_fdopen (filedes, mode); -} - -estream_t -gpgrt_fdopen_nc (int filedes, const char *mode) -{ - return _gpgrt_fdopen_nc (filedes, mode); -} - -estream_t -gpgrt_sysopen (es_syshd_t *syshd, const char *mode) -{ - return _gpgrt_sysopen (syshd, mode); -} - -estream_t -gpgrt_sysopen_nc (es_syshd_t *syshd, const char *mode) -{ - return _gpgrt_sysopen_nc (syshd, mode); -} - -estream_t -gpgrt_fpopen (FILE *fp, const char *mode) -{ - return _gpgrt_fpopen (fp, mode); -} - -estream_t -gpgrt_fpopen_nc (FILE *fp, const char *mode) -{ - return _gpgrt_fpopen_nc (fp, mode); -} - -estream_t -gpgrt_freopen (const char *_GPGRT__RESTRICT path, - const char *_GPGRT__RESTRICT mode, - estream_t _GPGRT__RESTRICT stream) -{ - return _gpgrt_freopen (path, mode, stream); -} - -estream_t -gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie, - const char *_GPGRT__RESTRICT mode, - gpgrt_cookie_io_functions_t functions) -{ - return _gpgrt_fopencookie (cookie, mode, functions); -} - -int -gpgrt_fclose (estream_t stream) -{ - return _gpgrt_fclose (stream); -} - -int -gpgrt_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen) -{ - return _gpgrt_fclose_snatch (stream, r_buffer, r_buflen); -} - -int -gpgrt_onclose (estream_t stream, int mode, - void (*fnc) (estream_t, void*), void *fnc_value) -{ - return _gpgrt_onclose (stream, mode, fnc, fnc_value); -} - -int -gpgrt_fileno (estream_t stream) -{ - return _gpgrt_fileno (stream); -} - -int -gpgrt_fileno_unlocked (estream_t stream) -{ - return _gpgrt_fileno_unlocked (stream); -} - -int -gpgrt_syshd (estream_t stream, es_syshd_t *syshd) -{ - return _gpgrt_syshd (stream, syshd); -} - -int -gpgrt_syshd_unlocked (estream_t stream, es_syshd_t *syshd) -{ - return _gpgrt_syshd_unlocked (stream, syshd); -} - -void -_gpgrt_set_std_fd (int no, int fd) -{ - _gpgrt__set_std_fd (no, fd); /* (double dash in name) */ -} - -estream_t -_gpgrt_get_std_stream (int fd) -{ - return _gpgrt__get_std_stream (fd); /* (double dash in name) */ -} - -void -gpgrt_flockfile (estream_t stream) -{ - _gpgrt_flockfile (stream); -} - -int -gpgrt_ftrylockfile (estream_t stream) -{ - return _gpgrt_ftrylockfile (stream); -} - -void -gpgrt_funlockfile (estream_t stream) -{ - _gpgrt_funlockfile (stream); -} - -int -_gpgrt_pending (estream_t stream) -{ - return _gpgrt__pending (stream); -} - -int -_gpgrt_pending_unlocked (estream_t stream) -{ - return _gpgrt__pending_unlocked (stream); -} - -int -gpgrt_feof (estream_t stream) -{ - return _gpgrt_feof (stream); -} - -int -gpgrt_feof_unlocked (estream_t stream) -{ - return _gpgrt_feof_unlocked (stream); -} - -int -gpgrt_ferror (estream_t stream) -{ - return _gpgrt_ferror (stream); -} - -int -gpgrt_ferror_unlocked (estream_t stream) -{ - return _gpgrt_ferror_unlocked (stream); -} - -void -gpgrt_clearerr (estream_t stream) -{ - _gpgrt_clearerr (stream); -} - -void -gpgrt_clearerr_unlocked (estream_t stream) -{ - _gpgrt_clearerr_unlocked (stream); -} - -int -gpgrt_fflush (estream_t stream) -{ - return _gpgrt_fflush (stream); -} - -int -gpgrt_fseek (estream_t stream, long int offset, int whence) -{ - return _gpgrt_fseek (stream, offset, whence); -} - -int -gpgrt_fseeko (estream_t stream, gpgrt_off_t offset, int whence) -{ - return _gpgrt_fseeko (stream, offset, whence); -} - -long int -gpgrt_ftell (estream_t stream) -{ - return _gpgrt_ftell (stream); -} - -gpgrt_off_t -gpgrt_ftello (estream_t stream) -{ - return _gpgrt_ftello (stream); -} - -void -gpgrt_rewind (estream_t stream) -{ - _gpgrt_rewind (stream); -} - -int -gpgrt_fgetc (estream_t stream) -{ - return _gpgrt_fgetc (stream); -} - -int -_gpgrt_getc_underflow (estream_t stream) -{ - return _gpgrt__getc_underflow (stream); -} - -int -gpgrt_fputc (int c, estream_t stream) -{ - return _gpgrt_fputc (c, stream); -} - -int -_gpgrt_putc_overflow (int c, estream_t stream) -{ - return _gpgrt__putc_overflow (c, stream); -} - -int -gpgrt_ungetc (int c, estream_t stream) -{ - return _gpgrt_ungetc (c, stream); -} - -int -gpgrt_read (estream_t _GPGRT__RESTRICT stream, - void *_GPGRT__RESTRICT buffer, size_t bytes_to_read, - size_t *_GPGRT__RESTRICT bytes_read) -{ - return _gpgrt_read (stream, buffer, bytes_to_read, bytes_read); -} - -int -gpgrt_write (estream_t _GPGRT__RESTRICT stream, - const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write, - size_t *_GPGRT__RESTRICT bytes_written) -{ - return _gpgrt_write (stream, buffer, bytes_to_write, bytes_written); -} - -int -gpgrt_write_sanitized (estream_t _GPGRT__RESTRICT stream, - const void * _GPGRT__RESTRICT buffer, size_t length, - const char * delimiters, - size_t * _GPGRT__RESTRICT bytes_written) -{ - return _gpgrt_write_sanitized (stream, buffer, length, delimiters, - bytes_written); -} - -int -gpgrt_write_hexstring (estream_t _GPGRT__RESTRICT stream, - const void *_GPGRT__RESTRICT buffer, size_t length, - int reserved, size_t *_GPGRT__RESTRICT bytes_written ) -{ - return _gpgrt_write_hexstring (stream, buffer, length, reserved, - bytes_written); -} - -size_t -gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems, - estream_t _GPGRT__RESTRICT stream) -{ - return _gpgrt_fread (ptr, size, nitems, stream); -} - -size_t -gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems, - estream_t _GPGRT__RESTRICT stream) -{ - return _gpgrt_fwrite (ptr, size, nitems, stream); -} - -char * -gpgrt_fgets (char *_GPGRT__RESTRICT buffer, int length, - estream_t _GPGRT__RESTRICT stream) -{ - return _gpgrt_fgets (buffer, length, stream); -} - -int -gpgrt_fputs (const char *_GPGRT__RESTRICT s, estream_t _GPGRT__RESTRICT stream) -{ - return _gpgrt_fputs (s, stream); -} - -int -gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s, - estream_t _GPGRT__RESTRICT stream) -{ - return _gpgrt_fputs_unlocked (s, stream); -} - -gpgrt_ssize_t -gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr, - size_t *_GPGRT__RESTRICT n, estream_t _GPGRT__RESTRICT stream) -{ - return _gpgrt_getline (lineptr, n, stream); -} - -gpgrt_ssize_t -gpgrt_read_line (estream_t stream, - char **addr_of_buffer, size_t *length_of_buffer, - size_t *max_length) -{ - return _gpgrt_read_line (stream, addr_of_buffer, length_of_buffer, - max_length); -} - -void -gpgrt_free (void *a) -{ - if (a) - _gpgrt_free (a); -} - -int -gpgrt_vfprintf (estream_t _GPGRT__RESTRICT stream, - const char *_GPGRT__RESTRICT format, - va_list ap) -{ - return _gpgrt_vfprintf (stream, format, ap); -} - -int -gpgrt_vfprintf_unlocked (estream_t _GPGRT__RESTRICT stream, - const char *_GPGRT__RESTRICT format, - va_list ap) -{ - return _gpgrt_vfprintf_unlocked (stream, format, ap); -} - -int -gpgrt_printf (const char *_GPGRT__RESTRICT format, ...) -{ - va_list ap; - int rc; - - va_start (ap, format); - rc = _gpgrt_vfprintf (es_stdout, format, ap); - va_end (ap); - - return rc; -} - -int -gpgrt_printf_unlocked (const char *_GPGRT__RESTRICT format, ...) -{ - va_list ap; - int rc; - - va_start (ap, format); - rc = _gpgrt_vfprintf_unlocked (es_stdout, format, ap); - va_end (ap); - - return rc; -} - -int -gpgrt_fprintf (estream_t _GPGRT__RESTRICT stream, - const char *_GPGRT__RESTRICT format, ...) -{ - va_list ap; - int rc; - - va_start (ap, format); - rc = _gpgrt_vfprintf (stream, format, ap); - va_end (ap); - - return rc; -} - -int -gpgrt_fprintf_unlocked (estream_t _GPGRT__RESTRICT stream, - const char *_GPGRT__RESTRICT format, ...) -{ - va_list ap; - int rc; - - va_start (ap, format); - rc = _gpgrt_vfprintf_unlocked (stream, format, ap); - va_end (ap); - - return rc; -} - -int -gpgrt_setvbuf (estream_t _GPGRT__RESTRICT stream, - char *_GPGRT__RESTRICT buf, int type, size_t size) -{ - return _gpgrt_setvbuf (stream, buf, type, size); -} - -void -gpgrt_setbuf (estream_t _GPGRT__RESTRICT stream, char *_GPGRT__RESTRICT buf) -{ - _gpgrt_setvbuf (stream, buf, buf? _IOFBF : _IONBF, BUFSIZ); -} - -void -gpgrt_set_binary (estream_t stream) -{ - _gpgrt_set_binary (stream); -} - -estream_t -gpgrt_tmpfile (void) -{ - return _gpgrt_tmpfile (); -} - -void -gpgrt_opaque_set (estream_t stream, void *opaque) -{ - _gpgrt_opaque_set (stream, opaque); -} - -void * -gpgrt_opaque_get (estream_t stream) -{ - return _gpgrt_opaque_get (stream); -} - -void -gpgrt_fname_set (estream_t stream, const char *fname) -{ - _gpgrt_fname_set (stream, fname); -} - -const char * -gpgrt_fname_get (estream_t stream) -{ - return _gpgrt_fname_get (stream); -} - -int -gpgrt_asprintf (char **r_buf, const char *_GPGRT__RESTRICT format, ...) -{ - va_list ap; - int rc; - - va_start (ap, format); - rc = _gpgrt_estream_vasprintf (r_buf, format, ap); - va_end (ap); - - return rc; -} - -int -gpgrt_vasprintf (char **r_buf, const char *_GPGRT__RESTRICT format, va_list ap) -{ - return _gpgrt_estream_vasprintf (r_buf, format, ap); -} - -char * -gpgrt_bsprintf (const char *_GPGRT__RESTRICT format, ...) -{ - int rc; - va_list ap; - char *buf; - - va_start (ap, format); - rc = _gpgrt_estream_vasprintf (&buf, format, ap); - va_end (ap); - if (rc < 0) - return NULL; - return buf; -} - -char * -gpgrt_vbsprintf (const char *_GPGRT__RESTRICT format, va_list ap) -{ - int rc; - char *buf; - - rc = _gpgrt_estream_vasprintf (&buf, format, ap); - if (rc < 0) - return NULL; - return buf; -} - -int -gpgrt_snprintf (char *buf, size_t bufsize, const char *format, ...) -{ - int rc; - va_list arg_ptr; - - va_start (arg_ptr, format); - rc = _gpgrt_estream_vsnprintf (buf, bufsize, format, arg_ptr); - va_end (arg_ptr); - - return rc; -} - -int -gpgrt_vsnprintf (char *buf, size_t bufsize, - const char *format, va_list arg_ptr) -{ - return _gpgrt_estream_vsnprintf (buf, bufsize, format, arg_ptr); -} diff --git a/plugins/MirOTR/Libgpg-error/visibility.h b/plugins/MirOTR/Libgpg-error/visibility.h deleted file mode 100644 index 6f7de8496e..0000000000 --- a/plugins/MirOTR/Libgpg-error/visibility.h +++ /dev/null @@ -1,253 +0,0 @@ -/* visibility.h - Set visibility attribute - * Copyright (C) 2014 g10 Code GmbH - * - * This file is part of libgpg-error. - * - * libgpg-error is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * libgpg-error is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this program; if not, see . - */ - -#ifndef _GPGRT_VISIBILITY_H -#define _GPGRT_VISIBILITY_H - -/* Include the main header here so that public symbols are mapped to - the internal underscored ones. */ -#ifdef _GPGRT_INCL_BY_VISIBILITY_C -# include "gpgrt-int.h" -#endif - - -/* Our use of the ELF visibility feature works by passing - -fvisibiliy=hidden on the command line and by explicitly marking - all exported functions as visible. - - NOTE: When adding new functions, please make sure to add them to - gpg-error.vers and gpg-error.def.in as well. */ - -#ifdef _GPGRT_INCL_BY_VISIBILITY_C - -# ifdef GPGRT_USE_VISIBILITY -# define MARK_VISIBLE(name) \ - extern __typeof__ (name) name __attribute__ ((visibility("default"))); -# else -# define MARK_VISIBLE(name) /* */ -# endif - -MARK_VISIBLE (gpg_strerror) -MARK_VISIBLE (gpg_strerror_r) -MARK_VISIBLE (gpg_strsource) -MARK_VISIBLE (gpg_err_code_from_errno) -MARK_VISIBLE (gpg_err_code_to_errno) -MARK_VISIBLE (gpg_err_code_from_syserror) -MARK_VISIBLE (gpg_err_set_errno) - -MARK_VISIBLE (gpg_err_init) -MARK_VISIBLE (gpg_err_deinit) -MARK_VISIBLE (gpg_error_check_version) -MARK_VISIBLE (gpgrt_check_version) - -MARK_VISIBLE (gpgrt_lock_init) -MARK_VISIBLE (gpgrt_lock_lock) -MARK_VISIBLE (gpgrt_lock_unlock) -MARK_VISIBLE (gpgrt_lock_destroy) -MARK_VISIBLE (gpgrt_yield) -MARK_VISIBLE (gpgrt_lock_trylock) - -MARK_VISIBLE (gpgrt_fopen) -MARK_VISIBLE (gpgrt_mopen) -MARK_VISIBLE (gpgrt_fopenmem) -MARK_VISIBLE (gpgrt_fopenmem_init) -MARK_VISIBLE (gpgrt_fdopen) -MARK_VISIBLE (gpgrt_fdopen_nc) -MARK_VISIBLE (gpgrt_sysopen) -MARK_VISIBLE (gpgrt_sysopen_nc) -MARK_VISIBLE (gpgrt_fpopen) -MARK_VISIBLE (gpgrt_fpopen_nc) -MARK_VISIBLE (gpgrt_freopen) -MARK_VISIBLE (gpgrt_fopencookie) -MARK_VISIBLE (gpgrt_fclose) -MARK_VISIBLE (gpgrt_fclose_snatch) -MARK_VISIBLE (gpgrt_onclose) -MARK_VISIBLE (gpgrt_fileno) -MARK_VISIBLE (gpgrt_fileno_unlocked) -MARK_VISIBLE (gpgrt_syshd) -MARK_VISIBLE (gpgrt_syshd_unlocked) -MARK_VISIBLE (_gpgrt_set_std_fd) -MARK_VISIBLE (_gpgrt_get_std_stream) -MARK_VISIBLE (gpgrt_flockfile) -MARK_VISIBLE (gpgrt_ftrylockfile) -MARK_VISIBLE (gpgrt_funlockfile) -MARK_VISIBLE (_gpgrt_pending) -MARK_VISIBLE (_gpgrt_pending_unlocked) -MARK_VISIBLE (gpgrt_feof) -MARK_VISIBLE (gpgrt_feof_unlocked) -MARK_VISIBLE (gpgrt_ferror) -MARK_VISIBLE (gpgrt_ferror_unlocked) -MARK_VISIBLE (gpgrt_clearerr) -MARK_VISIBLE (gpgrt_clearerr_unlocked) -MARK_VISIBLE (gpgrt_fflush) -MARK_VISIBLE (gpgrt_fseek) -MARK_VISIBLE (gpgrt_fseeko) -MARK_VISIBLE (gpgrt_ftell) -MARK_VISIBLE (gpgrt_ftello) -MARK_VISIBLE (gpgrt_rewind) -MARK_VISIBLE (gpgrt_fgetc) -MARK_VISIBLE (_gpgrt_getc_underflow) -MARK_VISIBLE (gpgrt_fputc) -MARK_VISIBLE (_gpgrt_putc_overflow) -MARK_VISIBLE (gpgrt_ungetc) -MARK_VISIBLE (gpgrt_read) -MARK_VISIBLE (gpgrt_write) -MARK_VISIBLE (gpgrt_write_sanitized) -MARK_VISIBLE (gpgrt_write_hexstring) -MARK_VISIBLE (gpgrt_fread) -MARK_VISIBLE (gpgrt_fwrite) -MARK_VISIBLE (gpgrt_fgets) -MARK_VISIBLE (gpgrt_fputs) -MARK_VISIBLE (gpgrt_fputs_unlocked) -MARK_VISIBLE (gpgrt_getline) -MARK_VISIBLE (gpgrt_read_line) -MARK_VISIBLE (gpgrt_free) -MARK_VISIBLE (gpgrt_fprintf) -MARK_VISIBLE (gpgrt_fprintf_unlocked) -MARK_VISIBLE (gpgrt_printf) -MARK_VISIBLE (gpgrt_printf_unlocked) -MARK_VISIBLE (gpgrt_vfprintf) -MARK_VISIBLE (gpgrt_vfprintf_unlocked) -MARK_VISIBLE (gpgrt_setvbuf) -MARK_VISIBLE (gpgrt_setbuf) -MARK_VISIBLE (gpgrt_set_binary) -MARK_VISIBLE (gpgrt_tmpfile) -MARK_VISIBLE (gpgrt_opaque_set) -MARK_VISIBLE (gpgrt_opaque_get) -MARK_VISIBLE (gpgrt_fname_set) -MARK_VISIBLE (gpgrt_fname_get) -MARK_VISIBLE (gpgrt_asprintf) -MARK_VISIBLE (gpgrt_vasprintf) -MARK_VISIBLE (gpgrt_bsprintf) -MARK_VISIBLE (gpgrt_vbsprintf) -MARK_VISIBLE (gpgrt_snprintf) -MARK_VISIBLE (gpgrt_vsnprintf) -MARK_VISIBLE (gpgrt_set_syscall_clamp) -MARK_VISIBLE (gpgrt_set_alloc_func) - -#undef MARK_VISIBLE - -#else /*!_GPGRT_INCL_BY_VISIBILITY_C*/ - -/* To avoid accidental use of the public functions inside Libgpg-error, - we redefine them to catch such errors. */ - -#define gpg_strerror _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpg_strerror_r _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpg_strsource _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpg_err_code_from_errno _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpg_err_code_to_errno _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpg_err_code_from_syserror _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpg_err_set_errno _gpgrt_USE_UNDERSCORED_FUNCTION - -#define gpg_err_init _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpg_err_deinit _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpg_error_check_version _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_check_version _gpgrt_USE_OTHER_FUNCTION - -#define gpgrt_lock_init _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_lock_lock _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_lock_unlock _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_lock_destroy _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_yield _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_lock_trylock _gpgrt_USE_UNDERSCORED_FUNCTION - -#define gpgrt_fopen _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_mopen _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fopenmem _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fopenmem_init _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fdopen _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fdopen_nc _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_sysopen _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_sysopen_nc _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fpopen _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fpopen_nc _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_freopen _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fopencookie _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fclose _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fclose_snatch _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_onclose _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fileno _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fileno_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_syshd _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_syshd_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION -#define _gpgrt_set_std_fd _gpgrt_USE_UNDERSCORED_FUNCTION -#define _gpgrt_get_std_stream _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_flockfile _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_ftrylockfile _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_funlockfile _gpgrt_USE_UNDERSCORED_FUNCTION -#define _gpgrt_pending _gpgrt_USE_UNDERSCORED_FUNCTION -#define _gpgrt_pending_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_feof _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_feof_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_ferror _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_ferror_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_clearerr _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_clearerr_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fflush _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fseek _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fseeko _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_ftell _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_ftello _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_rewind _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fgetc _gpgrt_USE_UNDERSCORED_FUNCTION -#define _gpgrt_getc_underflow _gpgrt_USE_DBLUNDERSCO_FUNCTION -#define gpgrt_fputc _gpgrt_USE_UNDERSCORED_FUNCTION -#define _gpgrt_putc_overflow _gpgrt_USE_DBLUNDERSCO_FUNCTION -#define gpgrt_ungetc _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_read _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_write _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_write_sanitized _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_write_hexstring _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fread _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fwrite _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fgets _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fputs _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fputs_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_getline _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_read_line _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_free _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fprintf _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fprintf_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_printf _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_printf_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_vfprintf _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_vfprintf_unlocked _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_setvbuf _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_setbuf _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_set_binary _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_tmpfile _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_opaque_set _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_opaque_get _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fname_set _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_fname_get _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_asprintf _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_vasprintf _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_bsprintf _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_vbsprintf _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_snprintf _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_vsnprintf _gpgrt_USE_UNDERSCORED_FUNCTION - -#define gpgrt_set_syscall_clamp _gpgrt_USE_UNDERSCORED_FUNCTION -#define gpgrt_set_alloc_func _gpgrt_USE_UNDERSCORED_FUNCTION - - -#endif /*!_GPGRT_INCL_BY_VISIBILITY_C*/ - -#endif /*_GPGRT_VISIBILITY_H*/ diff --git a/plugins/MirOTR/ekhtml/ekhtml_12.vcxproj.filters b/plugins/MirOTR/ekhtml/ekhtml_12.vcxproj.filters index f685538610..ff071a847b 100644 --- a/plugins/MirOTR/ekhtml/ekhtml_12.vcxproj.filters +++ b/plugins/MirOTR/ekhtml/ekhtml_12.vcxproj.filters @@ -9,10 +9,6 @@ {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hpp;hxx;hm;inl;inc;xsd - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav - diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp index de3f7e42ed..92608222b5 100644 --- a/plugins/MirOTR/src/otr.cpp +++ b/plugins/MirOTR/src/otr.cpp @@ -344,52 +344,48 @@ gcry_error_t otrl_privkey_write_FILEp(OtrlUserState us, FILE *privf); /* Generate a private DSA key for a given account, storing it into a * file on disk, and loading it into the given OtrlUserState. Overwrite any * previously generated keys for that account in that OtrlUserState. */ - gcry_error_t otrl_privkey_write(OtrlUserState us, const char *filename) +gcry_error_t otrl_privkey_write(OtrlUserState us, const char *filename) +{ + gcry_error_t err; + FILE *privf; +#ifndef WIN32 + mode_t oldmask = umask(077); +#endif + privf = fopen(filename, "w+b"); + if (!privf) { +#ifndef WIN32 + umask(oldmask); +#endif + err = gcry_error_from_errno(errno); + return err; + } + + err = otrl_privkey_write_FILEp(us, privf); + + fclose(privf); +#ifndef WIN32 + umask(oldmask); +#endif + return err; +} + + /* Just store the private keys of an OtrlUserState. + * The FILE* must be open for reading and writing. */ + gcry_error_t otrl_privkey_write_FILEp(OtrlUserState us, FILE *privf) { - gcry_error_t err; - FILE *privf; - #ifndef WIN32 - mode_t oldmask; - #endif - - #ifndef WIN32 - oldmask = umask(077); - #endif - privf = fopen(filename, "w+b"); - if (!privf) { - #ifndef WIN32 - umask(oldmask); - #endif - err = gcry_error_from_errno(errno); - return err; - } - - err = otrl_privkey_write_FILEp(us, privf); - - fclose(privf); - #ifndef WIN32 - umask(oldmask); - #endif - return err; + OtrlPrivKey *p; + + if (!privf) return gcry_error(GPG_ERR_NO_ERROR); + + + + /* Output the other keys we know */ + fprintf(privf, "(privkeys\n"); + for (p = us->privkey_root; p; p = p->next) { + otrl_account_write(privf, p->accountname, p->protocol, p->privkey); } + if (fprintf(privf, ")\n") < 0) + return gcry_error_from_errno(errno); + return gcry_error(GPG_ERR_NO_ERROR); -/* Just store the private keys of an OtrlUserState. - * The FILE* must be open for reading and writing. */ - gcry_error_t otrl_privkey_write_FILEp(OtrlUserState us, FILE *privf) - { - OtrlPrivKey *p; - - if (!privf) return gcry_error(GPG_ERR_NO_ERROR); - - - - /* Output the other keys we know */ - fprintf(privf, "(privkeys\n"); - for (p=us->privkey_root; p; p=p->next) { - otrl_account_write(privf, p->accountname, p->protocol, p->privkey); - } - if ( fprintf(privf, ")\n") < 0 ) - return gcry_error_from_errno(errno); - return gcry_error(GPG_ERR_NO_ERROR); - -} \ No newline at end of file + } \ No newline at end of file -- cgit v1.2.3