aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/estream-printf.c20
-rw-r--r--src/estream-printf.h4
-rw-r--r--src/estream.c334
-rw-r--r--src/gpg-error.def.in71
-rw-r--r--src/gpg-error.h.in21
-rw-r--r--src/gpg-error.vers75
-rw-r--r--src/gpgrt-int.h145
-rw-r--r--src/visibility.c517
-rw-r--r--src/visibility.h144
9 files changed, 1117 insertions, 214 deletions
diff --git a/src/estream-printf.c b/src/estream-printf.c
index d2d13fc..b1eb828 100644
--- a/src/estream-printf.c
+++ b/src/estream-printf.c
@@ -1853,3 +1853,23 @@ _gpgrt_estream_asprintf (char **bufp, const char *format, ...)
return rc;
}
+
+/* A variant of asprintf. The function returns the allocated buffer
+ or NULL on error; ERRNO is set in the error case. The caller
+ should use es_free to release the buffer. This function actually
+ belongs into estream-printf but we put it here as a convenience
+ and because es_free is required anyway. */
+char *
+_gpgrt_estream_bsprintf (const char *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;
+}
diff --git a/src/estream-printf.h b/src/estream-printf.h
index aabda9d..e82d8fb 100644
--- a/src/estream-printf.h
+++ b/src/estream-printf.h
@@ -135,12 +135,14 @@ int _gpgrt_estream_vfprintf (FILE *fp, const char *format, va_list arg_ptr)
int _gpgrt_estream_snprintf (char *buf, size_t bufsize, const char *format, ...)
_ESTREAM_GCC_A_PRINTF(3,4);
int _gpgrt_estream_vsnprintf (char *buf,size_t bufsize,
- const char *format, va_list arg_ptr)
+ const char *format, va_list arg_ptr)
_ESTREAM_GCC_A_PRINTF(3,0);
int _gpgrt_estream_asprintf (char **bufp, const char *format, ...)
_ESTREAM_GCC_A_PRINTF(2,3);
int _gpgrt_estream_vasprintf (char **bufp, const char *format, va_list arg_ptr)
_ESTREAM_GCC_A_PRINTF(2,0);
+char *_gpgrt_estream_bsprintf (const char *format, ...)
+ _ESTREAM_GCC_A_PRINTF(1,2);
#ifdef __cplusplus
diff --git a/src/estream.c b/src/estream.c
index 5a1a80b..0c54d0f 100644
--- a/src/estream.c
+++ b/src/estream.c
@@ -585,7 +585,7 @@ static void
do_deinit (void)
{
/* Flush all streams. */
- es_fflush (NULL);
+ _gpgrt_fflush (NULL);
/* We should release the estream_list. However there is one
problem: That list is also used to search for the standard
@@ -2469,7 +2469,7 @@ doreadline (estream_t _GPGRT__RESTRICT stream, size_t max_length,
if (newline)
{
data_len = (newline - (char *) data) + 1;
- err = es_write (line_stream, data, data_len, NULL);
+ err = _gpgrt_write (line_stream, data, data_len, NULL);
if (! err)
{
space_left -= data_len;
@@ -2480,7 +2480,7 @@ doreadline (estream_t _GPGRT__RESTRICT stream, size_t max_length,
}
else
{
- err = es_write (line_stream, data, data_len, NULL);
+ err = _gpgrt_write (line_stream, data, data_len, NULL);
if (! err)
{
space_left -= data_len;
@@ -2518,7 +2518,7 @@ doreadline (estream_t _GPGRT__RESTRICT stream, size_t max_length,
else
line_new = *line;
- err = es_read (line_stream, line_new, line_size, NULL);
+ err = _gpgrt_read (line_stream, line_new, line_size, NULL);
if (err)
goto out;
@@ -2691,7 +2691,8 @@ es_opaque_ctrl (estream_t _GPGRT__RESTRICT stream, void *_GPGRT__RESTRICT opaque
/* API. */
estream_t
-es_fopen (const char *_GPGRT__RESTRICT path, const char *_GPGRT__RESTRICT mode)
+_gpgrt_fopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode)
{
unsigned int modeflags, cmode;
int samethread, create_called;
@@ -2750,10 +2751,10 @@ es_fopen (const char *_GPGRT__RESTRICT path, const char *_GPGRT__RESTRICT mode)
function but no free function. Providing only a free function is
allowed as long as GROW is false. */
estream_t
-es_mopen (void *_GPGRT__RESTRICT data, size_t data_n, size_t data_len,
- unsigned int grow,
- func_realloc_t func_realloc, func_free_t func_free,
- const char *_GPGRT__RESTRICT mode)
+_gpgrt_mopen (void *_GPGRT__RESTRICT data, size_t data_n, size_t data_len,
+ unsigned int grow,
+ func_realloc_t func_realloc, func_free_t func_free,
+ const char *_GPGRT__RESTRICT mode)
{
int create_called = 0;
estream_t stream = NULL;
@@ -2789,7 +2790,7 @@ es_mopen (void *_GPGRT__RESTRICT data, size_t data_n, size_t data_len,
estream_t
-es_fopenmem (size_t memlimit, const char *_GPGRT__RESTRICT mode)
+_gpgrt_fopenmem (size_t memlimit, const char *_GPGRT__RESTRICT mode)
{
unsigned int modeflags;
int samethread;
@@ -2826,21 +2827,21 @@ es_fopenmem (size_t memlimit, const char *_GPGRT__RESTRICT mode)
beginning. If MEMLIMIT is not 0 but shorter than DATALEN it
DATALEN will be used as the value for MEMLIMIT. */
estream_t
-es_fopenmem_init (size_t memlimit, const char *_GPGRT__RESTRICT mode,
- const void *data, size_t datalen)
+_gpgrt_fopenmem_init (size_t memlimit, const char *_GPGRT__RESTRICT mode,
+ const void *data, size_t datalen)
{
estream_t stream;
if (memlimit && memlimit < datalen)
memlimit = datalen;
- stream = es_fopenmem (memlimit, mode);
+ stream = _gpgrt_fopenmem (memlimit, mode);
if (stream && data && datalen)
{
if (es_writen (stream, data, datalen, NULL))
{
int saveerrno = errno;
- es_fclose (stream);
+ _gpgrt_fclose (stream);
stream = NULL;
_set_errno (saveerrno);
}
@@ -2856,9 +2857,9 @@ es_fopenmem_init (size_t memlimit, const char *_GPGRT__RESTRICT mode,
estream_t
-es_fopencookie (void *_GPGRT__RESTRICT cookie,
- const char *_GPGRT__RESTRICT mode,
- gpgrt_cookie_io_functions_t functions)
+_gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie,
+ const char *_GPGRT__RESTRICT mode,
+ gpgrt_cookie_io_functions_t functions)
{
unsigned int modeflags;
int samethread;
@@ -2921,14 +2922,14 @@ do_fdopen (int filedes, const char *mode, int no_close, int with_locked_list)
}
estream_t
-es_fdopen (int filedes, const char *mode)
+_gpgrt_fdopen (int filedes, const char *mode)
{
return do_fdopen (filedes, mode, 0, 0);
}
/* A variant of es_fdopen which does not close FILEDES at the end. */
estream_t
-es_fdopen_nc (int filedes, const char *mode)
+_gpgrt_fdopen_nc (int filedes, const char *mode)
{
return do_fdopen (filedes, mode, 1, 0);
}
@@ -2983,7 +2984,7 @@ do_fpopen (FILE *fp, const char *mode, int no_close, int with_locked_list)
is easier to keep on using the standard I/O stream as a backend for
estream. */
estream_t
-es_fpopen (FILE *fp, const char *mode)
+_gpgrt_fpopen (FILE *fp, const char *mode)
{
return do_fpopen (fp, mode, 0, 0);
}
@@ -2991,7 +2992,7 @@ es_fpopen (FILE *fp, const char *mode)
/* Same as es_fpopen but does not close FP at the end. */
estream_t
-es_fpopen_nc (FILE *fp, const char *mode)
+_gpgrt_fpopen_nc (FILE *fp, const char *mode)
{
return do_fpopen (fp, mode, 1, 0);
}
@@ -3064,7 +3065,7 @@ do_sysopen (es_syshd_t *syshd, const char *mode, int no_close)
Windows it uses the bare W32 API and thus a HANDLE instead of a
file descriptor. */
estream_t
-es_sysopen (es_syshd_t *syshd, const char *mode)
+_gpgrt_sysopen (es_syshd_t *syshd, const char *mode)
{
return do_sysopen (syshd, mode, 0);
}
@@ -3072,7 +3073,7 @@ es_sysopen (es_syshd_t *syshd, const char *mode)
/* Same as es_sysopen but the handle/fd will not be closed by
es_fclose. */
estream_t
-es_sysopen_nc (es_syshd_t *syshd, const char *mode)
+_gpgrt_sysopen_nc (es_syshd_t *syshd, const char *mode)
{
return do_sysopen (syshd, mode, 1);
}
@@ -3081,9 +3082,10 @@ es_sysopen_nc (es_syshd_t *syshd, const char *mode)
/* Set custom standard descriptors to be used for stdin, stdout and
stderr. This function needs to be called before any of the
- standard streams are accessed. */
+ standard streams are accessed. This internal version uses a double
+ dash inside its name. */
void
-_gpgrt_set_std_fd (int no, int fd)
+_gpgrt__set_std_fd (int no, int fd)
{
/* fprintf (stderr, "es_set_std_fd(%d, %d)\n", no, fd); */
lock_list ();
@@ -3096,9 +3098,10 @@ _gpgrt_set_std_fd (int no, int fd)
}
-/* Return the stream used for stdin, stdout or stderr. */
+/* Return the stream used for stdin, stdout or stderr.
+ This internal version uses a double dash inside its name. */
estream_t
-_gpgrt_get_std_stream (int fd)
+_gpgrt__get_std_stream (int fd)
{
estream_list_t list_obj;
estream_t stream = NULL;
@@ -3164,8 +3167,9 @@ _gpgrt_get_std_stream (int fd)
/* Note: A "samethread" keyword given in "mode" is ignored and the
value used by STREAM is used instead. */
estream_t
-es_freopen (const char *_GPGRT__RESTRICT path, const char *_GPGRT__RESTRICT mode,
- estream_t _GPGRT__RESTRICT stream)
+_gpgrt_freopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode,
+ estream_t _GPGRT__RESTRICT stream)
{
int err;
@@ -3232,7 +3236,7 @@ es_freopen (const char *_GPGRT__RESTRICT path, const char *_GPGRT__RESTRICT mode
int
-es_fclose (estream_t stream)
+_gpgrt_fclose (estream_t stream)
{
int err;
@@ -3251,7 +3255,7 @@ es_fclose (estream_t stream)
success. The caller needs to release the returned memory using
es_free. */
int
-es_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen)
+_gpgrt_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen)
{
int err;
@@ -3321,8 +3325,8 @@ es_fclose_snatch (estream_t stream, void **r_buffer, size_t *r_buflen)
It may not call any estream function for STREAM, neither direct nor
indirectly. */
int
-es_onclose (estream_t stream, int mode,
- void (*fnc) (estream_t, void*), void *fnc_value)
+_gpgrt_onclose (estream_t stream, int mode,
+ void (*fnc) (estream_t, void*), void *fnc_value)
{
int err;
@@ -3335,11 +3339,11 @@ es_onclose (estream_t stream, int mode,
int
-es_fileno_unlocked (estream_t stream)
+_gpgrt_fileno_unlocked (estream_t stream)
{
es_syshd_t syshd;
- if (es_syshd_unlocked (stream, &syshd))
+ if (_gpgrt_syshd_unlocked (stream, &syshd))
return -1;
switch (syshd.type)
{
@@ -3357,7 +3361,7 @@ es_fileno_unlocked (estream_t stream)
sys handle. Return 0 on success or true on error and sets errno.
This is the unlocked version. */
int
-es_syshd_unlocked (estream_t stream, es_syshd_t *syshd)
+_gpgrt_syshd_unlocked (estream_t stream, es_syshd_t *syshd)
{
if (!stream || !syshd || stream->intern->syshd.type == ES_SYSHD_NONE)
{
@@ -3373,33 +3377,33 @@ es_syshd_unlocked (estream_t stream, es_syshd_t *syshd)
void
-es_flockfile (estream_t stream)
+_gpgrt_flockfile (estream_t stream)
{
lock_stream (stream);
}
int
-es_ftrylockfile (estream_t stream)
+_gpgrt_ftrylockfile (estream_t stream)
{
return trylock_stream (stream);
}
void
-es_funlockfile (estream_t stream)
+_gpgrt_funlockfile (estream_t stream)
{
unlock_stream (stream);
}
int
-es_fileno (estream_t stream)
+_gpgrt_fileno (estream_t stream)
{
int ret;
lock_stream (stream);
- ret = es_fileno_unlocked (stream);
+ ret = _gpgrt_fileno_unlocked (stream);
unlock_stream (stream);
return ret;
@@ -3411,12 +3415,12 @@ es_fileno (estream_t stream)
sys handle. Return 0 on success or true on error and sets errno.
This is the unlocked version. */
int
-es_syshd (estream_t stream, es_syshd_t *syshd)
+_gpgrt_syshd (estream_t stream, es_syshd_t *syshd)
{
int ret;
lock_stream (stream);
- ret = es_syshd_unlocked (stream, syshd);
+ ret = _gpgrt_syshd_unlocked (stream, syshd);
unlock_stream (stream);
return ret;
@@ -3424,19 +3428,19 @@ es_syshd (estream_t stream, es_syshd_t *syshd)
int
-es_feof_unlocked (estream_t stream)
+_gpgrt_feof_unlocked (estream_t stream)
{
return es_get_indicator (stream, 0, 1);
}
int
-es_feof (estream_t stream)
+_gpgrt_feof (estream_t stream)
{
int ret;
lock_stream (stream);
- ret = es_feof_unlocked (stream);
+ ret = _gpgrt_feof_unlocked (stream);
unlock_stream (stream);
return ret;
@@ -3444,19 +3448,19 @@ es_feof (estream_t stream)
int
-es_ferror_unlocked (estream_t stream)
+_gpgrt_ferror_unlocked (estream_t stream)
{
return es_get_indicator (stream, 1, 0);
}
int
-es_ferror (estream_t stream)
+_gpgrt_ferror (estream_t stream)
{
int ret;
lock_stream (stream);
- ret = es_ferror_unlocked (stream);
+ ret = _gpgrt_ferror_unlocked (stream);
unlock_stream (stream);
return ret;
@@ -3464,17 +3468,17 @@ es_ferror (estream_t stream)
void
-es_clearerr_unlocked (estream_t stream)
+_gpgrt_clearerr_unlocked (estream_t stream)
{
es_set_indicators (stream, 0, 0);
}
void
-es_clearerr (estream_t stream)
+_gpgrt_clearerr (estream_t stream)
{
lock_stream (stream);
- es_clearerr_unlocked (stream);
+ _gpgrt_clearerr_unlocked (stream);
unlock_stream (stream);
}
@@ -3497,7 +3501,7 @@ do_fflush (estream_t stream)
int
-es_fflush (estream_t stream)
+_gpgrt_fflush (estream_t stream)
{
int err;
@@ -3527,7 +3531,7 @@ es_fflush (estream_t stream)
int
-es_fseek (estream_t stream, long int offset, int whence)
+_gpgrt_fseek (estream_t stream, long int offset, int whence)
{
int err;
@@ -3540,7 +3544,7 @@ es_fseek (estream_t stream, long int offset, int whence)
int
-es_fseeko (estream_t stream, off_t offset, int whence)
+_gpgrt_fseeko (estream_t stream, off_t offset, int whence)
{
int err;
@@ -3553,7 +3557,7 @@ es_fseeko (estream_t stream, off_t offset, int whence)
long int
-es_ftell (estream_t stream)
+_gpgrt_ftell (estream_t stream)
{
long int ret;
@@ -3566,7 +3570,7 @@ es_ftell (estream_t stream)
off_t
-es_ftello (estream_t stream)
+_gpgrt_ftello (estream_t stream)
{
off_t ret = -1;
@@ -3579,7 +3583,7 @@ es_ftello (estream_t stream)
void
-es_rewind (estream_t stream)
+_gpgrt_rewind (estream_t stream)
{
lock_stream (stream);
es_seek (stream, 0L, SEEK_SET, NULL);
@@ -3589,7 +3593,7 @@ es_rewind (estream_t stream)
int
-_gpgrt_getc_underflow (estream_t stream)
+_gpgrt__getc_underflow (estream_t stream)
{
int err;
unsigned char c;
@@ -3602,7 +3606,7 @@ _gpgrt_getc_underflow (estream_t stream)
int
-_gpgrt_putc_overflow (int c, estream_t stream)
+_gpgrt__putc_overflow (int c, estream_t stream)
{
unsigned char d = c;
int err;
@@ -3614,12 +3618,12 @@ _gpgrt_putc_overflow (int c, estream_t stream)
int
-es_fgetc (estream_t stream)
+_gpgrt_fgetc (estream_t stream)
{
int ret;
lock_stream (stream);
- ret = es_getc_unlocked (stream);
+ ret = _gpgrt_getc_unlocked (stream);
unlock_stream (stream);
return ret;
@@ -3627,12 +3631,12 @@ es_fgetc (estream_t stream)
int
-es_fputc (int c, estream_t stream)
+_gpgrt_fputc (int c, estream_t stream)
{
int ret;
lock_stream (stream);
- ret = es_putc_unlocked (c, stream);
+ ret = _gpgrt_putc_unlocked (c, stream);
unlock_stream (stream);
return ret;
@@ -3640,7 +3644,7 @@ es_fputc (int c, estream_t stream)
int
-es_ungetc (int c, estream_t stream)
+_gpgrt_ungetc (int c, estream_t stream)
{
unsigned char data = (unsigned char) c;
size_t data_unread;
@@ -3654,9 +3658,9 @@ es_ungetc (int c, estream_t stream)
int
-es_read (estream_t _GPGRT__RESTRICT stream,
- void *_GPGRT__RESTRICT buffer, size_t bytes_to_read,
- size_t *_GPGRT__RESTRICT bytes_read)
+_gpgrt_read (estream_t _GPGRT__RESTRICT stream,
+ void *_GPGRT__RESTRICT buffer, size_t bytes_to_read,
+ size_t *_GPGRT__RESTRICT bytes_read)
{
int err;
@@ -3674,9 +3678,9 @@ es_read (estream_t _GPGRT__RESTRICT stream,
int
-es_write (estream_t _GPGRT__RESTRICT stream,
- const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write,
- size_t *_GPGRT__RESTRICT bytes_written)
+_gpgrt_write (estream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write,
+ size_t *_GPGRT__RESTRICT bytes_written)
{
int err;
@@ -3694,8 +3698,8 @@ es_write (estream_t _GPGRT__RESTRICT stream,
size_t
-es_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
- estream_t _GPGRT__RESTRICT stream)
+_gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
+ estream_t _GPGRT__RESTRICT stream)
{
size_t ret, bytes;
@@ -3715,8 +3719,8 @@ es_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
size_t
-es_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
- estream_t _GPGRT__RESTRICT stream)
+_gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
+ estream_t _GPGRT__RESTRICT stream)
{
size_t ret, bytes;
@@ -3736,7 +3740,8 @@ es_fwrite (const void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
char *
-es_fgets (char *_GPGRT__RESTRICT buffer, int length, estream_t _GPGRT__RESTRICT stream)
+_gpgrt_fgets (char *_GPGRT__RESTRICT buffer, int length,
+ estream_t _GPGRT__RESTRICT stream)
{
unsigned char *s = (unsigned char*)buffer;
int c;
@@ -3746,7 +3751,7 @@ es_fgets (char *_GPGRT__RESTRICT buffer, int length, estream_t _GPGRT__RESTRICT
c = EOF;
lock_stream (stream);
- while (length > 1 && (c = es_getc_unlocked (stream)) != EOF && c != '\n')
+ while (length > 1 && (c = _gpgrt_getc_unlocked (stream)) != EOF && c != '\n')
{
*s++ = c;
length--;
@@ -3765,7 +3770,8 @@ es_fgets (char *_GPGRT__RESTRICT buffer, int length, estream_t _GPGRT__RESTRICT
int
-es_fputs_unlocked (const char *_GPGRT__RESTRICT s, estream_t _GPGRT__RESTRICT stream)
+_gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s,
+ estream_t _GPGRT__RESTRICT stream)
{
size_t length;
int err;
@@ -3776,7 +3782,7 @@ es_fputs_unlocked (const char *_GPGRT__RESTRICT s, estream_t _GPGRT__RESTRICT st
}
int
-es_fputs (const char *_GPGRT__RESTRICT s, estream_t _GPGRT__RESTRICT stream)
+_gpgrt_fputs (const char *_GPGRT__RESTRICT s, estream_t _GPGRT__RESTRICT stream)
{
size_t length;
int err;
@@ -3791,8 +3797,8 @@ es_fputs (const char *_GPGRT__RESTRICT s, estream_t _GPGRT__RESTRICT stream)
ssize_t
-es_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr, size_t *_GPGRT__RESTRICT n,
- estream_t _GPGRT__RESTRICT stream)
+_gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr,
+ size_t *_GPGRT__RESTRICT n, estream_t _GPGRT__RESTRICT stream)
{
char *line = NULL;
size_t line_n = 0;
@@ -3875,9 +3881,9 @@ es_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr, size_t *_GPGRT__RE
released using es_free.
*/
ssize_t
-es_read_line (estream_t stream,
- char **addr_of_buffer, size_t *length_of_buffer,
- size_t *max_length)
+_gpgrt_read_line (estream_t stream,
+ char **addr_of_buffer, size_t *length_of_buffer,
+ size_t *max_length)
{
int c;
char *buffer = *addr_of_buffer;
@@ -3913,7 +3919,7 @@ es_read_line (estream_t stream,
lock_stream (stream);
p = buffer;
- while ((c = es_getc_unlocked (stream)) != EOF)
+ while ((c = _gpgrt_getc_unlocked (stream)) != EOF)
{
if (nbytes == length)
{
@@ -3921,7 +3927,7 @@ es_read_line (estream_t stream,
if (maxlen && length > maxlen)
{
/* We are beyond our limit: Skip the rest of the line. */
- while (c != '\n' && (c=es_getc_unlocked (stream)) != EOF)
+ while (c != '\n' && (c=_gpgrt_getc_unlocked (stream)) != EOF)
;
*p++ = '\n'; /* Always append a LF (we reserved some space). */
nbytes++;
@@ -3963,24 +3969,25 @@ es_read_line (estream_t stream,
by estream. Should be used for all buffers returned to the caller
by libestream. */
void
-es_free (void *a)
+_gpgrt_free (void *a)
{
mem_free (a);
}
int
-es_vfprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
- const char *_GPGRT__RESTRICT format,
- va_list ap)
+_gpgrt_vfprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format,
+ va_list ap)
{
return es_print (stream, format, ap);
}
int
-es_vfprintf (estream_t _GPGRT__RESTRICT stream, const char *_GPGRT__RESTRICT format,
- va_list ap)
+_gpgrt_vfprintf (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format,
+ va_list ap)
{
int ret;
@@ -3993,8 +4000,8 @@ es_vfprintf (estream_t _GPGRT__RESTRICT stream, const char *_GPGRT__RESTRICT for
int
-es_fprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
- const char *_GPGRT__RESTRICT format, ...)
+_gpgrt_fprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
{
int ret;
@@ -4008,41 +4015,10 @@ es_fprintf_unlocked (estream_t _GPGRT__RESTRICT stream,
int
-es_fprintf (estream_t _GPGRT__RESTRICT stream,
- const char *_GPGRT__RESTRICT format, ...)
-{
- int ret;
-
- va_list ap;
- va_start (ap, format);
- lock_stream (stream);
- ret = es_print (stream, format, ap);
- unlock_stream (stream);
- va_end (ap);
-
- return ret;
-}
-
-
-int
-es_printf_unlocked (const char *_GPGRT__RESTRICT format, ...)
-{
- int ret;
-
- va_list ap;
- va_start (ap, format);
- ret = es_print (es_stdout, format, ap);
- va_end (ap);
-
- return ret;
-}
-
-
-int
-es_printf (const char *_GPGRT__RESTRICT format, ...)
+_gpgrt_fprintf (estream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
{
int ret;
- estream_t stream = es_stdout;
va_list ap;
va_start (ap, format);
@@ -4055,45 +4031,6 @@ es_printf (const char *_GPGRT__RESTRICT format, ...)
}
-/* A variant of asprintf. The function returns the allocated buffer
- or NULL on error; ERRNO is set in the error case. The caller
- should use es_free to release the buffer. This function actually
- belongs into estream-printf but we put it here as a convenience
- and because es_free is required anyway. */
-char *
-es_asprintf (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;
-}
-
-
-/* A variant of vasprintf. The function returns the allocated buffer
- or NULL on error; ERRNO is set in the error case. The caller
- should use es_free to release the buffer. This function actually
- belongs into estream-printf but we put it here as a convenience
- and because es_free is required anyway. */
-char *
-es_vasprintf (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;
-}
-
-
static int
tmpfd (void)
{
@@ -4196,7 +4133,7 @@ tmpfd (void)
}
estream_t
-es_tmpfile (void)
+_gpgrt_tmpfile (void)
{
unsigned int modeflags;
int create_called;
@@ -4243,8 +4180,8 @@ es_tmpfile (void)
int
-es_setvbuf (estream_t _GPGRT__RESTRICT stream,
- char *_GPGRT__RESTRICT buf, int type, size_t size)
+_gpgrt_setvbuf (estream_t _GPGRT__RESTRICT stream,
+ char *_GPGRT__RESTRICT buf, int type, size_t size)
{
int err;
@@ -4265,21 +4202,12 @@ es_setvbuf (estream_t _GPGRT__RESTRICT stream,
}
-void
-es_setbuf (estream_t _GPGRT__RESTRICT stream, char *_GPGRT__RESTRICT buf)
-{
- lock_stream (stream);
- es_set_buffering (stream, buf, buf ? _IOFBF : _IONBF, BUFSIZ);
- unlock_stream (stream);
-}
-
-
/* Put a stream into binary mode. This is only needed for the
standard streams if they are to be used in a binary way. On Unix
systems it is never needed but MSDOS based systems require such a
call. It needs to be called before any I/O is done on STREAM. */
void
-es_set_binary (estream_t stream)
+_gpgrt_set_binary (estream_t stream)
{
lock_stream (stream);
if (!(stream->intern->modeflags & O_BINARY))
@@ -4307,7 +4235,7 @@ es_set_binary (estream_t stream)
void
-es_opaque_set (estream_t stream, void *opaque)
+_gpgrt_opaque_set (estream_t stream, void *opaque)
{
lock_stream (stream);
es_opaque_ctrl (stream, opaque, NULL);
@@ -4316,7 +4244,7 @@ es_opaque_set (estream_t stream, void *opaque)
void *
-es_opaque_get (estream_t stream)
+_gpgrt_opaque_get (estream_t stream)
{
void *opaque;
@@ -4359,7 +4287,7 @@ fname_set_internal (estream_t stream, const char *fname, int quote)
as long as STREAM is valid. This function is called internally by
functions which open a filename. */
void
-es_fname_set (estream_t stream, const char *fname)
+_gpgrt_fname_set (estream_t stream, const char *fname)
{
if (fname)
{
@@ -4374,7 +4302,7 @@ es_fname_set (estream_t stream, const char *fname)
been set, "[?]" will be returned. The returned file name is valid
as long as STREAM is valid. */
const char *
-es_fname_get (estream_t stream)
+_gpgrt_fname_get (estream_t stream)
{
const char *fname;
@@ -4395,10 +4323,10 @@ es_fname_get (estream_t stream)
the number of bytes actually written are stored at this
address. */
int
-es_write_sanitized (estream_t _GPGRT__RESTRICT stream,
- const void * _GPGRT__RESTRICT buffer, size_t length,
- const char * delimiters,
- size_t * _GPGRT__RESTRICT bytes_written)
+_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)
{
const unsigned char *p = buffer;
size_t count = 0;
@@ -4412,54 +4340,54 @@ es_write_sanitized (estream_t _GPGRT__RESTRICT stream,
|| (delimiters
&& (strchr (delimiters, *p) || *p == '\\')))
{
- es_putc_unlocked ('\\', stream);
+ _gpgrt_putc_unlocked ('\\', stream);
count++;
if (*p == '\n')
{
- es_putc_unlocked ('n', stream);
+ _gpgrt_putc_unlocked ('n', stream);
count++;
}
else if (*p == '\r')
{
- es_putc_unlocked ('r', stream);
+ _gpgrt_putc_unlocked ('r', stream);
count++;
}
else if (*p == '\f')
{
- es_putc_unlocked ('f', stream);
+ _gpgrt_putc_unlocked ('f', stream);
count++;
}
else if (*p == '\v')
{
- es_putc_unlocked ('v', stream);
+ _gpgrt_putc_unlocked ('v', stream);
count++;
}
else if (*p == '\b')
{
- es_putc_unlocked ('b', stream);
+ _gpgrt_putc_unlocked ('b', stream);
count++;
}
else if (!*p)
{
- es_putc_unlocked('0', stream);
+ _gpgrt_putc_unlocked('0', stream);
count++;
}
else
{
- es_fprintf_unlocked (stream, "x%02x", *p);
+ _gpgrt_fprintf_unlocked (stream, "x%02x", *p);
count += 3;
}
}
else
{
- es_putc_unlocked (*p, stream);
+ _gpgrt_putc_unlocked (*p, stream);
count++;
}
}
if (bytes_written)
*bytes_written = count;
- ret = es_ferror_unlocked (stream)? -1 : 0;
+ ret = _gpgrt_ferror_unlocked (stream)? -1 : 0;
unlock_stream (stream);
return ret;
@@ -4471,9 +4399,9 @@ es_write_sanitized (estream_t _GPGRT__RESTRICT stream,
BYTES_WRITTEN is not NULL the number of bytes actually written are
stored at this address. */
int
-es_write_hexstring (estream_t _GPGRT__RESTRICT stream,
- const void *_GPGRT__RESTRICT buffer, size_t length,
- int reserved, size_t *_GPGRT__RESTRICT bytes_written )
+_gpgrt_write_hexstring (estream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t length,
+ int reserved, size_t *_GPGRT__RESTRICT bytes_written )
{
int ret;
const unsigned char *s;
@@ -4490,14 +4418,14 @@ es_write_hexstring (estream_t _GPGRT__RESTRICT stream,
for (s = buffer; length; s++, length--)
{
- es_putc_unlocked ( tohex ((*s>>4)&15), stream);
- es_putc_unlocked ( tohex (*s&15), stream);
+ _gpgrt_putc_unlocked ( tohex ((*s>>4)&15), stream);
+ _gpgrt_putc_unlocked ( tohex (*s&15), stream);
count += 2;
}
if (bytes_written)
*bytes_written = count;
- ret = es_ferror_unlocked (stream)? -1 : 0;
+ ret = _gpgrt_ferror_unlocked (stream)? -1 : 0;
unlock_stream (stream);
diff --git a/src/gpg-error.def.in b/src/gpg-error.def.in
index 97bc00f..e7c8e8c 100644
--- a/src/gpg-error.def.in
+++ b/src/gpg-error.def.in
@@ -55,6 +55,77 @@ EXPORTS
gpgrt_lock_destroy @23
gpgrt_yield @24
+ gpgrt_fopen @25
+ gpgrt_mopen @26
+ gpgrt_fopenmem @27
+ gpgrt_fopenmem_init @28
+ gpgrt_fdopen @29
+ gpgrt_fdopen_nc @30
+ gpgrt_sysopen @31
+ gpgrt_sysopen_nc @32
+ gpgrt_fpopen @33
+ gpgrt_fpopen_nc @34
+ gpgrt_freopen @35
+ gpgrt_fopencookie @36
+ gpgrt_fclose @37
+ gpgrt_fclose_snatch @38
+ gpgrt_onclose @39
+ gpgrt_fileno @40
+ gpgrt_fileno_unlocked @41
+ gpgrt_syshd @42
+ gpgrt_syshd_unlocked @43
+ _gpgrt_set_std_stream @44
+ _gpgrt_get_std_stream @45
+ gpgrt_flockfile @46
+ gpgrt_ftrylockfile @47
+ gpgrt_funlockfile @48
+ gpgrt_feof @49
+ gpgrt_feof_unlocked @50
+ gpgrt_ferror @51
+ gpgrt_ferror_unlocked @52
+ gpgrt_clearerr @53
+ gpgrt_clearerr_unlocked @54
+ gpgrt_fflush @55
+ gpgrt_fseek @56
+ gpgrt_fseeko @57
+ gpgrt_ftell @58
+ gpgrt_ftello @59
+ gpgrt_rewind @60
+ gpgrt_fgetc @61
+ _gpgrt_getc_underflow @62
+ gpgrt_fputc @63
+ _gpgrt_putc_overflow @64
+ gpgrt_ungetc @65
+ gpgrt_read @66
+ gpgrt_write @67
+ gpgrt_write_sanitized @68
+ gpgrt_write_hexstring @69
+ gpgrt_fread @70
+ gpgrt_fwrite @71
+ gpgrt_fgets @72
+ gpgrt_fputs @73
+ gpgrt_fputs_unlocked @74
+ gpgrt_getline @75
+ gpgrt_read_line @76
+ gpgrt_free @77
+ gpgrt_fprintf @78
+ gpgrt_fprintf_unlocked @79
+ gpgrt_printf @80
+ gpgrt_printf_unlocked @81
+ gpgrt_vfprintf @82
+ gpgrt_vfprintf_unlocked @83
+ gpgrt_setvbuf @84
+ gpgrt_setbuf @85
+ gpgrt_set_binary @86
+ gpgrt_tmpfile @87
+ gpgrt_opaque_set @88
+ gpgrt_opaque_get @89
+ gpgrt_fname_set @90
+ gpgrt_fname_get @91
+ gpgrt_asprintf @92
+ gpgrt_vasprintf @93
+ gpgrt_bsprintf @94
+ gpgrt_vbsprintf @95
;; end of file with public symbols for Windows.
diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in
index 8cdbaba..1e10d97 100644
--- a/src/gpg-error.h.in
+++ b/src/gpg-error.h.in
@@ -569,11 +569,6 @@ int gpgrt_vfprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
const char *_GPGRT__RESTRICT format, va_list ap)
_GPGRT_GCC_A_PRINTF(2,0);
-char *gpgrt_asprintf (const char *_GPGRT__RESTRICT format, ...)
- _GPGRT_GCC_A_PRINTF(1,2);
-char *gpgrt_vasprintf (const char *_GPGRT__RESTRICT format, va_list ap)
- _GPGRT_GCC_A_PRINTF(1,0);
-
int gpgrt_setvbuf (gpgrt_stream_t _GPGRT__RESTRICT stream,
char *_GPGRT__RESTRICT buf, int mode, size_t size);
void gpgrt_setbuf (gpgrt_stream_t _GPGRT__RESTRICT stream,
@@ -590,6 +585,16 @@ void *gpgrt_opaque_get (gpgrt_stream_t stream);
void gpgrt_fname_set (gpgrt_stream_t stream, const char *fname);
const char *gpgrt_fname_get (gpgrt_stream_t stream);
+int gpgrt_asprintf (char **r_buf, const char *_GPGRT__RESTRICT format, ...)
+ _GPGRT_GCC_A_PRINTF(2,3);
+int gpgrt_vasprintf (char **r_buf, const char *_GPGRT__RESTRICT format,
+ va_list ap)
+ _GPGRT_GCC_A_PRINTF(2,0);
+char *gpgrt_bsprintf (const char *_GPGRT__RESTRICT format, ...)
+ _GPGRT_GCC_A_PRINTF(1,2);
+char *gpgrt_vbsprintf (const char *_GPGRT__RESTRICT format, va_list ap)
+ _GPGRT_GCC_A_PRINTF(1,0);
+
#ifdef GPGRT_ENABLE_ES_MACROS
# define es_fopen gpgrt_fopen
@@ -654,8 +659,6 @@ const char *gpgrt_fname_get (gpgrt_stream_t stream);
# define es_printf_unlocked gpgrt_printf_unlocked
# define es_vfprintf gpgrt_vfprintf
# define es_vfprintf_unlocked gpgrt_vfprintf_unlocked
-# define es_asprintf gpgrt_asprintf
-# define es_vasprintf gpgrt_vasprintf
# define es_setvbuf gpgrt_setvbuf
# define es_setbuf gpgrt_setbuf
# define es_set_binary gpgrt_set_binary
@@ -664,6 +667,10 @@ const char *gpgrt_fname_get (gpgrt_stream_t stream);
# define es_opaque_get gpgrt_opaque_get
# define es_fname_set gpgrt_fname_set
# define es_fname_get gpgrt_fname_get
+# define es_asprintf gpgrt_asprintf
+# define es_vasprintf gpgrt_vasprintf
+# define es_bsprintf gpgrt_bsprintf
+# define es_vbsprintf gpgrt_vbsprintf
#endif /*GPGRT_ENABLE_ES_MACROS*/
#ifdef __cplusplus
diff --git a/src/gpg-error.vers b/src/gpg-error.vers
index 8e67081..f878b07 100644
--- a/src/gpg-error.vers
+++ b/src/gpg-error.vers
@@ -1,4 +1,4 @@
-# libgpg-error.vers - What symbols to export -*- std -*-
+# libgpg-error.vers - What symbols to export -*- std -*-
# Copyright (C) 2014 g10 Code GmbH
#
# This file is part of libgpg-error.
@@ -37,6 +37,79 @@ GPG_ERROR_1.0 {
gpgrt_lock_destroy;
gpgrt_yield;
+ gpgrt_fopen;
+ gpgrt_mopen;
+ gpgrt_fopenmem;
+ gpgrt_fopenmem_init;
+ gpgrt_fdopen;
+ gpgrt_fdopen_nc;
+ gpgrt_sysopen;
+ gpgrt_sysopen_nc;
+ gpgrt_fpopen;
+ gpgrt_fpopen_nc;
+ gpgrt_freopen;
+ gpgrt_fopencookie;
+ gpgrt_fclose;
+ gpgrt_fclose_snatch;
+ gpgrt_onclose;
+ gpgrt_fileno;
+ gpgrt_fileno_unlocked;
+ gpgrt_syshd;
+ gpgrt_syshd_unlocked;
+ _gpgrt_set_std_stream;
+ _gpgrt_get_std_stream;
+ gpgrt_flockfile;
+ gpgrt_ftrylockfile;
+ gpgrt_funlockfile;
+ gpgrt_feof;
+ gpgrt_feof_unlocked;
+ gpgrt_ferror;
+ gpgrt_ferror_unlocked;
+ gpgrt_clearerr;
+ gpgrt_clearerr_unlocked;
+ gpgrt_fflush;
+ gpgrt_fseek;
+ gpgrt_fseeko;
+ gpgrt_ftell;
+ gpgrt_ftello;
+ gpgrt_rewind;
+ gpgrt_fgetc;
+ _gpgrt_getc_underflow;
+ gpgrt_fputc;
+ _gpgrt_putc_overflow;
+ gpgrt_ungetc;
+ gpgrt_read;
+ gpgrt_write;
+ gpgrt_write_sanitized;
+ gpgrt_write_hexstring;
+ gpgrt_fread;
+ gpgrt_fwrite;
+ gpgrt_fgets;
+ gpgrt_fputs;
+ gpgrt_fputs_unlocked;
+ gpgrt_getline;
+ gpgrt_read_line;
+ gpgrt_free;
+ gpgrt_fprintf;
+ gpgrt_fprintf_unlocked;
+ gpgrt_printf;
+ gpgrt_printf_unlocked;
+ gpgrt_vfprintf;
+ gpgrt_vfprintf_unlocked;
+ gpgrt_setvbuf;
+ gpgrt_setbuf;
+ gpgrt_set_binary;
+ gpgrt_tmpfile;
+ gpgrt_opaque_set;
+ gpgrt_opaque_get;
+ gpgrt_fname_set;
+ gpgrt_fname_get;
+
+ gpgrt_asprintf;
+ gpgrt_vasprintf;
+ gpgrt_bsprintf;
+ gpgrt_vbsprintf;
+
local:
*;
};
diff --git a/src/gpgrt-int.h b/src/gpgrt-int.h
index 044fe74..5743781 100644
--- a/src/gpgrt-int.h
+++ b/src/gpgrt-int.h
@@ -44,6 +44,151 @@ gpg_err_code_t _gpgrt_yield (void);
/* Local prototypes for estream. */
int _gpgrt_es_init (void);
+gpgrt_stream_t _gpgrt_fopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode);
+gpgrt_stream_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);
+gpgrt_stream_t _gpgrt_fopenmem (size_t memlimit,
+ const char *_GPGRT__RESTRICT mode);
+gpgrt_stream_t _gpgrt_fopenmem_init (size_t memlimit,
+ const char *_GPGRT__RESTRICT mode,
+ const void *data, size_t datalen);
+gpgrt_stream_t _gpgrt_fdopen (int filedes, const char *mode);
+gpgrt_stream_t _gpgrt_fdopen_nc (int filedes, const char *mode);
+gpgrt_stream_t _gpgrt_sysopen (gpgrt_syshd_t *syshd, const char *mode);
+gpgrt_stream_t _gpgrt_sysopen_nc (gpgrt_syshd_t *syshd, const char *mode);
+gpgrt_stream_t _gpgrt_fpopen (FILE *fp, const char *mode);
+gpgrt_stream_t _gpgrt_fpopen_nc (FILE *fp, const char *mode);
+gpgrt_stream_t _gpgrt_freopen (const char *_GPGRT__RESTRICT path,
+ const char *_GPGRT__RESTRICT mode,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+gpgrt_stream_t _gpgrt_fopencookie (void *_GPGRT__RESTRICT cookie,
+ const char *_GPGRT__RESTRICT mode,
+ gpgrt_cookie_io_functions_t functions);
+int _gpgrt_fclose (gpgrt_stream_t stream);
+int _gpgrt_fclose_snatch (gpgrt_stream_t stream,
+ void **r_buffer, size_t *r_buflen);
+int _gpgrt_onclose (gpgrt_stream_t stream, int mode,
+ void (*fnc) (gpgrt_stream_t, void*), void *fnc_value);
+int _gpgrt_fileno (gpgrt_stream_t stream);
+int _gpgrt_fileno_unlocked (gpgrt_stream_t stream);
+int _gpgrt_syshd (gpgrt_stream_t stream, gpgrt_syshd_t *syshd);
+int _gpgrt_syshd_unlocked (gpgrt_stream_t stream, gpgrt_syshd_t *syshd);
+
+void _gpgrt__set_std_fd (int no, int fd);
+gpgrt_stream_t _gpgrt__get_std_stream (int fd);
+
+void _gpgrt_flockfile (gpgrt_stream_t stream);
+int _gpgrt_ftrylockfile (gpgrt_stream_t stream);
+void _gpgrt_funlockfile (gpgrt_stream_t stream);
+
+int _gpgrt_feof (gpgrt_stream_t stream);
+int _gpgrt_feof_unlocked (gpgrt_stream_t stream);
+int _gpgrt_ferror (gpgrt_stream_t stream);
+int _gpgrt_ferror_unlocked (gpgrt_stream_t stream);
+void _gpgrt_clearerr (gpgrt_stream_t stream);
+void _gpgrt_clearerr_unlocked (gpgrt_stream_t stream);
+
+int _gpgrt_fflush (gpgrt_stream_t stream);
+int _gpgrt_fseek (gpgrt_stream_t stream, long int offset, int whence);
+int _gpgrt_fseeko (gpgrt_stream_t stream, off_t offset, int whence);
+long int _gpgrt_ftell (gpgrt_stream_t stream);
+off_t _gpgrt_ftello (gpgrt_stream_t stream);
+void _gpgrt_rewind (gpgrt_stream_t stream);
+
+int _gpgrt_fgetc (gpgrt_stream_t stream);
+int _gpgrt_fputc (int c, gpgrt_stream_t stream);
+
+int _gpgrt__getc_underflow (gpgrt_stream_t stream);
+int _gpgrt__putc_overflow (int c, gpgrt_stream_t stream);
+
+/* Note: Keeps the next two macros in sync
+ with their counterparts in gpg-error.h. */
+#define _gpgrt_getc_unlocked(stream) \
+ (((!(stream)->flags.writing) \
+ && ((stream)->data_offset < (stream)->data_len) \
+ && (! (stream)->unread_data_len)) \
+ ? ((int) (stream)->buffer[((stream)->data_offset)++]) \
+ : _gpgrt__getc_underflow ((stream)))
+
+#define _gpgrt_putc_unlocked(c, stream) \
+ (((stream)->flags.writing \
+ && ((stream)->data_offset < (stream)->buffer_size) \
+ && (c != '\n')) \
+ ? ((int) ((stream)->buffer[((stream)->data_offset)++] = (c))) \
+ : _gpgrt__putc_overflow ((c), (stream)))
+
+int _gpgrt_ungetc (int c, gpgrt_stream_t stream);
+
+int _gpgrt_read (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ void *_GPGRT__RESTRICT buffer, size_t bytes_to_read,
+ size_t *_GPGRT__RESTRICT bytes_read);
+int _gpgrt_write (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t bytes_to_write,
+ size_t *_GPGRT__RESTRICT bytes_written);
+int _gpgrt_write_sanitized (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t length,
+ const char *delimiters,
+ size_t *_GPGRT__RESTRICT bytes_written);
+int _gpgrt_write_hexstring (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const void *_GPGRT__RESTRICT buffer, size_t length,
+ int reserved,
+ size_t *_GPGRT__RESTRICT bytes_written);
+
+size_t _gpgrt_fread (void *_GPGRT__RESTRICT ptr, size_t size, size_t nitems,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+size_t _gpgrt_fwrite (const void *_GPGRT__RESTRICT ptr,
+ size_t size, size_t memb,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+
+char *_gpgrt_fgets (char *_GPGRT__RESTRICT s, int n,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+int _gpgrt_fputs (const char *_GPGRT__RESTRICT s,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+int _gpgrt_fputs_unlocked (const char *_GPGRT__RESTRICT s,
+ gpgrt_stream_t _GPGRT__RESTRICT stream);
+
+ssize_t _gpgrt_getline (char *_GPGRT__RESTRICT *_GPGRT__RESTRICT lineptr,
+ size_t *_GPGRT__RESTRICT n,
+ gpgrt_stream_t stream);
+ssize_t _gpgrt_read_line (gpgrt_stream_t stream,
+ char **addr_of_buffer, size_t *length_of_buffer,
+ size_t *max_length);
+void _gpgrt_free (void *a);
+
+int _gpgrt_fprintf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
+ _GPGRT_GCC_A_PRINTF(2,3);
+int _gpgrt_fprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, ...)
+ _GPGRT_GCC_A_PRINTF(2,3);
+
+int _gpgrt_vfprintf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, va_list ap)
+ _GPGRT_GCC_A_PRINTF(2,0);
+int _gpgrt_vfprintf_unlocked (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ const char *_GPGRT__RESTRICT format, va_list ap)
+ _GPGRT_GCC_A_PRINTF(2,0);
+
+int _gpgrt_setvbuf (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ char *_GPGRT__RESTRICT buf, int mode, size_t size);
+
+void _gpgrt_set_binary (gpgrt_stream_t stream);
+
+gpgrt_stream_t _gpgrt_tmpfile (void);
+
+void _gpgrt_opaque_set (gpgrt_stream_t _GPGRT__RESTRICT stream,
+ void *_GPGRT__RESTRICT opaque);
+void *_gpgrt_opaque_get (gpgrt_stream_t stream);
+
+void _gpgrt_fname_set (gpgrt_stream_t stream, const char *fname);
+const char *_gpgrt_fname_get (gpgrt_stream_t stream);
+
+#include "estream-printf.h"
#endif /*_GPGRT_GPGRT_INT_H*/
diff --git a/src/visibility.c b/src/visibility.c
index f7832ae..d53ec26 100644
--- a/src/visibility.c
+++ b/src/visibility.c
@@ -102,3 +102,520 @@ 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_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, off_t offset, int whence)
+{
+ return _gpgrt_fseeko (stream, offset, whence);
+}
+
+long int
+gpgrt_ftell (estream_t stream)
+{
+ return _gpgrt_ftell (stream);
+}
+
+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);
+}
+
+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);
+}
+
+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;
+}
diff --git a/src/visibility.h b/src/visibility.h
index 95d7d76..6455c1e 100644
--- a/src/visibility.h
+++ b/src/visibility.h
@@ -59,7 +59,77 @@ MARK_VISIBLE (gpgrt_lock_unlock)
MARK_VISIBLE (gpgrt_lock_destroy)
MARK_VISIBLE (gpgrt_yield)
-
+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_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)
#undef MARK_VISIBLE
@@ -84,7 +154,77 @@ MARK_VISIBLE (gpgrt_yield)
#define gpgrt_lock_destroy _gpgrt_USE_UNDERSCORED_FUNCTION
#define gpgrt_yield _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_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
#endif /*!_GPGRT_INCL_BY_VISIBILITY_C*/