/[gpgoe]/trunk/src/GPGOE.h
ViewVC logotype

Diff of /trunk/src/GPGOE.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 12 by twoaday, Fri Apr 7 10:46:41 2006 UTC revision 24 by twoaday, Tue Dec 13 10:40:30 2011 UTC
# Line 1  Line 1 
1  /* GPGOE.h - GnuPG for Outlook Express  /* GPGOE.h - GnuPG for Outlook Express
2   *      Copyright (C) 2001, 2002, 2003, 2006 Timo Schulz   *      Copyright (C) 2001, 2002, 2003, 2006, 2007 Timo Schulz
3   *   *
4   * This file is part of GPGOE.   * This file is part of GPGOE.
5   *   *
# Line 12  Line 12 
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU General Public License for more details.   * 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  
15   */   */
16    
17  #ifndef GPGOE_H  #ifndef GPGOE_H
18  #define GPGOE_H  #define GPGOE_H
19    
20    /* Macros to support a separate section for variables. */
21    #ifdef __GNUC__
22    #define ATTR_SEC __attribute__((section (".SHARDAT"), shared))
23    #else
24    #define ATTR_SEC
25    #endif
26    
27    /* How many items we can store in the dictionary */
28    #define HASH_BUCKETS 3
29    #define MAX_PASS_LEN 2048
30    
31  /* gettext support. */  /* gettext support. */
32  const char *gettext (const char *msgid);  const char *gettext (const char *msgid);
33  #define _(X) gettext ((X))  #define _(X) gettext ((X))
34    
   
