diff options
| author | Sam Varshavchik | 2013-08-19 16:39:41 -0400 | 
|---|---|---|
| committer | Sam Varshavchik | 2013-08-25 14:43:51 -0400 | 
| commit | 9c45d9ad13fdf439d44d7443ae75da15ea0223ed (patch) | |
| tree | 7a81a04cb51efb078ee350859a64be2ebc6b8813 /gpglib/mimegpgfork.h | |
| parent | a9520698b770168d1f33d6301463bb70a19655ec (diff) | |
| download | courier-libs-9c45d9ad13fdf439d44d7443ae75da15ea0223ed.tar.bz2 | |
Initial checkin
Imported from subversion report, converted to git. Updated all paths in
scripts and makefiles, reflecting the new directory hierarchy.
Diffstat (limited to 'gpglib/mimegpgfork.h')
| -rw-r--r-- | gpglib/mimegpgfork.h | 84 | 
1 files changed, 84 insertions, 0 deletions
| diff --git a/gpglib/mimegpgfork.h b/gpglib/mimegpgfork.h new file mode 100644 index 0000000..cebee60 --- /dev/null +++ b/gpglib/mimegpgfork.h @@ -0,0 +1,84 @@ +#ifndef mimegpgfork_h +#define mimegpgfork_h + +/* +** Copyright 2001 Double Precision, Inc.  See COPYING for +** distribution information. +*/ + + +#include "config.h" +#include <stdio.h> +#include <signal.h> +#include <sys/types.h> + +#ifdef  __cplusplus +extern "C" { +#endif + +struct gpgmime_forkinfo { +	int togpg_fd; +	int fromgpg_fd; +	int fromgpg_errfd; + +	char gpg_writebuf[BUFSIZ]; +	char gpg_errbuf[1024]; + +	unsigned gpg_writecnt; +	unsigned gpg_errcnt; + +	int gpg_errflag; +	pid_t gpg_pid; + +	struct sigaction old_pipe_sig; + +	int (*gpg_readhandler)(const char *, size_t, void *); +	void *gpg_voidarg; +} ; + +int libmail_gpgmime_forksignencrypt(const char *,	/* gpgdir */ +				    const char *,	/* passphrase fd */ +				    int,	/* Flags: */ + +#define GPG_SE_SIGN	1 +#define	GPG_SE_ENCRYPT	2 + +				    int, char **,	/* argc/argv */ + +				    int (*)(const char *, size_t, void *), +				    /* Encrypted output */ +				    void *, /* 3rd arg to encrypted output */ + +				    struct gpgmime_forkinfo * +				    /* Allocated struct */ +				    ); + +int libmail_gpgmime_forkchecksign(const char *,	/* gpgdir */ +				  const char *,	/* passphrase fd */ +				  const char *,	/* content filename */ +				  const char *,	/* signature filename */ +				  int, char **,	/* argc/argv */ +				  struct gpgmime_forkinfo *); +	/* Allocated struct */ + +int libmail_gpgmime_forkdecrypt(const char *,	/* gpgdir */ +				const char *,	/* passphrase fd */ +				int, char **,	/* argc/argv */ +				int (*)(const char *, size_t, void *), +				/* Output callback function */ +				void *,	/* 3rd arg to callback function */ + +				struct gpgmime_forkinfo *); +	/* Allocated struct */ + +void libmail_gpgmime_write(struct gpgmime_forkinfo *, const char *, size_t); +int libmail_gpgmime_finish(struct gpgmime_forkinfo *); + +const char *libmail_gpgmime_getoutput(struct gpgmime_forkinfo *); +const char *libmail_gpgmime_getcharset(struct gpgmime_forkinfo *); + +#ifdef  __cplusplus +} ; +#endif + +#endif | 
