diff options
Diffstat (limited to '')
| -rw-r--r-- | gpgme/gpgme.h | 76 | 
1 files changed, 75 insertions, 1 deletions
diff --git a/gpgme/gpgme.h b/gpgme/gpgme.h index eaabd4e3..f5ede58b 100644 --- a/gpgme/gpgme.h +++ b/gpgme/gpgme.h @@ -28,9 +28,81 @@ extern "C" {  #endif  struct gpgme_context_s; -typedef struct gpgme_context_s *GPGME; +typedef struct gpgme_context_s *GpgmeCtx; +struct gpgme_data_s; +typedef struct gpgme_data_s *GpgmeData; +struct gpgme_recipient_set_s; +typedef struct gpgme_recipient_set_s *GpgmeRecipientSet; + + +typedef enum { +    GPGME_No_Error = 0, +    GPGME_General_Error = 1, +    GPGME_Out_Of_Core = 2, +    GPGME_Invalid_Value = 3, +    GPGME_Busy = 4, +    GPGME_No_Request = 5, +    GPGME_Exec_Error = 6, +    GPGME_Too_Many_Procs = 7, +    GPGME_Pipe_Error = 8, +    GPGME_No_Recipients = 9, +    GPGME_No_Data = 10, +    GPGME_Conflict = 11, +    GPGME_Not_Implemented = 12, +    GPGME_Read_Error = 13, +    GPGME_Write_Error = 14, +    GPGME_Invalid_Type = 15, +    GPGME_Invalid_Mode = 16, +} GpgmeError; + +typedef enum { +    GPGME_DATA_TYPE_NONE = 0, +    GPGME_DATA_TYPE_MEM  = 1, +    GPGME_DATA_TYPE_FD   = 2, +    GPGME_DATA_TYPE_FILE = 3 +} GpgmeDataType; + + +/* Context management */ +GpgmeError gpgme_new_context (GpgmeCtx *r_ctx); +void       gpgme_release_context ( GpgmeCtx c ); +GpgmeCtx   gpgme_wait ( GpgmeCtx c, int hang ); + +/* Functions to handle recipients */ +GpgmeError   gpgme_new_recipient_set (GpgmeRecipientSet *r_rset); +void         gpgme_release_recipient_set ( GpgmeRecipientSet rset); +GpgmeError   gpgme_add_recipient (GpgmeRecipientSet rset, const char *name); +unsigned int gpgme_count_recipients ( const GpgmeRecipientSet rset ); + +/* Functions to handle data sources */ +GpgmeError gpgme_new_data ( GpgmeData *r_dh, +                                const char *buffer, size_t size, int copy ); +void gpgme_release_data ( GpgmeData dh ); +GpgmeDataType gpgme_query_data_type ( GpgmeData dh ); + + +/* Basic GnuPG functions */ +GpgmeError gpgme_req_encrypt ( GpgmeCtx c, GpgmeRecipientSet recp, +                               GpgmeData in, GpgmeData out ); +GpgmeError gpgme_wait_encrypt ( GpgmeCtx c, GpgmeData *r_out ); + + +/* Key management functions */ + + + + + + +/* Convenience functions for syncronous usage */ +GpgmeError gpgme_encrypt ( GpgmeCtx c, GpgmeRecipientSet recp, +                           GpgmeData in, GpgmeData out ); + + +/* miscellaneous functions */ +const char *gpgme_strerror (GpgmeError err);  #ifdef __cplusplus @@ -42,3 +114,5 @@ typedef struct gpgme_context_s *GPGME; + +  | 
