diff options
author | Neal H. Walfield <[email protected]> | 2015-08-09 08:52:34 +0000 |
---|---|---|
committer | Neal H. Walfield <[email protected]> | 2015-08-20 12:16:14 +0000 |
commit | c06eabac8e85f7f79414363836f093415e8da62e (patch) | |
tree | bc3eca2cd19dcbacfa2086387e69e16bd3bf961f /common/iobuf.h | |
parent | gpg: Avoid linking to Libksba (diff) | |
download | gnupg-c06eabac8e85f7f79414363836f093415e8da62e.tar.gz gnupg-c06eabac8e85f7f79414363836f093415e8da62e.zip |
common/iobuf.h: Replace further use of literals with symbolic constants.
* common/iobuf.c: Move BLOCK_FILTER_INPUT,
BLOCK_FILTER_OUTPUT_BLOCK_FILTER_TEMP from here...
* common/iobuf.h: ... to here and rename to IOBUF_INPUT, IOBUF_OUTPUT
and IOBUF_TEMP, respectively. Where appropriate, use these macros
instead of a literal.
--
Signed-off-by: Neal H. Walfield <[email protected]>.
Diffstat (limited to 'common/iobuf.h')
-rw-r--r-- | common/iobuf.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/common/iobuf.h b/common/iobuf.h index 3889459e3..23b1d091e 100644 --- a/common/iobuf.h +++ b/common/iobuf.h @@ -55,6 +55,13 @@ typedef enum IOBUF_IOCTL_FSYNC = 4 /* Uses ptrval. */ } iobuf_ioctl_t; +enum + { + IOBUF_INPUT=1, + IOBUF_OUTPUT=2, + IOBUF_TEMP=3 + }; + typedef struct iobuf_struct *iobuf_t; typedef struct iobuf_struct *IOBUF; /* Compatibility with gpg 1.4. */ @@ -62,7 +69,9 @@ typedef struct iobuf_struct *IOBUF; /* Compatibility with gpg 1.4. */ /* fixme: we should hide most of this stuff */ struct iobuf_struct { - int use; /* 1 input , 2 output, 3 temp */ + /* The type of filter. Either IOBUF_INPUT, IOBUF_OUTPUT or + IOBUF_TEMP. */ + int use; off_t nlimit; off_t nbytes; /* Used together with nlimit. */ off_t ntotal; /* Total bytes read (position of stream). */ @@ -184,6 +193,8 @@ void iobuf_skip_rest (iobuf_t a, unsigned long n, int partial); #define iobuf_get_temp_buffer(a) ( (a)->d.buf ) #define iobuf_get_temp_length(a) ( (a)->d.len ) -#define iobuf_is_temp(a) ( (a)->use == 3 ) + +/* Whether the filter uses an in-memory buffer. */ +#define iobuf_is_temp(a) ( (a)->use == IOBUF_TEMP ) #endif /*GNUPG_COMMON_IOBUF_H*/ |