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

Annotation of /trunk/w32gpgme/w32gpgme.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 36 - (hide annotations)
Thu Oct 27 15:25:13 2005 UTC (19 years, 4 months ago) by werner
File MIME type: text/plain
File size: 4821 byte(s)
First set of changes to use autotools for building.
1 werner 36 /* 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     #ifdef __cplusplus
25     extern "C" {
26     #endif
27    
28     #ifdef WINPT_MODERN_BUILD
29     #include <gpgme.h>
30     #else
31     #include "c:/oss/w32root/include/gpgme.h"
32     #endif
33    
34     struct keycache_s {
35     struct keycache_s * next;
36     int flags;
37     gpgme_key_t key; /* actual key context. */
38     struct keycache_s *pubpart; /* corresponding public key. */
39     struct {
40     unsigned int is_protected:1; /* key is protected. */
41     unsigned int divert_to_card:1; /* secret key on card. */
42     unsigned int has_desig_rev:1; /* has desig. revokers. */
43     } gloflags;
44     struct {
45     unsigned int used:1;
46     unsigned char *d; /* attribute (JPG) data. */
47     unsigned int len; /* attribute data length. */
48     } attrib;
49     unsigned char *sym_prefs;/* symmetric cipher preferences. */
50     char *card_type; /* if != NULL key stored on smart card. */
51     };
52    
53     struct gpgme_keycache_s {
54     struct keycache_s *item;
55     struct keycache_s *tmp;
56     int secret;
57     int pos;
58     void (*cb) (void *, const char *, int, int, int);
59     void *cb_value;
60     int cb_value2;
61     };
62     typedef struct gpgme_keycache_s *gpgme_keycache_t;
63     typedef struct gpgme_keycache_s *gpg_keycache_t;
64    
65     typedef enum {
66     PGP_MESSAGE = 1,
67     PGP_CLEARSIG = 2,
68     PGP_SIG = 4,
69     PGP_PUBKEY = 8,
70     PGP_SECKEY = 16,
71     PGP_DASH_ESCAPED = 32 /* actually not a type, just a flag */
72     } gpg_pgptype_t;
73    
74    
75     gpgme_error_t gpg_data_new_from_clipboard (gpgme_data_t *r_dh, int wraplen);
76     void gpg_data_release_and_set_clipboard (gpgme_data_t dh, int chg_ver);
77     size_t gpg_data_readline (gpgme_data_t dh, char *line, size_t nbytes);
78    
79     gpgme_error_t gpg_data_release_and_set_file (gpgme_data_t dh, const char *fname);
80     gpgme_error_t gpg_data_mail_quote (gpgme_data_t *r_dh);
81     gpgme_error_t gpg_data_extract_plaintext (gpgme_data_t sig, gpgme_data_t *r_plain);
82    
83     /* Key caching */
84     gpgme_error_t gpg_keycache_new (gpgme_keycache_t * r_ctx);
85     void gpg_keycache_release (gpgme_keycache_t ctx);
86     void gpg_keycache_set_cb (gpgme_keycache_t ctx,
87     void (*cb)(void *, const char *, int, int, int),
88     void * cb_value1, int cb_value2);
89     void gpg_keycache_rewind (gpgme_keycache_t ctx);
90     int gpg_keycache_get_size (gpgme_keycache_t ctx);
91     gpgme_error_t gpg_keycache_add_key (gpgme_keycache_t ctx, gpgme_key_t key,
92     void **opaque);
93     gpgme_error_t gpg_keycache_update_key (gpgme_keycache_t ctx, int is_sec,
94     void *opaque, const char *keyid);
95     gpgme_error_t gpg_keycache_find_key (gpgme_keycache_t ctx, const char * pattern,
96     int flags, gpgme_key_t * r_key);
97     gpgme_error_t gpg_keycache_find_key2 (gpgme_keycache_t ctx, const char *pattern, int flags,
98     gpgme_key_t *r_key, struct keycache_s **r_item);
99     gpgme_error_t gpg_keycache_delete_key (gpgme_keycache_t ctx,
100     const char * pattern);
101     gpgme_error_t gpg_keycache_init (gpgme_keycache_t ctx, const char * pattern,
102     int secret);
103     gpgme_error_t gpg_keycache_next_key (gpgme_keycache_t ctx, int flags,
104     gpgme_key_t * r_key);
105     gpgme_error_t gpg_keycache_prepare (gpgme_keycache_t ctx,
106     const char *pubring, const char * secring);
107     gpgme_error_t gpg_keycache_prepare_single (gpgme_keycache_t ctx,
108     const char *keyid,
109     const char *pubr,
110     const char *secr);
111     gpgme_error_t gpg_keycache_sync (gpgme_keycache_t pub, gpgme_keycache_t sec);
112    
113     /* XXX */
114     gpgme_error_t
115     _gpg_keycache_find_key2 (gpgme_keycache_t ctx, const char *pattern, int flags,
116     gpgme_key_t *r_key, struct keycache_s **r_item);
117    
118     /* Clipboard interface */
119     gpgme_error_t gpg_clip_istext_avail (int *r_rc);
120     gpgme_error_t gpg_clip_is_secured (gpg_pgptype_t *r_type, int *r_rc);
121     gpgme_error_t gpg_clip_get_pgptype (gpg_pgptype_t *r_type);
122     gpgme_error_t gpg_clip_parse_pgpid (const char *data, gpg_pgptype_t *r_type);
123     gpgme_error_t gpg_clip_do_check (int *r_rc);
124    
125     #ifdef __cplusplus
126     }
127     #endif
128    
129     /* helpers */
130     char* strsep (char **stringp, const char *delim);
131     const char *stristr (const char *buf, const char *sub);
132    
133     #endif /*W32_GPGME_H*/

Properties

Name Value
svn:eol-style native

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26