--- trunk/src/GPGOE.h 2006/04/13 07:41:30 18 +++ trunk/src/GPGOE.h 2007/08/18 10:55:14 23 @@ -1,5 +1,5 @@ /* GPGOE.h - GnuPG for Outlook Express - * Copyright (C) 2001, 2002, 2003, 2006 Timo Schulz + * Copyright (C) 2001, 2002, 2003, 2006, 2007 Timo Schulz * * This file is part of GPGOE. * @@ -12,20 +12,25 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with GPGOE; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ #ifndef GPGOE_H #define GPGOE_H +/* Macros to support a separate section for variables. */ +#ifdef __GNUC__ +#define ATTR_SEC __attribute__((section (".SHARDAT"), shared)) +#else +#define ATTR_SEC +#endif + +/* How many items we can store in the dictionary */ +#define HASH_BUCKETS 3 + /* gettext support. */ const char *gettext (const char *msgid); #define _(X) gettext ((X)) - #include /* safe wrapper around free. */ #define free_if_alloc(ptr) \ @@ -45,6 +50,10 @@ #define wipememory(_ptr,_len) wipememory2 (_ptr,0,_len) +#ifndef DIM +#define DIM(v) (sizeof (v) / sizeof ((v)[0])) +#endif + /* Dialog IDs for the various operations. */ #define ID_OE_SELECTALL 40125 #define ID_OE_COPY 40484 @@ -58,11 +67,18 @@ #define ID_OF_SAVE_FILE 1148 +/* Supported plug-in modes. */ +enum gpgoe_mode_t { + GPGOE_MODE_NORMAL = 0, + GPGOE_MODE_PLAINREPLY = 1, /* decrypt mails before a reply. */ + GPGOE_MODE_CACHEPASS = 2, /* cache passphrase. */ +}; + /* Context for the recipient list. */ struct recip_list_s { struct recip_list_s *next; - gpgme_key_t key; - char *addr; + gpgme_key_t key; /* The actual key to use */ + char *addr; /* The email address. */ }; typedef struct recip_list_s *recip_list_t; @@ -90,10 +106,18 @@ }; typedef struct viewer_ctx_s *viewer_ctx_t; +/* Signature verify context. */ +struct verify_ctx_s { + gpgme_signature_t sig; + gpgme_data_t text; +}; +typedef struct verify_ctx_s *verify_ctx_t; /*-- GPGOE.c --*/ -/*EXPORT*/ int gpgoe_initialize (void); -/*EXPORT*/ int gpgoe_remove (void); +int gpgoe_initialize (void); +int gpgoe_remove (void); +void gpgoe_set_active_modes (int mode); +int gpgoe_get_active_modes (void); /*-- OEProc.c --*/ extern plugin_ctx_t oe_plug; @@ -152,7 +176,7 @@ void free_pass_cb (pass_cb_t cb); pass_cb_t new_pass_cb (HWND main); int pass_cb_cancelled (pass_cb_t cb); -void free_pass_cache (void); +void reset_pass_cache (void); /*-- OENLS.c --*/ int setup_gettext (void);