35  #include <malloc.h>  #include <malloc.h>
36  /* wrapper around free. */  /* safe wrapper around free. */
37  #define free_if_alloc(ptr) \  #define free_if_alloc(ptr) \
38  do { \  do { \
39      if (ptr) free (ptr); \      if (ptr) free (ptr); \
# Line 45  do { \ Line 51  do { \
51    
52  #define wipememory(_ptr,_len) wipememory2 (_ptr,0,_len)  #define wipememory(_ptr,_len) wipememory2 (_ptr,0,_len)
53    
54  /* Dialog IDs for clipboard operations. */  #ifndef DIM
55    #define DIM(v) (sizeof (v) / sizeof ((v)[0]))
56    #endif
57    
58    /* Dialog IDs for the various operations. */
59  #define ID_OE_SELECTALL     40125  #define ID_OE_SELECTALL     40125
60  #define ID_OE_COPY          40484  #define ID_OE_COPY          40484
61  #define ID_OE_PASTE         40231  #define ID_OE_PASTE         40231
# Line 58  do { \ Line 68  do { \
68  #define ID_OF_SAVE_FILE      1148  #define ID_OF_SAVE_FILE      1148
69    
70    
71    /* Supported plug-in modes. */
72    enum gpgoe_mode_t {
73        GPGOE_MODE_NORMAL     = 0,
74        GPGOE_MODE_PLAINREPLY = 1,     /* decrypt mails before a reply. */
75        GPGOE_MODE_CACHEPASS  = 2,      /* cache passphrase. */
76    };
77    
78  /* Context for the recipient list. */  /* Context for the recipient list. */
79  struct recip_list_s {  struct recip_list_s {
80      struct recip_list_s *next;      struct recip_list_s *next;
81      gpgme_key_t key;      gpgme_key_t key; /* The actual key to use */
82      char *addr;      char *addr;      /* The email address. */
83  };  };
84  typedef struct recip_list_s *recip_list_t;  typedef struct recip_list_s *recip_list_t;
85    
# Line 85  typedef struct plugin_ctx_s *plugin_ctx_ Line 102  typedef struct plugin_ctx_s *plugin_ctx_
102    
103  /* Viewer context. */  /* Viewer context. */
104  struct viewer_ctx_s {  struct viewer_ctx_s {
105        HWND main_wnd;
106      const char *msg;      const char *msg;
107  };  };
108  typedef struct viewer_ctx_s *viewer_ctx_t;  typedef struct viewer_ctx_s *viewer_ctx_t;
109    
110    /* Signature verify context. */
111    struct verify_ctx_s {
112        gpgme_signature_t sig;
113        gpgme_data_t text;
114    };
115    typedef struct verify_ctx_s *verify_ctx_t;
116    
117  /*-- GPGOE.c --*/  /*-- GPGOE.c --*/
118  /*EXPORT*/ int gpgoe_initialize (void);  int gpgoe_initialize (void);
119  /*EXPORT*/ int gpgoe_remove (void);  int gpgoe_remove (void);
120    void gpgoe_set_active_modes (int mode);
121    int gpgoe_get_active_modes (void);
122    
123  /*-- OEProc.c --*/  /*-- OEProc.c --*/
124    extern plugin_ctx_t oe_plug;
125  extern HINSTANCE mod_hinst_dll;  extern HINSTANCE mod_hinst_dll;
126    extern HANDLE plugin_active;
127    
128    /* support for the mailer window. */
129  extern WNDPROC oe_proc_old;  extern WNDPROC oe_proc_old;
130    LRESULT CALLBACK oe_proc (HWND hwnd, UINT msg,
131                              WPARAM wparam, LPARAM lparam);
132    
133    /* support for the common dialogs. */
134  extern WNDPROC of_proc_old;  extern WNDPROC of_proc_old;
135  extern HANDLE plugin_active;  LRESULT CALLBACK of_proc (HWND hwnd, UINT msg,
136  LRESULT CALLBACK oe_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);                            WPARAM wparam, LPARAM lparam);
137  LRESULT CALLBACK of_proc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);  
138    /* support for the main window. */
139    extern WNDPROC oe_main_proc_old;
140    LRESULT CALLBACK oe_main_proc (HWND hwnd, UINT msg,
141                                   WPARAM wparam, LPARAM lparam);
142    
143    
144  /*-- OECrypto.c --*/  /*-- OECrypto.c --*/
145  gpgme_error_t oe_handle_mail (plugin_ctx_t ctx);  gpgme_error_t oe_handle_mail (plugin_ctx_t ctx);
146    gpgme_error_t oe_decrypt_msg (HWND main_wnd, char **r_msg);
147    
148  /*-- OEMisc.c --*/  /*-- OEMisc.c --*/
149    void center_window (HWND hwndChild, HWND parent);
150  char* utf8_to_native (const char *string);  char* utf8_to_native (const char *string);
151  char* native_to_utf8 (const char *string);  char* native_to_utf8 (const char *string);
152  char* get_clip_text (HWND hwnd);  char* get_clip_text (HWND hwnd);
# Line 115  void show_error (HWND hwnd, const char * Line 156  void show_error (HWND hwnd, const char *
156  void* xcalloc (size_t n, size_t m);  void* xcalloc (size_t n, size_t m);
157  char* xstrdup (const char *s);  char* xstrdup (const char *s);
158  void xfree (void *p);  void xfree (void *p);
159    void quote_msg_text (const char *inp, char **r_outp);
160    
161  /*-- dialogs --*/  /*-- dialogs --*/
162  BOOL CALLBACK encrypt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam,  BOOL CALLBACK encrypt_dlg_proc (HWND dlg, UINT msg, WPARAM wparam,
# Line 134  gpgme_error_t passphrase_cb (void *hook, Line 176  gpgme_error_t passphrase_cb (void *hook,
176                               int prev_was_bad, int fd);                               int prev_was_bad, int fd);
177  void free_pass_cb (pass_cb_t cb);  void free_pass_cb (pass_cb_t cb);
178  pass_cb_t new_pass_cb (HWND main);  pass_cb_t new_pass_cb (HWND main);
179    int pass_cb_cancelled (pass_cb_t cb);
180    void reset_pass_cache (void);
181    
182  /*-- OENLS.c --*/  /*-- OENLS.c --*/
183  int setup_gettext (void);  int setup_gettext (void);

Legend:
Removed from v.12  
changed lines
  Added in v.24

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26