/[winpt]/trunk/w32gpgme/w32gpgme.h
ViewVC logotype

Annotation of /trunk/w32gpgme/w32gpgme.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 25 - (hide annotations)
Wed Oct 12 10:04:26 2005 UTC (19 years, 4 months ago) by twoaday
File MIME type: text/plain
File size: 4595 byte(s)
First testing phase finished.
Provide bug fixes for a lot of (minor) problems.

1 twoaday 23 /* w32gpgme.h - W32 specific utility code for GPGME.
2     * Copyright (C) 2005 Timo Schulz
3     *
4     * This file is part of WinPT.
5     *
6     * WinPT is free software; you can redistribute it and/or modify
7     * it under the terms of the GNU General Public License as published by
8     * the Free Software Foundation; either version 2 of the License, or
9     * (at your option) any later version.
10     *
11     * WinPT is distributed in the hope that it will be useful,
12     * but WITHOUT ANY WARRANTY; without even the implied warranty of
13     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14     * GNU General Public License for more details.
15     *
16     * You should have received a copy of the GNU General Public License
17     * along with WinPT; if not, write to the Free Software Foundation,
18     * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
19     */
20    
21     #ifndef W32_GPGME_H
22     #define W32_GPGME_H
23    
24 twoaday 24 #ifdef __cplusplus
25     extern "C" {
26     #endif
27    
28 twoaday 23 #include "c:/oss/w32root/include/gpgme.h"
29    
30    
31    
32     struct keycache_s {
33     struct keycache_s * next;
34     int flags;
35     gpgme_key_t key;
36     struct keycache_s *pubpart;
37     struct {
38     unsigned int is_protected:1;
39     unsigned int divert_to_card:1;
40     unsigned int has_desig_rev:1;
41     } gloflags;
42     struct {
43     unsigned int used:1;
44     unsigned char *d;
45     unsigned int len;
46     } attrib;
47     unsigned char *sym_prefs;
48     };
49    
50     struct gpgme_keycache_s {
51     struct keycache_s *item;
52     struct keycache_s *tmp;
53     int secret;
54     int pos;
55     void (*cb) (void *, const char *, int, int, int);
56     void *cb_value;
57     int cb_value2;
58     };
59     typedef struct gpgme_keycache_s *gpgme_keycache_t;
60 twoaday 25 typedef struct gpgme_keycache_s *gpg_keycache_t;
61 twoaday 23
62     typedef enum {
63     PGP_MESSAGE = 1,
64     PGP_CLEARSIG = 2,
65     PGP_SIG = 4,
66     PGP_PUBKEY = 8,
67     PGP_SECKEY = 16,
68     PGP_DASH_ESCAPED = 32 /* actually not a type, just a flag */
69 twoaday 25 } gpg_pgptype_t;
70 twoaday 23
71    
72     gpgme_error_t gpg_data_new_from_clipboard (gpgme_data_t *r_dh, int wraplen);
73     void gpg_data_release_and_set_clipboard (gpgme_data_t dh, int chg_ver);
74     size_t gpg_data_readline (gpgme_data_t dh, char *line, size_t nbytes);
75    
76     gpgme_error_t gpg_data_release_and_set_file (gpgme_data_t dh, const char *fname);
77     gpgme_error_t gpg_data_mail_quote (gpgme_data_t *r_dh);
78     gpgme_error_t gpg_data_extract_plaintext (gpgme_data_t sig, gpgme_data_t *r_plain);
79    
80     /* Key caching */
81 twoaday 25 gpgme_error_t gpg_keycache_new (gpgme_keycache_t * r_ctx);
82     void gpg_keycache_release (gpgme_keycache_t ctx);
83     void gpg_keycache_set_cb (gpgme_keycache_t ctx,
84 twoaday 23 void (*cb)(void *, const char *, int, int, int),
85     void * cb_value1, int cb_value2);
86 twoaday 25 void gpg_keycache_rewind (gpgme_keycache_t ctx);
87     int gpg_keycache_get_size (gpgme_keycache_t ctx);
88     gpgme_error_t gpg_keycache_add_key (gpgme_keycache_t ctx, gpgme_key_t key,
89 twoaday 23 void **opaque);
90 twoaday 25 gpgme_error_t gpg_keycache_update_key (gpgme_keycache_t ctx, int is_sec,
91 twoaday 23 void *opaque, const char *keyid);
92 twoaday 25 gpgme_error_t gpg_keycache_find_key (gpgme_keycache_t ctx, const char * pattern,
93 twoaday 23 int flags, gpgme_key_t * r_key);
94 twoaday 25 gpgme_error_t gpg_keycache_find_key2 (gpgme_keycache_t ctx, const char *pattern, int flags,
95 twoaday 23 gpgme_key_t *r_key, struct keycache_s **r_item);
96 twoaday 25 gpgme_error_t gpg_keycache_delete_key (gpgme_keycache_t ctx,
97 twoaday 23 const char * pattern);
98 twoaday 25 gpgme_error_t gpg_keycache_init (gpgme_keycache_t ctx, const char * pattern,
99 twoaday 23 int secret);
100 twoaday 25 gpgme_error_t gpg_keycache_next_key (gpgme_keycache_t ctx, int flags,
101 twoaday 23 gpgme_key_t * r_key);
102 twoaday 25 gpgme_error_t gpg_keycache_prepare (gpgme_keycache_t ctx,
103 twoaday 23 const char *pubring, const char * secring);
104 twoaday 25 gpgme_error_t gpg_keycache_prepare_single (gpgme_keycache_t ctx,
105 twoaday 23 const char *keyid,
106     const char *pubr,
107     const char *secr);
108 twoaday 25 gpgme_error_t gpg_keycache_sync (gpgme_keycache_t pub, gpgme_keycache_t sec);
109 twoaday 23
110     /* XXX */
111     gpgme_error_t
112 twoaday 25 _gpg_keycache_find_key2 (gpgme_keycache_t ctx, const char *pattern, int flags,
113 twoaday 23 gpgme_key_t *r_key, struct keycache_s **r_item);
114    
115     /* Clipboard interface */
116 twoaday 25 gpgme_error_t gpg_clip_istext_avail (int *r_rc);
117     gpgme_error_t gpg_clip_is_secured (gpg_pgptype_t *r_type, int *r_rc);
118     gpgme_error_t gpg_clip_get_pgptype (gpg_pgptype_t *r_type);
119     gpgme_error_t gpg_clip_parse_pgpid (const char *data, gpg_pgptype_t *r_type);
120     gpgme_error_t gpg_clip_do_check (int *r_rc);
121 twoaday 23
122 twoaday 24 #ifdef __cplusplus
123     }
124     #endif
125    
126 twoaday 23 /* helpers */
127     char* strsep (char **stringp, const char *delim);
128     const char *stristr (const char *buf, const char *sub);
129    
130     #endif /*W32_GPGME_H*/

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26