aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpgrt-int.h
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2018-11-26 19:06:36 +0000
committerWerner Koch <[email protected]>2018-11-26 19:09:53 +0000
commitffb49b72f132d954a3d9fa11e45803c36a62fd25 (patch)
treeef464194cfdc5392af615079ed010a1c1d0efc75 /src/gpgrt-int.h
parentcore: New API gpgrt_cmp_version (diff)
downloadlibgpg-error-ffb49b72f132d954a3d9fa11e45803c36a62fd25.tar.gz
libgpg-error-ffb49b72f132d954a3d9fa11e45803c36a62fd25.zip
core: Add a limited version of gpgrt_ftruncate.
* src/gpg-error.h.in (gpgrt_ftruncate, es_ftruncate): New. * src/gpg-error.def.in, src/gpg-error.vers: Add gpgrt_ftruncate. * src/visibility.c (gpgrt_ftruncate): new. * src/gpgrt-int.h (COOKIE_IOCTL_TRUNCATE): New. * src/estream.c (func_mem_ioctl): Support new internal IOCTL. (_gpgrt_ftruncate): New. -- Right now the ftruncate works only on memory streams. Can easily be added to other stream times. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/gpgrt-int.h')
-rw-r--r--src/gpgrt-int.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpgrt-int.h b/src/gpgrt-int.h
index b5a4dd1..09aad11 100644
--- a/src/gpgrt-int.h
+++ b/src/gpgrt-int.h
@@ -208,12 +208,12 @@ void _gpgrt_internal_trace_end (void);
/*
* A private cookie function to implement an internal IOCTL service.
- * and ist IOCTL numbers.
*/
typedef int (*cookie_ioctl_function_t) (void *cookie, int cmd,
void *ptr, size_t *len);
#define COOKIE_IOCTL_SNATCH_BUFFER 1
#define COOKIE_IOCTL_NONBLOCK 2
+#define COOKIE_IOCTL_TRUNCATE 3
/* An internal variant of gpgrt_cookie_close_function_t with a slot
* for the ioctl function. */
@@ -366,6 +366,7 @@ int _gpgrt_fseeko (gpgrt_stream_t stream, gpgrt_off_t offset, int whence);
long int _gpgrt_ftell (gpgrt_stream_t stream);
gpgrt_off_t _gpgrt_ftello (gpgrt_stream_t stream);
void _gpgrt_rewind (gpgrt_stream_t stream);
+int _gpgrt_ftruncate (estream_t stream, gpgrt_off_t length);
int _gpgrt_fgetc (gpgrt_stream_t stream);
int _gpgrt_fputc (int c, gpgrt_stream_t stream);