summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>1997-12-12 13:03:58 +0100
committerWerner Koch <wk@gnupg.org>1997-12-12 13:03:58 +0100
commit68ea0f43533096d5c46bad4aee6e5d5864307f4a (patch)
treef5d3601897a3bdfbce113d5e1ed8b4336c83744a /include
parentfingerprints and self signatures added (diff)
downloadgnupg2-68ea0f43533096d5c46bad4aee6e5d5864307f4a.tar.xz
gnupg2-68ea0f43533096d5c46bad4aee6e5d5864307f4a.zip
added option file handling
Diffstat (limited to 'include')
-rw-r--r--include/cipher.h2
-rw-r--r--include/errors.h2
-rw-r--r--include/iobuf.h18
-rw-r--r--include/memory.h6
-rw-r--r--include/util.h1
5 files changed, 15 insertions, 14 deletions
diff --git a/include/cipher.h b/include/cipher.h
index f918dcf08..2fab4daa2 100644
--- a/include/cipher.h
+++ b/include/cipher.h
@@ -30,6 +30,7 @@
#include "mpi.h"
#include "../cipher/md5.h"
#include "../cipher/rmd.h"
+#include "../cipher/sha1.h"
#ifdef HAVE_RSA_CIPHER
#include "../cipher/rsa.h"
#endif
@@ -71,6 +72,7 @@ typedef struct {
union {
MD5HANDLE md5;
RMDHANDLE rmd;
+ SHA1HANDLE sha1;
} u;
int datalen;
char data[1];
diff --git a/include/errors.h b/include/errors.h
index cdd4a0549..9679e9153 100644
--- a/include/errors.h
+++ b/include/errors.h
@@ -50,5 +50,7 @@
#define G10ERR_NI_CIPHER 28
#define G10ERR_SIG_CLASS 29
#define G10ERR_BAD_MPI 30
+#define G10ERR_RESOURCE_LIMIT 31
+#define G10ERR_INV_KEYRING 32
#endif /*G10_ERRORS_H*/
diff --git a/include/iobuf.h b/include/iobuf.h
index 789ffde07..f2e6b3f21 100644
--- a/include/iobuf.h
+++ b/include/iobuf.h
@@ -39,18 +39,14 @@ typedef struct iobuf_struct *IOBUF;
struct iobuf_struct {
int usage; /* 1 input , 2 output, 3 temp */
unsigned long nlimit;
- unsigned long nbytes;
+ unsigned long nbytes; /* used together with nlimit */
+ unsigned long ntotal; /* total bytes read (position of stream) */
struct {
size_t size; /* allocated size */
size_t start; /* number of invalid bytes at the begin of the buffer */
size_t len; /* currently filled to this size */
byte *buf;
} d;
- struct {
- size_t size;
- size_t len;
- char *buf;
- } recorder;
int filter_eof;
int (*filter)( void *opaque, int control,
IOBUF chain, byte *buf, size_t *len);
@@ -80,6 +76,9 @@ void iobuf_clear_eof(IOBUF a);
void iobuf_set_limit( IOBUF a, unsigned long nlimit );
+ulong iobuf_tell( IOBUF a );
+int iobuf_seek( IOBUF a, ulong newpos );
+
int iobuf_readbyte(IOBUF a);
int iobuf_writebyte(IOBUF a, unsigned c);
int iobuf_write(IOBUF a, byte *buf, unsigned buflen );
@@ -88,10 +87,6 @@ int iobuf_writestr(IOBUF a, const char *buf );
int iobuf_write_temp( IOBUF a, IOBUF temp );
size_t iobuf_temp_to_buffer( IOBUF a, byte *buffer, size_t buflen );
-void iobuf_start_recorder( IOBUF a );
-void iobuf_push_recorder( IOBUF a, int c );
-char *iobuf_stop_recorder( IOBUF a, size_t *n );
-
u32 iobuf_get_filelength( IOBUF a );
const char *iobuf_get_fname( IOBUF a );
@@ -104,8 +99,7 @@ int iobuf_in_block_mode( IOBUF a );
* returned value to be in the range 0 ..255.
*/
#define iobuf_get(a) \
- ( ((a)->recorder.buf || (a)->nlimit \
- || (a)->d.start >= (a)->d.len )? \
+ ( ((a)->nlimit || (a)->d.start >= (a)->d.len )? \
iobuf_readbyte((a)) : ( (a)->nbytes++, (a)->d.buf[(a)->d.start++] ) )
#define iobuf_get_noeof(a) (iobuf_get((a))&0xff)
diff --git a/include/memory.h b/include/memory.h
index 32eb3906b..6a9ed84df 100644
--- a/include/memory.h
+++ b/include/memory.h
@@ -34,6 +34,7 @@
#define m_free(n) m_debug_free((n), M_DBGINFO(__LINE__) )
#define m_check(n) m_debug_check((n), M_DBGINFO(__LINE__) )
#define m_copy(a) m_debug_copy((a), M_DBGINFO(__LINE__) )
+#define m_strdup(a) m_debug_strdup((a), M_DBGINFO(__LINE__) )
void *m_debug_alloc( size_t n, const char *info );
void *m_debug_alloc_clear( size_t n, const char *info );
@@ -43,6 +44,7 @@ void *m_debug_realloc( void *a, size_t n, const char *info );
void m_debug_free( void *p, const char *info );
void m_debug_check( const void *a, const char *info );
void *m_debug_copy( const void *a, const char *info );
+char *m_debug_strdup( const char *a, const char *info );
#else
void *m_alloc( size_t n );
@@ -52,10 +54,10 @@ void *m_alloc_secure_clear( size_t n );
void *m_realloc( void *a, size_t n );
void m_free( void *p );
void m_check( const void *a );
-void *m_copy( void *a );
+void *m_copy( const void *a );
+char *m_strdup( const char * a);
#endif
-
size_t m_size( const void *a );
int m_is_secure( const void *p );
diff --git a/include/util.h b/include/util.h
index 0b6d4e9bc..23514ad1f 100644
--- a/include/util.h
+++ b/include/util.h
@@ -79,6 +79,7 @@ const char *strusage( int level );
/*-- fileutil.c --*/
+char *make_filename( const char *first_part, ... );
/*-- miscutil.c --*/
u32 make_timestamp(void);