e4993873130b0e8f2d40466dc091dce9fb411464
[gpgme.git] / src / ChangeLog
1 2010-05-06  Marcus Brinkmann  <marcus@g10code.de>
2
3         * w32-glib-io.c, w32-io.c, w32-qt-io.cpp, w32-sema.c, w32-util.c:
4         Do not include <signal.h>.
5
6         * sign.c, data-user.c, conversion.c, debug.c, verify.c, data.c,
7         decrypt.c, delete.c, assuan-support.c, import.c, engine-gpgsm.c,
8         data-mem.c, op-support.c, w32-io.c, w32-util.c, data-compat.c: Use
9         gpg_error_from_syserror instead gpg_error_from_errno, and use
10         gpg_err_set_errno to set error number.
11         * setenv.c: Include <gpg-error.h> and define __set_errno to use
12         gpg_err_set_errno.
13         * gpgme-tool.c (ARGP_ERR_UNKNOWN): Define to EDEADLOCK (which is
14         mapped in Windows CE) instead of E2BIG (which is not).
15         (gt_import_keys): Initialize err.
16
17 2010-04-19  Marcus Brinkmann  <marcus@g10code.de>
18
19         * assuan-support.c (my_spawn): Cast to avoid warning.
20         * engine-g13.c (g13_new): Make ARGV array of pointer to const
21         char.
22         (g13_assuan_simple_command) [!USE_DESCRIPTOR_FUNCTION]: Don't define.
23         * ops.h (_gpgme_key_append_name): Same in prototype.
24         * key.c (_gpgme_key_append_name): Make SRC argument pointer to
25         const char.
26         * posix-util.c (_gpgme_get_uiserver_socket_path): Make HOMEDIR
27         const.
28         * vfs-mount.c (gpgme_op_vfs_transact_start): Never define this
29         potentially useful but currently unused function.
30         * vfs-create.c (gpgme_op_vfs_transact_start): Likewise.
31
32 2010-04-16  Werner Koch  <wk@g10code.com>
33
34         * w32-io.c (is_socket): New.
35         (reader, writer): Use it to figure out the API to use.
36
37 2010-03-15  Werner Koch  <wk@g10code.com>
38
39         * gpgme.h.in: Add autoconf template to set generated file to
40         read-only in an emacs buffer.
41
42 2010-03-12  Werner Koch  <wk@g10code.com>
43
44         * gpgme.h.in (GPGME_STATUS_SUCCESS): Use the right file for the
45         change; see below.
46
47         * passwd.c (op_data_t): New.
48         (passwd_start): Setup OPD.
49         (passwd_status_handler): Return GPG_ERR_NOT_SUPPORTED if needed.
50         * context.h (OPDATA_PASSWD): New.
51         * gpgme.h (GPGME_STATUS_SUCCESS): New.
52
53 2010-03-09  Werner Koch  <wk@g10code.com>
54
55         * engine-gpgsm.c (gpgsm_keylist): Try to start the agent.
56
57 2010-02-17  Werner Koch  <wk@g10code.com>
58
59         * posix-io.c (notify_table): Change implementation.
60         (notify_table_item_t, notify_table_size, notify_table_lock): New.
61         (_gpgme_io_close, _gpgme_io_set_close_notify): Adjust for new
62         implementation.
63
64 2010-02-16  Werner Koch  <wk@g10code.com>
65
66         * gpgme-tool.c (spacep, has_option, skip_options): New.
67         (cmd_export): Implement option --minimal.
68
69         * gpgme.h.in (GPGME_EXPORT_MODE_MINIMAL): New.
70         * export.c (export_start, export_ext_start): Implement it.
71         * engine-gpg.c (export_common): Ditto.
72
73 2010-01-25  Werner Koch  <wk@g10code.com>
74
75         * w32-io.c (_gpgme_io_connect): Fix return code check to make it work.
76
77         * version.c (do_subsystem_inits): Remove superfluous second
78         WSAStartup.
79
80 2010-01-22  Werner Koch  <wk@g10code.com>
81
82         * w32-io.c (writer): Try to use send first.
83         (reader): Try to use recv first.
84
85 2010-01-08  Werner Koch  <wk@g10code.com>
86
87         * engine-gpg.c (gpg_passwd): New.
88         (_gpgme_engine_ops_gpg): Register.
89         * passwd.c (parse_error): New.
90         (passwd_status_handler): Use it.
91
92 2010-01-07  Marcus Brinkmann  <marcus@g10code.de>
93
94         * gpgme-tool.c (result_xml_write_cb_t, struct result_xml_state):
95         New types.
96         (MAX_TAGS): New macro.
97         (result_init, result_xml_indent, result_xml_tag_start)
98         (result_xml_tag_data, result_xml_tag_end, result_add_error)
99         (result_add_pubkey_algo, result_add_hash_algo, result_add_keyid)
100         (result_add_fpr, result_add_timestamp, result_add_sig_mode)
101         (result_add_value, result_add_string, result_encrypt_to_xml)
102         (result_decrypt_to_xml, result_sign_to_xml)
103         (result_verify_to_xml, result_import_to_xml)
104         (result_genkey_to_xml, result_keylist_to_xml)
105         (result_vfs_mount_to_xml): New functions.
106         (gt_result): Rewritten.
107
108 2010-01-05  Werner Koch  <wk@g10code.com>
109
110         * gpgme-tool.c (gt_passwd, cmd_passwd): New.
111         (register_commands): Register.
112
113         * gpgme.h.in (gpgme_op_passwd_start, gpgme_op_passwd): New.
114         * libgpgme.vers, gpgme.def: Add new functions.
115         * passwd.c: New.
116         * Makefile.am (main_sources): Add passwd.c
117         * engine.c, engine.h (_gpgme_engine_op_passwd): New.
118         * engine-backend.h (struct engine_ops): Add PASSWD.
119         * engine-gpgsm.c (gpgsm_passwd): New.
120         (_gpgme_engine_ops_gpgsm): Register.
121         (gpgsm_reset): Reset only if we have a conenction.
122
123         * gpgme.h.in (GPGME_PK_ECDSA, GPGME_PK_ECDH): New.
124         * gpgme.c (gpgme_pubkey_algo_name): Add them.
125
126 2009-12-22  Marcus Brinkmann  <marcus@g10code.de>
127
128         * debug.c: Test for TLS, not __GNUC__
129
130 2009-12-15  Marcus Brinkmann  <marcus@g10code.de>
131
132         * assuan-support.c (my_spawn): Calloc, not malloc, the fd_items.
133
134 2009-12-10  Werner Koch  <wk@g10code.com>
135
136         * debug.c (debug_init): Test on sgid process.
137
138 2009-12-08  Marcus Brinkmann  <marcus@g10code.de>
139
140         * Makefile.am (LTRCCOMPILE): Refactor with ...
141         (RCCOMPILE): ... this new macro.
142         (SUFFIXES): Add .lo.
143         (gpgme_res_ldflag): Removed.
144         (gpgme_res): Use libtool object file name here.
145         (libgpgme_la_LDFLAGS): Remove gpgme_res_ldflag usage.
146         (libgpgme_la_LIBADD): Add gpgme_res.
147
148         * ath.c (ath_self) [HAVE_W32_SYSTEM]: Fix typo.
149
150 2009-12-02  Werner Koch  <wk@g10code.com>
151
152         * gpgconf.c (gpgme_conf_arg_release): No return in a function
153         returning void.  Reported by Wyllys Ingersoll.
154
155 2009-12-01  Werner Koch  <wk@g10code.com>
156
157         * gpgme-tool.c (cmd_getauditlog): Add flag --html.
158         (hlp_getauditlog): New.
159
160         * gpgme-tool.c (GT_GCC_A_SENTINEL, GT_GCC_A_PRINTF): New.
161         (gt_write_status): Use sentinel.
162         (argp_error, log_error): Use printf attribute.
163         (argp_parse): Remove extra argument to argp_error.
164         (_gt_progress_cb, gt_get_engine_info, gt_get_keylist_mode)
165         (gt_result): Add NULL arg.
166
167 2009-11-26  Marcus Brinkmann  <marcus@g10code.de>
168
169         * opassuan.c (opassuan_start): Allocate result structure before
170         beginning operation.
171
172 2009-11-25  Marcus Brinkmann  <marcus@g10code.de>
173
174         * gpgme-tool.c (gpgme_server): Use assuan_fd_t and assuan_fdopen
175         on fds.
176
177 2009-11-13    <wk@g10code.com>
178
179         * sign.c (_gpgme_sign_status_handler): Handle SIG_CREATED_SEEN.
180         * engine-uiserver.c (uiserver_sign): Make sending SENDER optional.
181
182 2009-11-10  Marcus Brinkmann  <marcus@g10code.de>
183
184         * op-support.c (_gpgme_op_reset): Instead of last change, only set
185         sub protocol if it is not the default.
186
187 2009-11-10  Werner Koch  <wk@g10code.com>
188
189         * op-support.c (_gpgme_op_reset): Ignore GPG_ERR_NOT_IMPLEMENTED
190         while setting the sub protocol.
191
192         * engine-uiserver.c (uiserver_new): Pass fdpassing flag to
193         assuan_socket_connect.
194         (set_recipients): Replace fingerprint by user id.
195
196         * engine-gpgsm.c (set_recipients): Fix non-terminating loop in
197         case of a missing key.
198
199 2009-11-10  Marcus Brinkmann  <marcus@g10code.de>
200
201         * gpgme.c (gpgme_new): Set default sub protocol.
202         * gpgme-tool.c: Implement get sub protocol.
203
204         * gpgme.h.in (gpgme_get_sub_protocol): Add prototype.
205         * gpgme.def, libgpgme.vers: Add gpgme_get_sub_protocol.
206         * context.h (struct gpgme_context): New member sub_protocol.
207         * gpgme.c (gpgme_set_sub_protocol): Set CTX->sub_protocol.
208         (gpgme_get_sub_protocol): New function.
209         * op-support.c (_gpgme_op_reset): Set sub protocol.
210
211         * Makefile.am (uiserver_components): New variable.
212         (main_sources): Add it.
213         * ops.h, key.c (_gpgme_key_append_name): Take CONVERT argument,
214         implement it.  Adjust callers.
215         (gpgme_key_from_uid): New function.
216         * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_DEFAULT.
217         (gpgme_encrypt_flags_t): Add GPGME_ENCRYPT_PREPARE,
218         GPGME_ENCRYPT_EXPECT_SIGN.
219         (gpgme_set_sub_protocol, gpgme_key_from_uid): New functions.
220         * libgpgme.vers, gpgme.def: Add new functions.
221         * gpgme.c (gpgme_set_protocol): Add UIServer protocol.
222         (gpgme_set_sub_protocol): New function.
223         (gpgme_get_protocol_name): Add UIServer and default protocol.
224         * assuan-support.c: Return correct error values, implement
225         socketpair for POSIX.
226         * priv-io.h, posix-io.c, w32-io.c, w32-glib-io.c,
227         w32-qt-io.cpp (_gpgme_io_spawn): Add ATFORK and ATFORKVALUE
228         arguments.  Implement it for POSIX.  Adjust all callers.
229         * engine.h, engine-backend.h (_gpgme_engine_set_protocol)
230         (_gpgme_engine_op_decrypt_verify): New prototypes.  Adjust all
231         users.
232         * engine.c (engine_ops, gpgme_get_engine_info): Add UIServer
233         engine.
234         (_gpgme_engine_set_protocol, _gpgme_engine_op_decrypt_verify): New
235         function.
236         * decrypt-verify.c (decrypt_verify_start): Call
237         _gpgme_engine_op_decrypt_verify.
238         * util.h, posix-util.c,
239         w32-util.c (_gpgme_get_uiserver_socket_path): New function.
240         * engine-gpgsm.c (gpgsm_set_fd): Fix _gpgme_io_pipe invocation.
241         * gpgme-tool.c: Some support for UIServer protocol.
242         * engine-uiserver.c: New file.
243
244 2009-11-09  Marcus Brinkmann  <marcus@g10code.de>
245
246         * engine-gpgsm.c (gpgsm_new): Close server side FDs.
247
248 2009-11-06  Marcus Brinkmann  <marcus@g10code.de>
249
250         * gpgme-tool.c (struct gpgme_tool): New members write_data and
251         write_data_hook.
252         (gt_write_data): New function.
253         (gt_result): Output vfs_mount result.
254         (server_write_data): New function.
255         (gpgme_server): Initialize write_data members.
256
257 2009-11-05  Marcus Brinkmann  <marcus@g10code.de>
258
259         * engine-g13.c (struct engine_g13): Remove members RESULT_CB and
260         RESULT_CB_VALUE.
261         (g13_assuan_simple_command, status_handler): Don't use those anymore.
262         (g13_transact): Remove them from argument list, too.
263         * vfs-mount.c (_gpgme_vfs_mount_status_handler): New function.
264         (_gpgme_op_vfs_mount): Pass it to transact.
265
266         * engine-assuan.c (llass_new): Update use of assuan_socket_connect.
267         * engine-gpgsm.c (gpgsm_new): Update use of assuan_pipe_connect.
268         * engine-g13.c (g13_new): Likewise.
269
270         * priv-io.h (IOSPAWN_FLAG_NOCLOSE): New flag.
271         * w32-io.c (_gpgme_io_spawn): Implement this flag.
272         * posix-io.c (_gpgme_io_spawn): Likewise.
273         * w32-glib-io.c (_gpgme_io_spawn): Likewise.
274         * assuan-support.c (my_spawn): Set this flag.
275
276         * decrypt.c (gpgme_op_decrypt_start): Fix use of debug macro.
277         * decrypt-verify.c (gpgme_op_decrypt_verify_start): Likewise.
278         * delete.c (gpgme_op_delete_start): Likewise.
279         * edit.c (gpgme_op_edit_start, gpgme_op_card_edit_start):
280         Likewise.
281         * encrypt.c (gpgme_op_encrypt_start): Likewise.
282         * encrypt-sign.c (gpgme_op_encrypt_sign_start): Likewise.
283         * export.c (gpgme_op_export_start, gpgme_op_export_ext_start)
284         (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
285         * genkey.c (gpgme_op_genkey_start): Likewise.
286         * getauditlog.c (gpgme_op_getauditlog_start): Likewise.
287         * import.c (gpgme_op_import_start, gpgme_op_import_keys_start):
288         Likewise.
289         * opassuan.c (gpgme_op_assuan_transact_start): Likewise.
290         * sign.c (gpgme_op_sign_start): Likewise.
291         * verify.c (gpgme_op_verify_start): Likewise.
292         * vfs-create.c (gpgme_op_vfs_create): Likewise.
293         * vfs-mount.c (gpgme_op_vfs_mount): Likewise.
294
295 2009-11-04  Marcus Brinkmann  <marcus@g10code.de>
296
297         * ath.h (ath_self): New prototype.  Include <stdint.h>
298         * ath.c, ath-pth.c, ath-pthread.c (ath_self): New function.
299         * debug.h: Rewrite most macros to beautify debug output.
300         (_gpgme_debug_buffer): Remove tagname and tag argument.
301         (_gpgme_debug_frame_begin, _gpgme_debug_frame_end): New prototypes.
302         * debug.c: Include <time.h>.  Don't include assuan.h.
303         (frame_nr, FRAME_NR): New thread-specific variable and macro.
304         (debug_init): Do not initialize assuan.  Call _gpgme_debug after
305         initialization instead using printf directly.
306         (_gpgme_debug): Do not call debug_init (we now ensure proper
307         initialization by user).  Add timestamp and thread/process ID.
308         (_gpgme_debug_buffer): Do not take tagname and tag argument.
309         (_gpgme_debug_frame_begin, _gpgme_debug_frame_end): New functions.
310         * version.c (gpgme_check_version_internal, gpgme_check_version):
311         Fix debug string.  Do not initialize assuan.
312         * posix-io.c (get_max_fds): Use 0 not NULL (nicer debug output).
313
314 2009-11-04  Werner Koch  <wk@g10code.com>
315
316         * gpgme-tool.c (register_commands): Add HELP feature.
317
318 2009-11-03  Werner Koch  <wk@g10code.com>
319
320         * gpgme.h.in (GPGME_PROTOCOL_UISERVER): New.
321
322 2009-11-03  Marcus Brinkmann  <marcus@g10code.de>
323
324         * Makefile.am (main_sources): Change g13.c to vfs-mount.c.  Add
325         vfs-create.c
326         * vfs-create.c: New file.
327         * g13.c: Renamed to ...
328         * vfs-mount.c: ... this new file.
329         * gpgme.h.in (gpgme_op_vfs_create): New prototype.
330         * gpgme.def, libgpgme.vers: Add gpgme_op_vfs_create.
331         * gpgme-tool.c (gt_vfs_create, cmd_vfs_create): New functions.
332         (register_commands): Add VFS_CREATE and CREAET.
333
334 2009-11-02  Marcus Brinkmann  <marcus@g10code.de>
335
336         * debug.h (_gpgme_debug_buffer): Make TAG argument const const.
337         * debug.c (_gpgme_debug_buffer): Likewise.
338         * gpgme-tool.c (input_notify, output_notify): Adjust type to new
339         assuan interface.
340         * decrypt.c (gpgme_op_decrypt_result): Remove unused variable.
341         * opassuan.c (gpgme_op_assuan_transact): Fix return value.
342
343 2009-10-30  Marcus Brinkmann  <marcus@g10code.de>
344
345         * Makefile.am (noinst_PROGRAMS): New target gpgme-tool.
346         (gpgme_tool_LDADD): New variable.
347         * gpgme-tool.c: New file.
348         * ops.h (_gpgme_sig_notation_clearm _gpgme_signers_clear): New
349         prototypes.
350         * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_GPGCONF (when
351         had that gone missing?).
352         (_gpgme_sig_notation_clear): New function without debug output.
353         (gpgme_release): Call it and _gpgme_signers_clear.
354         * signers.c (_gpgme_signers_clear): New function without debug output.
355         * g13.c (gpgme_op_vfs_mount): Add debug output.
356         * assuan-support.c (my_spawn): Allow fd_child_list to be NULL.
357         * conversion.c (_gpgme_encode_percent_string): Fix infinite loop.
358         * debug.h: Put tag in front of debug lines, should make for nicer
359         output.
360         * engine-assuan.c (llass_new): Use our new system hooks for libassuan.
361         * engine-g13.c (g13_new): Remove redundant assuan context allocation.
362         * version.c (gpgme_check_version_internal): Delay debug output
363         until after gpgme_check_version was called.
364
365 2009-10-28  Marcus Brinkmann  <marcus@g10code.de>
366
367         * signers.c, encrypt-sign.c, encrypt.c, delete.c, keylist.c,
368         edit.c, import.c, export.c: Fix last change in debug output.
369
370 2009-10-27  Marcus Brinkmann  <marcus@g10code.de>
371
372         * edit.c (gpgme_op_edit_start, gpgme_op_edit)
373         (gpgme_op_card_edit_start, gpgme_op_card_edit): Add debug output.
374         * encrypt-sign.c (gpgme_op_encrypt_sign_start)
375         (gpgme_op_encrypt_sign): Likewise.
376         * encrypt.c (gpgme_op_encrypt_start, gpgme_op_encrypt)
377         (gpgme_op_encrypt_result): Likewise.
378         * export.c (gpgme_op_export_start, gpgme_op_export)
379         (gpgme_op_export_ext_start, gpgme_op_export_ext)
380         (gpgme_op_export_keys_start, gpgme_op_export_keys): Likewise.
381         * genkey.c (gpgme_op_genkey_start, gpgme_op_genkey)
382         (gpgme_op_genkey_result): Likewise.
383         * getauditlog.c (gpgme_op_getauditlog_start)
384         (gpgme_op_getauditlog): Likewise.
385         * import.c (gpgme_op_import_result, gpgme_op_import_start)
386         (gpgme_op_import): Likewise.
387         * keylist.c (gpgme_op_keylist_result, keylist_colon_handler)
388         (gpgme_op_keylist_start, gpgme_op_keylist_ext_start)
389         (gpgme_op_keylist_next, gpgme_op_keylist_end, gpgme_get_key): Likewise.
390         * opassuan.c (gpgme_op_assuan_transact_start)
391         (gpgme_op_assuan_transact_ext, gpgme_op_assuan_result)
392         (gpgme_op_assuan_transact): Likewise.
393         * signers.c (gpgme_signers_add, gpgme_signers_clear): Likewise.
394         * trustlist.c (gpgme_op_trustlist_start)
395         (gpgme_op_trustlist_next, gpgme_op_trustlist_end): Likewise.
396         * verify.c (gpgme_op_verify_start, gpgme_op_verify)
397         (gpgme_op_verify_result): Likewise.
398
399 2009-10-26  Marcus Brinkmann  <marcus@g10code.de>
400
401         * gpgme.h.in (struct gpgme_io_event_done_data)
402         (gpgme_io_event_done_data_t): New types.
403         (struct _gpgme_op_assuan_result): Deprecate the err member.
404         (gpgme_op_assuan_result): Deprecate (for now).
405         (gpgme_op_assuan_transact_ext): New prototype.
406         (gpgme_op_assuan_transact): Deprecate.
407         (struct _gpgme_op_g13_result): Replace with ...
408         (struct _gpgme_op_vfs_mount_result): ... this.
409         (gpgme_op_g13_mount): Replace with ...
410         (gpgme_op_vfs_mount): ... this.
411         * gpgme.def (gpgme_op_assuan_transact_ext, gpgme_wait_ext)
412         (gpgme_op_vfs_mount_result, gpgme_op_vfs_mount): New.
413         (gpgme_op_g13_mount): Remove.
414         * libgpgme.vers: Likewise.
415         * engine-backend.h (struct engine_ops): Remove RESULT_CB and
416         RESULT_CB_VALUE args in opassuan_transact member.  Add CANCEL_OP
417         member.
418         * ops.h (_gpgme_cancel_with_err, _gpgme_wait_on_condition): Add
419         OP_ERR argument.
420         (_gpgme_wait_one_ext): New prototype.
421         * context.h (ctx_op_data_id_t): Add OPDATA_VFS_MOUNT.
422         * engine-g13.c (g13_cancel_op): New function.
423         (parse_status): Remove declaration.
424         (g13_assuan_simple_command): Do nothing with status lines for now.
425         (status_handler): Update opaque value access.
426         (_gpgme_engine_ops_g13): Add new cancel_op member.
427         * gpgme.c (_gpgme_cancel_with_err): Add new parameter OP_ERR.
428         Handle operational errors.
429         (gpgme_cancel, gpgme_io_read, gpgme_io_write): Add debug output.
430         * data.c (_gpgme_data_inbound_handler)
431         (_gpgme_data_outbound_handler): Adjust opaque value access.
432         * engine-gpg.c (command_handler, status_handler)
433         (colon_line_handler): Likewise.
434         * engine-gpgsm.c (status_handler): Likewise.
435         * engine-gpg.c (_gpgme_engine_ops_gpg): Add cancel_op member.
436         * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Likewise.
437         * g13.c: Rewritten (and will be rewritten again).
438         * engine.h (_gpgme_engine_op_assuan_transact): Remove result_cb
439         and result_cb_value parameters from prototype.
440         (_gpgme_engine_cancel_op): New prototype.
441         * engine.c (engine_ops) [! ENABLE_ASSUAN]: Add missing comma.
442         (_gpgme_engine_op_assuan_transact): Remove result_cb and
443         result_cb_value parameter.
444         (_gpgme_engine_cancel_op): New function.
445         * wait.h (_gpgme_run_io_cb): Add new argument OP_ERR.
446         (struct io_cb_data): New struct to pass opaque data and get a
447         op_err return value.  Needed because we can't modify I/O callback
448         handler signature because it is exposed to the user.
449         * wait.c (_gpgme_run_io_cb): Add OP_ERR parameter.  Handle
450         operational errors.
451         * wait-user.c (_gpgme_user_io_cb_handler): Handle operational
452         errors.
453         * wait-private.c (_gpgme_wait_on_condition): New argument to
454         retrieve the operational result.  Handle operational errors in
455         session based protocols.
456         (_gpgme_wait_one_ext): New function.
457         (_gpgme_wait_one): Pass argument in invocation of
458         _gpgme_wait_on_condition.
459         * wait-global.c (struct ctx_list_item): Add member OP_ERR.
460         (ctx_done): New argument OP_ERR.
461         (ctx_wait): New argument OP_ERR.
462         (gpgme_wait_ext): New function based on gpgme_wait but handling
463         operational errors.
464         (gpgme_wait): Implement in term of gpgme_wait_ext.
465         * keylist.c (gpgme_op_keylist_next): Pass argument in invocation
466         of _gpgme_wait_on_condition.
467         * trustlist.c (gpgme_op_trustlist_next): Pass argument in
468         invocation of _gpgme_wait_on_condition.
469         * engine-assuan.c (struct engine_llass): Replace members RESULT_CB
470         and RESULT_CB_VALUE by LAST_OP_ERR.
471         (_gpgme_engine_assuan_last_op_err): Add this hack function.
472         (llass_cancel_op): New function.
473         (_gpgme_engine_llass_ops): Add cancel_op member.
474         (llass_status_handler): Update opaque value access.
475         (llass_transact): Remove RESULT_CB and RESULT_CB_VALUE arguments.
476         * opassuan.c: Move compat hacks to the end of file.
477         (opassuan_start): Do not set OPD->result.err.
478         Do not pass RESULT_Cb and CTX to _gpgme_engine_op_assuan_transact.
479         (gpgme_op_assuan_transact_ext): New function.
480
481         * debug.h (DEBUG_GLOBAL): New debug level.
482         * conversion.c (gnupg_errors, _gpgme_map_gnupg_error): Removed.
483         * data-user.c (gpgme_data_new_from_cbs): Add debug output.
484         * data-fd.c (gpgme_data_new_from_fd): Likewise.
485         * data-stream.c (gpgme_data_new_from_stream): Likewise.
486         * decrypt.c (gpgme_op_decrypt_result, gpgme_op_decrypt_start)
487         (gpgme_op_decrypt): Likewise.
488         * delete.c (gpgme_op_delete_start, gpgme_op_delete): Likewise.
489         * decrypt-verify.c (gpgme_op_decrypt_verify_start)
490         (gpgme_op_decrypt_verify): Likewise.
491         * sign.c (gpgme_op_sign_result): Fix debug message.
492         * data-mem.c (gpgme_data_new): Improve debug output.
493         * verify.c (parse_trust): Use atoi instead of
494         _gpgme_map_gnupg_error.
495         * decrypt.c (_gpgme_decrypt_status_handler): Likewise.
496
497 2009-10-22  Marcus Brinkmann  <marcus@g10code.de>
498
499         * Makefile.am: Remove @NETLIBS@ from LIBADDs.
500         (g13_components): New variable.
501         (main_sources): Add $(g13_components).
502         * g13.c, engine-g13.c: New files.
503         * engine.c (engine_ops): Check for assuan for assuan engine, add
504         g13 engine.
505         * util.h (_gpgme_get_g13_path, _gpgme_encode_percent_string): New
506         prototypes.
507         * conversion.c (_gpgme_encode_percent_string): New function.
508         * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_G13.
509         (struct _gpgme_op_g13_result, gpgme_g13_result_t): New types.
510         (gpgme_op_g13_mount): New function.
511         * gpgme.def, libgpgme.vers: Add gpgme_op_g13_mount.
512         * gpgme.c (gpgme_set_protocol): Allow GPGME_PROTOCOL_G13.
513         (gpgme_get_protocol_name): Add GPGME_PROTOCOL_G13.
514         * posix-util.c (_gpgme_get_g13_path): New function.
515         * w32-util.c (_gpgme_get_g13_path): New function.
516         * engine-backend.h (_gpgme_engine_ops_g13): New declaration.
517
518 2009-10-20  Marcus Brinkmann  <marcus@g10code.de>
519
520         * gpgme-config.in (netlibs): Remove.
521         (assuan_cflags, assuan_libs): Add.
522
523         * Makefile.am (assuan_cppflags, assuan_libobjs): Removed.
524         (gpgsm_components): Move engine-assuan.c to ...
525         (assuan_components): ... this new variable.
526         (main_sources): Add this new variable.
527         (AM_CPPFLAGS): Remove $(assuan_cppflags).
528         (AM_CFLAGS): Add @LIBASSUAN_CFLAGS@.
529         (libgpgme_la_DEPENDENCIES, libgpgme_pth_la_DEPENDENCIES)
530         (libgpgme_glib_la_DEPENDENCIES, libgpgme_qt_la_DEPENDENCIES)
531         (libgpgme_pthread_la_DEPENDENCIES): Remove $(assuan_libobjs).
532         (libgpgme_la_LIBADD, libgpgme_pth_la_LIBADD)
533         (libgpgme_glib_la_LIBADD, libgpgme_qt_la_LIBADD))
534         (libgpgme_pthread_la_LIBADD): Replace $(assuan_libobjs) by
535         @LIBASSUAN_LIBS@.
536         * priv-io.h [!HAVE_W32_SYSTEM]: Declare _gpgme_io_recvmsg,
537         _gpgme_io_sendmsg, _gpgme_io_waitpid.
538         * engine-backend.h: Define with [ENABLE_ASSUAN] instead
539         of [ENABLE_GPGSM].
540         * posix-io.c (_gpgme_io_waitpid): Make non-static.
541         * util.h (ENABLE_ASSUAN): Declar _gpgme_assuan_system_hooks,
542         _gpgme_assuan_malloc_hooks, _gpgme_assuan_log_cb.
543         * engine-gpgsm.c: Don't map assuan error codes.  Use
544         assuan_release instead of assuan_disconnect.
545         (map_assuan_error): Remove function.
546         (gpgsm_new): Use new assuan context interface.
547         * engine-assuan.c: Use assuan_release instead of
548         assuan_disconnect.
549         (llass_new): Use new assuan context interface.
550
551 2009-10-07    <wk@g10code.com>
552
553         * priv-io.h [W32]: Include windows.h instead of sys/socket.h.
554
555 2009-08-06  Werner Koch  <wk@g10code.com>
556
557         * op-support.c (_gpgme_parse_inv_recp): Allow for no fingerprint.
558
559         * engine-gpgsm.c (gpgsm_sign): Hook up the status func for the
560         SIGNER command.
561         * gpgme.h.in (GPGME_STATUS_INV_SGNR, GPGME_STATUS_NO_SGNR): New.
562         * sign.c (op_data_t): Add fields IGNORE_INV_RECP and INV_SGNR_SEEN.
563         (_gpgme_op_sign_init_result): Factor code out to ...
564         (sign_init_result): .. new.  Init new fields.
565         (sign_start): Use sign_init_result.
566         (_gpgme_sign_status_handler): Take care of the new INV_SGNR.
567         Return an error if no signature has been created.
568
569 2009-07-07  Werner Koch  <wk@g10code.com>
570
571         * engine-gpgsm.c (struct engine_gpgsm): Add fields
572         input_helper_data and input_helper_memory.
573         (close_notify_handler): Release these new fields.
574         (gpgsm_import): Implement the keyarray feature.
575
576         * engine-gpg.c (gpg_import): Actually return GPG_ERR_INV_VALUE.
577
578         * engine-gpgsm.c (gpgsm_import): Return an error for unknown data
579         encodings.
580
581 2009-06-22  Marcus Brinkmann  <marcus@g10code.de>
582
583         * debug.h: Everywhere, use %p instead of 0x%x to print pointer.
584         [HAVE_STDINT_H]: Include <stdint.h>.
585         (_TRACE, TRACE, TRACE0, TRACE1, TRACE2, TRACE3, TRACE6): Cast tag
586         to (uintptr_t) before casting it to (void*) to silence GCC
587         warning.
588
589         * gpgme.h.in (_GPGME_DEPRECATED_OUTSIDE_GPGME): New macro.
590         * sign.c (_GPGME_IN_GPGME): Define it.
591         * keylist.c (_GPGME_IN_GPGME): Define it.
592
593         * debug.c (_gpgme_debug_begin, _gpgme_debug_add): Handle error in
594         vasprintf and asprintf.
595
596         * priv-io.h: Include <sys/socket.h>.  Declare _gpgme_io_connect.
597
598 2009-06-18  Marcus Brinkmann  <marcus@g10code.de>
599
600         * gpgme.h.in (GPGME_CONF_PATHNAME): Revert last change, it's
601         back! (GPA still uses it...).
602
603         * gpgme.def: Fix stupid typo.
604         * w32-io.c (_gpgme_io_pipe): Add missing declaration.
605
606         * gpgme.h.in (GPGME_CONF_PATHNAME): Remove obsolete macro.
607
608         * w32-io.c (_gpgme_io_pipe): Allocate reader/writer thread right
609         away.
610         (_gpgme_io_read, _gpgme_io_write, _gpgme_io_select)
611         (_gpgme_io_dup): Never allocate threads here.
612         (find_writer, find_reader): Check return value of thread creation
613         function.
614
615         * context.h (CTX_OP_DATA_MAGIC): New macro.
616         (struct ctx_op_data): New member MAGIC.
617         * op-support.c (_gpgme_op_data_lookup): Initialize magic.
618         * gpgme.c (gpgme_result_unref, gpgme_result_ref): Check magic.
619
620 2009-06-16  Marcus Brinkmann  <marcus@g10code.de>
621
622         * gpgme.c (gpgme_result_unref): Hot fix to release a lock.
623
624         * gpgme.c (result_ref_lock): New global variable.
625         (gpgme_result_ref, gpgme_result_unref): use it.
626
627 2009-06-16  Werner Koch  <wk@g10code.com>
628
629         * version.c: Include stdlib.h. 
630
631         * gpgme.h.in (gpgme_data_encoding_t): Add GPGME_DATA_ENCODING_URL,
632         GPGME_DATA_ENCODING_URLESC, GPGME_DATA_ENCODING_URL0.
633         * data.c (gpgme_data_set_encoding): Adjust for new values.
634         * engine-gpg.c (string_from_data): New.
635         (gpg_import): Implement --fetch-key feature.
636
637         * gpgme.h.in (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
638         * gpgme.def, libgpgme.vers: Add them.
639         * export.c (gpgme_op_export_keys_start, gpgme_op_export_keys): New.
640         (export_keys_start): New.
641
642         * gpgme.h.in (gpgme_export_mode_t, GPGME_EXPORT_MODE_EXTERN): New.
643         (gpgme_op_export_start, gpgme_op_export, gpgme_op_export_ext_start)
644         (gpgme_op_export_ext): Change arg RESERVED to MODE of new
645         compatible type.
646         * export.c (gpgme_export_ext_start, gpgme_op_export)
647         (gpgme_op_export_ext_start, gpgme_op_export_ext): Ditto.
648         (export_start): Ditto.
649         * engine.c (_gpgme_engine_op_export): Ditto.
650         * engine-backend.h (struct engine_ops): Ditto.
651         * engine-gpgsm.c (gpgsm_export, gpgsm_export_ext): Ditto.
652         * engine-gpg.c (gpg_export, gpg_export_ext): Ditto.  Implement
653         mode EXTERN.
654         (gpg_export, gpg_export_ext): Factor common code out to ..
655         (export_common): .. this.
656
657         * gpgme.h.in (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
658         * gpgme.def, libgpgme.vers: Add them.
659         * import.c (gpgme_op_import_keys_start, gpgme_op_import_keys): New.
660         (_gpgme_op_import_keys_start): New.
661         * engine.c (_gpgme_engine_op_import): Add arg KEYARRAY.
662         * engine-backend.h (struct engine_ops): Ditto.
663         * engine-gpgsm.c (gpgsm_import): Ditto.  Not functional.
664         * engine-gpg.c (gpg_import): Ditto.  Implement it.
665
666 2009-06-15  Marcus Brinkmann  <marcus@g10code.de>
667
668         * gpgme.h.in (gpgme_result_ref, gpgme_result_unref): Add
669         prototypes.
670         * gpgme.def, libgpgme.vers (gpgme_result_ref, gpgme_result_unref):
671         Add these.
672         * context.h (struct ctx_op_data): Add member "references".
673         * gpgme.c (gpgme_result_ref, gpgme_result_unref): New functions.
674         (_gpgme_release_result): Use gpgme_result_unref.
675         * op-support.c (_gpgme_op_data_lookup): Initialize references.
676
677 2009-06-12  Werner Koch  <wk@g10code.com>
678
679         * gpgme-w32spawn.c (translate_get_from_file): Parse optional spawn
680         flags.  Add new arg R_FLAGS.  Fix segv on file w/o LF.
681         (translate_handles): Add new arg R_FLAGS.  Avoid possible segv.
682         (main): Pass flags for my_spawn.
683         (my_spawn): Add arg FLAGS and implement AllowSetForegroundWindow.
684
685         * priv-io.h (IOSPAWN_FLAG_ALLOW_SET_FG): New.
686         * w32-io.c (_gpgme_io_spawn): Add arg FLAGS and implement it.
687         * w32-glib-io.c (_gpgme_io_spawn): Ditto.
688         * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
689         * posix-io.c (_gpgme_io_spawn): Add dummy arg FLAGS.
690         * engine-gpg.c (start): Call spawn with new flag.
691
692         * w32-util.c (_gpgme_allow_set_foregound_window): Rename to
693         _gpgme_allow_set_foreground_window.  Change all callers.
694         * posix-util.c (_gpgme_allow_set_foreground_window): Ditto.
695
696 2009-06-10  Werner Koch  <wk@g10code.com>
697
698         * w32-util.c (_gpgme_allow_set_foregound_window): Add trace support.
699
700 2009-06-09  Werner Koch  <wk@g10code.com>
701
702         * engine-gpg.c (gpg_io_event): Test for cmd.fd.
703
704         * version.c (gpgme_check_version_internal): Make result const.
705
706         * gpgme.c: Include priv-io.h.
707         (gpgme_io_read, gpgme_io_write): New.
708         * libgpgme.vers (GPGME_1.1): Add them. 
709         * gpgme.def: Ditto.
710
711         * Makefile.am (main_sources): Remove gpgme.h.
712         (include_HEADERS): Rename to nodist_include_HEADERS so that a
713         VPATH build won't use the distributed one.
714
715         * util.h (GPG_ERR_NOT_OPERATIONAL): Define.
716
717 2009-05-28  Marcus Brinkmann  <marcus@g10code.de>
718
719         * gpgme.h.in (gpgme_check_version_internal): New prototype.
720         (gpgme_check_version): New macro, overriding function of the same
721         name.
722         * libgpgme.vers, gpgme.def: Add gpgme_check_version_internal.o
723         * context.h (_gpgme_selftest): New variable declaration.
724         * version.c: Include "context.h".
725         (gpgme_check_version): Set _gpgme_selftest on success.
726         (gpgme_check_version_internal): New function.
727         * gpgme.c (_gpgme_selftest): Define it.
728         (gpgme_new): Check the selftest result.
729
730 2009-05-18  Marcus Brinkmann  <marcus@g10code.de>
731
732         * gpgme.h.in (gpgme_encrypt_flags_t): Add
733         GPGME_ENCRYPT_NO_ENCRYPT_TO.
734         * engine-gpg.c (gpg_encrypt): Pass --no-encrypt-to to gpg if
735         GPGME_ENCRYPT_NO_ENCRYPT_TO flag is set.
736
737 2009-05-14  Werner Koch  <wk@g10code.com>
738
739         * gpgme.h.in (gpgme_status_code_t): Explicitly initialize for
740         better maintainability and to help debugging.
741
742 2009-05-05  Marcus Brinkmann  <marcus@g10code.de>
743
744         * gpgme.h.in: Add compile time check for _FILE_OFFSET_BITS.
745
746 2009-04-15  Marcus Brinkmann  <marcus@g10code.de>
747
748         * posix-io.c (_gpgme_io_socket, _gpgme_io_connect): New functions.
749         * w32-io.c (_gpgme_io_connect): Fix stupid error.
750
751 2009-04-08  Marcus Brinkmann  <marcus@g10code.de>
752
753         * w32-glib-io.c (giochannel_table): New members used, fd, socket.
754         (find_channel): Drop CREATE argument.
755         (new_dummy_channel_from_fd, new_channel_from_fd)
756         (new_channel_from_socket): New functions.
757         (_gpgm_io_fd2str): Implement for sockets.
758         (_gpgme_io_write, _gpgme_io_read): Translate EAGAIN errors
759         correctly.
760         (_gpgme_io_pipe): Fix for new channel bookkeeping.
761         (_gpgme_io_close, _gpgme_io_dup): Likewise.
762         (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
763         * w32-io.c (MAX_READERS, MAX_WRITERS): Bump up to 40.
764         (wsa2errno, _gpgme_io_socket, _gpgme_io_connect): New.
765         * w32-qt-io.cpp (_gpgme_io_socket, _gpgme_io_connect): New stubs.
766         * version.c [HAVE_W32_SYSTEM]: Include "windows.h.
767         (do_subsystem_inits) [HAVE_W32_SYSTEM]: Call WSAStartup.
768         * engine-assuan.c (llass_status_handler): Ignore EAGAIN errors.
769
770 2009-03-18  Werner Koch  <wk@g10code.com>
771
772         * gpgme.h.in (GPGME_KEYLIST_MODE_EPHEMERAL): New.
773         * engine-gpgsm.c (gpgsm_keylist): Send new option.
774
775 2009-03-13  Werner Koch  <wk@g10code.com>
776
777         * gpgme-config.in: Make sure locale is set to C.
778
779 2009-02-24  Werner Koch  <wk@g10code.com>
780
781         * gpgme.h.in (struct _gpgme_op_assuan_result): New.
782         (gpgme_assuan_result_t): New.
783         (gpgme_op_assuan_result): Change return type.
784         (struct _gpgme_assuan_sendfnc_ctx)
785         (gpgme_assuan_sendfnc_ctx_t, gpgme_assuan_sendfnc_t):Remove.
786         (gpgme_assuan_inquire_cb_t): Changed.
787         * opassuan.c (op_data_t): Make use of a result structure.
788         (gpgme_op_assuan_result): Change return type.
789         (opassuan_start): Use result structure.
790         (result_cb): Ditto.
791         * engine-assuan.c (struct _gpgme_assuan_sendfnc_ctx): Remove.
792         (inquire_cb_sendfnc): Remove.
793         (inquire_cb): Change for new callback scheme.  Not yet finished.
794         (llass_status_handler): Allow sending a CANCEL from the inquire CB.
795
796 2009-02-04  Werner Koch  <wk@g10code.com>
797
798         * w32-glib-io.c (_gpgme_io_spawn): Make ARGV argument const to
799         match prototype.
800         * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
801
802 2009-02-03  Werner Koch  <wk@g10code.com>
803
804         * gpgme.h.in (struct _gpgme_subkey): Add fields IS_CARDKEY and
805         CARD_NUMBER..
806         * key.c (gpgme_key_unref): Release field CARD_NUMBER.
807         * keylist.c (keylist_colon_handler): Factor common code out to ...
808         (parse_sec_field15): New.  Set card number.
809
810 2009-01-26  Werner Koch  <wk@g10code.com>
811
812         * opassuan.c, dirinfo.c, engine-assuan.c: New.
813         * Makefile.am:  Add them.
814         * engine-backend.h: Add _gpgme_engine_ops_assuan.
815         (struct engine_ops): Add field OPASSUAN_TRANSACT.  Update all
816         engine intializers.
817         * Makefile.am (gpgsm_components): Add engine-assuan.c.
818         * gpgme.h.in (gpgme_protocol_t): Add GPGME_PROTOCOL_ASSUAN.
819         (gpgme_assuan_data_cb_t, gpgme_assuan_sendfnc_ctx_t)
820         (gpgme_assuan_inquire_cb_t, gpgme_assuan_status_cb_t): New.
821         (gpgme_op_assuan_transact_start, gpgme_op_assuan_transact): New.
822         * gpgme.c (gpgme_get_protocol_name): Ditto.
823         (gpgme_set_protocol): Support it.
824         * engine.c (gpgme_get_engine_info): Ditto.
825         (engine_ops): Register it.
826         (_gpgme_engine_op_assuan_transact): New.
827         * libgpgme.vers (gpgme_op_assuan_transact_start)
828         (gpgme_op_assuan_transact): New.
829         * gpgme.def (gpgme_op_assuan_transact_start)
830         (gpgme_op_assuan_transact): New.
831         * engine-backend.h (struct engine_ops): Add GET_HOME_DIR and
832         initialize to NULL for all engines.
833         * engine.c (engine_get_home_dir): New.
834         (gpgme_get_engine_info): Use it.
835         (_gpgme_set_engine_info): Use it.
836         * engine.h (engine_assuan_result_cb_t): New.
837         * context.h (ctx_op_data_id_t): Add OPDATA_ASSUAN.
838
839         * util.h (GPG_ERR_UNFINISHED): Define if not yet defined.
840
841         * version.c (gpgme_check_version): Protect trace arg against NULL.
842
843 2009-01-19  Werner Koch  <wk@g10code.com>
844
845         * rungpg.c: Rename to engine-gpg.c
846         * Makefile.am (main_sources): Ditto.
847
848 2008-12-03  Marcus Brinkmann  <marcus@g10code.de>
849
850         * Makefile.am (status-table.h): Use $(builddir) to find gpgme.h.
851
852 2008-11-18  Werner Koch  <wk@g10code.com>
853
854         * version.c (do_subsystem_inits): Always initialize I/O
855         subsystem.  Fixes regression from 2007-08-02.
856
857         * decrypt.c (_gpgme_decrypt_status_handler): Use
858         _gpgme_map_gnupg_error to parse the error code for decrypt.algorithm.
859
860 2008-10-30  Marcus Brinkmann  <marcus@g10code.de>
861
862         * wait-private.c (_gpgme_wait_on_condition): Remove unused
863         variable IDX.
864         * wait-global.c: Include ops.h to silence gcc warning.
865         (_gpgme_wait_global_event_cb): Pass error value directly.
866         * wait-user.c: Include ops.h to silence gcc warning.
867
868         * posix-io.c (_gpgme_io_spawn): Make ARGV argument const to
869         silence gcc warning.  Cast argument to execv to silence warning.
870         * w32-io.c (_gpgme_io_spawn): Likewise.
871         * priv-io.h (_gpgme_io_spawn): Likewise for prototype.
872
873 2008-10-24  Werner Koch  <wk@g10code.com>
874
875         * rungpg.c (gpg_keylist_preprocess): Escape backslashes too.
876
877 2008-10-23  Marcus Brinkmann  <marcus@g10code.de>
878
879         * rungpg.c (gpg_keylist_preprocess): Convert percent escaped
880         string to C coded string.
881
882 2008-10-20  Werner Koch  <wk@g10code.com>
883
884         * Makefile.am (EXTRA_DIST): Add gpgme.h.in.
885
886         * gpgme.h: Rename to gpgme.h.in.
887         * gpgme.h.in (GPGME_VERSION): Use autoconf substitution.
888
889         * posix-io.c: Include sys/uio.h.  Fixes bug #818.
890
891 2008-10-18  Marcus Brinkmann  <marcus@g10code.com>
892
893         * w32-util.c (find_program_in_registry): Don't define.
894         (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path)
895         (_gpgme_get_gpgconf_path): Do not check for fooProgram in the
896         registry anymore.  It is now no longer possible to overwrite the
897         default location in that way.
898
899 2008-10-17  Werner Koch  <wk@g10code.com>
900
901         * w32-glib-io.c (_gpgme_io_fd2str): Use "%d" and not "%ld" to work
902         around a bug in mingw32.
903
904 2008-09-23  Marcus Brinkmann  <marcus@g10code.com>
905
906         * gpgme.c (gpgme_sig_notation_clear): Clear CTX->sig_notations.
907         Submitted by "Daniel Mueller" <daniel@danm.de>
908
909 2008-09-16  Marcus Brinkmann  <marcus@g10code.com>
910
911         * rungpg.c (gpg_new): Don't use errno with ttyname_r.
912
913 2008-08-11  Marcus Brinkmann  <marcus@g10code.com>
914
915         * rungpg.c (gpg_cancel): Remove cmd fd before status fd.
916         * gpgme.c (_gpgme_cancel_with_err): New function.
917         (gpgme_cancel): Reimplement in terms of _gpgme_cancel_with_err.
918         * wait-private.c (_gpgme_wait_on_condition): Use
919         _gpgme_cancel_with_err.
920         * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
921         * wait-global.c (_gpgme_wait_global_event_cb, gpgme_wait): Likewise.
922
923 2008-08-08  Marcus Brinkmann  <marcus@g10code.com>
924
925         * rungpg.c (command_handler): Remove I/O callback on error, too.
926
927 2008-06-29  Marcus Brinkmann  <marcus@g10code.com>
928
929         * gpgme.c (gpgme_cancel_async): Remove unused variable.
930
931 2008-06-27  Marcus Brinkmann  <marcus@g10code.de>
932
933         * libgpgme.vers: Add gpgme_cancel_async.
934         * gpgme.def: Likewise.
935
936         * context.h: Include "sema.h".
937         (struct gpgme_context): New members lock and canceled.
938         * gpgme.c (gpgme_new): Initialize lock.
939         (gpgme_release): Destroy lock.
940         (gpgme_cancel_async): New function.
941         * op-support.c (_gpgme_op_reset): Reset the canceled flag.
942         * wait-global.c (gpgme_wait): Check cancel flag before processing
943         any I/O callbacks.
944         * wait-private.c (_gpgme_wait_on_condition): Likewise.
945         * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
946
947 2008-06-26  Werner Koch  <wk@g10code.com>
948
949         * w32-util.c (_gpgme_mkstemp): Replace sprint by stpcpy.
950         (mkstemp): Need to use GetSystemTimeAsFileTime for better
951         compatibility.
952
953 2008-06-25  Marcus Brinkmann  <marcus@g10code.de>
954
955         * gpgme-w32spawn.c: New file.
956         * Makefile.am (libexec_PROGRAMS) [HAVE_W32_SYSTEM]: New variable
957         with gpgme-w32spawn.
958         * engine-gpgsm.c (gpgsm_new): Use server translated handles.
959         (gpgsm_set_locale): Return early if locale value is NULL.
960         * util.h (_gpgme_mkstemp)
961         (_gpgme_get_w32spawn_path) [HAVE_W32_SYSTEM]: New function
962         prototypes.
963         * w32-util.c: Include <stdint.h>, <sys/stat.h> and <unistd.h>.
964         (letters, mkstemp, _gpgme_mkstemp, _gpgme_get_w32spawn_path): New
965         functions.
966         * rungpg.c (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign)
967         (gpg_genkey, gpg_import, gpg_verify, gpg_sign): Pass data over
968         special filename FD rather than stdin.
969         (struct arg_and_data_s): Add member ARG_LOCP.
970         (struct fd_data_map_s): Add member ARG_LOC.
971         (struct engine_gpg): Add member ARG_LOC to status and colon.
972         (_add_arg, add_arg_with_locp): New function.
973         (add_arg_ext): Reimplement in terms of _add_arg.
974         (gpg_new): Remember argument location for status FD.
975         (build_argv): Set argument location if requested.  Also set
976         argument location of fd_data_map for data items.
977         (start): Adjust caller of _gpgme_io_spawn.
978         * priv-io.h (struct spawn_fd_item_s): Add members peer_name and
979         arg_loc.
980         (_gpgme_io_spawn): Remove parent fd list argument.
981         * posix-io.c (get_max_fds): New function.
982         (_gpgme_io_dup): Add tracing.
983         (_gpgme_io_spawn): Remove parent fd list.  Change meaning of child
984         fd list to contain all child fds that should be inherited.  Close
985         all other file descriptors after fork.
986         * w32-io.c, w32-glib-io.c, w32-qt-io.c(_gpgme_io_spawn): Remove
987         parent fd list.  Change meaning of child fd list to contain all
988         child fds that should be inherited.  Do not inherit any file
989         descriptors, but DuplicateHandle them.  Spawn process through
990         wrapper process.  Provide wrapper process with a temporary file
991         containing handle translation data.  Return translated handle
992         names.
993         * w32-io.c (reader): Add more tracing output.
994         (_gpgme_io_read): Likewise.
995         * engine-gpgconf.c (gpgconf_read): Adjust caller of
996         _gpgme_io_spawn.
997         * version.c (_gpgme_get_program_version): Likewise.
998
999 2008-06-20  Werner Koch  <wk@g10code.com>
1000
1001         * engine-gpgconf.c (gpgconf_read): Change ARGV initialization for
1002         compatibility with old compilers.  Fix amount of memmove.  Fix
1003         CR removal.
1004
1005 2008-06-19  Werner Koch  <wk@g10code.com>
1006
1007         * gpgme.h (GPGME_CONF_PATHNAME): Replace by GPGME_CONF_FILENAME,
1008         change all callers and provide compatibilty macro.
1009         (gpgme_conf_type_t): Add complex types 34..37.
1010         * engine-gpgconf.c (gpgconf_parse_option, arg_to_data)
1011         (_gpgme_conf_arg_new, _gpgme_conf_arg_release): Add new types.
1012
1013 2008-06-19  Marcus Brinkmann  <marcus@g10code.de>
1014
1015         * engine-gpgconf.c (gpgconf_parse_option): Fix comma detection.
1016
1017 2008-05-09  Werner Koch  <wk@g10code.com>
1018
1019         * engine-gpgconf.c (gpgconf_read): Do not pass empty lines to the
1020         callback.
1021
1022 2008-05-07  Werner Koch  <wk@g10code.com>
1023
1024         * engine-gpgconf.c (gpgconf_write): Change argv[0] to a
1025         self-explaining string.  Needs a proper fix, though.
1026
1027         * rungpg.c (gpg_keylist, gpg_keylist_ext): Factor common code out
1028         to ..
1029         (gpg_build_keylist_options): .. new. Allow combination of extern
1030         and intern mode.
1031         (gpg_new): DFT_TTYNAME is an array, thus check the first character.
1032
1033 2008-05-06  Werner Koch  <wk@g10code.com>
1034
1035         * version.c (extract_version_string): New.
1036         (_gpgme_get_program_version): Use it to allow for suffixes in the
1037         version line.
1038
1039 2008-04-28  Werner Koch  <wk@g10code.com>
1040
1041         * engine-gpgconf.c (gpgconf_read): Fixed segv.  Avoid memmove for
1042         each line.
1043
1044 2008-04-22  Marcus Brinkmann  <marcus@g10code.de>
1045
1046         * w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
1047         Osterfeld, implement blocking select.
1048
1049 2008-03-11  Marcus Brinkmann  <marcus@g10code.de>
1050
1051         * data.c (gpgme_data_read, gpgme_data_write): Retry on EINTR.
1052
1053 2008-03-06  Marcus Brinkmann  <marcus@g10code.de>
1054
1055         * key.c (_gpgme_key_add_sig): Terminate UID in case SRC is NULL.
1056         Reported by Marc Mutz.
1057
1058 2008-03-05  Marcus Brinkmann  <marcus@g10code.de>
1059
1060         * decrypt.c (release_op_data): Release OPD->result.recipients.
1061         * encrypt.c (release_op_data): Release invalid_recipient.
1062
1063 2008-02-15  Marcus Brinkmann  <marcus@g10code.de>
1064
1065         * engine-gpgconf.c (gpgconf_read): Fix end-of-line handline.
1066
1067 2008-02-14  Werner Koch  <wk@g10code.com>
1068
1069         * w32-io.c (_gpgme_io_spawn): Add arg R_PID to return the pid.
1070         * posix-io.c (_gpgme_io_spawn): Ditto.
1071         * w32-glib-io.c (_gpgme_io_spawn): Ditto.
1072         * w32-qt-io.cpp (_gpgme_io_spawn): Ditto.
1073         * priv-io.h (_gpgme_io_spawn): Adjust prototyp and change all callers.
1074         * rungpg.c (start): Call _gpgme_allow_set_foregound_window.
1075
1076         * w32-util.c (_gpgme_allow_set_foregound_window): New.
1077         * posix-util.c (_gpgme_allow_set_foregound_window): New.
1078         * engine-gpgsm.c (default_inq_cb): New.
1079         (gpgsm_new) [W32]: Enable pinentry notifications.
1080         (status_handler): Handle inquiries.
1081
1082 2008-01-30  Marcus Brinkmann  <marcus@g10code.de>
1083
1084         * kdpipeiodevice.cpp: New version by Frank Osterfeld, fixes race
1085         condition.
1086
1087 2008-01-28  Marcus Brinkmann  <marcus@g10code.de>
1088
1089         * engine-gpgsm.c (map_input_enc): Rename to ...
1090         (map_data_enc): ... this.  Also change all callers.
1091         (gpgsm_encrypt, gpgsm_export, gpgsm_export_ext, gpgsm_genkey)
1092         (gpgsm_sign): Set encoding for output.
1093
1094 2008-01-28  Werner Koch  <wk@g10code.com>
1095
1096         * keylist.c (gpgme_get_key): Skip duplicated keys.  Fixes bug 876.
1097
1098 2008-01-14  Marcus Brinkmann  <marcus@g10code.de>
1099
1100         * engine-gpgconf.c (gpgconf_config_load_cb): Fix program_name
1101         field.
1102
1103 2008-01-10  Marcus Brinkmann  <marcus@g10code.de>
1104
1105         * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1106
1107         * engine-gpgconf.c (gpgconf_config_load_cb2): Handle the flag
1108         NO_ARG_DESC.
1109
1110 2008-01-04  Marcus Brinkmann  <marcus@g10code.de>
1111
1112         * Makefile.am (gpgconf_components): New variable.
1113         (main_sources): Add gpgconf.c.
1114         * gpgme.h (gpgme_protocol_t): New protocol GPGME_PROTOCOL_GPGCONF.
1115         (gpgme_conf_level_t, gpgme_conf_type_t, gpgme_conf_arg_t)
1116         (gpgme_conf_opt_t, gpgme_conf_comp_t, gpgme_conf_arg_new)
1117         (gpgme_conf_arg_release, gpgme_conf_opt_change)
1118         (gpgme_conf_release, gpgme_op_conf_load, gpgme_op_conf_save): New
1119         types.
1120         * gpgconf.c, engine-gpgconf.c: New files.
1121         * engine.h: (_gpgme_engine_op_conf_load,
1122         (_gpgme_engine_op_conf_save): New prototypes.
1123         * op-support.c (_gpgme_op_reset): Ignore not implemented locale
1124         function.
1125         * posix-util.c (_gpgme_get_gpgconf_path): New function.
1126         * w32-util.c (_gpgme_get_gpgconf_path): New function.
1127         * engine-gpgsm.c:
1128         (_gpgme_engine_ops_gpgsm): Add stubs for conf_load and conf_save.
1129         * rungpg.c:
1130         (_gpgme_engine_ops_gpg): Add stubs for conf_load and conf_save.
1131         * gpgme.def: Add new gpgconf related interfaces.
1132         * libgpgme.vers: Likewise.
1133         * util.h (_gpgme_get_gpgconf_path): New prototype.
1134         * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_GPGCONF.
1135         * engine-backend.h (_gpgme_engine_ops_gpgconf): New prototype.
1136         (struct engine_ops): Add members for conf_load and conf_save.
1137         * engine.c (engine_ops): Add _gpgme_engine_ops_gpgconf.
1138         (_gpgme_engine_op_conf_load,
1139         (_gpgme_engine_op_conf_save): New functions.
1140         (gpgme_get_engine_info): Allow protocol GPGME_PROTOCOL_GPGCONF.
1141
1142 2007-11-28  Marcus Brinkmann  <marcus@g10code.de>
1143
1144         * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Search
1145         for installation directory.  Remove old fallback default.
1146         (find_program_in_inst_dir): New function.
1147
1148 2007-11-26  Werner Koch  <wk@g10code.com>
1149
1150         * engine-gpgsm.c (struct engine_gpgsm): Add field INLINE_DATA and
1151         always reset it before calling start.
1152         (gpgsm_new): Clear it.
1153         (status_handler): Implement it.
1154         (gpgsm_getauditlog) [USE_DESCRIPTOR_PASSING]: Use INLINE_DATA.
1155
1156 2007-11-23  Werner Koch  <wk@g10code.com>
1157
1158         * op-support.c (_gpgme_op_reset): Implement a no-reset flag.
1159         * getauditlog.c (getauditlog_start): Use that flag.
1160
1161 2007-11-22  Werner Koch  <wk@g10code.com>
1162
1163         * gpgme.h (gpgme_op_getauditlog_start, gpgme_op_getauditlog): New.
1164         * libgpgme.vers: Ditto.
1165         * gpgme.def: Ditto.
1166         * getauditlog.c: New.
1167         * engine-backend.h (struct engine_ops): Add member GETAUDITLOG.
1168         * engine-gpgsm.c (gpgsm_getauditlog): New.
1169         (_gpgme_engine_ops_gpgsm): Insert new function.
1170         (gpgsm_new): Try to enable audit log support.
1171         * rungpg.c (_gpgme_engine_ops_gpg): Insert dummy entry.
1172         
1173 2007-11-20  Werner Koch  <wk@g10code.com>
1174
1175         * op-support.c (_gpgme_parse_inv_recp): Add new reason code 11.
1176
1177 2007-11-12  Marcus Brinkmann  <marcus@g10code.de>
1178
1179         * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1180
1181 2007-10-11  Marcus Brinkmann  <marcus@g10code.de>
1182
1183         * kdpipeiodevice.cpp: New version from Frank Osterfeld.
1184
1185 2007-10-09  Marcus Brinkmann  <marcus@g10code.de>
1186
1187         * kdpipeiodevice.cpp: New version from Frank Osterfeld and Marc
1188         Mutz.
1189
1190 2007-10-05  Marcus Brinkmann  <marcus@g10code.de>
1191
1192         * kdpipeiodevice.cpp, w32-qt-io.cpp: New versions from Frank
1193         Osterfeld.
1194
1195 2007-10-04  Marcus Brinkmann  <marcus@g10code.de>
1196
1197         * kdpipeiodevice.h, kdpipeiodevice.cpp, kdpipeiodevice.moc,
1198         w32-qt-io.cpp: New versions from Frank Osterfeld.
1199
1200 2007-10-02  Marcus Brinkmann  <marcus@g10code.de>
1201
1202         * kdpipeiodevice.cpp, kdpipeiodevice.moc: New versions.
1203         * w32-qt-io.cpp (_gpgme_io_fd2str): Print actual_fd if available.
1204         (_gpgme_io_dup): Only acquire a reference, do not actually dup.
1205         Submitted by Frank Osterfeld.
1206
1207         * priv-io.h, engine-gpgsm.c: Add comments.
1208         * w32-qt-io.cpp (_gpgme_io_select): Remove code handling frozen FDs.
1209         * w32-glib-io.c (_gpgme_io_close): Always dereference the channel,
1210         even if not primary.
1211         (_gpgme_io_dup): Acquire a reference.  Replace unused
1212         implementation by assertion.
1213
1214 2007-09-28  Werner Koch  <wk@g10code.com>
1215
1216         * engine-gpgsm.c (iocb_data_t): Add SERVER_FD_STR.
1217         (gpgsm_new): Set it.
1218         (gpgsm_set_fd): Use it.
1219
1220         * w32-glib-io.c (find_channel): Add a new primary flag.
1221         (_gpgme_io_close): Close channel only if primary.
1222         (_gpgme_io_dup): Put newfd into the table as shallow copy.
1223
1224         * priv-io.h (struct io_select_fd_s): Remove member FROZEN.
1225         * w32-io.c (_gpgme_io_select): Ditto.
1226         * w32-glib-io.c (_gpgme_io_select): Ditto.
1227
1228         * posix-io.c (_gpgme_io_select): Ditto.
1229         * rungpg.c (read_status): Ditto.
1230         * wait.c (fd_table_put): Ditto.
1231
1232         * rungpg.c (gpg_io_event): Add tracing.
1233         (start): Use gpg_io_event for sending the start event.
1234         * engine-gpgsm.c (gpgsm_io_event): Add tracing.
1235         (start): Use gpgsm_io_event for sending the start event.
1236         * wait.c (_gpgme_add_io_cb, _gpgme_run_io_cb): Add tracing.
1237
1238 2007-09-28  Marcus Brinkmann  <marcus@g10code.de>
1239
1240         * kdpipeiodevice.moc, w32-qt-io.cpp, kdpipeiodevice.cpp: New
1241         versions from Frank Osterfeld.
1242
1243 2007-09-27  Marcus Brinkmann  <marcus@g10code.de>
1244
1245         * w32-glib-io.c (_gpgme_io_spawn),
1246         w32-qt-io.cpp (_gpgme_io_spawn), w32-io.c (_gpgme_io_spawn): Close
1247         the process handle, return 0.
1248
1249         * gpgme.h (gpgme_protocol_t): Add GPGME_PROTOCOL_UNKNOWN.
1250         * gpgme.c (gpgme_get_protocol_name): Implement support for
1251         GPGME_PROTOCOL_UNKNOWN.
1252
1253         * kdpipeiodevice.h: Fix last change.
1254
1255         * w32-glib-io.c (_gpgme_io_pipe), w32-qt-io.c (_gpgme_io_pipe),
1256         w32-io.c (_gpgme_io_pipe), posix-io.c (_gpgme_io_pipe): Fix debug
1257         output.
1258
1259 2007-09-25  Marcus Brinkmann  <marcus@g10code.de>
1260
1261         * conversion.c, keylist.c: Include <sys/types.h>.
1262
1263         * kdpipeiodevice.h: Use namespace _gpgme_.
1264         * kdpipeiodevice.cpp: Use namespace _gpgme_.
1265         [Q_OS_WIN32 && NOMINMAX]: Do not define NOMINMAX again.
1266         * w32-qt-io.cpp: Change namespace of KDPipeIODevice to
1267         _gpgme_::KDPipeIODevice.
1268
1269 2007-09-17  Werner Koch  <wk@g10code.com>
1270
1271         * rungpg.c (gpg_new): Make robust against undefined ttyname or
1272         ttytype.
1273
1274 2007-09-14  Werner Koch  <wk@g10code.com>
1275
1276         * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug.
1277
1278 2007-09-14  Marcus Brinkmann  <marcus@g10code.de>
1279
1280         * gpgme.c (gpgme_release): Call gpgme_sig_notation_clear.
1281
1282 2007-09-13  Marcus Brinkmann  <marcus@g10code.de>
1283
1284         * rungpg.c (gpg_new): Handle return value of _gpgme_getenv (fixes
1285         small memory leak).
1286
1287 2007-09-07  Marcus Brinkmann  <marcus@g10code.de>
1288
1289         * Makefile.am (libgpgme_qt_la_SOURCES): Move
1290         moc_kdpipeiodevice.cpp to EXTRA_DIST, as this is only included by
1291         another file (it's more like a header file than a cpp file, but
1292         automake doesn't know that).
1293
1294         * w32-qt-io.cpp (_gpgme_io_spawn): Fix several cast errors and typos.
1295         * w32-io.c (_gpgme_io_write): Use TRACE_SYSRES instead of TRACE_SYS.
1296         (libgpgme_qt_la_LIBADD): Add QT4_CORE_LIBS, not QT4_CORE_LIB.
1297
1298         * kdpipeiodevice.h, kdpipeiodevice.cpp, moc_kdpipeiodevice.cpp,
1299         kdpipeiodevice.moc, w32-qt-io.c: New files.
1300         * Makefile.am (ltlib_gpgme_extra): Rename to ltlib_gpgme_glib.
1301         (ltlib_gpgme_qt): New variable.
1302         (lib_LTLIBRARIES): Add $(ltlib_gpgme_qt).
1303         (libgpgme_qt_la_SOURCES): New variable.
1304         (AM_CPPFLAGS): Add @QT4_CORE_INCLUDES@
1305         (AM_CFLAGS): Add @QT4_CORE_CFLAGS@.
1306         (libgpgme_qt_la_LDFLAGS, libgpgme_qt_la_DEPENDENCIES)
1307         (libgpgme_qt_la_LIBADD): New variables.
1308
1309         * sema.h (struct critsect_s): Rename "private" to "priv" to make
1310         C++ users happy.  Change users.
1311         * posix-sema.c (_gpgme_sema_cs_enter, _gpgme_sema_cs_leave)
1312         (_gpgme_sema_cs_destroy): Likewise.
1313         * w32-sema.c (critsect_init, _gpgme_sema_cs_enter)
1314         (_gpgme_sema_cs_leave, _gpgme_sema_cs_destroy): Likewise.
1315         * w32-glib-io.c (gpgme_get_giochannel): Change return type to
1316         void*.
1317         (gpgme_get_fdptr): New function.
1318         * w32-io.c (gpgme_get_fdptr): New function
1319         * gpgme.def: Add gpgme_get_fdptr.
1320
1321 2007-08-22  Marcus Brinkmann  <marcus@g10code.de>
1322
1323         * w32-io.c (_gpgme_io_write): Return early if COUNT is zero.
1324         (writer): Remove superfluous check.
1325
1326 2007-08-20  Marcus Brinkmann  <marcus@g10code.de>
1327
1328         * gpgme.h: Move include of gpg-error.h out of extern "C".
1329
1330 2007-08-07  Werner Koch  <wk@g10code.com>
1331
1332         * gpgme.h (struct _gpgme_signature): Add member CHAIN_MODEL.
1333         * verify.c (parse_trust): Set Chain_MODEL.
1334
1335 2007-08-02  Werner Koch  <wk@g10code.com>
1336
1337         * w32-glib-io.c (_gpgme_io_spawn): Use DETACHED_PROCESS flag.
1338         * w32-io.c (_gpgme_io_spawn): Ditto.
1339         (_gpgme_io_write): Map ERROR_NO_DATA to EPIPE.
1340         * debug.c (_gpgme_debug): Enable assuan logging.
1341         (_gpgme_debug_subsystem_init): New.
1342         * version.c (do_subsystem_inits): Disable assuan logging and
1343         initialize the debug system.
1344         (gpgme_check_version): Do not trace before the subsystems are
1345         initialized.
1346
1347 2007-07-17  Marcus Brinkmann  <marcus@g10code.de>
1348
1349         * debug.c: Include <errno.h> and "debug.h".
1350         (_gpgme_debug): Save and restore ERRNO.
1351         (TOHEX): New macro.
1352         (_gpgme_debug_buffer): New function.
1353         * conversion.c, data-compat.c, data-mem.c, data.c, engine-gpgsm.c,
1354         gpgme.c, keylist.c, posix-io.c, rungpg.c, sign.c, version.c,
1355         w32-io.c, wait.c: Replace DEBUG macros by TRACE_* variants.  In
1356         most of these files, add many more tracepoints.
1357
1358 2007-07-16  Marcus Brinkmann  <marcus@g10code.de>
1359
1360         * engine-gpgsm.c (status_handler): Do not send BYE here.
1361
1362         * w32-io.c (struct reader_context_s, struct writer_context_s): New
1363         members REFCOUNT.
1364         (create_reader, create_writer): Initialize C->refcount to 1.
1365         (destroy_reader, destroy_writer): Only destroy if C->refcount
1366         drops to 0.
1367         (find_reader, find_writer, kill_reader, kill_writer): Beautify.
1368         * priv-io.h (_gpgme_io_dup): New prototype.
1369         * posix-io.c (_gpgme_io_dup): New function. 
1370         * w32-io.c (_gpgme_io_dup): Likewise.
1371         * w32-glib-io.c (_gpgme_io_dup): Likewise.
1372         * engine-gpgsm.c (start): Reverting to version 2007-07-10.
1373
1374 2007-07-13  Marcus Brinkmann  <marcus@g10code.de>
1375
1376         * data-user.c (user_read, user_write, user_seek): Set errno and
1377         return -1 instead returning the error code directly.
1378         * data-compat.c (old_user_seek): Likewise.
1379         * gpgme.c (gpgme_sig_notation_add): Return error properly.
1380
1381         * Revert the "close_notify_handler" returns int stuff.  Always
1382         close in the _gpgme_io_close implementations.
1383         * engine-gpgsm.c (status_handler): Try to terminate the connection
1384         in case of error.
1385         * w32-io.c (_gpgme_io_read): Return C->error_code in ERRNO.
1386         (_gpgme_io_write): Likewise.
1387         
1388         * priv-io.h (_gpgme_io_set_close_notify): Change type of HANDLER
1389         to _gpgme_close_notify_handler.
1390         (_gpgme_close_notify_handler): New type.
1391         (_gpgme_io_dup): Remove prototype.
1392         * posix-io.c (notify_table, _gpgme_io_set_close_notify): Change
1393         type of HANDLER to _gpgme_close_notify_handler_t.
1394         (_gpgme_io_close): Do not close the FD if handler returns 0.
1395         (_gpgme_io_dup): Remove function.
1396         * w32-io.c (notify_table, _gpgme_io_set_close_notify,
1397         _gpgme_io_close): Change type of HANDLER to
1398         _gpgme_close_notify_handler_t.
1399         (_gpgme_io_close): Do not close the FD if handler returns 0.
1400         (_gpgme_io_dup): Remove function.
1401         * w32-glib-io.c (_gpgme_io_dup): Remove function.
1402         (_gpgme_io_set_close_notify, notify_table): Change type of HANDLER
1403         to _gpgme_close_notify_handler_t.
1404         (_gpgme_io_close): Do not close the FD if handler returns 0.
1405         * rungpg.c (close_notify_handler): Change return type to int,
1406         return 1.
1407         * engine-gpgsm.c (close_notify_handler): Change return type to
1408         int, return 0 for status FD and 1 for all other FDs.
1409         (start): Do not duplicate the status FD.
1410
1411 2007-07-12  Marcus Brinkmann  <marcus@g10code.de>
1412
1413         * Makefile.am: Replace implicite rule by suffix rule.  Add
1414         SUFFIXES for that.
1415
1416 2007-07-12  Werner Koch  <wk@g10code.com>
1417
1418         * version.c (do_subsystem_inits) [W32]: Make sure that the socket
1419         system has been started.
1420
1421 2007-07-10  Marcus Brinkmann  <marcus@g10code.de>
1422
1423         * priv-io.h (_gpgme_io_dup): New prototype.
1424         * posix-io.c (_gpgme_io_dup): New function. 
1425         * w32-io.c (_gpgme_io_dup): Likewise.
1426         * w32-glib-io.c (_gpgme_io_dup): Likewise.
1427         * engine-gpgsm.c (start): Use _gpgme_dup() instead of dup().
1428
1429 2007-07-08  Marcus Brinkmann  <marcus@g10code.de>
1430
1431         * engine-gpgsm.c [HAVE_W32_SYSTEM]: Enable the bunch of the file.
1432         * funopen.c (funopen): Rename to _gpgme_funopen.
1433
1434 2007-04-30  Marcus Brinkmann  <marcus@g10code.de>
1435
1436         * engine-gpgsm.c (gpgsm_new): Fix error handling for ttyname_r.
1437         * rungpg.c (gpg_new): Likewise.
1438         Submitted by Stephen Tether.
1439
1440 2007-02-26  Werner Koch  <wk@g10code.com>
1441
1442         * verify.c (op_data_t): New element PLAINTEXT_SEEN.
1443         (_gpgme_verify_status_handler): Return an error if more than one
1444         plaintext has been seen.
1445         (parse_error): New arg SET_STATUS. Also detect it based on an
1446         ERROR status (gpg > 1.4.6).
1447
1448 2007-01-26  Werner Koch  <wk@g10code.com>
1449
1450         * w32-io.c (build_commandline): Fixed stupid quoting bug.
1451         * w32-glib-io.c (build_commandline): Ditto.
1452
1453         * rungpg.c (gpg_set_locale): Avoid dangling pointer after free.
1454
1455         * gpgme-config.in: New options --get-gpg and --get-gpgsm.
1456
1457 2007-01-18  Marcus Brinkmann  <marcus@g10code.de>
1458
1459         * data.h (_gpgme_data_get_fd): Add prototype.
1460         (gpgme_data_get_fd_cb): New type.
1461         (struct _gpgme_data_cbs): New member get_fd.
1462         * data.c (_gpgme_data_get_fd): New function.
1463         * data-fd.c (fd_get_fd): New function.
1464         (fd_cbs): Add fd_get_fd.
1465         * data-stream.c (stream_get_fd): New function.
1466         (stream_cbs): Add stream_get_fd.
1467         * data-mem.c (mem_cbs): Add NULL for get_fd callback.   
1468         * data-user.c (user_cbs): Likewise.
1469         * engine-gpgsm.c (gpgsm_set_fd) [USE_DESCRIPTOR_PASSING]: Try to
1470         short-cut by passing the data descriptor directly.
1471
1472 2007-01-17  Marcus Brinkmann  <marcus@g10code.de>
1473
1474         * w32-io.c (build_commandline): Quote all command line arguments.
1475         * w32-glib-io.c (build_commandline): Likewise.
1476
1477 2007-01-10  Werner Koch  <wk@g10code.com>
1478
1479         * ttyname_r.c (ttyname_r) [W32]: Return a dummy name.
1480
1481 2007-01-08  Werner Koch  <wk@g10code.com>
1482
1483         * version.c (do_subsystem_inits): Do assuan init only if building
1484         with Assuan.
1485         * setenv.c: Include assuan-def.h only if building with Assuan
1486         support.
1487
1488         * op-support.c (_gpgme_op_reset): Set LC_MESSAGES only if
1489         if defined.
1490         * engine-gpgsm.c (gpgsm_set_locale): Ditto.
1491         * rungpg.c (gpg_set_locale): Ditto.
1492
1493 2006-12-17  Marcus Brinkmann  <marcus@g10code.de>
1494
1495         * gpgme.c (gpgme_set_protocol): Shut down the engine when
1496         switching protocols.
1497         (gpgme_ctx_set_engine_info): Likewise for engine info.
1498         * engine.h (_gpgme_engine_reset): New function prototype.
1499         * engine.c (_gpgme_engine_reset): New function.
1500         * engine-backend.h (struct engine_ops): New member RESET.
1501         * rungpg.c (_gpgme_engine_ops_gpg): Add NULL for reset function.
1502         * engine-gpgsm.c (_gpgme_engine_ops_gpgsm)
1503         [USE_DESCRIPTOR_PASSING]: Add gpgsm_reset for reset.
1504         (_gpgme_engine_ops_gpgsm) [!USE_DESCRIPTOR_PASSING]: Add NULL for
1505         reset function.
1506         (gpgsm_reset) [USE_DESCRIPTOR_PASSING]: New function.
1507         * op-support.c (_gpgme_op_reset): Try to use the engine's reset
1508         function if available.
1509         * engine-gpgsm.c (gpgsm_new): Move code to dup status_fd to ...
1510         (start): ... here.
1511         * posix-io.c (_gpgme_io_recvmsg, _gpgme_io_sendmsg): New functions.
1512         
1513         * engine.h (_gpgme_engine_new): Remove arguments lc_ctype and
1514         lc_messages from prototype.
1515         (_gpgme_engine_set_locale): New prototype.
1516         * engine.c (_gpgme_engine_set_locale): New function.
1517         * op-support.c (_gpgme_op_reset): Call _gpgme_engine_set_locale.
1518         * engine-backend.h (struct engine_ops): Add new member SET_LOCALE.
1519         Remove arguments lc_messages and lc_ctype from member NEW.
1520         * engine-gpgsm.c (struct engine_gpgsm): New members lc_ctype_set
1521         and lc_messages_set.
1522         (gpgsm_new): Remove lc_messages and lc_ctype
1523         arguments.
1524         (gpgsm_set_locale): New function.
1525         (_gpgme_engine_ops_gpgsm): Add gpgsm_set_locale.
1526         * rungpg.c (struct engine_gpg): Add new members lc_messages and
1527         lc_ctype.
1528         (gpg_release): Release lc_messages and lc_ctype if set.
1529         (gpg_new): Remove lc_messages and lc_ctype arguments.
1530         (gpg_set_locale): New function.
1531         (_gpgme_engine_ops_gpg): Add gpg_set_locale.
1532         (add_arg): Implement in terms of:
1533         (add_arg_ext): New function.
1534         (start): Set lc-messages and lc-ctype arguments here.
1535
1536 2006-12-03  Marcus Brinkmann  <marcus@g10code.de>
1537
1538         * engine-gpgsm.c (struct engine_gpgsm): Move members
1539         input_fd_server, output_fd_server, message_fd_server to ...
1540         (iocb_data): ... here (as server_fd).
1541         (close_notify_handler): Reset tags as well.
1542         (gpgsm_new): Implement support for descriptor
1543         passing.
1544         (fd_type_t): New type.
1545         (gpgsm_clear_fd): New function.  Use it instead of _gpgsm_io_close
1546         for unused communication channels.
1547         (gpgsm_set_fd): Rewritten to support descriptor passing.  All
1548         relevant callers adjusted as well (previously of _gpgme_io_close).
1549
1550 2006-12-02  Marcus Brinkmann  <marcus@g10code.de>
1551
1552         * version.c: Include "assuan.h".
1553         (do_subsystem_inits): Call assuan_set_assuan_err_source.
1554
1555 2006-12-01  Marcus Brinkmann  <marcus@g10code.de>
1556
1557         * Makefile.am (libgpgme_real_la_SOURCES): Rename to main_sources.
1558         (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1559         libgpgme_glib_la_SOURCES, libgpgme_pth_la_SOURCES): Add
1560         $(main_sources).
1561         (libgpgme_la_DEPENDENCIES, libgpgme_la_LIBADD,
1562         libgpgme_pthread_la_DEPENDENCIES, libgpgme_pthread_la_LIBADD,
1563         libgpgme_pth_la_DEPENDENCIES, libgpgme_pth_la_LIBADD,
1564         libgpgme_glib_la_DEPENDENCIES, libgpgme_glib_la_LIBADD): Remove
1565         libgpgme-real.la.
1566         (noinst_LTLIBRARIES): Removed.
1567         (libgpgme_glib_la_CFLAGS, libgpgme_pth_la_CFLAGS): Removed.
1568         (AM_CFLAGS): New variable.
1569
1570 2006-11-30  Marcus Brinkmann  <marcus@g10code.de>
1571
1572         * engine-gpgsm.c: Replace AssuanError with gpg_error_t and
1573         ASSUAN_CONTEXT with assuan_context_t.
1574
1575 2006-11-29  Marcus Brinkmann  <marcus@g10code.de>
1576
1577         * engine-gpgsm.c (gpgsm_new): Check return value of
1578         assuan_pipe_connect.
1579
1580         * rungpg.c: Include <unistd.h>.
1581         (gpg_new): Support --display, --ttyname, --ttytype, --lc-ctype and
1582         --lc-messages.  Fixes issue 734.
1583
1584 2006-10-24  Marcus Brinkmann  <marcus@g10code.de>
1585
1586         * trustlist.c (gpgme_op_trustlist_next): Return error if OPD is
1587         NULL.
1588
1589 2006-10-23  Marcus Brinkmann  <marcus@g10code.de>
1590
1591         * wait-global.c (gpgme_wait): Unlock CTX_LIST_LOCK while calling
1592         _gpgme_engine_io_event().
1593
1594         * keylist.c (gpgme_op_keylist_next): Return error if OPD is NULL.
1595
1596 2006-09-25  Marcus Brinkmann  <marcus@g10code.de>
1597
1598         * data-mem.c (gpgme_data_release_and_get_mem): Release the data
1599         object properly.
1600
1601 2006-09-22  Marcus Brinkmann  <marcus@g10code.de>
1602
1603         * keylist.c (keylist_colon_handler): Move debug output after
1604         initialising KEY.
1605
1606 2006-07-29  Marcus Brinkmann  <marcus@g10code.de>
1607
1608         * gpgme-config.in (Options): Add NETLIBS.
1609         * Makefile.am (libgpgme_la_LIBADD, libgpgme_pthread_la_LIBADD,
1610         libgpgme_pth_la_LIBADD, libgpgme_glib_la_LIBADD): Add NETLIBS.
1611
1612         * rungpg.c (read_status): Fix comparison disguising as an
1613         assignment.
1614
1615 2005-03-24  Marcus Brinkmann  <marcus@g10code.de>
1616
1617         * gpgme.c (gpgme_set_locale): Remove conditional on
1618         HAVE_W32_SYSTEM, and just check for LC_MESSAGES.
1619
1620 2006-07-16  Marcus Brinkmann  <marcus@g10code.de>
1621
1622         * rungpg.c (read_status): Strip potential carriage return.
1623         * genkey.c (get_key_parameter): Skip potential carriage return.
1624         * version.c (_gpgme_get_program_version): Strip potential carriage
1625         return.
1626
1627         * data.c (gpgme_data_set_file_name): Allow to clear the file name
1628         by passing NULL.
1629
1630 2006-06-22  Marcus Brinkmann  <marcus@g10code.de>
1631
1632         * keylist.c (gpgme_get_key): Also clone the engine info.
1633
1634 2006-03-06  Marcus Brinkmann  <marcus@g10code.de>
1635
1636         * gpgme-config.in (cflags_pth): Revert accidential removal of
1637         pthread support with last change.
1638
1639 2006-02-28  Marcus Brinkmann  <marcus@g10code.de>
1640
1641         * w32-glib-io.c (O_BINARY) [!O_BINARY]: New macro.
1642         (_gpgme_io_pipe): Open pipes in binary mode.
1643
1644 2006-02-22  Marcus Brinkmann  <marcus@g10code.de>
1645
1646         * engine.c (gpgme_engine_check_version): Reimplemented to allow
1647         checking the version correctly even after changing the engine
1648         information.  Bug reported by Stéphane Corthésy.
1649
1650         * rungpg.c (read_colon_line): Invoke colon preprocess handler if
1651         it is set.
1652         (colon_preprocessor_t): New type.
1653         (struct engine_gpg): New member colon.preprocess_fnc.
1654         (gpg_keylist_preprocess): New function.
1655         * keylist.c (keylist_colon_handler): Allow short key IDs.
1656
1657 2006-02-15  Marcus Brinkmann  <marcus@g10code.de>
1658
1659         * w32-io.c (create_writer): Make C->have_data a manually resetted
1660         event.
1661         (writer): Move code from end of if block to beginning, so it
1662         is also run the first time.
1663         (_gpgme_io_write): Move assert check after error check.  Reset
1664         the is_empty event, and also do it eagerly.
1665         (_gpgme_io_select): Unconditionally wait for the is_empty event.
1666
1667 2006-01-26  Werner Koch  <wk@g10code.com>
1668
1669         * w32-util.c (_gpgme_get_conf_int): New.
1670         * posix-util.c (_gpgme_get_conf_int): New.
1671         * w32-io.c (get_desired_thread_priority): New.
1672         (create_reader, create_writer): Use it here.
1673
1674 2006-01-04  Werner Koch  <wk@g10code.com>
1675
1676         * debug.h (_gpgme_debug_srcname): New. Use it with the debug macros.
1677
1678         * w32-glib-io.c (_gpgme_io_set_nonblocking): Add debug
1679         statements. Disable error return for failed nonblocking call.
1680
1681 2006-01-03  Marcus Brinkmann  <marcus@g10code.de>
1682
1683         * w32-glib-io.c (_gpgme_io_close): Only close fd if there is no
1684         channel for it.
1685
1686 2005-12-31  Marcus Brinkmann  <marcus@g10code.de>
1687
1688         * w32-glib-io.c (find_channel): Set channel to unbuffered.
1689         (_gpgme_io_select): Fix debug output.
1690
1691 2005-12-23  Werner Koch  <wk@g10code.com>
1692
1693         * gpgme.h (struct _gpgme_signature): Append field PKA_ADDRESS.
1694         * verify.c (release_op_data, _gpgme_verify_status_handler): Set
1695         this field.
1696
1697 2005-12-20  Werner Koch  <wk@g10code.com>
1698
1699         * gpgme.h (gpgme_status_code_t): Added GPGME_STATUS_PKA_TRUST_BAD
1700         and GPGME_STATUS_PKA_TRUST_GOOD.
1701         (struct _gpgme_signature): New field pka_trust.
1702         * verify.c (_gpgme_verify_status_handler): Set pka_trust.
1703
1704 2005-12-06  Werner Koch  <wk@g10code.com>
1705
1706         * keylist.c (keylist_colon_handler): Store fingerprints of the
1707         subkeys.  Reset the secret flag of subkeys for stub secret keys.
1708         (NR_FIELDS): Bumped up to 16
1709
1710 2005-11-27  Marcus Brinkmann  <marcus@g10code.de>
1711
1712         * engine.c (_gpgme_set_engine_info): Use new_file_name in
1713         engine_get_version invocation.  Reported by Stéphane Corthésy.
1714
1715 2005-11-24  Marcus Brinkmann  <marcus@g10code.de>
1716
1717         * w32-glib-io.c (_gpgme_io_fd2str): Remove debug printf.
1718
1719 2005-11-18  Werner Koch  <wk@g10code.com>
1720
1721         * w32-glib-io.c: Include glib.h before windows to avoid a symbol
1722         shadowing warning.
1723         (find_channel): Better use g_io_channel_win32_new_fd instead of
1724         the autodetection function g_io_channel_unix_new.
1725         (_gpgme_io_select): Rewritten.  It is now a fully working select
1726         implementation.
1727
1728 2005-11-18  Marcus Brinkmann  <marcus@g10code.de>
1729
1730         * priv-io.h (_gpgme_io_fd2str): New prototype.
1731         * posix-io.c (_gpgme_io_fd2str): New function.
1732         * w32-io.c (_gpgme_io_fd2str): New function.
1733         * rungpg.c: Use this new function.
1734         * w32-glib-io.c (_gpgme_io_fd2str): Rewrote the file handle code
1735         again.  Two's company, three's the musketeers.
1736
1737         * w32-glib-io.c: Rewrote the file handle code.  We don't create
1738         system fds for every handle (doesn't work for inherited handles),
1739         but we create pseudo fds in a private namespace that designate a
1740         handle and potentially a giochannel.
1741
1742 2005-11-18  Werner Koch  <wk@g10code.com>
1743
1744         * versioninfo.rc.in: Set file version to LT-version + Svn-revision.
1745
1746 2005-11-17  Marcus Brinkmann  <marcus@g10code.de>
1747
1748         * w32-glib-io.c: New file.
1749         * gpgme.def (gpgme_get_giochannel): Add symbol.
1750         * Makefile.am (system_components) [HAVE_DOSISH_SYSTEM]: Remove
1751         w32-io.c.
1752         (ltlib_gpgme_extra): New variable.
1753         (lib_LTLIBRARIES): Add $(ltlib_gpgme_extra).
1754         (system_components_not_extra): New variable.
1755         (libgpgme_la_SOURCES, libgpgme_pthread_la_SOURCES,
1756         (libgpgme_pth_la_SOURCES): Add $(system_components_not_extra).
1757         (libgpgme_glib_la_LDFLAGS, libgpgme_glib_la_DEPENDENCIES,
1758         (libgpgme_glib_la_LIBADD, libgpgme_glib_la_CFLAGS)
1759         [BUILD_W32_GLIB]: New variables. 
1760         * gpgme-config.in (glib): New option.
1761         * gpgme.m4 (AM_PATH_GPGME_GLIB): New macro.
1762
1763 2005-11-17  Marcus Brinkmann  <marcus@g10code.de>
1764
1765         * priv-io.h (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1766         * w32-io.c (_gpgme_io_waitpid, _gpgme_io_kill): Removed.
1767         * posix-io.c (_gpgme_io_kill): Removed.
1768         (_gpgme_io_waitpid): Declare static.
1769
1770 2005-10-24  Marcus Brinkmann  <marcus@g10code.de>
1771
1772         * w32-io.c (_gpgme_io_spawn): Don't minimize window, hide it.
1773
1774 2005-10-21  Werner Koch  <wk@g10code.com>
1775
1776         * Makefile.am: Fixed cut+paste problem
1777
1778 2005-10-20  Marcus Brinkmann  <marcus@g10code.de>
1779
1780         * Makefile.am: Build versioninfo.lo, not versioninfo.o.  Also, fix
1781         the whole mess.
1782
1783 2005-10-16  Marcus Brinkmann  <marcus@g10code.de>
1784
1785         * rungpg.c (gpg_edit): Don't add a key argument if in card edit
1786         mode.
1787
1788 2005-10-06  Marcus Brinkmann  <marcus@g10code.de>
1789
1790         * Makefile.am (gpgme.dll gpgme.dll.a): Use $(srcdir) for
1791         gpgme.def.
1792
1793         * gpgme.h (gpgme_free): New prototype.
1794         * data-mem.c (gpgme_free): New function.
1795         * libgpgme.vers (GPGME_1.1): Add gpgme_free.
1796         * gpgme.def: Add gpgme_free.
1797
1798 2005-10-02  Marcus Brinkmann  <marcus@g10code.de>
1799
1800         * util.h (_gpgme_decode_percent_string): Add new argument BINARY
1801         to prototype.
1802         * verify.c (parse_notation): Likewise for invocation.
1803         * conversion.c (_gpgme_decode_percent_string): Likewise to
1804         declaration.  If set, do not replace '\0' characters with a
1805         printable string.
1806         * gpgme.h (struct _gpgme_key_sig): New field notations.
1807         * ops.h (_gpgme_parse_notation): New prototype.
1808         * sig-notation.c (_gpgme_parse_notation): New function.
1809         * key.c (gpgme_key_unref): Free all signature notations.
1810         * keylist.c (op_data_t): New member tmp_keysig.
1811         (finish_key): Clear OPD->tmp_keysig.
1812         * gpgme.c (gpgme_set_keylist_mode): Remove check.
1813         * rungpg.c (gpg_keylist): Support listing signature notations.
1814         (gpg_keylist_ext): Likewise.
1815
1816 2005-10-01  Marcus Brinkmann  <marcus@g10code.de>
1817
1818         * engine.h (_gpgme_set_engine_info): Add prototype.
1819         * engine-backend.h (struct engine_ops): Change return type of
1820         get_file_name() to const char * to silence gcc warning.
1821         * engine.c (engine_get_file_name): Change return type to const
1822         char * to silence gcc warning.
1823         (gpgme_get_engine_info): Use transitional variable to go from
1824         const char * to char * to silence gcc warning.
1825         (_gpgme_set_engine_info): Likewise.
1826         * engine-gpgsm.c (struct engine_gpgsm): Change type of LINE to
1827         char * to silence gcc warning.
1828         (gpgsm_new): Make ARGV a pointer to const char.
1829         (status_handler): Change type of SRC, END, DST, ALINE and NEWLINE
1830         to char * to silence gcc warning.
1831
1832         * gpgme.def: Add gpgme_data_set_file_name,
1833         gpgme_data_get_file_name, gpgme_sig_notation_clear,
1834         gpgme_sig_notation_add and gpgme_sig_notation_get.
1835         * libgpgme.vers: Add gpgme_sig_notation_clear,
1836         gpgme_sig_notation_add and gpgme_sig_notation_get.
1837         * Makefile.am (libgpgme_real_la_SOURCES): Add sig-notation.c.
1838         * context.h (struct gpgme_context): New field sig_notations.
1839         * gpgme.h (struct _gpgme_sig_notation): New member value_len and
1840         critical.
1841         (GPGME_SIG_NOTATION_CRITICAL): New symbol.
1842         (gpgme_sig_notation_flags_t): New type.
1843         (gpgme_sig_notation_add, gpgme_sig_notation_clear,
1844         gpgme_sig_notation_get): New prototypes.
1845         * ops.h (_gpgme_sig_notation_create, _gpgme_sig_notation_free):
1846         New prototypes.
1847         * sig-notation.c (_gpgme_sig_notation_free): New file.
1848         * verify.c (parse_notation): Use support functions.
1849         (release_op_data): Likewise.
1850         * rungpg.c (append_args_from_sig_notations): New function.
1851         (gpg_encrypt_sign, gpg_sign): Call it.
1852
1853 2005-09-30  Marcus Brinkmann  <marcus@g10code.de>
1854
1855         * data.h (struct gpgme_data): New member file_name.
1856         * data.c (gpgme_data_set_filename): New function.
1857         (_gpgme_data_release): Free DH->filename if necessary.
1858         (gpgme_data_get_filename): New function.
1859         * rungpg.c (gpg_encrypt): Set filename option.
1860         (gpg_encrypt_sign): Likewise.
1861         (gpg_sign): Likewise.
1862         * libgpgme.vers (GPGME_1.1): Add gpgme_data_set_file_name and
1863         gpgme_data_get_file_name.
1864
1865         * decrpyt.c, verify.c, gpgme.h: Replace plaintext_filename with
1866         file_name.
1867
1868 2005-09-29  Marcus Brinkmann  <marcus@g10code.de>
1869
1870         * gpgme.h (struct _gpgme_key): Add field is_qualified.
1871         (struct _gpgme_subkey): Likewise.
1872         * keylist.c (set_subkey_capability, set_mainkey_capability): Set
1873         field is_qualified.
1874
1875 2005-09-23  Werner Koch  <wk@g10code.com>
1876
1877         * w32-io.c (_gpgme_io_pipe): Removed use of environment variable
1878         again.
1879         (create_reader, create_writer): Set thread priority higher.
1880
1881 2005-09-19  Werner Koch  <wk@g10code.com>
1882
1883         * w32-io.c (_gpgme_io_pipe): New environment variable to change
1884         the size of the pipe buffer.
1885
1886 2005-09-13  Werner Koch  <wk@g10code.com>
1887
1888         * ath.c: Changes to make it work under W32.
1889
1890 2005-09-12  Marcus Brinkmann  <marcus@g10code.de>
1891
1892         * Makefile.am (libgpgme_la_SOURCES): Set to ath.h and ath.c.
1893         (ath_pth_src, ath_pthread_src): Removed.
1894         (w32_o_files): Replace ath-compat.o with ath.o.
1895         (libgpgme_pth_la_CFLAGS): New variable.
1896         * ath-compat.c, ath-pthread-compat.c, ath-pth-compat.c: Removed.
1897         * ath.h (ath_pthread_available, ath_pth_available): Removed.
1898         (ath_init) [!_ATH_EXT_SYM_PREFIX]: Do not define macro.
1899         (struct ath_ops, ath_init) [_ATH_COMPAT]: Removed.
1900         (_ATH_COMPAT): Macro removed.
1901         * posix-sema.c (_gpgme_sema_subsystem_init): Do not call
1902         _gpgme_ath_init.
1903
1904 2005-09-12  Marcus Brinkmann  <marcus@g10code.de>
1905
1906         * keylist.c (release_op_data): Do not free opd->tmp_uid.
1907
1908 2005-09-07  Werner Koch  <wk@g10code.com>
1909
1910         * w32-io.c (build_commandline): Quote argv[0].
1911
1912 2005-08-26  Marcus Brinkmann  <marcus@g10code.de>
1913
1914         * rungpg.c (command_handler): Use _gpgme_io_write instead of write.
1915
1916         * edit.c (command_handler): Do not depend on PROCESSED being
1917         available.
1918
1919         * engine.h (engine_command_handler_t): Add new argument processed.
1920         * ops.h (_gpgme_passphrase_command_handler_internal): Rename
1921         prototype to ...
1922         (_gpgme_passphrase_command_handler): ... this one.
1923         * passphrase.c (_gpgme_passphrase_command_handler_internal):
1924         Rename to ...
1925         (_gpgme_passphrase_command_handler): ... this one.
1926         * edit.c (command_handler): Add new argument processed.  Remove
1927         local variable with the same name.  Always return processed as
1928         true.
1929         * rungpg.c (command_handler): Send a newline character if the
1930         handler did not.
1931
1932 2005-08-26  Werner Koch  <wk@g10code.com>
1933
1934         * w32-util.c (read_w32_registry_string): Updated from code used by
1935         GnuPG.  This allows for expanding strings and features the
1936         implicit fallback key.
1937         (w32_shgetfolderpath, find_program_at_standard_place): New.
1938         (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): With no registry
1939         entry, locate the programs at the standard place.
1940         (dlopen, dlsym, dlclose): New, so that we can keep on using what
1941         we are accustomed to.
1942
1943         * debug.c (debug_init): Use PATHSEP_C so that under W32 a
1944         semicolon is used which allows us to create files with drive
1945         letters.
1946
1947         * w32-io.c (_gpgme_io_read, _gpgme_io_write): Print content in
1948         debug mode too.
1949
1950 2005-08-19  Werner Koch  <wk@g10code.com>
1951
1952         * gpgme.def: New.
1953         * versioninfo.rc.in: New.
1954         * Makefile.am: Addes support for building a W32 DLL.
1955         
1956         * ttyname_r.c (ttyname_r) [W32]: Return error.
1957         * ath-compat.c [W32]: select and co are not yet supported; return
1958         error.
1959         * data-stream.c (stream_seek): Use ftell if ftello is not available.
1960
1961 2005-08-08  Werner Koch  <wk@g10code.com>
1962
1963         * util.h (stpcpy): Renamed to ..
1964         (_gpgme_stpcpy): .. this and made inline.  This avoids duplicate
1965         definitions when linking statically.
1966         * stpcpy.c: Removed.
1967         
1968 2005-07-27  Marcus Brinkmann  <marcus@g10code.de>
1969
1970         * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_PLAINTEXT.
1971         (struct _gpgme_op_decrypt_result): New member plaintext_filename.
1972         (struct _gpgme_op_verify_result): Likewise.
1973         * ops.h (_gpgme_parse_plaintext): Add prototype.
1974         * op-support.c (_gpgme_parse_plaintext): New function.
1975         * decrypt.c (release_op_data): Release
1976         OPD->result.plaintext_filename.
1977         (_gpgme_decrypt_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1978         * verify.c (release_op_data): Release
1979         OPD->result.plaintext_filename.
1980         (_gpgme_verify_status_handler): Handle GPGME_STATUS_PLAINTEXT.
1981
1982 2005-07-26  Marcus Brinkmann  <marcus@g10code.de>
1983
1984         * keylist.c (gpgme_get_key): Allow key IDs.
1985
1986 2005-06-20  Marcus Brinkmann  <marcus@g10code.de>
1987
1988         * gpgme.m4: Only call GPGME_CONFIG if found.
1989
1990 2005-06-03  Marcus Brinkmann  <marcus@g10code.de>
1991
1992         * gpgme.h (struct _gpgme_signature): New members pubkey_algo and
1993         hash_algo.
1994         * verify.c (parse_valid_sig): Parse pubkey and hash algo numbers.
1995         (parse_new_sig): Parse pubkey, hash algo and timestamp for ERRSIG.
1996
1997         (_gpgme_decrypt_status_handler): Fix last change.
1998
1999         * gpgme.h (struct _gpgme_recipient): New structure.
2000         (gpgme_recipient_t): New type.
2001         (struct _gpgme_op_decrypt_result): Add member recipients.
2002         * decrypt.c (op_data_t): New member last_recipient_p.
2003         (_gpgme_op_decrypt_init_result): Initialize last_recipient_p.
2004         (parse_enc_to): New function.
2005         (_gpgme_decrypt_status_handler): Handle status ENC_TO and
2006         NO_SECKEY.
2007
2008         * wait-global.c (gpgme_wait): Break out of the fd processing loop
2009         after an error.
2010         Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2011
2012 2005-06-02  Marcus Brinkmann  <marcus@g10code.de>
2013
2014         * wait.h (_gpgme_run_io_cb): New prototype.
2015         * wait.c (_gpgme_run_io_cb): New function.
2016         * wait-global.c (gpgme_wait): Call it.
2017         * wait-user.c (_gpgme_user_io_cb_handler): Likewise.
2018         * wait-private.c (_gpgme_wait_on_condition): Likewise.
2019
2020 2005-06-02  Werner Koch  <wk@g10code.com>
2021
2022         * passphrase.c (_gpgme_passphrase_status_handler): Take care of
2023         GPGME_STATUS_NEED_PASSPHRASE_PIN.
2024         (_gpgme_passphrase_command_handler_internal): Also act on the key
2025         "passphrase.pin.ask".
2026
2027         * gpgme.h: Added status codes GPGME_STATUS_SIG_SUBPACKET,
2028         GPGME_STATUS_NEED_PASSPHRASE_PIN, GPGME_STATUS_SC_OP_FAILURE,
2029         GPGME_STATUS_SC_OP_SUCCESS, GPGME_STATUS_CARDCTRL,
2030         GPGME_STATUS_BACKUP_KEY_CREATED.
2031
2032 2005-05-28  Marcus Brinkmann  <marcus@g10code.de>
2033
2034         * data-user.c: Include <errno.h>.
2035
2036 2005-05-17  Marcus Brinkmann  <marcus@g10code.de>
2037
2038         * gpgme.c (gpgme_new): Set the CTX->include_certs default to the
2039         default.
2040
2041 2005-05-11  Marcus Brinkmann  <marcus@g10code.de>
2042
2043         * w32-io.c (_gpgme_io_select): Fix loop increment.
2044
2045 2005-05-05  Marcus Brinkmann  <marcus@g10code.de>
2046
2047         * data-user.c (user_release): Only call user hook if provided.
2048         (user_seek): Return EBADF if no user hook is provided.
2049         (user_read): Likewise.
2050         (user_write): Likewise.
2051
2052 2005-04-28  Marcus Brinkmann  <marcus@g10code.de>
2053
2054         * gpgme.h (GPGME_INCLUDE_CERTS_DEFAULT): New macro.
2055         * engine-gpgsm.c (gpgsm_sign): Send the include-certs option after
2056         the reset, just for cleanliness, and do not sent it at all if the
2057         default is requested.
2058         * gpgme.c (gpgme_set_include_certs): Allow to use
2059         GPGME_INCLUDE_CERTS_DEFAULT.
2060
2061 2005-04-21  Werner Koch  <wk@g10code.com>
2062
2063         * verify.c (calc_sig_summary): Set the key revoked bit.
2064
2065 2005-04-14  Marcus Brinkmann  <marcus@g10code.de>
2066
2067         * wait-global.c (gpgme_wait): Use LI->ctx when checking a context
2068         in the list, not the user-provided CTX.
2069         Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2070
2071         * wait-global.c (gpgme_wait): If no context is found, and we
2072         should not hang, set *status to 0 and return NULL.
2073         Reported by Igor Belyi <gpgme@katehok.ac93.org>.
2074
2075 2005-03-24  Marcus Brinkmann  <marcus@g10code.de>
2076
2077         * data.h (EOPNOTSUPP) [_WIN32]: Remove definition.
2078         * data.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
2079         (gpgme_data_read, gpgme_data_write, gpgme_data_seek): Return
2080         ENOSYS instead EOPNOTSUPP.
2081         * data-compat.c (EOPNOTSUPP) [HAVE_W32_SYSTEM]: Remove definition.
2082         (gpgme_error_to_errno): Map GPG_ERR_NOT_SUPPORTED
2083         to ENOSYS.
2084
2085 2005-03-24  Marcus Brinkmann  <marcus@g10code.de>
2086
2087         * io.h: Rename to ...
2088         * priv-io.h: ... this.
2089         * Makefile.am (libgpgme_real_la_SOURCES): Change io.h to priv-io.h.
2090         * data.c, engine-gpgsm.c, posix-io.c, rungpg.c, version.c,
2091         w32-io.c, wait-private.c, wait-global.c, wait-user.c, wait.c:
2092         Change all includes of "io.h" to "priv-io.h"
2093         
2094 2005-03-09  Werner Koch  <wk@g10code.com>
2095
2096         * w32-util.c (_gpgme_get_gpg_path, _gpgme_get_gpgsm_path): Do not
2097         cast away type checks.
2098
2099         * io.h [W32]: Do not include stdio.h.  If it is needed do it at
2100         the right place.
2101
2102         * data.h [W32]: Removed kludge for EOPNOTSUP.
2103         * data.c, data-compat.c [W32]: Explicitly test for it here.
2104
2105         Replaced use of _WIN32 by HAVE_W32_SYSTEM except for public header
2106         files.
2107
2108 2005-03-07  Timo Schulz  <twoaday@g10code.de>
2109  
2110         * gpgme.h: [_WIN32] Removed ssize_t typedef.
2111         * ath.h: [_WIN32] Added some (dummy) types.
2112         * io.h: [_WIN32] include stdio.h.
2113         * data.h: [_WIN32] Define EOPNOTSUPP.
2114         * w32-io.c [_WIN32] (_gpgme_io_subsystem_init): New.
2115         * gpgme.c [_WIN32] (gpgme_set_locale): Disabled.
2116
2117 2004-12-12  Marcus Brinkmann  <marcus@g10code.de>
2118
2119         * engine.c (_gpgme_set_engine_info): Fix assertion.
2120
2121 2004-12-11  Marcus Brinkmann  <marcus@g10code.de>
2122
2123         * util.h [HAVE_CONFIG_H && HAVE_TTYNAME_R] (ttyname_r): Define
2124         prototype.
2125         * ttyname_r.c: New file.
2126
2127 2004-12-07  Marcus Brinkmann  <marcus@g10code.de>
2128
2129         * putc_unlocked.c, funopen.c: I just claim copyright on these
2130         files and change their license to LGPL, because they are totally
2131         trivial wrapper functions.
2132         * isascii.c: Change copyright notice to the one from ctype/ctype.h
2133         in the GNU C Library (CVS Head 2004-10-10), where isascii is
2134         defined as a macro doing exactly the same as the function in this
2135         file.
2136         * memrchr.c: Update from the GNU C Library (CVS Head 2001-07-06).
2137         * stpcpy.c: Update from the GNU C Library (CVS Head 2004-10-10).
2138         * ath.c, ath-compat.c, ath.h, ath-pth.c, ath-pth-compat.c,
2139         ath-pthread.c, ath-pthread-compat.c, context.h, conversion.c,
2140         data.c, data-compat.c, data-fd.c, data.h, data-mem.c,
2141         data-stream.c, data-user.c, debug.c, debug.h, decrypt.c,
2142         decrypt-verify.c, delete.c, edit.c, encrypt.c, encrypt-sign.c,
2143         engine-backend.h, engine.c, engine-gpgsm.c, engine.h, error.c,
2144         export.c, genkey.c, get-env.c, gpgme.c, gpgme.h, import.c, io.h,
2145         key.c, keylist.c, mkstatus, Makefile.am, ops.h, op-support.c,
2146         passphrase.c, posix-io.c, posix-sema.c, posix-util.c, progress.c,
2147         rungpg.c, sema.h, sign.c, signers.c, trust-item.c, trustlist.c,
2148         util.h, verify.c, version.c, w32-io.c, w32-sema.c, w32-util.c,
2149         wait.c, wait-global.c, wait.h, wait-private.c, wait-user.c: Change
2150         license to LGPL.
2151
2152 2004-12-07  Marcus Brinkmann  <marcus@g10code.de>
2153
2154         * libgpgme.vers (GPGME_1.1): New version.
2155         * engine-backend.h (struct engine_ops): Add argument FILE_NAME to
2156         member get_version().  Add arguments FILE_NAME and HOME_DIR to
2157         member new().  Change return type of get_file_name and get_version
2158         to char *.
2159         * engine-gpgsm.c (gpgsm_get_version): Change return type to char
2160         pointer.  Do not cache result.
2161         (gpgsm_new): Add file_name and home_dir argument, and use them
2162         instead of the defaults, if set.
2163         * rungpg.c (struct engine_gpg): New member file_name.
2164         (gpg_get_version): Change return type to char pointer, and do not
2165         cache result.
2166         (gpg_release): Free gpg->file_name.
2167         (gpg_new): Take new arguments file_name and home_dir.  Set the
2168         --homedir argument if HOME_DIR is not NULL.  Set gpg->file_name.
2169         (start): Use gpg->file_name instead _gpgme_get_gpg_path, if set.
2170         * engine.h (_gpgme_engine_info_copy, _gpgme_engine_info_release):
2171         New prototypes.
2172         (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
2173         info.
2174         * engine.c: Include <assert.h>.
2175         (gpgme_get_engine_info): Set *INFO within the lock.  Move
2176         ENGINE_INFO and ENGINE_INFO_LOCK to ....
2177         (engine_info, engine_info_lock): ... here.  New static variables.
2178         (engine_get_version): Add file_name argument to
2179         get_version invocation.  Change return type to char pointer.
2180         (gpgme_engine_check_version): Rewritten to free() the return value
2181         of engine_get_version after using it.
2182         (_gpgme_engine_info_release): New function.
2183         (gpgme_get_engine_info): Rewritten.
2184         (_gpgme_engine_info_copy): New function.
2185         (_gpgme_set_engine_info): New function.
2186         (gpgme_set_engine_info): New function.
2187         (_gpgme_engine_new): Change first argument to gpgme_engine_info_t
2188         info, and use that.
2189         * gpgme.h (struct _gpgme_engine_info): Change type of file_name
2190         and version to char * (remove the const).  New member home_dir.
2191         (gpgme_set_engine_info, gpgme_ctx_get_engine_info,
2192         gpgme_ctx_set_engine_info): New prototypes.
2193         * context.h (struct gpgme_context): New member engine_info.
2194         * gpgme.c (gpgme_new): Allocate CTX->engine_info.
2195         (gpgme_release): Deallocate CTX->engine_info.
2196         (gpgme_ctx_get_engine_info, gpgme_ctx_set_engine_info): New
2197         functions.
2198         * op-support.c (_gpgme_op_reset): Look for correct engine info and
2199         pass it to _gpgme_engine_new.
2200         * version.c (gpgme_check_version): Adjust to
2201         _gpgme_compare_versions returning an int.
2202         (_gpgme_compare_versions): Return an int value, not a const char
2203         pointer.
2204         * ops.h (_gpgme_compare_versions): Same for prototype.
2205
2206 2004-10-03  Marcus Brinkmann  <marcus@g10code.de>
2207
2208         * verify.c (parse_trust): If no reason is provided, set
2209         SIG->validity_reason to 0.
2210         (calc_sig_summary): Set GPGME_SIGSUM_CRL_TOO_OLD if appropriate.
2211
2212 2004-10-22  Marcus Brinkmann  <marcus@g10code.de>
2213
2214         * engine-gpgsm.c (map_assuan_error): Return 0 if ERR is 0.
2215         (start): Call map_assuan_error on return value of
2216         assuan_write_line.
2217
2218 2004-10-05  Marcus Brinkmann  <marcus@g10code.de>
2219
2220         * op-support.c (_gpgme_op_data_lookup): Use char pointer for
2221         pointer arithmetic.
2222
2223 2004-09-30  Marcus Brinkmann  <marcus@g10code.de>
2224
2225         * gpgme.m4: Implement the --api-version check.
2226
2227         * rungpg.c (read_status): Move the polling of the output data pipe
2228         to just before removing the command fd, from just before adding
2229         it.  This avoids buffering problems.
2230
2231         * data.c (_gpgme_data_inbound_handler): Use _gpgme_io_read, not
2232         read, to improve debug output.
2233
2234 2004-09-29  Marcus Brinkmann  <marcus@g10code.de>
2235
2236         * gpgme.h (GPGME_IMPORT_NEW, GPGME_IMPORT_UID, GPGME_IMPORT_SIG,
2237         GPGME_IMPORT_SUBKEY, GPGME_IMPORT_SECRET,
2238         (GPGME_KEYLIST_MODE_LOCAL, GPGME_KEYLIST_MODERN_EXTERN,
2239         GPGME_KEYLIST_MODE_SIGS, GPGME_KEYLIST_MODE_VALIDATE): Change from
2240         enum to macros.
2241         (gpgme_keylist_mode_t): Define as unsigned int.
2242         (gpgme_key_t): Change type of keylist_mode to
2243         gpgme_keylist_mode_t.
2244
2245 2004-09-23  Marcus Brinkmann  <marcus@g10code.de>
2246
2247         * data.c (_gpgme_data_outbound_handler): Close the file descriptor
2248         if we get an EPIPE.
2249         
2250         * data-stream.c (stream_seek): Call ftello and return the current
2251         offset.
2252         * data.h (struct gpgme_data): Change type of data.mem.offset to
2253         off_t.
2254         * data.c (gpgme_data_seek): Check dh->cbs->seek callback, not read
2255         callback.  If SEEK_CUR, adjust the offset by the pending buffer
2256         size.  Clear pending buffer on success.
2257
2258
2259 2004-09-14  Marcus Brinkmann  <marcus@g10code.de>
2260
2261         * gpgme.m4: Add copyright notice.
2262
2263 2004-08-18  Marcus Brinkmann  <marcus@g10code.de>
2264
2265         * passphrase.c (_gpgme_passphrase_status_handler): Always run the
2266         status handler.
2267
2268 2004-08-17  Marcus Brinkmann  <marcus@g10code.de>
2269
2270         * rungpg.c (build_argv): Use --no-sk-comment, not --no-comment.
2271
2272 2004-06-23  Marcus Brinkmann  <marcus@g10code.de>
2273
2274         * key.c (_gpgme_key_append_name): Make sure tail points to the
2275         byte following the uid.
2276         (_gpgme_key_add_sig): Likewise.  Don't use calloc, but malloc and
2277         memset.
2278
2279 2004-06-02  Marcus Brinkmann  <marcus@g10code.de>
2280
2281         * libgpgme.vers: Remove C-style comment, which is not supported by
2282         older binutils.
2283
2284 2004-05-21  Marcus Brinkmann  <marcus@g10code.de>
2285
2286         * gpgme-config.in (Options): Support --api-version.
2287
2288         * libgpgme.vers: List all gpgme symbols under version GPGME_1.0.
2289
2290         * decrypt.c (_gpgme_decrypt_status_handler): Fix last change.
2291         * verify.c (parse_error): Likewise.
2292
2293         * verify.c (parse_error): Do not skip location of where token.
2294
2295         * gpgme.h (gpgme_status_code_t): Add GPGME_STATUS_REVKEYSIG.
2296         * verify.c (_gpgme_verify_status_handler): Add handling of
2297         GPGME_STATUS_REVKEYSIG.
2298         (parse_trust): Likewise.
2299
2300 2004-05-21  Marcus Brinkmann  <marcus@g10code.de>
2301
2302         * gpgme.h (struct _gpgme_decrypt_result): New fields
2303         wrong_key_usage and _unused.
2304         * decrypt.c (_gpgme_decrypt_status_handler): Don't skip over
2305         character after a matched string, as in a protocol error this
2306         could skip over the trailing binary zero.
2307         Handle decrypt.keyusage error notifications.
2308
2309         * gpgme.h (struct _gpgme_key): New member keylist_mode.
2310         * keylist.c (keylist_colon_handler): Set the keylist_mode of KEY.
2311
2312 2004-04-29  Marcus Brinkmann  <marcus@g10code.de>
2313
2314         * gpgme.h (struct _gpgme_signature): Change member WRONG_KEY_USAGE
2315         to unsigned int.  Same for member _unused.
2316
2317         * keylist.c (set_mainkey_trust_info): Rewritten.
2318         (set_subkey_capability): Handle 'd' (disabled).
2319         (set_mainkey_capability): Rewritten.
2320
2321 2004-04-22  Marcus Brinkmann  <marcus@g10code.de>
2322
2323         * gpgme.m4: Quote first argument to AC_DEFUN.
2324
2325 2004-04-21  Werner Koch  <wk@gnupg.org>
2326
2327         * key.c (gpgme_key_unref): Allow passing NULL like free does.
2328         The rule of least surprise.
2329
2330 2004-04-15  Werner Koch  <wk@gnupg.org>
2331
2332         * verify.c (prepare_new_sig, _gpgme_verify_status_handler): Remove
2333         unused result.signatures items.
2334
2335         * keylist.c (gpgme_get_key): Return an error if FPR is NULL.
2336
2337 2004-04-08  Werner Koch  <wk@gnupg.org>
2338
2339         * verify.c (_gpgme_verify_status_handler): Ignore the error status
2340         if we can't process it.
2341         * decrypt-verify.c (decrypt_verify_status_handler): Backed out
2342         yesterday's hack.  It is not any longer required.
2343
2344 2004-04-07  Werner Koch  <wk@gnupg.org>
2345
2346         * decrypt-verify.c (decrypt_verify_status_handler): Hack to cope
2347         with meaningless error codes from the verify status function.
2348
2349 2004-04-05  Werner Koch  <wk@gnupg.org>
2350
2351         * gpgme.h: Add GPGME_STATUS_NEWSIG.
2352
2353         * verify.c (parse_error): Compare only the last part of the where
2354         token.
2355         (prepare_new_sig): New.
2356         (parse_new_sig): Use prepare_new_sig when required.
2357         (_gpgme_verify_status_handler): Handle STATUS_NEWSIG.
2358
2359         * engine-gpgsm.c (gpgsm_keylist_ext): Send with-validation
2360         option.  Fixed pattern construction.
2361         (status_handler): Add debugging output.
2362
2363 2004-03-23  Marcus Brinkmann  <marcus@g10code.de>
2364
2365         * engine-gpgsm.c (gpgsm_new): Protect _only_ tty related code with
2366         isatty().  Submitted by Bernhard Herzog.
2367
2368 2004-03-11  Marcus Brinkmann  <marcus@g10code.de>
2369
2370         * engine-gpgsm.c (gpgsm_new): Protect all tty related code with
2371         isatty().
2372
2373         * rungpg.c (gpg_cancel): Set GPG->fd_data_map to NULL after
2374         releasing it.
2375         * engine-gpgsm.c (gpgsm_cancel): Only call assuan_disconnect if
2376         GPGSM->assuan_ctx is not NULL.  Set it to NULL afterwards.
2377
2378 2004-03-07  Marcus Brinkmann  <marcus@g10code.de>
2379
2380         * gpgme-config.in: Do not emit include and lib directory for
2381         prefix "/usr" or "".
2382
2383 2004-03-03  Werner Koch  <wk@gnupg.org>
2384
2385         * engine-gpgsm.c (gpgsm_export_ext): Properly insert a space
2386         beween patterns.
2387
2388 2004-02-18  Werner Koch  <wk@gnupg.org>
2389
2390         * gpgme-config.in: Ignore setting of --prefix.
2391
2392 2004-02-25  Marcus Brinkmann  <marcus@g10code.de>
2393
2394         * rungpg.c (gpg_cancel): New function.
2395         (gpg_release): Call it here.
2396         (_gpgme_engine_ops_gpg): Add it here.
2397         * engine-gpgsm.c (gpgsm_cancel): Fix last change.
2398
2399 2004-02-24  Marcus Brinkmann  <marcus@g10code.de>
2400
2401         * gpgme.c (gpgme_cancel): New function.
2402         * engine-backend.h (struct engine_ops): New member cancel.
2403         * engine.h (_gpgme_engine_cancel): New prototype.
2404         * engine.c (_gpgme_engine_cancel): New function.
2405         * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Add new member cancel.
2406         (gpgsm_cancel): New function.
2407         (gpgsm_release): Use it.
2408         * rungpg.c (_gpgme_engine_ops_gpg): Add new member cancel.
2409
2410 2004-02-17  Werner Koch  <wk@gnupg.org>
2411
2412         * gpgme.h: Add GPGME_KEYLIST_MODE_VALIDATE. 
2413         * engine-gpgsm.c (gpgsm_keylist): Send this to gpgsm.
2414
2415 2004-02-15  Werner Koch  <wk@gnupg.org>
2416
2417         * memrchr.c (memrchr): Fixed implementation.  Problem pointed out
2418         by Adriaan de Groot.
2419
2420 2004-02-01  Marcus Brinkmann  <marcus@g10code.de>
2421
2422         * rungpg.c (build_argv): Use --no-comment, not --comment "".
2423
2424         * data-compat.c (gpgme_data_new_from_filepart): Call fseeko if
2425         available.
2426         * data-stream.c (stream_seek): Likewise.
2427
2428 2004-01-16  Werner Koch  <wk@gnupg.org>
2429
2430         * conversion.c (_gpgme_map_gnupg_error): Handle numerical codes as
2431         used by GnuPG 1.9.x
2432
2433 2004-01-13  Marcus Brinkmann  <marcus@g10code.de>
2434
2435         * gpgme.h (struct _gpgme_key_sig): Fix comment on REVOKED.
2436
2437 2004-01-12  Werner Koch  <wk@gnupg.org>
2438
2439         * sign.c: Include util.h for prototype of _gpgme_parse_timestamp.
2440
2441 2003-12-25  Marcus Brinkmann  <marcus@g10code.de>
2442
2443         * gpgme.h (_GPGME_D_CLASS): Revert this change.
2444         (struct _gpgme_key_sig): For C++ compilers, rename class
2445         member to _obsolete_class.  Add new member sig_class.
2446         (struct _gpgme_new_signature): Same here.
2447         * key.c (gpgme_key_sig_get_ulong_attr): Use CERTSIG->sig_class,
2448         not CERTSIG->class.
2449         * keylist.c (keylist_colon_handler): Likewise for KEYSIG, but keep
2450         setting KEYSIG->class, too.  Rename variable CLASS to SIG_CLASS.
2451         * sign.c (parse_sig_created): Set SIG->sig_class.
2452
2453 2003-12-22  Werner Koch  <wk@gnupg.org>
2454
2455         * gpgme.h (_GPGME_D_CLASS): Kludge for C++ compatibility without
2456         changing the C API.
2457
2458 2003-11-19  Werner Koch  <wk@gnupg.org>
2459
2460         * conversion.c (_gpgme_parse_timestamp): New.
2461         (atoi_1, atoi_2, atoi_4): New.
2462         * keylist.c (parse_timestamp): Removed. Changed all callers to use
2463         the new function.
2464         * verify.c (parse_valid_sig): Ditto.  Repalced the errno check.
2465         * sign.c (parse_sig_created): Ditto.
2466
2467 2003-10-31  Werner Koch  <wk@gnupg.org>
2468
2469         * keylist.c (parse_timestamp): Detect ISO 8601 timestamps and try
2470         to convert them.
2471
2472 2003-10-10  Marcus Brinkmann  <marcus@g10code.de>
2473
2474         * genkey.c (get_key_parameter): Make a copy of the key parameters.
2475         Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
2476
2477 2003-10-06  Marcus Brinkmann  <marcus@g10code.de>
2478
2479         * data-compat.c: Include <sys/time.h> before <sys/stat.h> for
2480         broken systems.
2481
2482         * engine-gpgsm.c (map_assuan_error): If ERR is -1, return sensible
2483         error.
2484
2485         * io.h (_gpgme_io_subsystem_init): New prototype.
2486         * posix-io.c (_gpgme_io_subsystem_init): Add function.
2487         (_gpgme_io_spawn): Do not fixup signal handler here.
2488         * version.c (do_subsystem_inits): Call _gpgme_io_subsystem_init.
2489
2490         * debug.c (debug_init): Drop const qualifier from E.
2491
2492         * ath.h (struct ath_ops): Make ADDR argument of CONNECT prototype
2493         const.
2494         (ath_connect): Make ADDR argument const.
2495         * ath-pthread.c (ath_connect): Likewise.
2496         * ath-pth.c (ath_connect): Likewise.
2497         * ath-compat.c (ath_connect): Likewise.
2498         * ath.c (ath_connect): Likewise.
2499
2500         * ath.h [HAVE_SYS_SELECT_H]: Include <sys/select.h> for fd_set.
2501         [!HAVE_SYS_SELECT_H]: Include <sys/time.h>.
2502
2503         * conversion.c (_gpgme_hextobyte): Drop "unsigned" from type of
2504         SRC argument.
2505         * util.h (_gpgme_hextobyte): Likewise for prototype.
2506
2507         * gpgme.h: Remove trailing comma in enum.
2508
2509         * rungpg.c: Do not include <time.h>, <sys/time.h>, <sys/types.h>,
2510         <signal.h>, <fcntl.h>, or "unistd.h".
2511
2512 2003-10-02  Marcus Brinkmann  <marcus@g10code.de>
2513
2514         * engine-backend.h (struct engine_ops): Add argument TYPE.
2515         * engine.c (_gpgme_engine_op_edit): Likewise.
2516         * engine.h: Likewise.
2517         * rungpg.c (gpg_edit): Likewise.  Use it.
2518         * edit.c (edit_start): Likewise.  Pass it on.
2519         (gpgme_op_edit_start, gpgme_op_edit): Likewise.
2520         (gpgme_op_card_edit_start, gpgme_op_card_edit): New functions.
2521
2522 2003-09-30  Marcus Brinkmann  <marcus@g10code.de>
2523
2524         * gpgme.h (gpg_strerror_r): Change prototype to match
2525         gpg_strerror_r change.
2526         * error.c (gpg_strerror_r): Likewise, also update implementation.
2527
2528         * gpgme.c (gpgme_hash_algo_name): Change name of RMD160 to
2529         RIPEMD160, name of TIGER to TIGER192, name of CRC32-RFC1510 to
2530         CRC32RFC1510, and name of CRC24-RFC2440 to CRC24RFC2440.
2531
2532 2003-09-14  Marcus Brinkmann  <marcus@g10code.de>
2533
2534         * gpgme.h: Add prototype for gpgme_set_locale.
2535
2536         * gpgme.h: Define macro _GPGME_INLINE depending on the compiler
2537         characteristics and use that instead __inline__.
2538
2539         * context.h (struct gpgme_context): New members lc_ctype and
2540         lc_messages.
2541         * gpgme.c: Include <locale.h>.
2542         (def_lc_lock, def_lc_ctype, def_lc_messages): New static
2543         variables.
2544         (gpgme_set_locale): New function.
2545         * engine.c (_gpgme_engine_new): Add arguments lc_ctype and
2546         lc_messages.
2547         * engine.h (_gpgme_engine_new): Likewise.
2548         * engine-gpgsm.c (gpgsm_new): Likewise.
2549         * rungpg.c (gpg_new): Likewise.
2550         * engine-backend.h (struct engine_ops): Likewise to NEW.
2551         * op-support.c (_gpgme_op_reset): Likewise to invocation of
2552         _gpgme_engine_new.
2553
2554 2003-09-13  Marcus Brinkmann  <marcus@g10code.de>
2555
2556         * gpgme.h (gpgme_strerror_r): New prototype.
2557         * error.c (gpgme_strerror_r): New function.
2558
2559         * get-env.c: New file.
2560         * util.h (_gpgme_getenv): Add prototype.
2561         * Makefile.am (libgpgme_real_la_SOURCES): Add get-env.c.
2562         * rungpg.c (build_argv): Use _gpgme_getenv.
2563         * debug.c (debug_init): Likewise.
2564         * engine-gpgsm.c (gpgsm_new): Likewise.
2565         (gpgsm_new): Use ttyname_r.
2566         * w32-io.c (_gpgme_io_spawn): Disable debugging for now.
2567
2568 2003-09-03  Marcus Brinkmann  <marcus@g10code.de>
2569
2570         * gpgme-config.in: Use $libdir, not @libdir@, for the echo
2571         command.
2572
2573         * gpgme-config.in: Rewritten.
2574         * gpgme.m4: Rewritten.
2575
2576 2003-08-19  Marcus Brinkmann  <marcus@g10code.de>
2577
2578         The ath files (ath.h, ath.c, ath-pth.c, ath-pthread.c,
2579         ath-compat.c, ath-pth-compat.c and ath-pthread-compat.c) have been
2580         updated to have better thread support, and the Makefile.am was
2581         changed to reflect that.
2582
2583         * util.h [!HAVE_FOPENCOOKIE]: Remove fopencookie declaration.
2584         * engine-gpgsm.c (gpgsm_assuan_simple_command): Set ERR to return
2585         value of status_fnc.
2586         * rungpg.c (start): Return SAVED_ERRNO, not errno.
2587
2588 2003-08-18  Marcus Brinkmann  <marcus@g10code.de>
2589
2590         * rungpg.c (start): Use saved_errno instead errno.
2591
2592 2003-08-18  Marcus Brinkmann  <marcus@g10code.de>
2593
2594         * funopen.c, putc_unlocked.c, isascii.c, memrchr.c: New files.
2595         * fopencookie.c: File removed.
2596
2597 2003-08-15  Marcus Brinkmann  <marcus@g10code.de>
2598
2599         * gpgme-config.in: Put gpg-error related flags after gpgme's.
2600
2601 2003-08-14  Marcus Brinkmann  <marcus@g10code.de>
2602
2603         * gpgme.h (struct _gpgme_new_signature): Rename member CLASS to
2604         _OBSOLETE_CLASS, add member CLASS with type unsigned int.
2605         * sign.c (parse_sig_created): Also set SIG->_unused_class for
2606         backward compatibility.
2607
2608 2003-08-04  Marcus Brinkmann  <marcus@g10code.de>
2609
2610         * verify.c (parse_new_sig): Fix status parsing case.
2611
2612 2003-07-31  Marcus Brinkmann  <marcus@g10code.de>
2613
2614         * gpgme.h (struct _gpgme_subkey): Add flag CAN_AUTHENTICATE.
2615         Lower _UNUSED to 23 bits.
2616         (struct _gpgme_key): Likewise.
2617         * keylist.c (set_mainkey_capability): Support 'a' and 'A'.
2618         (set_subkey_capability): Support 'a'.
2619
2620         * keylist.c (gpgme_get_key): Check if there is more than one key
2621         listed, and return GPG_ERR_AMBIGUOUS_NAME in that case.
2622
2623         * util.h (_gpgme_decode_c_string): Change type of LEN argument to
2624         size_t.
2625         (_gpgme_decode_percent_string): Likewise.
2626         * conversion.c (_gpgme_decode_c_string): Likewise.
2627         (_gpgme_decode_percent_string): Likewise.
2628         (_gpgme_map_gnupg_error): Change type of I to unsigned int.
2629         * signers.c (gpgme_signers_clear): Likewise.
2630         (gpgme_signers_enum): New unsigned variable SEQNO, set to SEQ.
2631         Use SEQNO instead SEQ.
2632         * wait.c (fd_table_put): Change type of I and J to unsigned int.
2633         * wait-global.c (_gpgme_wait_global_event_cb): Change type of IDX
2634         to unsigned int.
2635         (gpgme_wait): Change type of I and IDX to unsigned int.
2636         * wait-private.c (_gpgme_wait_on_condition): Change type of IDX
2637         and I to unsigned int.
2638         * posix-io.c (_gpgme_io_close): Cast return value of macro DIM to
2639         int to suppress gcc warning.
2640         (_gpgme_io_set_close_notify): Likewise.
2641         (_gpgme_io_select): Change type of I to unsigned int.
2642         * engine.c (gpgme_get_engine_info): Change type of PROTO to
2643         unsigned int.
2644         * wait-user.c (_gpgme_user_io_cb_handler): Change type of IDX and
2645         I to unsigned int.
2646
2647 2003-07-29  Marcus Brinkmann  <marcus@g10code.de>
2648
2649         * decrypt-verify.c (decrypt_verify_status_handler): Expand silly
2650         and wrong expression.
2651         * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2652         * encrypt.c (encrypt_sym_status_handler): Likewise.
2653         * sign.c (sign_status_handler): Likewise.
2654         * verify.c (verify_status_handler): Likewise.
2655         * decrypt.c (decrypt_status_handler): Likewise.
2656
2657         * engine.c (gpgme_get_engine_info): Initialize NULL.
2658
2659 2003-07-23  Marcus Brinkmann  <marcus@g10code.de>
2660
2661         * gpgme-config.in (gpg_error_libs): Quote GPG_ERROR_CFLAGS and
2662         GPG_ERROR_LIBS when setting the corresponding variables.
2663         Reported by Stéphane Corthésy.
2664
2665 2003-07-22  Marcus Brinkmann  <marcus@g10code.de>
2666
2667         * engine-gpgsm.c (set_recipients): Move declaration of NEWLEN to
2668         the beginning of the block.
2669
2670 2003-06-22  Marcus Brinkmann  <marcus@g10code.de>
2671
2672         * data-mem.c (mem_write): Copy original buffer content.
2673
2674 2003-06-22  Marcus Brinkmann  <marcus@g10code.de>
2675
2676         * gpgme.h (gpgme_user_ids_release, gpgme_user_ids_append): Remove
2677         prototypes.
2678
2679 2003-06-06  Marcus Brinkmann  <marcus@g10code.de>
2680
2681         * Makefile.am (AM_CPPFLAGS): Add @GPG_ERROR_CFLAGS@.
2682         * gpgme-config.in (gpg_error_libs, gpg_error_cflags): New variables.
2683         Print them.
2684
2685         * op-support.c (_gpgme_parse_inv_userid): Rename to
2686         _gpgme_parse_inv_recp and change to new datatype.
2687         * ops.h (_gpgme_parse_inv_key): Fix prototype.
2688         * gpgme.h (struct _gpgme_invalid_user_id): Rename to
2689         __gpgme_invalid_key.  Rename field ID to KEY.
2690         (gpgme_invalid_user_id_t): Rename to gpgme_invalid_key_t.
2691         (struct _gpgme_op_encrypt_result): Here, too.
2692         (struct _gpgme_op_sign_result): Likewise.
2693         * encrypt.c (struct op_data): Likewise.
2694         (release_op_data): Likewise.
2695         * sign.c (struct op_data): Likewise.
2696         (release_op_data): Likewise.
2697
2698         * posix-io.c (_gpgme_io_read): Save errno across debug calls.
2699         (_gpgme_io_write): Likewise.
2700         (_gpgme_io_pipe): Likewise.
2701         (_gpgme_io_select): Likewise.
2702
2703         * rungpg.c (struct engine_gpg): Remove arg_error.
2704         (add_arg): Don't set arg_error.
2705         (add_data): Likewise.
2706         (start): Don't check arg_error.
2707         (gpg_new): Check return value of add_arg.
2708         * verify.c (parse_notation): Free allocated memory at error.
2709
2710 2003-06-05  Marcus Brinkmann  <marcus@g10code.de>
2711
2712         Everywhere: Use libgpg-error error codes.
2713
2714         * Makefile.am (EXTRA_DIST): Remove mkerrors.
2715         (BUILT_SOURCES): Remove errors.c.
2716         (MOSTLYCLEANFILES): Likewise.
2717         (libgpgme_la_SOURCES): Likewise.  Add error.c.
2718         (errors.c): Remove target.
2719         * mkerrors: File removed.
2720         * error.c: New file.
2721
2722         * gpgme.h (gpgme_error_t): Change to type gpg_error_t.
2723         (gpgme_err_code_t, gpgme_err_source_t): New types.
2724         (gpgme_err_code, gpgme_err_source, gpgme_error, gpgme_err_make):
2725         New static inline functions.
2726         (gpgme_strsource, gpgme_err_code_from_errno,
2727         gpgme_err_code_to_errno, gpgme_err_make_from_errno,
2728         gpgme_error_from_errno): New prototypes.
2729
2730 2003-05-29  Marcus Brinkmann  <marcus@g10code.de>
2731
2732         * gpgme.h (gpgme_op_export_start): Change second arg to const char *.
2733         (gpgme_op_export): Likewise.
2734         (gpgme_op_export_ext_start): New prototype.
2735         (gpgme_op_export_ext): Likewise.
2736         * engine.h: Likewise for _gpgme_engine_op_export and
2737         _gpgme_engine_op_export_ext.
2738         * engine-backend.h (struct engine_ops): Change second argument of
2739         prototype of export to const char *, and add reserverd int as
2740         third argument.  Add prototype for export_ext.
2741         * engine.c (_gpgme_engine_op_export_ext): New function.
2742         (_gpgme_engine_op_export): Change second argument of prototype of
2743         export to const char *, and add reserverd int as third argument.
2744         * rungpg.c (gpg_export): Change second argument of prototype of
2745         export to const char *, and add reserverd int as third argument.
2746         (gpg_export_ext): New function.
2747         (gpg_keylist_ext): Break loop at error.
2748         (_gpgme_engine_ops_gpg): Add gpg_export_ext.
2749         * engine-gpgsm.c (gpgsm_export): Change second argument of
2750         prototype of export to const char *, and add reserverd int as
2751         third argument.
2752         (gpgsm_export_ext): New function.
2753         (_gpgme_engine_ops_gpgsm): Add gpgsm_export_ext.
2754         * export.c (export_start): Change second argument of prototype of
2755         export to const char *, and add reserverd int as third argument.
2756         (gpgme_op_export_start): Likewise.
2757         (export_ext_start): New function.
2758         (gpgme_op_export_ext_start): Likewise.
2759         (gpgme_op_export_ext): Likewise.
2760
2761         * gpgme.h (gpgme_keylist_mode_t): New type for anonymous enum.
2762         (gpgme_sigsum_t): New type for anonymous enum.
2763
2764         * encrypt-sign.c (encrypt_sign_start): Check for errors earlier,
2765         and return an error if RECP is not set.
2766
2767         * Makefile.am (libgpgme_la_SOURCES): Remove user-id.c.
2768         * user-id.c: Remove file.
2769         * ops.h: Remove prototype for _gpgme_user_ids_all_valid.
2770         * gpgme.h (gpgme_encrypt_flags_t): New type.
2771         (gpgme_op_encrypt_start): Change second parameter to type
2772         gpgme_key_t[], and add third parameter.
2773         (gpgme_op_encrypt): Likewise.
2774         (gpgme_op_encrypt_sign_start): Likewise.
2775         (gpgme_op_encrypt_sign): Likewise.
2776         * encrypt.c (encrypt_start): Likewise.
2777         (gpgme_op_encrypt_start): Likewise.
2778         (gpgme_op_encrypt): Likewise.  Pass flags to engine.
2779         * encrypt-sign.c (encrypt_sign_start): Likewise.
2780         (gpgme_op_encrypt_sign_start): Likewise.
2781         (gpgme_op_encrypt_sign): Likewise.
2782         * engine-backend.h (struct engine_ops): Likewise for prototypes of
2783         encrypt and encrypt_sign.
2784         * engine.h: Likewise for prototypes of _gpgme_engine_op_encrypt
2785         and _gpgme_engine_op_encrypt_sign.
2786         * engine.c (_gpgme_engine_op_encrypt): Likewise.
2787         (_gpgme_engine_op_encrypt_sign): Likewise.
2788         * rungpg.c (gpg_encrypt): Likewise.
2789         (gpg_encrypt_sign): Likewise.
2790         * rungpg.c (gpg_encrypt): Check flags for always trust option.
2791         * engine-gpgsm.c (gpgsm_encrypt): Likewise.
2792         (set_recipients): Rewritten to use keys instead user IDs.
2793         * rungpg.c (append_args_from_recipients): Rewritten to use keys
2794         instead user IDs.
2795         * encrypt.c (_gpgme_encrypt_status_handler): Change errors
2796         returned to GPGME_Invalid_Key and GPGME_General_Error.
2797
2798 2003-05-28  Marcus Brinkmann  <marcus@g10code.de>
2799
2800         * engine-gpgsm.c: Rename GpgsmObject to engine_gpgsm_t.
2801         (struct gpgsm_object_s): Rename to struct engine_gpgsm.
2802         * rungpg.c: Rename GpgObject to engine_gpg_t.
2803         (struct gpg_object_s): Rename to struct engine_gpg.
2804
2805         * context.h (struct gpgme_context): Change EngineObject to
2806         engine_object_t.
2807         (enum ctx_op_data_type): Rename to ctx_op_data_id_t.
2808         (ctx_op_data_t): New type.
2809         (struct gpgme_context): Use it.
2810         * ops.h (_gpgme_op_data_lookup): Use new type name.
2811         * op-support.c (_gpgme_op_data_lookup): Likewise.
2812         * engine.c: Rename EngineObject to engine_t in the file.  Also
2813         EngineStatusHandler to engine_status_handler_t,
2814         EngineCommandHandler to engine_command_handler_t and
2815         EngineColonLineHandler to engine_colon_line_handler.    
2816         * rungpg.c (start): Likewise.
2817         * engine-gpgsm.c: Likewise.
2818         * engine-backend.h (struct engine_ops): Likewise
2819         * engine.h (struct engine_object_s): Rename to struct engine.
2820         (EngineObject): Rename to engine_t.  Also everywhere else in the
2821         file.
2822         (EngineStatusHandler): Rename to engine_status_handler_t.
2823         (EngineColonLineHandler): Rename to engine_colon_line_handler_t.
2824         (EngineCommandHandler): Rename to engine_command_handler_t.
2825
2826         * engine-gpgsm.c (gpgsm_export): Fix bug in last change.
2827
2828         * Makefile.am (libgpgme_la_SOURCES): Remove recipient.c, add
2829         user-id.c.
2830         * gpgme.h (gpgme_recipients_t): Removed.
2831         (gpgme_recipients_new, gpgme_recipients_release,
2832         gpgme_recipients_add_name,
2833         gpgme_recipients_add_name_with_validity, gpgme_recipients_count,
2834         gpgme_recipients_enum_open, gpgme_recipients_enum_read,
2835         gpgme_recipients_enum_close): Removed.
2836         (gpgme_op_encrypt, gpgme_op_encrypt_start, gpgme_op_encrypt_sign,
2837         gpgme_op_encrypt_sign_start, gpgme_op_export_start,
2838         gpgme_op_export): Change second argument to gpgme_user_id_t.
2839         (gpgme_user_ids_release): New prototype.
2840         (gpgme_user_ids_append): Likewise.
2841         * ops.h (_gpgme_recipients_all_valid): Remove.
2842         (_gpgme_user_ids_all_valid): Add.
2843         * context.h (struct gpgme_recipients): Removed.
2844         * user-id.c: New file.
2845         * recipient.c: Removed file.
2846         * rungpg.c (append_args_from_recipients): Change last arg to
2847         gpgme_user_id_t.  Reimplement.
2848         (gpg_encrypt): Change second arg to gpgme_user_id_t.
2849         (gpg_encrypt_sign): Likewise.
2850         (gpg_export): Likewise.  Rewrite user ID list code.
2851         * engine.c (_gpgme_engine_op_encrypt): Change second arg to
2852         gpgme_user_id_t.
2853         (_gpgme_engine_op_encrypt_sign): Likewise.
2854         (_gpgme_engine_op_export): Likewise.
2855         * engine.h (_gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
2856         _gpgme_engine_op_export): Likewise.
2857         * engine-gpgsm.c (set_recipients): Likewise.  Rewrite loop code.
2858         (gpgsm_encrypt): Likewise.
2859         (gpgsm_export): Likewise.
2860         * engine-backend.h (struct engine_ops): Likewise for members
2861         ENCRYPT, ENCRYPT_SIGN and EXPORT.
2862         * export.c (export_start, gpgme_op_export_start, gpgme_op_export):
2863         Likewise.
2864         * encrypt.c (encrypt_start): Likewise.  Don't check for count of
2865         recipients.
2866         (gpgme_op_encrypt_start): Likewise.
2867         (gpgme_op_encrypt): Likewise.
2868         * encrypt-sign.c (encrypt_sign_start): Likewise.
2869         (gpgme_op_encrypt_sign): Likewise.
2870         (gpgme_op_encrypt_sign_start): Likewise.
2871
2872 2003-05-27  Marcus Brinkmann  <marcus@g10code.de>
2873
2874         * gpgme.h (struct _gpgme_op_import_result): Add skipped_new_keys.
2875         * import.c (parse_import_res): Add skipped_new_keys parser.
2876
2877         * op-support.c (_gpgme_parse_inv_userid): Add missing break
2878         statements.
2879         * encrypt.c (gpgme_op_encrypt): Use gpgme_error_t instead of int.
2880
2881 2003-05-27  Marcus Brinkmann  <marcus@g10code.de>
2882
2883         * encrypt.c (gpgme_op_encrypt_result): Use intermediate variable
2884         HOOK to avoid compiler warning.  Don't ask, you don't want to know.
2885         (_gpgme_encrypt_status_handler): Likewise.
2886         (_gpgme_op_encrypt_init_result): Likewise.
2887         * decrypt.c (gpgme_op_decrypt_result): Likewise.
2888         (_gpgme_decrypt_status_handler): Likewise.
2889         (_gpgme_op_decrypt_init_result): Likewise.
2890         * verify.c (gpgme_op_verify_result): Likewise.
2891         (_gpgme_verify_status_handler): Likewise.
2892         (_gpgme_op_verify_init_result): Likewise.
2893         * edit.c (edit_status_handler): Likewise.
2894         (command_handler): Likewise.
2895         (edit_start): Likewise.
2896         * genkey.c (gpgme_op_genkey_result): Likewise.
2897         (genkey_status_handler): Likewise.
2898         (genkey_start): Likewise.
2899         * import.c (gpgme_op_import_result): Likewise.
2900         (import_status_handler): Likewise.
2901         (_gpgme_op_import_start): Likewise.
2902         * trustlist.c (gpgme_op_trustlist_next): Likewise.
2903         (_gpgme_op_trustlist_event_cb): Likewise.
2904         (gpgme_op_trustlist_start): Likewise.
2905         * keylist.c (gpgme_op_keylist_result): Likewise.
2906         (keylist_colon_handler): Likewise.
2907         (keylist_status_handler): Likewise.
2908         (_gpgme_op_keylist_event_cb): Likewise.
2909         (gpgme_op_keylist_start): Likewise.
2910         (gpgme_op_keylist_ext_start): Likewise.
2911         (gpgme_op_keylist_next): Likewise.
2912         * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
2913         (_gpgme_passphrase_command_handler_internal): Likewise.
2914         * sign.c (gpgme_op_sign_result): Likewise.
2915         (_gpgme_sign_status_handler): Likewise.
2916         (_gpgme_op_sign_init_result): Likewise.
2917
2918         * passphrase.c (_gpgme_passphrase_command_handler_internal): Fix
2919         access to pointer type.
2920
2921 2003-05-26  Marcus Brinkmann  <marcus@g10code.de>
2922
2923         * engine.h (EngineCommandHandler): Change last argument to int fd.
2924         * gpgme.h (gpgme_passphrase_cb_t): Rewritten to take parts of the
2925         description and fd.
2926         (gpgme_edit_cb_t): Change last argument to int fd.
2927         * ops.h (_gpgme_passphrase_command_handler_internal): New prototype.
2928         * passphrase.c: Include <assert.h>.
2929         (op_data_t): Rename userid_hint to uid_hint, remove last_pw_handle.
2930         (release_op_data): Check values before calling free.
2931         (_gpgme_passphrase_status_handler): Likewise.
2932         (_gpgme_passphrase_command_handler_internal): New function.
2933         (_gpgme_passphrase_command_handler): Rewritten.
2934         * edit.c (edit_status_handler): Pass -1 as fd argument.
2935         (command_handler): Update prototype.  New variable processed.  Use
2936         it to store return value of
2937         _gpgme_passphrase_command_handler_internal which is now used
2938         instead _gpgme_passphrase_command_handler.  Use it also to check
2939         if we should call the user's edit function.  Pass fd to user's
2940         edit function.
2941         * rungpg.c (struct gpg_object_s): Change type of cmd.cb_data to
2942         void *.
2943         (gpg_release): Check value before calling free.  Do not release
2944         cmd.cb_data.
2945         (command_cb): Function removed.
2946         (command_handler): New function.  Thus we don't use a data object
2947         for command handler stuff anymore, but handle it directly.  This
2948         allows proper error reporting (cancel of passphrase requests, for
2949         example).  Also all callbacks work via direct writes to the file
2950         descriptor (so that passphrases are not kept in insecure memory).
2951         (gpg_set_command_handler): Rewritten to use even more ugly hacks.
2952         (read_status): Check cmd.keyword before calling free.  Install
2953         command_handler as the I/O callback handler with GPG as private
2954         data.
2955
2956         * rungpg.c (gpg_new): Add --enable-progress-filter to gpg
2957         invocation.
2958         * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Rename to
2959         decrypt_verify_start.
2960         (gpgme_op_decrypt_verify_start): Call decrypt_verify_start.
2961         (gpgme_op_decrypt_verify): Likewise.
2962         * verify.c (verify_status_handler): New function that also calls
2963         progress status handler.
2964         (_gpgme_op_verify_start): Set status handler to verify_status_handler.
2965         Rename to (verify_start).
2966         (gpgme_op_verify_start): Call verify_start.
2967         (gpgme_op_verify): Likewise.
2968         * encrypt.c (encrypt_status_handler): New function.
2969         (_gpgme_encrypt_sym_status_handler): Call progress status handler.
2970         Make static.  Rename to encrypt_sym_status_handler.
2971         (encrypt_start): Set status handler to encrypt_sym_status_handler
2972         or encrypt_status_handler.
2973         * sign.c (sign_status_handler): New function.
2974         (sign_start): Set status handler to sign_status_handler.
2975         * decrypt.c (decrypt_status_handler): New function that also calls
2976         progress status handler.
2977         (decrypt_start): Set status handler to decrypt_status_handler.
2978         * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
2979         * decrypt-verify.c (decrypt_verify_status_handler): Call
2980         _gpgme_progress_status_handler.
2981
2982         * conversion.c (_gpgme_decode_c_string): Add missing break
2983         statement.
2984
2985         * recipient.c (gpgme_recipients_add_name_with_validity): Add one
2986         to buffer to allocate.
2987
2988 2003-05-19  Marcus Brinkmann  <marcus@g10code.de>
2989
2990         * verify.c (parse_new_sig): Fix ERRSIG case.
2991         Submitted by Benjamin Lee <benjaminlee@users.sf.net>.
2992
2993 2003-05-18  Marcus Brinkmann  <marcus@g10code.de>
2994
2995         * gpgme.h: The following types are renamed.  The old name is kept
2996         as a deprecated typedef.
2997         (GpgmeCtx): Rename to gpgme_ctx_t.
2998         (GpgmeData): Rename to gpgme_data_t.
2999         (GpgmeRecipients): Rename to gpgme_recipients_t.
3000         (GpgmeError): Rename to gpgme_error_t.
3001         (GpgmeDataEncoding): Rename to gpgme_data_encoding_t.
3002         (GpgmePubKeyAlgo): Rename to gpgme_pubkey_algo_t.
3003         (GpgmeHashAlgo): Rename to gpgme_hash_algo_t.
3004         (GpgmeSigStat): Rename to gpgme_sig_stat_t.
3005         (GpgmeSigMode): Rename to gpgme_sig_mode_t.
3006         (GpgmeAttr): Rename to gpgme_attr_t.
3007         (GpgmeValidity): Rename to gpgme_validity_t.
3008         (GpgmeProtocol): Rename to gpgme_protocol_t.
3009         (GpgmeStatusCode): Rename to gpgme_status_code_t.
3010         (GpgmeEngineInfo): Rename to gpgme_engine_info_t.
3011         (GpgmeSubkey): Rename to gpgme_subkey_t.
3012         (GpgmeKeySig): Rename to gpgme_keysig_t.
3013         (GpgmeUserID): Rename to gpgme_user_id_t.
3014         (GpgmePassphraseCb): Rename to gpgme_passphrase_cb_t.
3015         (GpgmeProgressCb): Rename to gpgme_progress_cb_t.
3016         (GpgmeEditCb): Rename to gpgme_edit_cb_t.
3017         (GpgmeIOCb): Rename to gpgme_io_cb_t.
3018         (GpgmeRegisterIOCb): Rename to gpgme_register_io_cb_t.
3019         (GpgmeRemoveIOCb): Rename to gpgme_remove_io_cb_t.
3020         (GpgmeEventIO): Rename to gpgme_event_io_t.
3021         (GpgmeEventIOCb): Rename to gpgme_event_io_cb_t.
3022         (GpgmeIOCbs): Rename to gpgme_io_cbs.
3023         (gpgme_io_cbs_t): New type.
3024         (GpgmeDataReadCb): Rename to gpgme_data_read_cb_t.
3025         (GpgmeDataWriteCb): Rename to gpgme_data_write_cb_t.
3026         (GpgmeDataSeekCb): Rename to gpgme_data_seek_cb_t.
3027         (GpgmeDataReleaseCb): Rename to gpgme_data_release_cb_t.
3028         (GpgmeDataCbs): Rename to gpgme_data_cbs.
3029         (gpgme_data_cbs_t): New type.
3030         (GpgmeInvalidUserID): Rename to gpgme_invalid_user_id_t.
3031         (GpgmeEncryptResult): Rename to gpgme_encrypt_result_t.
3032         (GpgmeDecryptResult): Rename to gpgme_decrypt_result_t.
3033         (GpgmeNewSignature): Rename to gpgme_new_signature_t.
3034         (GpgmeSignResult): Rename to gpgme_sign_result_t.
3035         (GpgmeSigNotation): Rename to gpgme_sig_notation_t.
3036         (GpgmeSignature): Rename to gpgme_signature_t.
3037         (GpgmeVerifyResult): Rename to gpgme_verify_result_t.
3038         (GpgmeImportStatus): Rename to gpgme_import_status_t.
3039         (GpgmeImportResult): Rename to gpgme_import_result_t.
3040         (GpgmeGenKeyResult): Rename to gpgme_genkey_result_t.
3041         (GpgmeKeyListResult): Rename to gpgme_keylist_result_t.
3042         (GpgmeTrustItem): Rename to gpgme_trust_item_t.
3043         * gpgme.h (gpgme_deprecated_error_t): New type, swallowing macros
3044         GPGME_No_Recipients, GPGME_Invalid_Recipient and
3045         GPGME_No_Passphrase.
3046         * data.h (struct gpgme_data_s): Rename to struct gpgme_data.
3047         * context.h (struct gpgme_context_s): Rename to struct
3048         gpgme_context.
3049         (struct gpgme_recipients_s): Rename to gpgme_recipients.
3050
3051 2003-05-18  Marcus Brinkmann  <marcus@g10code.de>
3052
3053         * keylist.c (finish_key): Clear OPD->tmp_uid.
3054
3055 2003-05-18  Marcus Brinkmann  <marcus@g10code.de>
3056
3057         * verify.c (_gpgme_verify_status_handler): Return GPGME_No_Data
3058         for NODATA status without signatures.
3059
3060 2003-05-05  Marcus Brinkmann  <marcus@g10code.de>
3061
3062         * key.c (_gpgme_key_append_name): Use decoded string to parse user id.
3063         (_gpgme_key_add_sig): Likewise.
3064
3065 2003-05-04  Marcus Brinkmann  <marcus@g10code.de>
3066
3067         * context.h (struct gpgme_context_s): Remove member op_info.
3068
3069         * key.c (_gpgme_key_add_sig): Initialize SIG->uid.
3070
3071         * gpgme.h (GpgmeError): Add deprecated values for
3072         GPGME_Invalid_Type and GPGME_Invalid_Mode.
3073
3074 2003-04-30  Marcus Brinkmann  <marcus@g10code.de>
3075
3076         * gpgme.h (gpgme_get_op_info): Remove prototype.
3077         * ops.h (_gpgme_set_op_info,
3078         _gpgme_data_release_and_return_string, _gpgme_data_get_as_string,
3079         _gpgme_data_append, _gpgme_data_append_string,
3080         _gpgme_data_append_string_for_xml, _gpgme_data_append_for_xml,
3081         _gpgme_data_append_percentstring_for_xml): Likewise.
3082         (_gpgme_progress_status_handler): Change first arg to void *.
3083         * progress.c (_gpgme_progress_status_handler): Likewise.
3084         * conversion.c: Do not include <string.h>, <errno.h>, <ctype.h>,
3085         and <sys/types.h>, but <string.h>.
3086         (_gpgme_data_append): Remove function.
3087         (_gpgme_data_append_string): Likewise.
3088         (_gpgme_data_append_for_xml): Likewise.
3089         (_gpgme_data_append_string_for_xml): Likewise.
3090         (_gpgme_data_append_percentstring_for_xml): Likewise.
3091         * data-mem.c (_gpgme_data_get_as_string): Likewise.
3092         (_gpgme_data_release_and_return_string): Likewise.
3093         * gpgme.c (gpgme_get_op_info): Likewise.
3094         (_gpgme_set_op_info): Likewise.
3095
3096         * gpgme.h (struct _gpgme_key): New structure.
3097         (GpgmeKey): Define using _gpgme_key.
3098         (struct _gpgme_subkey): New structure.
3099         (GpgmeSubKey): New type.
3100         (struct _gpgme_key_sig): New structure.
3101         (GpgmeKeySig): New type.
3102         (struct _gpgme_user_id): New structure.
3103         (GpgmeUserID): New type.
3104         (struct _gpgme_op_keylist_result): New structure.
3105         (GpgmeKeyListResult): New type.
3106         (gpgme_op_keylist_result): New function.
3107         (gpgme_key_get_as_xml): Remove prototype.
3108         * context.h (struct gpgme_context_s): Remove members tmp_key,
3109         tmp_uid, key_cond and key_queue.
3110         (struct key_queue_item_s): Remove structure.
3111         (struct user_id_s): Remove structure.
3112         (struct gpgme_recipients_s): Replace with simple
3113         GpgmeUserID list.
3114         * gpgme.c (gpgme_release): Do not release CTX->tmp_key.
3115         * ops.h (_gpgme_key_add_subkey, _gpgme_key_append_name,
3116         _gpgme_key_add_sig, _gpgme_trust_item_new): New prototypes.
3117         * rungpg.c (command_cb): Return GpgmeError instead int.
3118         New variable ERR.  Use it to hold return value of cmd handler.
3119         (gpg_delete): Access fingerprint of key directly.
3120         (append_args_from_signers): Likewise.
3121         (gpg_edit): Likewise.
3122         (append_args_from_recipients): Use GpgmeUserID for recipient list.
3123         * engine-gpgsm.c: Do not include "key.h".
3124         (gpgsm_delete): Access fingerprint of key directly.
3125         (gpgsm_sign): Likewise.
3126         (set_recipients): Use GpgmeUserID for recipients.  Invert invalid
3127         user ID flag.
3128         * key.h: File removed.
3129         * key.c: Completely reworked to use exposed GpgmeKey data types.
3130         * keylist.c: Likewise.
3131         * recipient.c: Completely reworked to use GpgmeUserID.
3132
3133 2003-04-29  Marcus Brinkmann  <marcus@g10code.de>
3134
3135         * gpgme.h (gpgme_get_key): Remove force_update argument.
3136         * key-cache.c: File removed.
3137         * Makefile.am (libgpgme_la_SOURCES): Remove key-cache.c.
3138         * ops.h (_gpgme_key_cache_add, _gpgme_key_cache_get): Remove
3139         prototypes.
3140         * keylist.c (_gpgme_op_keylist_event_cb): Don't call
3141         _gpgme_key_cache_add.
3142         (gpgme_get_key): New function.
3143         * verify.c (gpgme_get_sig_key): Remove last argument to
3144         gpgme_get_key invocation.
3145
3146         * gpgme.h (struct _gpgme_trust_item): New structure.
3147         (GpgmeTrustItem): New type.
3148         (gpgme_trust_item_ref, gpgme_trust_item_unref): New prototypes.
3149         * context.h (struct trust_queue_item_s): Remove structure.
3150         (struct gpgme_context_s): Remove trust_queue member.
3151         * Makefile.am (libgpgme_la_SOURCES): Add trust-item.c.
3152         * trust-item.c: New file.
3153         * trustlist.c: Do not include <stdio.h> or <time.h>, but
3154         "gpgme.h".
3155         (struct trust_queue_item_s): Change to new type op_data_t.
3156         (trust_status_handler): Change first argument to void *.
3157         (trust_colon_handler): Likewise.
3158         (_gpgme_op_trustlist_event_cb): Use op_data_t type.
3159         (gpgme_op_trustlist_start): Use op_data_t and rework error
3160         handling.
3161         (gpgme_op_trustlist_next): Use op_data_t.
3162         (gpgme_trust_item_release): Remove function.
3163         (gpgme_trust_item_get_string_attr): Likewise.
3164         (gpgme_trust_item_get_int_attr): Likewise.
3165
3166         * verify.c (calc_sig_summary): Do not set GPGME_SIGSUM_SYS_ERROR
3167         for bad signatures.
3168
3169 2003-04-28  Marcus Brinkmann  <marcus@g10code.de>
3170
3171         * context.h: Remove OPDATA_VERIFY_COLLECTING.
3172         (struct gpgme_context_s): Remove member notation.
3173         * gpgme.h: Make enum for GPGME_KEYLIST_MODE_* values.
3174
3175         * gpgme.h (struct _gpgme_sig_notation): New structure.
3176         (GpgmeSigNotation): New type.
3177         (struct _gpgme_signature): New structure.
3178         (GpgmeSignature): New type.
3179         (struct _gpgme_op_verify_result): New structure.
3180         (GpgmeVerifyResult): New type.
3181         (gpgme_op_verify_result): New prototype.
3182         (gpgme_get_notation): Remove prototype.
3183         * ops.h (_gpgme_op_verify_init_result): New prototype.
3184         (_gpgme_verify_status_handler): Change first argument to void *.
3185         * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error):
3186         New prototypes.
3187         * conversion.c (_gpgme_decode_percent_string): New function.
3188         (gnupg_errors): New static global.
3189         (_gpgme_map_gnupg_error): New function.
3190         * gpgme.c (gpgme_release): Don't release CTX->notation.
3191         (gpgme_get_notation): Remove function.
3192         * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call
3193         _gpgme_op_verify_init_result.
3194         * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but
3195         do include "gpgme.h".
3196         (struct verify_result): Replace with ...
3197         (op_data_t): ... this type.
3198         (release_verify_result): Remove function.
3199         (release_op_data): New function.
3200         (is_token): Remove function.
3201         (skip_token): Remove function.
3202         (copy_token): Remove function.
3203         (gpgme_op_verify_result): New function.
3204         (calc_sig_summary): Rewritten.
3205         (finish_sig): Remove function.
3206         (parse_new_sig): New function.
3207         (parse_valid_sig): New function.
3208         (parse_notation): New function.
3209         (parse_trust): New function.
3210         (parse_error): New function.
3211         (_gpgme_verify_status_handler): Rewritten.  Change first argument
3212         to void *.
3213         (_gpgme_op_verify_start): Rework error handling.  Call
3214         _gpgme_op_verify_init_result.
3215         (gpgme_op_verify): Do not release or clear CTX->notation.
3216         (gpgme_get_sig_status): Rewritten.
3217         (gpgme_get_sig_string_attr): Likewise.
3218         (gpgme_get_sig_ulong_attr): Likewise.
3219         (gpgme_get_sig_key): Likewise.
3220
3221         * gpgme.h (struct _gpgme_op_decrypt_result): New structure.
3222         (GpgmeDecryptResult): New type.
3223         (gpgme_op_decrypt_result): New prototype.
3224         * ops.h (_gpgme_op_decrypt_init_result): New prototype.
3225         (_gpgme_decrypt_status_handler): Fix prototype.
3226         (_gpgme_decrypt_start): Remove prototype.
3227         * decrypt-verify.c: Do not include <stdio.h>, <stdlib.h>,
3228         <string.h> and <assert.h>, "util.h" and "context.h", but
3229         "gpgme.h".
3230         (decrypt_verify_status_handler): Change first argument to void *,
3231         and rework error handling.
3232         (_gpgme_op_decrypt_verify_start): New function.
3233         (gpgme_op_decrypt_verify_start): Rewrite using
3234         _gpgme_op_decrypt_verify_start.
3235         (gpgme_op_decrypt_verify): Likewise.
3236         * decrypt.c: Include <string.h>, "gpgme.h" and "util.h".
3237         (struct decrypt_result): Change to typedef op_data_t, rewritten.
3238         (is_token): Remove function.
3239         (release_op_data): New function.
3240         (skip_token): Remove function.
3241         (gpgme_op_decrypt_result): New function.
3242         (_gpgme_decrypt_status_handler): Change first argument to void *.
3243         Rework error handling.
3244         (_gpgme_decrypt_start): Rename to ...
3245         (decrypt_start): ... this.  Call _gpgme_op_decrypt_init_result.
3246         (_gpgme_op_decrypt_init_result): New function.
3247         (gpgme_op_decrypt_start): Use decrypt_start.
3248         (gpgme_op_decrypt): Likewise.
3249
3250 2003-04-27  Marcus Brinkmann  <marcus@g10code.de>
3251
3252         * encrypt-sign.c: Do not include <stddef.h>, <stdio.h>,
3253         <stdlib.h>, <string.h>, <assert.h> and "util.h", but "gpgme.h".
3254         (_gpgme_op_encrypt_sign_start): Rename to ...
3255         (encrypt_sign_start): ... this.
3256         (gpgme_op_encrypt_sign_start): Use encrypt_sign_start, not
3257         _gpgme_op_encrypt_sign_start.
3258         (gpgme_op_encrypt_sign): Likewise.
3259
3260         * gpgme.h (GpgmeEncryptResult): New data type.
3261         (gpgme_op_encrypt_result): New prototype.
3262         * ops.h (_gpgme_op_encrypt_init_result): New prototype.
3263         (_gpgme_op_encrypt_status_handler): Fix prototype.
3264         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
3265         _gpgme_op_encrypt_init_result.
3266         * encrypt.c: Do not include <stdio.h>, <assert.h>, "util.h" and
3267         "wait.h".  Include <errno.h> and "gpgme.h".
3268         (SKIP_TOKEN_OR_RETURN): Remove macro.
3269         (struct encrypt_result): Rename to ...
3270         (op_data_t): ... new data type.  Rewrite for user result data.
3271         (append_xml_encinfo): Remove function.
3272         (release_op_data): New function.
3273         (gpgme_op_encrypt_result): New function.
3274         (_gpgme_op_encrypt_status_handler): Change first argument to void *.
3275         Rewrite result parsing.
3276         (_gpgme_op_encrypt_sym_status_handler): Change first argument to
3277         void *.
3278         (_gpgme_op_encrypt_init_result): New function.
3279         (_gpgme_op_encrypt_start): Rename to ...
3280         (encrypt_start): ... this.
3281         (gpgme_op_encrypt_start): Use encrypt_start, not
3282         gpgme_op_encrypt_start.
3283         (gpgme_op_encrypt): Likewise.
3284
3285         * gpgme.h (GpgmePubKeyAlgo, GpgmeHashAlgo, GpgmeInvalidUserID,
3286         GpgmeNewSignature, GpgmeSignResult): New data types.
3287         (gpgme_op_sign_result, gpgme_pubkey_algo_name,
3288         gpgme_hash_algo_name): New prototypes.
3289         * gpgme.c (gpgme_pubkey_algo_name): New function.
3290         (gpgme_hash_algo_name): Likewise.
3291         * ops.h (_gpgme_parse_inv_userid, _gpgme_op_sign_init_result): New
3292         prototype.
3293         (_gpgme_op_sign_status_handler): Fix prototype.
3294         * op-support.c: Include <errno.h> and <string.h>.
3295         (_gpgme_parse_inv_userid): New function.
3296         * sign.c: Include <errno.h> and "gpgme.h", but not <stdio.h>,
3297         <assert.h> and "util.h".
3298         (SKIP_TOKEN_OR_RETURN): Remove macro.
3299         (struct sign_result): Change to op_data_t type and rework it.
3300         (release_sign_result): Rename to ...
3301         (release_op_data): ... this and rewrite it.
3302         (append_xml_info): Remove function.
3303         (gpgme_op_sign_result): New function.
3304         (parse_sig_created): New function.
3305         (_gpgme_sign_status_handler): Change first argument to void *.
3306         Rewrite the function to use the new result structure and functions.
3307         (_gpgme_op_sign_init_result): New function.
3308         (_gpgme_op_sign_start): Rename to ...
3309         (sign_start): ... this.  Call _gpgme_op_sign_init_result.
3310         (gpgme_op_sign_start): Use sign_start instead _gpgme_op_sign_start.
3311         (gpgme_op_sign): Likewise.
3312         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Call
3313         _gpgme_op_sign_init_result.
3314         
3315         * delete.c: Include <errno.h> and "gpgme.h", but not "util.h" or
3316         "key.h".
3317         (enum delete_problem): Move into function delete_status_handler.
3318         (delete_status_handler): Change first argument to void *.  Parse
3319         delete problem with strtol instead atoi.  Return better error
3320         values.
3321         (_gpgme_op_delete_start): Rename to ...
3322         (delete_start): ... this.  Rework error handling.
3323         (gpgme_op_delete_start): Use delete_start instead
3324         _gpgme_op_delete_start.
3325         (gpgme_op_delete): Likewise.
3326         * gpgme.h (GpgmeDataType): Removed.
3327
3328 2003-04-25  Marcus Brinkmann  <marcus@g10code.de>
3329
3330         * gpgme.h: Change GPGME_IMPORT_PRIVATE to GPGME_IMPORT_SECRET.
3331         * import.c (parse_import_res): Parse unchanged field.
3332
3333         * gpgme.h: New enum for GPGME_IMPORT_NEW, GPGME_IMPORT_UID,
3334         GPGME_IMPORT_SIG, GPGME_IMPORT_SUBKEY, GPGME_IMPORT_PRIVATE.
3335         (GpgmeError): GPGME_Unknown_Reason, GPGME_Not_Found,
3336         GPGME_Ambiguous_Specification, GPGME_Wrong_Key_Usage,
3337         GPGME_Key_Revoked, GPGME_Key_Expired, GPGME_No_CRL_Known,
3338         GPGME_CRL_Too_Old, GPGME_Policy_Mismatch, GPGME_No_Secret_Key,
3339         GPGME_Key_Not_Trusted, GPGME_Issuer_Missing, GPGME_Chain_Too_Long,
3340         GPGME_Unsupported_Algorithm, GPGME_Sig_Expired,
3341         GPGME_Bad_Signature, GPGME_No_Public_Key added as new error codes.
3342         (struct _gpgme_import_status): New structure.
3343         (GpgmeImportStatus): New type.
3344         (struct _gpgme_op_import_result): New structure.
3345         (GpgmeImportResult): New type.
3346         (gpgme_op_import_result): New function.
3347         * import.c: Include <errno.h> and "gpgme.h", but not "util.h".
3348         (struct import_result): Change to type op_data_t.
3349         (release_import_result): Rename to ...
3350         (release_op_data): ... this.
3351         (append_xml_impinfo): Function removed.
3352         (gpgme_op_import_result): New function.
3353         (parse_import): New function.
3354         (parse_import_res): Likewise.
3355         (import_status_handler): Change first argument to void *.  Rewrite
3356         to use new functions.
3357         (_gpgme_op_import_start): Rework error handling.
3358
3359         * edit.c: Do not include <assert.h>, "util.h", but "gpgme.h".
3360         (edit_resut): Change to typedef for op_data_t.
3361         (edit_status_handler): Change first argument to void *.
3362         Rework error handling.
3363         (command_handler): Rework error handling.
3364         (_gpgme_op_edit_start): Rename to ...
3365         (edit_start): ... this.  Rework error handling.
3366         (gpgme_op_edit_start): Rewrite using edit_start.
3367         (gpgme_op_edit): Likewise.
3368
3369         * ops.h (_gpgme_passphrase_start): Remove prototype.
3370         * passphrase.c: Do not include <assert.h>, "util.h" or
3371         "debug.h", but "gpgme.h".
3372         (struct passphrase_result): Change to typedef for op_data_t.
3373         (release_passphrase_result): Rename to release_op_data.
3374         (_gpgme_passphrase_status_handler): Change first argument to void *.
3375         Use new op_data_t type.
3376         (_gpgme_passphrase_command_handler): Use new op_data_t type.
3377         (_gpgme_passphrase_start): Remove function.
3378         * decrypt.c (_gpgme_decrypt_start): Rewrite error handling.  Do
3379         not call _gpgme_passphrase_start, but install command handler.
3380         * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3381         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3382         * sign.c (_gpgme_op_sign_start): Likewise.
3383
3384         * context.h (struct gpgme_context_s): Remove member initialized,
3385         use_cms and help_data_1.  Add member protocol.  Make use_armor and
3386         use_textmode bit flags.  Make keylist_mode, include_certs,
3387         signers_len and signers_size unsigned.
3388         * gpgme.c (gpgme_new): Initialize CTX->protocol.
3389         (gpgme_set_protocol): Do not check CTX.  Use CTX->protocol.
3390         (gpgme_get_protocol): Likewise.
3391         (gpgme_release): Do not release CTX->help_data_1.
3392         * op-support.c (_gpgme_op_reset): Use CTX->protocol.
3393
3394         * wait-private.c (_gpgme_wait_private_event_cb): Remove variable CTX.
3395
3396         * data.c: Do not include <assert.h>, but "gpgme.h".
3397         (_gpgme_data_inbound_handler): Expand _gpgme_data_append, because
3398         it will go.  Do not assert DH.
3399         (_gpgme_data_outbound_handler): Do not assert DH.
3400         
3401         * export.c: Do not include <stdlib.h>, "debug.h" and "util.h", but
3402         "gpgme.h".
3403         (export_status_handler): Change type of first argument to void *.
3404         (_gpgme_op_export_start): Rename to ...
3405         (export_start): ... this.  Rework error handling.
3406         (gpgme_op_export_start): Rewritten to use export_start instead
3407         _gpgme_op_export_start.
3408         (gpgme_op_export): Likewise.
3409
3410         * gpgme.h (GpgmeError): Add GPGME_Busy, GPGME_No_Request.
3411         (GPGME_No_Recipients, GPGME_Invalid_Recipient,
3412         GPGME_No_Passphrase): New macros.
3413
3414         * key.c (gpgme_key_get_string_attr): Fix validity attribute.
3415
3416 2003-04-24  Marcus Brinkmann  <marcus@g10code.de>
3417         
3418         * gpgme.h (struct _gpgme_op_genkey_result): New structure.
3419         (GpgmeGenKeyResult): New type.
3420         (gpgme_op_genkey): Drop last argument.
3421         (gpgme_op_genkey_result): New function.
3422         * genkey.c: Do not include "util.h", but "gpgme.h".
3423         (struct genkey_result): Replace with ...
3424         (op_data_t): ... this new type.
3425         (release_genkey_result): Replace with ...
3426         (release_op_data): ... this new function.
3427         (gpgme_op_genkey_result): New function.
3428         (genkey_status_handler): Rewritten using new op_data_t type.
3429         (get_key_parameter): New function.
3430         (_gpgme_op_genkey_start): Renamed to
3431         (genkey_start): ... this and rewritten.
3432         (gpgme_op_genkey_start): Use genkey_start instead
3433         _gpgme_op_genkey_start.
3434         (gpgme_op_genkey): Rewritten.  Remove FPR argument.
3435
3436         * context.h (struct gpgme_context_s): Remove member verbosity.
3437         * gpgme.c (gpgme_new): Do not set member verbosity.
3438         * engine.h (_gpgme_engine_set_verbosity): Remove prototype.
3439         * engine.c (_gpgme_engine_set_verbosity): Remove function.
3440         * engine-backend.h (struct engine_ops): Remove set_verbosity.
3441         * engine-gpgsm.c (_gpgme_engine_ops_gpgsm): Remove set_verbosity member.
3442         * rungpg.c (_gpgme_engine_ops_gpg): Likewise.
3443         (gpg_set_verbosity): Remove function.
3444         * decrypt.c (_gpgme_decrypt_start): Don't call
3445         _gpgme_engine_set_verbosity.
3446         * delete.c (_gpgme_op_delete_start): Likewise.
3447         * edit.c (_gpgme_op_edit_start): Likewise.
3448         * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3449         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3450         * export.c (_gpgme_op_export_start): Likewise.
3451         * genkey.c (_gpgme_op_genkey_start): Likewise.
3452         * import.c (_gpgme_op_import_start): Likewise.
3453         * keylist.c (gpgme_op_keylist_start): Likewise.
3454         (gpgme_op_keylist_ext_start): Likewise.
3455         * sign.c (_gpgme_op_sign_start): Likewise.
3456         * verify.c (_gpgme_op_verify_start): Likewise.
3457
3458         * Makefile.am (libgpgme_la_SOURCES): Add key-cache.c.
3459         * key.c (key_cache_initialized, key_cache_size,
3460         key_cache_max_chain_length, ): Removed.
3461         (struct key_cache_item_s, key_cache_lock, key_cache,
3462         key_cache_unused_items, hash_key, _gpgme_key_cache_add,
3463         _gpgme_key_cache_get, gpgme_get_key): Moved to ...
3464         * key-cache.c: ... here.  New file.
3465         * key.h (_gpgme_key_cache_init): Remove prototypes.
3466         (_gpgme_key_cache_add,_gpgme_key_cache_get): Move to ...
3467         * ops.h: ... here.
3468         * version.c: Do not include "key.h".
3469         (do_subsystem_inits): Do not call _gpgme_key_cache_init.
3470
3471         * mkstatus: Strip trailing comma.
3472         * gpgme.h (GpgmeStatus): Pretty print.
3473
3474         * gpgme.h (GpgmeError): Rename GPGME_No_Passphrase to
3475         GPGME_Bad_Passphrase.
3476         * passphrase.c (_gpgme_passphrase_status_handler): Use
3477         GPGME_Bad_Passphrase instead GPGME_No_Passphrase.
3478
3479         * gpgme.h (GpgmeError): Rename GPGME_No_Recipients to
3480         GPGME_No_UserID and GPGME_Invalid_Recipient to
3481         GPGME_Invalid_UserID.
3482         * encrypt.c (_gpgme_encrypt_status_handler): Use GPGME_No_UserID
3483         instead GPGME_No_Recipients and GPGME_Invalid_UserID instead
3484         GPGME_Invalid_Recipient.
3485         (_gpgme_op_encrypt_start): Likewise.
3486
3487         * gpgme.h (GpgmeError): Remove GPGME_Busy and GPGME_No_Request.
3488         * wait-user.c (_gpgme_wait_user_event_cb): Don't clear CTX->pending.
3489         * wait-private.c (_gpgme_wait_private_event_cb): Likewise.
3490         * wait-global.c (gpgme_wait): Likewise.
3491         * verify.c (_gpgme_op_verify_start): Likewise.
3492         (gpgme_get_sig_status): Don't check pending flag.
3493         (gpgme_get_sig_string_attr): Likewise.
3494         (gpgme_get_sig_ulong_attr): Likewise.
3495         (gpgme_get_sig_key): Likewise.
3496         * op-support.c (_gpgme_op_reset): Likewise.
3497         * trustlist.c (gpgme_op_trustlist_start): Don't clear pending flag.
3498         (gpgme_op_trustlist_next): Don't check or clear pending flag.
3499         (gpgme_op_trustlist_end): Likewise.
3500         * sign.c (_gpgme_op_sign_start): Likewise.
3501         * context.h (struct gpgme_context_s): Remove member PENDING.
3502         * decrypt.c (_gpgme_decrypt_start): Likewise.
3503         * delete.c (_gpgme_op_delete_start): Likewise.
3504         * edit.c (_gpgme_op_edit_start): Likewise.
3505         * encrypt.c (_gpgme_op_encrypt_start): Likewise.
3506         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
3507         * export.c (_gpgme_op_export_start): Likewise.
3508         * genkey.c (_gpgme_op_genkey_start): Likewise.
3509         * import.c (_gpgme_op_import_start): Likewise.
3510         * key.c (gpgme_get_key): Likewise.
3511         * keylist.c (gpgme_op_keylist_start): Likewise.
3512         (gpgme_op_keylist_ext_start): Likewise.
3513         (gpgme_op_keylist_next): Likewise.
3514         (gpgme_op_keylist_end): Likewise.
3515         * data-compat.c (gpgme_error_to_errno): Don't convert EBUSY.
3516
3517 2003-02-06  Marcus Brinkmann  <marcus@g10code.de>
3518
3519         * gpgme.h (GpgmePassphraseCb): Change type to return GpgmeError,
3520         and add argument for returning the result string.
3521         (gpgme_cancel): Remove prototype.
3522         * gpgme.c (gpgme_cancel): Remove function.
3523         * context.h (struct gpgme_context_s): Remove member cancel.
3524         * passphrase.c (_gpgme_passphrase_command_handler): Call the
3525         passphrase callback in the new way.
3526
3527 2003-01-30  Marcus Brinkmann  <marcus@g10code.de>
3528
3529         * edit.c (_gpgme_edit_status_handler): Call the progress status
3530         handler.
3531
3532 2003-02-05  Marcus Brinkmann  <marcus@g10code.de>
3533
3534         * wait-user.c (_gpgme_wait_user_remove_io_cb): Move check for no
3535         I/O handlers left to ...
3536         (_gpgme_user_io_cb_handler): ... here.
3537
3538 2003-02-04  Marcus Brinkmann  <marcus@g10code.de>
3539
3540         * trustlist.c (trustlist_colon_handler): Release ITEM if name
3541         could not be allocated.
3542         (gpgme_trust_item_release): Only release name if it is allocated.
3543         Reported by Marc Mutz <Marc.Mutz@uni-bielefeld.de>.
3544
3545 2003-02-04  Marcus Brinkmann  <marcus@g10code.de>
3546
3547         * rungpg.c (read_status): If he status handler returns an error,
3548         return it.
3549         (status_handler): If read_status fails, just return the error.
3550
3551 2003-02-01  Marcus Brinkmann  <marcus@g10code.de>
3552
3553         * engine-gpgsm.c (start): Handle all errors, not only most of
3554         them.
3555         (xtoi_1, xtoi_2): Remove macro.
3556         (status_handler): Replace use of xtoi_2 with _gpgme_hextobyte.
3557
3558 2003-02-01  Marcus Brinkmann  <marcus@g10code.de>
3559
3560         * engine-gpgsm.c (map_assuan_error): Replace
3561         ASSUAN_Bad_Certificate_Path with ASSUAN_Bad_Certificate_Chain.
3562         (gpgsm_new): Use assuan_pipe_connect instead assuan_pipe_connect2.
3563
3564         * util.h (DIMof): Remove macro.
3565
3566         * ops.h (_gpgme_op_event_cb, _gpgme_op_event_cb_user,
3567         _gpgme_data_unread): Prototypes removed.
3568
3569 2003-01-30  Marcus Brinkmann  <marcus@g10code.de>
3570
3571         * types.h: File removed.
3572         * Makefile.am (libgpgme_la_SOURCES): Remove types.h.
3573         * io.h (struct spawn_fd_item_s): Do not include "types.h".
3574         * key.h: Likewise.
3575         * context.h: Likewise.
3576         * cengine-gpgsm.h: Likewise.
3577         * engine.h: Include "gpgme.h" instead "types.h".  Add prototypes
3578         for EngineStatusHandler, EngineColonLineHandler and
3579         EngineCommandHandler.
3580         (_gpgme_engine_set_status_handler): Change parameter type from
3581         GpgmeStatusHandler to EngineStatusHandler.
3582         (_gpgme_engine_set_command_handler): Change parameter type from
3583         GpgmeCommandHandler to EngineCommandHandler.
3584         (_gpgme_engine_set_colon_line_handler): Change parameter type from
3585         GpgmeColonLineHandler to EngineColonLineHandler.
3586         * engine-backend.h: Include "engine.h" instead "types.h".
3587         (struct engine_ops): Change Gpgme*Handler parameters in members
3588         set_command_handler, set_colon_line_handler and set_status_handler
3589         to Engine*Handler.
3590         * engine.c (_gpgme_engine_set_status_handler): Change parameter
3591         type from GpgmeStatusHandler to EngineStatusHandler.
3592         (_gpgme_engine_set_command_handler): Change parameter type from
3593         GpgmeCommandHandler to EngineCommandHandler.
3594         (_gpgme_engine_set_colon_line_handler): Change parameter type from
3595         GpgmeColonLineHandler to EngineColonLineHandler.
3596         * rungpg.c (struct gpg_object_s): Change type of member status.fnc
3597         from GpgmeStatusHandler to EngineStatusHandler.  Change type of
3598         member colon.fnc from GpgmeColonLineHandler to
3599         EngineColonLineHandler.  Change type of member cmd.fnc from
3600         GpgmeCommandHandler to EngineCommandHandler.
3601         * engine-gpgsm.c (struct gpgsm_object_s): Likewise.
3602         * rungpg.c (gpg_set_status_handler): Change parameter type from
3603         GpgmeStatusHandler to EngineStatusHandler.
3604         * engine-gpgsm.c (gpgsm_set_status_handler): Likewise.
3605         (assuan_simple_command): Likewise.
3606         * rungpg.c (gpg_set_colon_line_handler): Change parameter type
3607         from GpgmeColonLineHandler to EngineColonLineHandler.
3608         * engine-gpgsm.c (gpgsm_set_colon_line_handler): Likewise.
3609         * rungpg.c (gpg_set_command_handler): Change parameter type from
3610         GpgmeCommandHandler to EngineCommandHandler.
3611
3612         * engine-gpgsm.c (status_handler): Do not close status fd at end
3613         of function.
3614
3615         * ops.h (_gpgme_op_data_lookup): Add prototype.
3616         * op-support.c: Include <stdlib.h>.
3617         (_gpgme_op_data_lookup): New function.
3618         * decrypt.c (_gpgme_release_decrypt_result): Function removed.
3619         (struct decrypt_result_s): Rename to ...
3620         (struct decrypt_resul): ... this.
3621         (DecryptResult): New type.
3622         (_gpgme_decrypt_status_handler): Don't use
3623         test_and_allocate_result, but use _gpgme_op_data_lookup to
3624         retrieve result data object.
3625         * sign.c (_gpgme_release_sign_result): Function removed.
3626         (release_sign_result): New function.
3627         (struct sign_result_s): Rename to ...
3628         (struct sign_result): ... this.
3629         (SignResult): New type.
3630         (_gpgme_sign_status_handler): Don't use
3631         test_and_allocate_result, but use _gpgme_op_data_lookup to
3632         retrieve result data object.
3633         * encrypt.c (struct encrypt_result_s): Rename to ...
3634         (struct encrypt_result): ... this.
3635         (_gpgme_release_encrypt_result): Function removed.
3636         (release_encrypt_result): New function.
3637         (_gpgme_encrypt_status_handler): Don't use
3638         test_and_allocate_result, but use _gpgme_op_data_lookup to
3639         retrieve result data object.
3640         * verify.c (struct verify_result_s): Rename to ...
3641         (struct verify_result): ... this.  Remove member next.
3642         (VerifyResult): New type.
3643         (_gpgme_release_verify_result): Function removed.
3644         (release_verify_result): New function.
3645         (finish_sig): Change first argument to type VerifyResult.  Diddle
3646         the type of the op_data structure.
3647         (add_notation): Change first argument to type VerifyResult.
3648         (_gpgme_verify_status_handler): Don't use
3649         test_and_allocate_result, but use _gpgme_op_data_lookup to
3650         retrieve result data object.
3651         * passphrase.c (struct passphrase_result_s): Rename to ...
3652         (struct passphrase_result): ... this.  Remove member next.
3653         (PassphraseResult): New type.
3654         (_gpgme_release_passphrase_result): Function removed.
3655         (release_passphrase_result): New function.
3656         (_gpgme_passphrase_status_handler): Don't use
3657         test_and_allocate_result, but use _gpgme_op_data_lookup to
3658         retrieve result data object.
3659         (_gpgme_passphrase_command_handler): Likewise.
3660         * keylist.c (struct keylist_result_s): Rename to ...
3661         (struct keylist_result): ... this.  Remove member next.
3662         (KeylistResult): New type.
3663         (_gpgme_release_keylist_result): Function removed.
3664         (release_keylist_result): New function.
3665         (keylist_status_handler): Don't use
3666         test_and_allocate_result, but use _gpgme_op_data_lookup to
3667         retrieve result data object.
3668         * edit.c (struct edit_result_s): Rename to ...
3669         (struct edit_result): ... this.  Remove member next.
3670         (EditResult): New type.
3671         (_gpgme_release_edit_result): Function removed.
3672         (release_edit_result): New function.
3673         (edit_status_handler): Don't use
3674         test_and_allocate_result, but use _gpgme_op_data_lookup to
3675         retrieve result data object.
3676         (command_handler): Likewise.
3677         * types.h (DecryptResult, SignResult, EncryptResult,
3678         PassphraseResult, ImportResult, DeleteResult, GenKeyResult,
3679         KeylistResult, EditResult): Types removed.
3680         * ops.h: Don't include "types.h", but "gpgme.h" and "context.h".
3681         (test_and_allocate_result): Remove macro.
3682         (_gpgme_release_decrypt_result): Remove prototype.
3683         (_gpgme_decrypt_result): Remove prototype.
3684         (_gpgme_release_sign_result): Remove prototype.
3685         (_gpgme_release_encrypt_result): Remove prototype.
3686         (_gpgme_release_passphrase_result): Remove prototype.
3687         (_gpgme_release_import_result): Remove prototype.
3688         (_gpgme_release_delete_result): Remove prototype.
3689         (_gpgme_release_genkey_result): Remove prototype.
3690         (_gpgme_release_keylist_result): Remove prototype.
3691         (_gpgme_release_edit_result): Remove prototype.
3692         (_gpgme_release_verify_result): Remove prototype.
3693         * gpgme.c (_gpgme_release_result): Rewritten.
3694         * context.h (enum ctx_op_data_type): New enum.
3695         (struct ctx_op_data): New structure.
3696         (struct gpgme_context_s): Replace the member result with a member
3697         op_data.
3698         (fail_on_pending_request): Remove macro.
3699         * op-support.c (_gpgme_op_reset): Expand macro
3700         fail_on_pending_request.
3701         * util.h: Don't include "types.h" or "debug.h", but include "gpgme.h".
3702
3703 2003-01-30  Marcus Brinkmann  <marcus@g10code.de>
3704
3705         * types.h (EngineObject): Move typedef to ...
3706         * engine.h: ... here.
3707         * types.h (GpgObject): Move typedef to ...
3708         * rungpg.c: ... here.
3709         * types.h (GpgsmObject): Move typedef to ...
3710         * engine-gpgsm.c: ... here.
3711
3712         * util.h (return_if_fail, return_null_if_fail,
3713         return_val_if_fail): Remove macro.
3714         * gpgme.c (gpgme_cancel): Don't use return_if_fail.
3715         * key.c (gpgme_key_ref): Likewise.
3716         * signers.c (gpgme_signers_enum): Likewise.
3717         (gpgme_signers_clear): Likewise.
3718
3719         * engine-backend.h (struct engine_ops): Rename get_path to
3720         get_file_name.
3721         * gpgme.h (struct _gpgme_engine_info): Rename member path to
3722         file_name.
3723         * version.c: Do not include <stdio.h>, <stdlib.h>, context.h and
3724         util.h.  Other clean ups.
3725         (parse_version_number): Protect more seriously against
3726         overflow.
3727         (gpgme_get_engine_info): Move to ...
3728         * engine.c (gpgme_get_engine_info): ... here.
3729         (_gpgme_engine_get_info): Function removed.
3730         (_gpgme_engine_get_path): Make static and rename to ...
3731         (engine_get_file_name): .. this.
3732         (_gpgme_engine_get_version): Make static and rename to ...
3733         (engine_get_version): ... this.
3734         (_gpgme_engine_get_req_version): Make static and rename to ...
3735         (engine_get_req_version): ... this.
3736         * engine.h (_gpgme_engine_get_path, _gpgme_engine_get_version,
3737         _gpgme_engine_req_version, _gpgme_engine_get_info.): Remove
3738         prototypes.
3739
3740         * gpgme.h (enum GpgmeProtocol): Remove GPGME_PROTOCOL_AUTO.
3741         * gpgme.c (gpgme_set_protocol): Don't handle GPGME_PROTOCOL_AUTO.
3742         (gpgme_get_protocol_name): New function.
3743
3744         * engine-backend.h (struct engine_ops): New member
3745         get_req_version, remove member check_version.
3746         * engine.h (_gpgme_Engine_get_version): New prototype.
3747         * rungpg.c (gpg_get_req_version): New function.
3748         (gpg_check_version): Function removed.
3749         (_gpgme_engine_ops_gpg): Add gpg_get_req_version, remove
3750         gpg_check_version.
3751         * engine-gpgsm.c (gpgsm_get_req_version): New function.
3752         (gpgsm_check_version): Function removed.
3753         (_gpgme_engine_ops_gpgsm): Add gpgsm_get_req_version, remove
3754         gpgsm_check_version.
3755         * engine.c: Include ops.h.
3756          (_gpgme_engine_get_req_version): New function.
3757         (gpgme_engine_check_version): Rewritten.
3758         * version.c (gpgme_get_engine_info): Rewritten.
3759         * gpgme.h (gpgme_engine_info): New structure.
3760         (GpgmeEngineInfo): New type.
3761         
3762 2003-01-29  Marcus Brinkmann  <marcus@g10code.de>
3763
3764         * types.h: Remove byte and ulong types.
3765         * util.h (_gpgme_hextobyte): Change prototype to unsigned char
3766         instead byte.
3767         * conversion.c (_gpgme_hextobyte): Change argument to unsigned
3768         char instead byte.
3769         (_gpgme_decode_c_string): Likewise, and beautify.  Also support a
3770         few more escaped characters.  Be more strict about buffer size.
3771         (_gpgme_data_append_percentstring_for_xml): Change type of SRC,
3772         BUF and DST to unsigned char instead byte.
3773         * progress.c (_gpgme_progress_status_handler): Use unsigned char
3774         instead byte.
3775         * debug.c (trim_spaces): Likewise.
3776
3777         * util.h (mk_error): Remove macro.
3778         * conversion.c, data.c, data-compat.c, decrypt.c, delete.c,
3779         edit.c, encrypt.c, encrypt-sign.c, engine.c, engine-gpgsm.c,
3780         export.c, genkey.c, gpgme.c, import.c, key.c, keylist.c,
3781         passphrase.c, progress.c, recipient.c, rungpg.c, sign.c,
3782         signers.c, trustlist.c, verify.c, wait.c, wait-global.c,
3783         wait-private (literally everywhere): Expand the mk_error macro.
3784
3785         * context.h (wait_on_request_or_fail): Remove macro.
3786
3787         * context.h (gpgme_context_s): Remove member ERROR.
3788         * types.h (GpgmeStatusHandler): Change return type to GpgmeError.
3789         (GpgmeCommandHandler): Change return type to GpgmeError and add
3790         new argument RESULT.
3791         * gpgme.h (GpgmeIOCb): Change return type to GpgmeError.
3792         (GpgmeEventIO): New event GPGME_EVENT_START.
3793         (GpgmeIdleFunc): Remove type.
3794         (gpgme_register_idle): Remove prototype.
3795         * data.c: Include <assert.h>.
3796         (_gpgme_data_inbound_handler): Change return type to GpgmeError.
3797         Return any error instead ignoring it, don't close file descriptor
3798         on error.
3799         (_gpgme_data_outbound_handler): Likewise.
3800         * decrypt.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3801         (_gpgme_decrypt_status_handler): Change return type to GpgmeError.
3802         Return error instead setting ctx->error.  Return success at end of
3803         function.
3804         (gpgme_op_decrypt): Don't work around the old kludge anymore.
3805         * decrypt-verify.c (decrypt_verify_status_handler): Change return
3806         type to GpgmeError.  Return possible errors.
3807         * delete.c: Do not include <stdio.h>, <string.h>, <time.h> and
3808         <assert.h>.
3809         (delete_status_handler): Change return type to GpgmeError.  Return
3810         error instead setting ctx->error.  Return success at end of
3811         function.
3812         * edit.c: Do not include <stdio.h> and <string.h>.
3813         (_gpgme_edit_status_handler): Change type to GpgmeError,
3814         make static and rename to ...
3815         (edit_status_handler): ... this.  Return error directly.
3816         (command_handler): Change return type to GpgmeError, add result
3817         argument.  Return error directly.
3818         * encrypt.c (status_handler_finish): Remove function.
3819         (_gpgme_encrypt_status_handler): Change return type to GpgmeError.
3820         Return error directly.
3821         (_gpgme_encrypt_sym_status_handler): Likewise.
3822         * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
3823         * engine-gpgsm.c (close_notify_handler): Do not signal done event
3824         anymore.
3825         (status_handler): Change return type to GpgmeError.  Diddle things
3826         around a bit to return errors directly.
3827         (start): Send start event.
3828         * export.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3829         (export_status_handler): Change return type to GpgmeError.  Don't
3830         check ctx->error.
3831         * genkey.c: Do not include <stdio.h> and <assert.h>.
3832         (genkey_status_handler): Change return type to GpgmeError.  Don't
3833         check ctx->error.  Return errors directly.
3834         * gpgme.c (_gpgme_release_result): Do not initialize ctx->error.
3835         (_gpgme_op_event_cb): Function removed.
3836         (_gpgme_op_event_cb_user): Likewise.
3837         * import.c: Do not include <stdio.h>, <string.h> and <assert.h>.
3838         (import_status_handler): Change return type to GpgmeError.  Don't
3839         check ctx->error.
3840         * keylist.c (keylist_colon_handler, keylist_status_handler, finish_key):
3841         Change return type to GpgmeError, return error directly.
3842         * Makefile (libgpgme_la_SOURCES): Add wait-global.c,
3843         wait-private.c and wait-user.c
3844         * ops.h (test_and_allocate_result): Return error instead setting
3845         ctx->error.
3846         (_gpgme_data_inbound_handler, _gpgme_data_outbound_handler,
3847         _gpgme_verify_status_handler, _gpgme_decrypt_status_handler,
3848         _gpgme_sign_status_handler, _gpgme_encrypt_staus_handler,
3849         _gpgme_passphrase_status_handler, _gpgme_progress_status_handler):
3850         Change return type to GpgmeError.
3851         (_gpgme_passphease_command_handler): Change return type to
3852         GpgmeError and add new argument RESULT.
3853         * op-support.c: Use new callback functions, and change private
3854         data to ctx everywhere.
3855         * passphrase.c (_gpgme_passphrase_status_handler): Change return
3856         type to GpgmeError, return error directly.
3857         (_gpgme_passphrase_command_handler): Change return type to
3858         GpgmeError, add result argument.  Return results accordingly.
3859         * progress.c (_gpgme_progress_status_handler): Change return type
3860         to GpgmeError, return errors directly.
3861         * rungpg.c (status_handler): Change return type to GpgmeError.
3862         Return error directly.
3863         (close_notify_handler): Don't send done event.
3864         (colon_line_handler): Change return type to GpgmeError, return
3865         errors directly.
3866         * rungpg.c (start): Send start event.
3867         * sign.c (_gpgme_sign_status_handler): Change return type to
3868         GpgmeError, return errors directly.
3869         * trustlist.c (trustlist_status_handler): Change return type to
3870         GpgmeError.  Return 0.
3871         (trustlist_colon_handler): Change return type GpgmeError.  Return
3872         errors directly.
3873         * verify.c (add_notation): Change return type to GpgmeError,
3874         return errors directly.
3875         (_gpgme_verify_status_handler): Likewise.
3876         * wait.h (struct fd_table): Remove lock member.
3877         (struct wait_item_s): Moved here from wait.c.
3878         (struct tag): New structure.
3879         (_gpgme_wait_event_cb): Remove prototype.
3880         (_gpgme_wait_private_event_cb, _gpgme_wait_global_event_cb,
3881         _gpgme_wait_user_add_io_cb, _gpgme_wait_user_remove_io_cb,
3882         _gpgme_wait_user_event_io_cb): New prototypes.
3883         * wait.c: Don't include <stdio.h>.
3884         (ftd_global, ctx_done_list, ctx_done_list_size,
3885         ctx_done_list_length, ctx_done_list_lock, idle_function): Remove
3886         global variable.
3887         (gpgme_register_idle, do_select, _gpgme_wait_event_cb): Remove
3888         function.
3889         (gpgme_wait): Move to file wait-global.c.
3890         (_gpgme_add_io_cb): Take ctx as private argument, initialize ctx
3891         member in wait item and tag.
3892         (_gpgme_remove_io_cb): Take ctx from tag.  Don't use FDT lock.
3893         (_gpgme_wait_one, _gpgme_wait_on_condition): Move to
3894         wait-private.c.
3895         (gpgme_fd_table_init): Don't initialize FDT->lock.
3896         (gpgme_fd_table_deinit): Don't destroy FDT->lock.
3897         (_gpgme_fd_table_put): Make static and rename to ...
3898         (fd_table_put): ... this function.  Don't use FDT->lock.
3899         (struct wait_item_s): Move to wait.h.
3900         * wait-global.c: New file.
3901         * wait-private.c: New file.
3902         * wait-user.c: New file.
3903
3904         * key.c (gpgme_key_sig_get_string_attr): Use validity_to_string
3905         instead otrust_to_string to calculate validity.
3906         
3907 2003-01-19  Miguel Coca  <mcoca@gnu.org>
3908
3909         * w32-io.c (_gpgme_io_select): Add missing argument in calls to
3910         DEBUG_BEGIN.
3911         * w32-util.c: Include "sema.h".
3912         (find_program_in_registry): Change DEBUG1 to DEBUG2, fixes compilation
3913         error.
3914
3915 2003-01-19  Marcus Brinkmann  <marcus@g10code.de>
3916
3917         * rungpg.c (_gpgme_engine_ops_gpg): Remove gpg_start.
3918         (gpg_start): Rename to ...
3919         (start): ... this function.  Change arguments to GpgObject.
3920         (gpg_decrypt): Call start.
3921         (gpg_edit): Likewise.
3922         (gpg_encrypt): Likewise.
3923         (gpg_encrypt_sign): Likewise.
3924         (gpg_export): Likewise.
3925         (gpg_import): Likewise.
3926         (gpg_keylist): Likewise.
3927         (gpg_keylist_ext): Likewise.
3928         (gpg_trustlist): Likewise.
3929         (gpg_verify): Likewise.
3930
3931         * engine-gpgsm.c (_gpgme_engine_ops_encrypt): Remove gpgsm_start.
3932         (gpgsm_start): Rename to ...
3933         (struct gpgsm_object_s): Remove member command.
3934         (gpgsm_release): Don't free command.
3935         (start): ... this function.  Change arguments to GpgsmObject and
3936         const char *.
3937         (gpgsm_decrypt): Call start.
3938         (gpgsm_delete): Likewise.
3939         (gpgsm_encrypt): Likewise.
3940         (gpgsm_export): Likewise.
3941         (gpgsm_genkey): Likewise.
3942         (gpgsm_import): Likewise.
3943         (gpgsm_keylist): Likewise.
3944         (gpgsm_keylist_ext): Likewise.
3945         (gpgsm_verify): Likewise.
3946
3947         * decrypt.c (_gpgme_decrypt_start): Don't call
3948         _gpgme_engine_start.
3949         * delete.c (_gpgme_op_delete_start): Likewise.
3950         * edit.c (_gpgme_op_edit_start): Likewise.
3951         * encrypt.c (_gpgme_op_encrypt_start): 
3952         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): 
3953         * export.c (_gpgme_op_export_start): Likewise.
3954         * genkey.c (_gpgme_op_genkey_start): Likewise.
3955         * import.c (_gpgme_op_import_start): Likewise.
3956         * keylist.c (gpgme_op_keylist_ext_start): Likewise.
3957         (gpgme_op_keylist_start): Likewise.
3958         * sign.c (_gpgme_op_sign_start): Likewise.
3959         * trustlist.c (gpgme_op_trustlist_start): Likewise.
3960         * verify.c (_gpgme_op_verify_start): Likewise.
3961
3962         * engine-backend.h (struct engine_ops): Remove member start.
3963
3964         * engine.h (_gpgme_engine_start): Remove prototype.
3965         * engine.c (_gpgme_engine_start): Remove function.
3966
3967 2003-01-06  Werner Koch  <wk@gnupg.org>
3968
3969         * keylist.c (set_mainkey_capability): Handle 'd' and 'D' used
3970         since gpg 1.3 to denote disabled keys.
3971
3972 2003-01-06  Marcus Brinkmann  <marcus@g10code.de>
3973
3974         * data-mem.c: Include <string.h>.
3975         * engine.c: Likewise.
3976
3977 2003-01-06  Marcus Brinkmann  <marcus@g10code.de>
3978
3979         * Makefile.am (libgpgme_la_DEPENDENCIES): Correct bug in last change.
3980
3981 2002-12-24  Marcus Brinkmann  <marcus@g10code.de>
3982
3983         * gpgme.h (gpgme_op_verify, gpgme_op_decrypt_verify): Drop R_STAT
3984         argument.
3985         * decrypt-verify.c (gpgme_op_decrypt_verify): Drop R_STAT
3986         argument.
3987         * verify.c (gpgme_op_verify): Drop R_STAT argument.
3988         (_gpgme_intersect_stati): Function removed.
3989         * ops.h (_gpgme_intersect_stati): Remove prototype.
3990
3991 2002-12-24  Marcus Brinkmann  <marcus@g10code.de>
3992
3993         * libgpgme.vers: New file.
3994         * Makefile.am (EXTRA_DIST): Add libgpgme.vers.
3995         (libgpgme_version_script_cmd): New variable.
3996         (libgpgme_la_LDFLAGS): Add libgpgme_version_script_cmd here.
3997         (libgpgme_la_DEPENDENCIES): New variable.
3998
3999 2002-12-23  Marcus Brinkmann  <marcus@g10code.de>
4000
4001         * key.c (gpgme_key_get_string_attr): Don't accept GPGME_ATTR_IS_SECRET.
4002         (otrust_to_string): New function.
4003         (gpgme_key_get_as_xml): Use it.
4004         (validity_to_string): New function.
4005         (gpgme_key_get_string_attr): Beautify using above functions.
4006         (gpgme_key_get_ulong_attr): Likewise.
4007
4008 2002-12-23  Marcus Brinkmann  <marcus@g10code.de>
4009
4010         * data-mem.c (mem_release): Fix gcc warning.
4011         * data-user.c (user_release): Likewise.
4012
4013 2002-12-06  Marcus Brinkmann  <marcus@g10code.de>
4014
4015         * data.h (gpgme_data_release_cb): Change return type to void.
4016         (gpgme_data_read_cb): Change return type to ssize_t.
4017         * data.c (gpgme_data_read): Likewise.
4018         * data-stream.c (stream_read): Likewise.
4019         * data-fd.c (fd_read): Likewise.
4020         * data-mem.c (mem_read): Likewise.
4021         (mem_release): Change return type to void.
4022         * data-user.c (user_read): Change return type to ssize_t.
4023         (user_release): Change return type to void.
4024         * data-compat.c (old_user_read): Change return type to ssize_t. 
4025         * gpgme.h (GpgmeDataReadCb): Likewise.
4026         (gpgme_data_read): Likewise.
4027         (GpgmeDataSeekCb): Change return type to off_t.
4028
4029 2002-12-04  Marcus Brinkmann  <marcus@g10code.de>
4030
4031         * gpgme.h: Add prototype for gpgme_get_key.
4032         * key.c (gpgme_get_key): New function.
4033         * verify.c (gpgme_get_sig_key): Rewrite using gpgme_get_key.
4034
4035         * gpgme.h: Add prototypes for new interfaces
4036         gpgme_key_sig_get_string_attr and gpgme_key_get_ulong_attr.
4037         (enum GpgmeAttr): New attribute GPGME_ATTR_SIG_CLASS.
4038         * gpgme.c (gpgme_set_keylist_mode): Allow GPGME_KEYLIST_MODE_SIGS.
4039         * key.h (struct certsig_s): New members ALGO, NAME_PART,
4040         EMAIL_PART, COMMENT_PART, NAME, SIG_STAT and SIG_CLASS.
4041
4042         * conversion.c (_gpgme_decode_c_string): Add new parameter LEN.
4043         Use that to determine if allocation is desired or not.
4044         * util.h: Adjust prototype of _gpgme_decode_c_string.
4045         * keylist.c (keylist_colon_handler): Adjust caller of
4046         _gpgme_decode_c_string.
4047
4048         * key.h (struct gpgme_key_s): New member last_uid.
4049         * key.c (_gpgme_key_append_name): Rewritten using
4050         _gpgme_decode_c_string and the last_uid pointer.
4051         (my_isdigit): Macro removed.
4052         (ALLOC_CHUNK): Likewise.
4053         * keylist.c (set_userid_flags): Use last_uid member of KEY.
4054
4055         * context.h (struct user_id_s): New member last_certsig.
4056         * key.h: Add prototype for _gpgme_key_add_certsig.
4057         * key.c (_gpgme_key_add_certsig): New function.
4058         (set_user_id_part): Move function before _gpgme_key_add_certsig.
4059         (parse_user_id): Change first argument to SRC, add new arguments
4060         NAME, EMAIL and COMMENT.  Change code to use these arguments
4061         instead going through UID.  Move function before
4062         _gpgme_add_certsig.
4063         (parse_x509_user_id): Likewise.
4064         (_gpgme_key_append_name): Adjust arguments to parse_x509_user_id
4065         and parse_user_id invocation.
4066         (one_certsig_as_xml): New function.
4067         (one_uid_as_xml): Print signatures.
4068         * context.h (struct gpgme_context_s): New member TMP_UID.
4069         * keylist.c (keylist_colon_handler): Rewritten, implement "sig"
4070         record entries.
4071
4072         * key.c (get_certsig): New function.
4073         (gpgme_key_sig_get_string_attr): Likewise.
4074         (gpgme_key_sig_get_ulong_attr): Likewise.
4075
4076         * keylist.c: Include <ctype.h>.
4077         (my_isdigit): Macro removed.
4078         (set_mainkey_trust_info): Use isdigit, not my_isdigit.
4079         (set_userid_flags): Likewise.
4080         (set_subkey_trust_info): Likewise.
4081         (set_ownertrust): Likewise.
4082         (finish_key): Move function up a bit and remove prototype.
4083
4084         * rungpg.c (gpg_keylist_ext): Correct precedence of signature
4085         listing mode.
4086         (gpg_keylist_ext): Implement signature listing mode.
4087
4088 2002-11-25  Marcus Brinkmann  <marcus@g10code.de>
4089
4090         * rungpg.c (_gpgme_gpg_spawn): Do not set parent fds to -1.
4091         * posix-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead close
4092         for parent fds.
4093         * w32-io.c (_gpgme_io_spawn): Call _gpgme_io_close instead
4094         CloseHandle for parent fds.
4095
4096 2002-11-22  Marcus Brinkmann  <marcus@g10code.de>
4097
4098         * gpgme.h [_MSC_VER]: Define ssize_t as long.
4099
4100 2002-11-22  Werner Koch  <wk@gnupg.org>
4101
4102         * engine-gpgsm.c (_gpgme_gpgsm_new): Save the result of a first
4103         setlocale before doing another setlocale.
4104
4105 2002-11-21  Marcus Brinkmann  <marcus@g10code.de>
4106
4107         * decrypt.c: Some beautyfication.
4108
4109         * verify.c (_gpgme_verify_status_handler): Treat
4110         GPGME_STATUS_UNEXPECTED like GPGME_STATUS_NODATA.
4111         Reported by Miguel Coca <e970095@zipi.fi.upm.es>.
4112
4113 2002-11-19  Marcus Brinkmann  <marcus@g10code.de>
4114
4115         * genkey.c: Only include <config.h> if [HAVE_CONFIG_H].
4116         (struct genkey_result_s): Add new member FPR.
4117         (_gpgme_release_genkey_result): Free RESULT->fpr if set.
4118         (genkey_status_handler): Extract the fingerprint from the status
4119         line.
4120         (gpgme_op_genkey): Add new argument FPR and return the fingerprint
4121         in it.
4122         * gpgme.h: Adjust prototype of gpgme_op_genkey.
4123
4124 2002-11-19  Marcus Brinkmann  <marcus@g10code.de>
4125
4126         * rungpg.c (gpg_keylist): Add --with-fingerprint to gpg invocation
4127         twice, to get fingerprints on subkeys.  Suggested by Timo Schulz
4128         <twoaday@freakmail.de>.
4129         (gpg_keylist_ext): Likewise.
4130
4131 2002-11-05  Marcus Brinkmann  <marcus@g10code.de>
4132
4133         * import.c (append_xml_impinfo): Use
4134         _gpgme_data_append_string_for_xml rather than
4135         _gpgme_data_append_string for the field content.
4136         Submitted by Miguel Coca <e970095@zipi.fi.upm.es>.
4137         
4138 2002-10-10  Marcus Brinkmann  <marcus@g10code.de>
4139
4140         * rungpg.h, engine-gpgsm.h: File removed.
4141         * engine-backend.h: New file.
4142         * Makefile.am (gpgsm_components): New variable, set depending on
4143         automake conditional HAVE_GPGSM.
4144         (libgpgme_la_SOURCES): Add engine-backend.h, remove rungpg.h and
4145         engine-gpgsm.h.  Replace engine-gpgsm.c with ${gpgsm_components}.
4146         (status-table.h): Depend on gpgme.h, not rungpg.h.
4147         * conversion.c: Include <stdlib.h>.
4148         * engine-gpgsm.c: Do not set ENABLE_GPGSM here.  Include
4149         "engine-backend.h" instead "engine-gpgsm.h".  Reorder some
4150         functions and remove all function prototypes.
4151         (_gpgme_gpgsm_get_version): Make static and rename to ...
4152         (gpgsm_get_version): ... this.
4153         (_gpgme_gpgsm_check_version): Make static and rename to ...
4154         (gpgsm_check_version): ... this.
4155         (_gpgme_gpgsm_new): Make static.  Change argument type from
4156         GpgsmObject * to void **.  Call gpgsm_release instead
4157         _gpgme_gpgsm_release.
4158         (_gpgme_gpgsm_op_decrypt): Make static and rename to ...
4159         (gpgsm_check_decrypt): ... this.
4160         (_gpgme_gpgsm_op_delete): Make static and rename to ...
4161         (gpgsm_check_delete): ... this.
4162         (_gpgme_gpgsm_set_recipients): Make static and rename to ...
4163         (gpgsm_check_set_recipients): ... this.
4164         (_gpgme_gpgsm_op_encrypt): Make static and rename to ...
4165         (gpgsm_encrypt): ... this.
4166         (_gpgme_gpgsm_op_export): Make static and rename to ...
4167         (gpgsm_export): ... this.
4168         (_gpgme_gpgsm_op_genkey): Make static and rename to ...
4169         (gpgsm_genkey): ... this.
4170         (_gpgme_gpgsm_op_import): Make static and rename to ...
4171         (gpgsm_import): ... this.
4172         (_gpgme_gpgsm_op_keylist): Make static and rename to ...
4173         (gpgsm_keylist): ... this.
4174         (_gpgme_gpgsm_op_keylist_ext): Make static and rename to ...
4175         (gpgsm_keylist_ext): ... this.
4176         (_gpgme_gpgsm_op_sign): Make static and rename to ...
4177         (gpgsm_sign): ... this.
4178         (_gpgme_gpgsm_op_trustlist): Make static and rename to ...
4179         (gpgsm_trustlist): ... this.
4180         (_gpgme_gpgsm_op_verify): Make static and rename to ...
4181         (gpgsm_verify): ... this.
4182         (gpgsm_status_handler): Rename to ...
4183         (status_handler): ... this.
4184         (_gpgme_gpgsm_set_status_handler): Make static and rename to ...
4185         (gpgsm_set_status_handler): ... this.
4186         (_gpgme_gpgsm_set_colon_line_handler): Make static and rename to ...
4187         (gpgsm_set_colon_line_handler): ... this.
4188         (_gpgme_gpgsm_add_io_cb): Rename to ...
4189         (add_io_cb): ... this.
4190         (_gpgme_gpgsm_start): Make static and rename to ...
4191         (gpgsm_start): ... this.
4192         (_gpgme_gpgsm_set_io_cb): Make static and rename to ...
4193         (gpgsm_set_io_cb): ... this.
4194         (_gpgme_gpgsm_io_event): Make static and rename to ...
4195         (gpgsm_io_event): ... this.
4196         (struct _gpgme_engine_ops_gpgsm): New variable.
4197         [!ENABLE_GPGSM]: Removed.
4198         * engine.c: Do not include <time.h>, <sys/types.h>, <string.h>,
4199         <assert.h>, "io.h", "rungpg.h" and "engine-gpgsm.h".  Include
4200         <stdlib.h> and "engine-backend.h".
4201         (struct engine_object_s): Rewritten.
4202         (engine_ops): New variable.
4203         * engine.c (_gpgme_engine_get_path, _gpgme_engine_get_version,
4204         _gpgme_engine_check_version, _gpgme_engine_new,
4205         _gpgme_engine_release, _gpgme_engine_set_verbosity,
4206         _gpgme_engine_set_status_handler,
4207         _gpgme_engine_set_command_handler,
4208         _gpgme_engine_set_colon_line_handler, _gpgme_engine_op_decrypt,
4209         _gpgme_engine_op_delete, _gpgme_engine_op_edit,
4210         _gpgme_engine_op_encrypt, _gpgme_engine_op_encrypt_sign,
4211         _gpgme_engine_op_export, _gpgme_engine_op_genkey,
4212         _gpgme_engine_op_import, _gpgme_engine_op_keylist,
4213         _gpgme_engine_op_keylist_ext, _gpgme_engine_op_sign,
4214         _gpgme_engine_op_trustlist, _gpgme_engine_op_verify,
4215         _gpgme_engine_start, _gpgme_engine_set_io_cbs,
4216         _gpgme_engine_io_event): Reimplement.
4217         * engine.h: Fix a few comments and a variable name in a prototype.
4218         * ops.h: Do not include "rungpg.h".
4219         * passphrase.c: Include config.h only if [HAVE_CONFIG_H].  Do not
4220         include "rungpg.h".
4221         * recipient.c: Likewise.
4222         * signers.c: Likewise.
4223         * version.c: Likewise.
4224         * rungpg.c: Likewise.  Include "engine-backend.h".  Reorder
4225         functions and remove prototypes.
4226         (_gpgme_gpg_get_version): Make static and rename to ...
4227         (gpg_get_version): ... this.
4228         (_gpgme_gpg_check_version): Make static and rename to ...
4229         (gpg_check_version): ... this.
4230         (_gpgme_gpg_new): Make static.  Change argument type from
4231         GpgObject * to void **.  Call gpg_release instead
4232         _gpgme_gpg_release.
4233         (_gpgme_gpg_op_decrypt): Make static and rename to ...
4234         (gpg_check_decrypt): ... this.
4235         (_gpgme_gpg_op_delete): Make static and rename to ...
4236         (gpg_check_delete): ... this.
4237         (_gpgme_gpg_set_recipients): Make static and rename to ...
4238         (gpg_check_set_recipients): ... this.
4239         (_gpgme_gpg_op_encrypt): Make static and rename to ...
4240         (gpg_encrypt): ... this.
4241         (_gpgme_gpg_op_export): Make static and rename to ...
4242         (gpg_export): ... this.
4243         (_gpgme_gpg_op_genkey): Make static and rename to ...
4244         (gpg_genkey): ... this.
4245         (_gpgme_gpg_op_import): Make static and rename to ...
4246         (gpg_import): ... this.
4247         (_gpgme_gpg_op_keylist): Make static and rename to ...
4248         (gpg_keylist): ... this.
4249         (_gpgme_gpg_op_keylist_ext): Make static and rename to ...
4250         (gpg_keylist_ext): ... this.
4251         (_gpgme_gpg_op_sign): Make static and rename to ...
4252         (gpg_sign): ... this.
4253         (_gpgme_gpg_op_trustlist): Make static and rename to ...
4254         (gpg_trustlist): ... this.
4255         (_gpgme_gpg_op_verify): Make static and rename to ...
4256         (gpg_verify): ... this.
4257         (gpg_status_handler): Rename to ...
4258         (status_handler): ... this.
4259         (_gpgme_gpg_set_status_handler): Make static and rename to ...
4260         (gpg_set_status_handler): ... this.
4261         (_gpgme_gpg_set_colon_line_handler): Make static and rename to ...
4262         (gpg_set_colon_line_handler): ... this.
4263         (gpgme_gpg_add_io_cb): Rename to ...
4264         (add_io_cb): ... this.
4265         (_gpgme_gpg_start): Make static and rename to ...
4266         (gpg_start): ... this.
4267         (_gpgme_gpg_set_io_cb): Make static and rename to ...
4268         (gpg_set_io_cb): ... this.
4269         (_gpgme_gpg_io_event): Make static and rename to ...
4270         (gpg_io_event): ... this.
4271         (struct _gpgme_engine_ops_gpg): New variable.
4272
4273 2002-10-10  Marcus Brinkmann  <marcus@g10code.de>
4274
4275         * engine-gpgsm.c (_gpgme_gpgsm_op_verify) [!ENABLE_GPGSM]: Add
4276         missing argument.
4277
4278 2002-10-09  Marcus Brinkmann  <marcus@g10code.de>
4279
4280         * data.h, data-user.c, data-stream.c, data-mem.c, data-fd.c,
4281         data-compat.c: New file.  Really check them in this time, completes
4282         2002-10-08 change.
4283
4284         * rungpg.h (GpgStatusHandler): Rename type to GpgmeStatusHandler
4285         and move to ...
4286         * types.h (GpgmeStatusHandler): ... here.
4287         * rungpg.h (GpgColonLineHandler): Rename type to GpgmeColonLineHandler.
4288         and move to ...
4289         * types.h (GpgmeColonLineHandler): ... here.
4290         * rungpg.h (GpgCommandHandler): Rename type to GpgmeCommandHandler.
4291         and move to ...
4292         * types.h (GpgmeCommandHandler): ... here.
4293         * engine.h: Don't include "rungpg.h".
4294         (_gpgme_engine_set_status_handler): Change type of
4295         argument from GpgStatusHandler to GpgmeStatusHandler.
4296         (_gpgme_engine_set_colon_line_handler): Change type of
4297         argument from GpgColonLineHandler to GpgmeColonLineHandler.
4298         (_gpgme_engine_set_command_handler): Change type of
4299         argument from GpgCommandHandler to GpgmeCommandHandler.
4300         * engine-gpgsm.h: Don't include "rungpg.h".
4301         (_gpgme_gpgsm_set_status_handler): Change type of
4302         argument from GpgStatusHandler to GpgmeStatusHandler.
4303         (_gpgme_gpgsm_set_colon_line_handler): Change type of
4304         argument from GpgColonLineHandler to GpgmeColonLineHandler.
4305         * engine-gpgsm.c: Do not include "rungpg.h".
4306         (struct gpgsm_object_s): Change type of
4307         status.fnc to GpgmeStatusHandler.  Change type of colon.fnc to
4308         GpgmeColonLineHandler.
4309         (gpgsm_assuan_simple_command): Change type of argument from
4310         GpgStatusHandler to GpgmeStatusHandler.
4311         (_gpgme_gpgsm_set_status_handler): Likewise.
4312         (_gpgme_gpgsm_set_colon_line_handler): Change type of argument from
4313         GpgColonLineHandler to GpgmeColonLineHandler.
4314         * rungpg.h (_gpgme_gpg_set_status_handler): Change type of
4315         argument from GpgStatusHandler to GpgmeStatusHandler.
4316         (_gpgme_gpg_set_colon_line_handler): Change type of
4317         argument from GpgColonLineHandler to GpgmeColonLineHandler.
4318         (_gpgme_gpg_set_command_handler): Change type of
4319         argument from GpgCommandHandler to GpgmeCommandHandler.
4320         * rungpg.c (struct gpg_object_s): Change type of status.fnc to
4321         GpgmeStatusHandler.  Change type of colon.fnc to
4322         GpgmeColonLineHandler.  Change type of cmd.fnc to
4323         GpgmeCommandLineHandler.
4324         (_gpgme_gpg_set_status_handler): Change type of argument FNC to
4325         GpgmeStatusHandler.
4326         (_gpgme_gpg_set_colon_line_handler): Change type of argument FNC
4327         to GpgmeColonLineHandler.
4328         (_gpgme_gpg_set_command_handler): Change type of argument FNC to
4329         GpgmeCommandHandler.
4330         * engine.c (_gpgme_engine_set_status_handler): Change type of
4331         argument FNC to GpgmeStatusHandler.
4332         (_gpgme_engine_set_colon_line_handler): Change type of argument FNC
4333         to GpgmeColonLineHandler.
4334         (_gpgme_engine_set_command_handler): Change type of argument FNC to
4335         GpgmeCommandHandler.
4336
4337         * rungpg.h (_gpgme_gpg_enable_pipemode): Remove prototype.
4338         * rungpg.c (struct gpg_object_s): Remove PM.
4339         (pipemode_cb): Prototype removed.
4340         (add_pm_data): Function removed.
4341         (_gpgme_gpg_enable_pipemode): Likewise.
4342         (pipemode_copy): Likewise.
4343         (pipemode_cb): Likewise.
4344         (add_arg): Don't check for pipemode.
4345         (add_data): Likewise.
4346         (_gpgme_gpg_set_status_handler): Likewise.
4347         (_gpgme_gpg_set_colon_line_handler): Likewise.
4348         (_gpgme_gpg_set_command_handler): Likewise.
4349         (_gpgme_gpg_spawn): Likewise.
4350         (_gpgme_gpg_spawn): Don't set PM.active.
4351         (_gpgme_gpg_op_verify): Remove pipemode case.
4352         * verify.c (_gpgme_op_verify_start): Remove pipemode case.
4353
4354         * rungpg.h (_gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4355         _gpgme_gpg_add_pm_data, _gpgme_gpg_housecleaning,
4356         _gpgme_gpg_set_simple_line_handler): Prototype removed.
4357         (_gpgme_gpg_set_verbosity): New prototype.
4358         * rungpg.c (_gpgme_gpg_add_data): Make static and rename to ...
4359         (add_data): ... this.
4360         (_gpgme_gpg_add_pm_data): Call add_data, not _gpgme_gpg_add_data.
4361         (_gpgme_gpg_set_command_handler): Likewise.
4362         (_gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4363         _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4364         _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4365         _gpgme_gpg_op_verify): Likewise.
4366         (_gpgme_gpg_add_pm_data): Rename to ...
4367         (add_pm_data): ... this.
4368         (_gpgme_gpg_op_verify): Call add_pm_data, not
4369         _gpgme_gpg_add_pm_data.
4370         (_gpgme_gpg_add_arg): Make static and rename to ...
4371         (add_arg): ... this.
4372         (_gpgme_gpg_set_command_handler, _gpgme_gpg_new,
4373         _gpgme_gpg_op_decrypt, _gpgme_gpg_op_delete,
4374         _gpgme_append_gpg_args_from_signers, _gpgme_gpg_op_edit,
4375         _gpgme_append_gpg_args_from_recipients, _gpgme_gpg_op_encrypt,
4376         _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4377         _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_keylist,
4378         _gpgme_gpg_op_keylist_ext, _gpgme_gpg_op_trustlist,
4379         _gpgme_gpg_op_sign, _gpgme_gpg_op_verify): Use add_arg, not
4380         _gpgme_gpg_add_arg.
4381         (_gpgme_gpg_set_verbosity): New function.
4382         (struct gpg_object_s): Remove member simple from colon.
4383         (_gpgme_gpg_set_colon_line_handler): Don't initialize simple.
4384         (_gpgme_gpg_set_simple_line_handler): Removed function.
4385         (read_colon_line): Don't check the GPG->colon.simple.
4386         * engine.c (_gpgme_engine_set_verbosity): Call
4387         _gpgme_gpg_set_verbosity instead _gpgme_gpg_add_arg.
4388
4389 2002-10-08  Marcus Brinkmann  <marcus@g10code.de>
4390
4391         * util.h (_gpgme_malloc, _gpgme_realloc, _gpgme_calloc,
4392         _gpgme_strdup, _gpgme_free): Remove prototypes.
4393         (xtrymalloc, xtrycalloc, xtryrealloc, xtrystrdup, xfree): Remove
4394         macros.
4395         * util.c: File removed.
4396         * Makefile.am (libgpgme_la_SOURCES): Remove util.h.
4397         * conversion.c (_gpgme_decode_c_string): Use malloc instead of
4398         xtrymalloc, realloc instead of xtryrealloc, calloc instead of
4399         xtrycalloc, free instead of xfree.
4400         (_gpgme_data_append_percentstring_for_xml): Likewise.
4401         * data.c (_gpgme_data_new, _gpgme_data_release): Likewise.
4402         * data-compat.c (gpgme_data_new_from_filepart): Likewise.
4403         * data-mem.c (mem_write, mem_release, gpgme_data_new_from_mem,
4404         _gpgme_data_get_as_string): Likewise.
4405         * debug.c (debug_init): Likewise.
4406         * decrypt.c (_gpgme_release_decrypt_result): Likewise.
4407         * delete.c (_gpgme_release_delete_result): Likewise.
4408         * edit.c (_gpgme_release_edit_result, _gpgme_op_edit_start):
4409         Likewise.
4410         * encrypt.c (_gpgme_release_encrypt_result): Likewise.
4411         * engine.c (_gpgme_engine_get_info, _gpgme_engine_new,
4412         _gpgme_engine_release): Likewise.
4413         * engine-gpgsm.c (_gpgme_gpgsm_new, _gpgme_gpgsm_release,
4414         _gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
4415         gpgsm_set_recipients, _gpgme_gpgsm_op_encrypt,
4416         _gpgme_gpgsm_op_export, _gpgme_gpgsm_op_genkey,
4417         _gpgme_gpgsm_op_import, _gpgme_gpgsm_op_keylist,
4418         _gpgme_gpgsm_op_keylist_ext, _gpgme_gpgsm_op_sign,
4419         _gpgme_gpgsm_op_verify, gpgsm_status_handler): Likewise.
4420         * genkey.c (_gpgme_release_genkey_result): Likewise.
4421         * gpgme.c (gpgme_new, gpgme_release): Likewise.
4422         * import.c (_gpgme_release_import_result): Likewise.
4423         * key.c (_gpgme_key_cache_init, _gpgme_key_cache_add, key_new,
4424         add_subkey, gpgme_key_release, _gpgme_key_append_name): Likewise.
4425         * keylist.c (_gpgme_release_keylist_result, keylist_colon_handler,
4426         _gpgme_op_keylist_event_cb, gpgme_op_keylist_next): Likewise.
4427         * ops.h (test_and_allocate_result): Likewise.
4428         * passphrase.c (_gpgme_release_passphrase_result,
4429         _gpgme_passphrase_status_handler,
4430         _gpgme_passphrase_command_handler): Likewise.
4431         * progress.c (_gpgme_progress_status_handler): Likewise.
4432         * recipient.c (gpgme_recipients_new, gpgme_recipients_release,
4433         gpgme_recipients_add_name_with_validity): Likewise.
4434         * rungpg.c (_gpgme_gpg_new, _gpgme_gpg_release,
4435         _gpgme_gpg_add_arg, _gpgme_gpg_add_data,
4436         _gpgme_gpg_set_colon_line_handler, free_argv, free_fd_data_map,
4437         build_argv, _gpgme_gpg_spawn, read_status, read_colon_line):
4438         Likewise.
4439         * sign.c (_gpgme_release_sign_result): Likewise.
4440         * signers.c (_gpgme_signers_add): Likewise.
4441         * trustlist.c (trust_item_new, trustlist_colon_handler,
4442         _gpgme_op_trustlist_event_cb, gpgme_op_trustlist_next,
4443         gpgme_trustitem_release): Likewise.
4444         * verify.c (_gpgme_release_verify_result, finish_sig): Likewise.
4445         * version.c (gpgme_get_engine_info, _gpgme_get_program_version):
4446         Likewise.
4447         * w32-io.c (create_reader, create_writer, destroy_reader,
4448         destroy_writer, build_commandline, _gpgme_io_spawn): Likewise.
4449         * w32-sema.c (critsect_init, _gpgme_sema_cs_destroy): Likewise.
4450         * w32-util.c (read_w32_registry_string): Likewise.
4451         * wait.c (_gpgme_fd_table_deinit, _gpgme_fd_table_put,
4452         _gpgme_wait_event_cb, _gpgme_add_io_cb, _gpgme_remove_io_cb)
4453         * data-compat.c: Include <stdlib.h>.
4454
4455 2002-10-08  Marcus Brinkmann  <marcus@g10code.de>
4456
4457         New data object component:
4458
4459         * gpgme.h (GpgmeDataReadCb, GpgmeDataWriteCb, GpgmeDataSeekCb,
4460         GpgmeDataReleaseCb): New types.
4461         (struct GpgmeDataCbs): New structure.
4462         (gpgme_data_read): Changed prototype to match that of read() closely.
4463         (gpgme_data_write): Similar for write().
4464         (gpgme_data_seek, gpgme_data_new_from_cbs, gpgme_data_new_from_fd,
4465         gpgme_data_new_from_stream): New prototypes.
4466         (gpgme_data_get_type, gpgme_check_engine): Prototype removed.
4467
4468         * Makefile.am (libgpgme_la_SOURCES): Add data.h, data-fd.c,
4469         data-stream.c, data-mem.c, data-user.c and data-compat.c.
4470         * data.c: Reimplemented from scratch.
4471         * (data-compat.c, data-fd.c, data.h, data-mem.c, data-stream.c,
4472         data-user.c): New file.
4473         * context.h (struct gpgme_data_s): Removed.
4474         * conversion.c: Include <errno.h> and <sys/types.h>.
4475         (_gpgme_data_append): New function.
4476         * data.c (_gpgme_data_append_string): Move to ...
4477         * conversion.c (_gpgme_data_append_string): ... here.
4478         * data.c (_gpgme_data_append_for_xml): Move to ...
4479         * conversion.c (_gpgme_data_append_for_xml): ... here.
4480         * data.c (_gpgme_data_append_string_for_xml): Move to ...
4481         * conversion.c (_gpgme_data_append_string_for_xml): ... here.
4482         * data.c (_gpgme_data_append_percentstring_for_xml): Move to ...
4483         * conversion.c (_gpgme_data_append_percentstring_for_xml): ... here.
4484
4485         * ops.h (_gpgme_data_get_mode, _gpgme_data_set_mode): Prototype
4486         removed.
4487         * types.h (GpgmeDataMode): Type removed.
4488
4489         * decrypt.c (_gpgme_decrypt_start): Don't check data type or mode.
4490         * edit.c (_gpgme_op_edit_start): Likewise.
4491         * encrypt.c (_gpgme_op_encrypt_start): Likewise.
4492         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4493         * encrypt-sign.c (_gpgme_op_encrypt_sign_start): Likewise.
4494         * export.c (_gpgme_op_export_start): Likewise.
4495         * genkey.c (_gpgme_op_genkey_start): Likewise.
4496         * import.c (_gpgme_op_import_start): Likewise.
4497         * sign.c (_gpgme_op_sign_start): Likewise.
4498         * verify.c (_gpgme_op_verify_start): Likewise.
4499         
4500         * encrypt.c (gpgme_op_encrypt): Remove hack that returns invalid
4501         no recipient if no data was returned.
4502         * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4503         no recipient if no data was returned.
4504         * encrypt-sign.c (gpgme_op_encrypt_sign): Remove hack that returns
4505         no recipient if no data was returned.
4506
4507         * engine.c (_gpgme_engine_op_verify): Add new argument to
4508         differentiate detached from normal signatures.
4509         * engine.h (_gpgme_engine_op_verify): Likewise for prototype.
4510         * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.  Don't check
4511         mode of data argument.
4512         * engine-gpgsm.h (_gpgme_gpgsm_op_verify): Likewise for prototype.
4513         * gpgme.h (gpgme_op_verify_start): Likewise for prototype.
4514         (gpgme_op_verify): Likewise for prototype.
4515         * rungpg.c (_gpgme_gpg_op_verify): Likewise.
4516         * rungpg.h (_gpgme_gpg_op_verify): Likewise for prototype.
4517         * verify.c (_gpgme_op_verify_start): Likewise.
4518         (gpgme_op_verify_start): Likewise.
4519         (gpgme_op_verify): Likewise.
4520
4521         * rungpg.c (struct arg_and_data_s): New member INBOUND to hold
4522         direction of data object.
4523         (_gpgme_gpg_add_data): Add new argument INBOUND.  Use it to
4524         determine direction of data object.
4525         (_gpgme_gpg_add_pm_data, _gpgme_gpg_set_command_handler,
4526         _gpgme_gpg_op_decrypt, _gpgme_gpg_op_edit, _gpgme_gpg_op_encrypt,
4527         _gpgme_gpg_op_encrypt_sign, _gpgme_gpg_op_export,
4528         _gpgme_gpg_op_genkey, _gpgme_gpg_op_import, _gpgme_gpg_op_sign,
4529         _gpgme_gpg_op_verify): Add new argument to _gpgme_gpg_add_data
4530         invocation.
4531         (build_argv): Use new member INBOUND to determine direction of
4532         file descriptor.  Don't check the data type.
4533         * rungpg.h (_gpgme_gpg_add_data): Add new argument to prototype.
4534         
4535         * gpgme.c (gpgme_get_op_info): Don't call
4536         _gpgme_data_get_as_string if CTX->op_info is NULL.
4537
4538         * version.c (gpgme_check_engine): Function removed.
4539
4540 2002-09-30  Werner Koch  <wk@gnupg.org>
4541
4542         * keylist.c (keylist_colon_handler): Take care when printing a
4543         NULL with the DEBUG.
4544
4545         * engine-gpgsm.c (struct gpgsm_object_s): New member ANY.
4546         (gpgsm_status_handler): Run the colon function to indicate EOF.
4547         (_gpgme_gpgsm_set_colon_line_handler): Better reset ANY here.
4548
4549 2002-09-28  Marcus Brinkmann  <marcus@g10code.de>
4550
4551         * conversion.c (_gpgme_hextobyte): Prevent superfluous
4552         multiplication with base.  Reported by Stéphane Corthésy.
4553
4554         * keylist.c (gpgme_op_keylist_ext_start): Use private asynchronous
4555         operation type in invocation of _gpgme_op_reset.
4556
4557 2002-09-20  Werner Koch  <wk@gnupg.org>
4558
4559         * ath.c: Include sys/time.h if sys/select.h is not available.
4560
4561 2002-09-13  Marcus Brinkmann  <marcus@g10code.de>
4562
4563         * keylist.c (keylist_status_handler): Do not call finish_key() here.
4564         (gpgme_op_keylist_ext_start): Set CTX->tmp_key to NULL.
4565
4566 2002-09-03  Marcus Brinkmann  <marcus@g10code.de>
4567
4568         * Makefile.am (assuan_libobjs): Remove @LTLIBOBJS@ as we link them
4569         into gpgme unconditionally.
4570         (libgpgme_la_LIBADD): Change @LIBOBJS@ into @LTLIBOBJS@.
4571
4572 2002-09-02  Marcus Brinkmann  <marcus@g10code.de>
4573
4574         * Makefile.am (assuan_libobjs): Use @LTLIBOBJS@ instead @LIBOBJS@.
4575
4576 2002-09-02  Marcus Brinkmann  <marcus@g10code.de>
4577
4578         * debug.c (_gpgme_debug_add): Test *LINE, not LINE.
4579         (_gpgme_debug_end): Likewise.
4580         Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4581
4582 2002-09-02  Marcus Brinkmann  <marcus@g10code.de>
4583
4584         * posix-io.c (_gpgme_io_select): Don't use a non-constant struct
4585         initializer.
4586         * version.c (_gpgme_get_program_version): Likewise.
4587         Reported by Dr. Stefan Dalibor <Dr.Stefan.Dalibor@bfa.de>.
4588
4589 2002-09-02  Marcus Brinkmann  <marcus@g10code.de>
4590
4591         * conversion.c (_gpgme_decode_c_string): Set DESTP before
4592         modifying DEST.
4593
4594         * conversion.c (_gpgme_decode_c_string): Fix off by one error in
4595         last change.
4596         * rungpg.c (_gpgme_append_gpg_args_from_signers): Move before
4597         _gpgme_op_edit so its prototype is known early on.
4598
4599         * conversion.c: New file.
4600         * util.h: Add prototypes for _gpgme_decode_c_string and
4601         _gpgme_hextobyte.
4602         * keylist.c (keylist_colon_handler): Call _gpgme_decode_c_string
4603         on issuer name.
4604         * Makefile.am (libgpgme_la_SOURCES): Add conversion.c
4605         * key.c (_gpgme_key_append_name): Replace calls to hextobyte by
4606         calls to _gpgme_hextobyte.
4607         (hash_key): Likewise.
4608
4609 2002-09-01  Marcus Brinkmann  <marcus@g10code.de>
4610
4611         * op-support.c (_gpgme_op_reset): Set CTX->pending after calling
4612         _gpgme_engine_release, as this will reset pending to zero in the
4613         event done callback on cancelled operations.
4614
4615 2002-08-30  Marcus Brinkmann  <marcus@g10code.de>
4616
4617         * rungpg.c (_gpgme_gpg_op_edit): Add args from signers.
4618         Suggested by Miguel Coca <e970095@zipi.fi.upm.es>.
4619
4620         * rungpg.c (_gpgme_gpg_op_edit): Add bogus ctx argument.
4621         * rungpg.h: Also to prototype.
4622         * engine.c (_gpgme_engine_op_edit): Likewise.
4623         * engine.h: Likewise.
4624         * edit.c (_gpgme_op_edit_start): Likewise.
4625
4626 2002-08-29  Werner Koch  <wk@gnupg.org>
4627
4628         * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement signer
4629         selection.
4630         * vasprintf.c (va_copy): Define macro if not yet defined.
4631
4632 2002-08-29  Marcus Brinkmann  <marcus@g10code.de>
4633
4634         * passphrase.c (_gpgme_passphrase_status_handler): Reset
4635         CTX->result.passphrase->no_passphrase if passphrase is given (good
4636         or bad).  Submitted by Jean DIRAISON <jean.diraison@free.fr>.
4637
4638 2002-08-28  Marcus Brinkmann  <marcus@g10code.de>
4639
4640         * posix-io.c (_gpgme_io_spawn): Use a double-fork approach.
4641         Return 0 on success, -1 on error.
4642         * version.c (_gpgme_get_program_version): Don't wait for the child.
4643         * engine.c (_gpgme_engine_housecleaning): Function removed.
4644         (do_reaping): Likewise.
4645         (_gpgme_engine_add_child_to_reap_list): Likewise.
4646         (struct reap_s): Removed.
4647         (reap_list): Likewise.
4648         (reap_list_lock): Likewise.
4649         * engine.h (_gpgme_engine_io_event): Remove prototypes for
4650         _gpgme_engine_housecleaning and
4651         _gpgme_engine_add_child_to_reap_list.
4652         * rungpg.c (_gpgme_gpg_release): Don't add child to reap list.
4653         (struct gpg_object_s): Remove PID member.
4654         (_gpgme_gpg_new): Don't initialize GPG->pid.
4655         (_gpgme_gpg_spawn): Don't set GPG->pid.
4656         * wait.c (run_idle): Removed.
4657         (gpgme_wait): Run idle_function directly.
4658
4659 2002-08-21  Marcus Brinkmann  <marcus@g10code.de>
4660
4661         * encrypt-sign.c (encrypt_sign_status_handler): Remove dead
4662         variables encrypt_info and encrypt_info_len.
4663         * trustlist.c (gpgme_op_trustlist_start): Set colon line handler.
4664         * posix-sema.c (sema_fatal): Remove function.
4665         All these reported by Stéphane Corthésy.
4666
4667 2002-08-23  Werner Koch  <wk@gnupg.org>
4668
4669         * gpgme-config.in: Made --prefix work for --libs. 
4670
4671 2002-08-21  Marcus Brinkmann  <marcus@g10code.de>
4672
4673         * ath.h: Update list of symbols that get a prefix: Rename the
4674         ath_mutex_*_available symbols to ath_*_available.
4675
4676 2002-08-21  Marcus Brinkmann  <marcus@g10code.de>
4677
4678         * stpcpy.c: New file from gnulib.
4679         * Makefile.am (assuan_libobjs): Remove jnlib.
4680
4681 2002-08-20  Marcus Brinkmann  <marcus@g10code.de>
4682
4683         * gpgme.h: Add prototype for gpgme_op_import_ext.
4684         * import.c (struct import_result_s): New member `nr_considered'.
4685         Rename `any_imported' to `nr_imported'.
4686         (import_status_handler): Increment nr_imported.  Set nr_considered
4687         if appropriate.
4688         (gpgme_op_import_ext): New function.
4689         (gpgme_op_import): Implement in terms of gpgme_op_import_ext.
4690
4691 2002-08-20  Werner Koch  <wk@gnupg.org>
4692
4693         * gpgme.m4: Replaced with a new and faster version.  This does not
4694         anymore try to build test programs.  If we really need test
4695         programs, we should add an option to gpgme-config to do so. 
4696
4697         * vasprintf.c (int_vasprintf): Hack to handle NULL passed for %s.
4698
4699 2002-08-20  Marcus Brinkmann  <marcus@g10code.de>
4700
4701         * gpgme.c (_gpgme_set_op_info): Append data on subsequent calls.
4702         * encrypt-sign.c (encrypt_sign_status_handler): Remove op_info
4703         handling.
4704
4705 2002-08-19  Werner Koch  <wk@gnupg.org>
4706
4707         * decrypt.c (is_token,skip_token): Duplicated from verify.c
4708         (gpgme_op_decrypt): Hack to properly return Decryption_Failed..
4709         (_gpgme_decrypt_status_handler): Create an operation info.
4710
4711 2002-08-14  Werner Koch  <wk@gnupg.org>
4712
4713         * key.h (struct certsig_s): New.  Use it in gpgme_key_s.
4714         * key.c (gpgme_key_release): Release it. We need to add more code
4715         of course.
4716         (_gpgme_key_append_name): Use memset to intialize the struct.
4717         * gpgme.h (GPGME_KEYLIST_MODE_SIGS): New.
4718         * rungpg.c (_gpgme_gpg_op_keylist): Include sigs in listing depending
4719         non the list mode.
4720         
4721         * key.c (gpgme_key_get_string_attr): Use GPGME_ATTR_TYPE to return
4722         information about the key type (PGP or X.509).
4723         (gpgme_key_get_ulong_attr): Likewise.
4724
4725         * keylist.c (keylist_colon_handler): Include 1 in the check for
4726         valid algorithms so that RSA is usable.  Store the issuer name and
4727         serial number also for "crs" records.  Parse the expire date for
4728         subkeys.
4729         (set_userid_flags): Put them onto the last appended key.
4730
4731 2002-07-29  Marcus Brinkmann  <marcus@g10code.de>
4732
4733         * rungpg.c (_gpgme_gpg_op_edit): Use --with-colons.
4734
4735 2002-07-28  Marcus Brinkmann  <marcus@g10code.de>
4736
4737         * data.c (gpgme_data_read): For GPGME_DATA_TYPE_NONE, return EOF
4738         instead an error.
4739
4740         The following changes make it possible to flush an inbound data
4741         pipe before invoking a command handler:
4742
4743         * posix-io.c (_gpgme_io_select): Accept new argument NONBLOCK to
4744         _gpgme_io_select.  Set timeout of 0 if this is set.
4745         * w32-io.c (_gpgme_io_select): Likewise.
4746         * io.h: Add new argument NONBLOCK to _gpgme_io_select prototype.
4747         * wait.c (do_select): Add new argument to _gpgme_io_select
4748         invocation.
4749         * rungpg.h (_gpgme_gpg_set_command_handler): Add new argument
4750         linked_data to prototype.
4751         * engine.h (_gpgme_engine_set_command_handler): Likewise.
4752         * engine.c (_gpgme_engine_set_command_handler): Likewise.
4753         * passphrase.c (_gpgme_passphrase_start): Pass NULL as linked_data
4754         argument to _gpgme_engine_set_command_handler.
4755         * rungpg.c (struct gpg_object_s): New members linked_data and
4756         linked_idx in CMD.
4757         (_gpgme_gpg_new): Initialize those new members.
4758         (_gpgme_gpg_set_command_handler): Accept new argument linked_data.
4759         (build_argv): Handle linked_data in the same hack as cb_data.
4760         (read_status): If linked_data is in use, flush the pipe before
4761         activating the command handler.
4762         * gpgme.h: Add prototypes for gpgme_op_edit_start and
4763         gpgme_op_edit.
4764
4765         The next changes export the status codes to the user:
4766
4767         * decrypt.c (_gpgme_decrypt_status_handler): Likewise, also prefix
4768         all STATUS_ with GPGME_.
4769         * delete.c (delete_status_handler): Likewise.
4770         * decrypt-verify.c (decrypt_verify_status_handler): Likewise.
4771         * encrypt.c (_gpgme_encrypt_status_handler): Likewise.
4772         (_gpgme_encrypt_sym_status_handler): Likewise.
4773         * encrypt-sign.c (encrypt_sign_status_handler): Likewise.
4774         * engine-gpgsm.c (parse_status): Likewise.
4775         (gpgsm_status_handler): Likewise.
4776         (gpgsm_set_recipients): Likewise.
4777         * export.c (export_status_handler): Likewise.
4778         * genkey.c (genkey_status_handler): Likewise.
4779         * import.c (append_xml_impinfo): Likewise.
4780         (import_status_handler): Likewise.
4781         * keylist.c (keylist_status_handler): Likewise.
4782         * passphrase.c (_gpgme_passphrase_status_handler): Likewise.
4783         (command_handler): Likewise.
4784         * progress.c (_gpgme_progress_status_handler): Likewise.
4785         * sign.c (_gpgme_sign_status_handler): Likewise.
4786         * trustlist.c (trustlist_status_handler): Likewise.
4787         * verify.c (_gpgme_verify_status_handler): Likewise.
4788         * gpgme.h (GpgmeEditCb): New type.
4789         * rungpg.h (GpgStatusCode): Rename and move to ...
4790         * gpgme.h (GpgmeStatusCode): ... this and here.
4791         * Makefile.am (status-table.h): Run mkstatus on gpgme.h, not rungpg.h.
4792         * mkstatus: Prefix STATUS with GPGME_.
4793         * rungpg.h (GpgStatusHandler, GpgCommandHandler): Change type
4794         accordingly.
4795         * ops.h (_gpgme_verify_status_handler,
4796         _gpgme_decrypt_status_handler, _gpgme_sign_status_handler,
4797         _gpgme_encrypt_status_handler, _gpgme_passphrase_status_handler,
4798         _gpgme_progress_status_handler): Likewise.
4799         * rungpg.c (struct gpg_object_s): Likewise for CMD.code.
4800
4801         These changes add an edit operation to GPGME:
4802         
4803         * context.h (struct gpgme_context_s): New member RESULT.edit.  *
4804         ops.h: Add prototype for _gpgme_release_edit_result and
4805         _gpgme_passphrase_command_handler.
4806         * passphrase.c (command_handler): Make non-static and rename to ...
4807         (_gpgme_passphrase_command_handler): ... this.
4808         (_gpgme_passphrase_start): Use new name for command handler.
4809         * types.h: Add EditResult type.
4810         * gpgme.c (_gpgme_release_result): Release EDIT result.
4811         * edit.c: New file.
4812         * Makefile.am (libgpgme_la_SOURCES): Add edit.c.
4813         (libgpgme_la_LDADD): Rename to libgpgme_la_LIBADD, and include
4814         assuan_libobjs.
4815         (assuan_libobjs): New variable, set this instead
4816         libgpgme_la_LIBADD.
4817         * engine.h (_gpgme_engine_op_edit): New prototype.
4818         * engine.c (_gpgme_engine_op_edit): New function.
4819         * rungpg.h (_gpgme_gpg_op_edit): New prototype.
4820         * rungpg.c (_gpgme_gpg_op_edit): New function.
4821
4822 2002-07-27  Marcus Brinkmann  <marcus@g10code.de>
4823
4824         * delete.c (delete_problem): New case ambigious specification.
4825         (delete_status_handler): Handle new case (poorly).
4826
4827 2002-07-25  Marcus Brinkmann  <marcus@g10code.de>
4828
4829         * engine-gpgsm.c (_gpgme_gpgsm_op_delete): Implement this.
4830
4831 2002-07-25  Marcus Brinkmann  <marcus@g10code.de>
4832
4833         * Makefile.am (libgpgme_la_LDADD): Add @LIBOBJS@ for vasprintf and
4834         fopencookie.
4835         * vasprintf.c: Update to more recent libiberty version.
4836         * debug.h: Replace #elsif with #elif.
4837
4838         Submitted by Stéphane Corthésy:
4839         * util.h (vasprintf): Correct prototype.
4840         * encrypt-sign.c: Include <stddef.h>.
4841         (encrypt_sign_status_handler): Change type of ENCRYPT_INFO_LEN to
4842         size_t.
4843         * ath-pthread.c: Include <stdlib.h>, not <malloc.h>.
4844         * ath-pth.c: Likewise.
4845
4846 2002-07-25  Marcus Brinkmann  <marcus@g10code.de>
4847
4848         * wait.c (fdt_global): Make static.  Reported by Stéphane
4849         Corthésy.
4850
4851         * rungpg.c (_gpgme_gpg_op_keylist_ext): Skip empty string
4852         patterns.  Reported by Stéphane Corthésy.
4853
4854         * key.c (gpgme_key_get_as_xml): Add OTRUST attribute.  Requested
4855         by Stéphane Corthésy.
4856         (gpgme_key_get_string_attr): Add GPGME_ATTR_SIG_SUMMARY case to
4857         silence gcc warning.
4858
4859         * rungpg.c (_gpgme_gpg_new): Always set utf8 as charset.
4860
4861 2002-07-03  Marcus Brinkmann  <marcus@g10code.de>
4862
4863         * gpgme.c (gpgme_set_io_cbs): Deal with CTX being NULL.
4864
4865         * gpgme.c (_gpgme_op_event_cb_user): New function.
4866         * op-support.c (_gpgme_op_reset): Support a new mode of operation
4867         for private or user event loop.  Use new user event callback
4868         wrapper.
4869         * trustlist.c (gpgme_op_trustlist_start): Use this new mode.
4870         * keylist.c (gpgme_op_keylist_start): Likewise.
4871
4872         * rungpg.c (_gpgme_gpg_io_event): New function.
4873         * rungpg.h (_gpgme_gpg_io_event): New prototype.
4874         * engine-gpgsm.c (_gpgme_gpg_io_event): New function.
4875         * engine-gpgsm.h (_gpgme_gpgsm_io_event): New prototype.
4876         * engine.c (_gpgme_engine_io_event): New function.
4877         * engine.h (_gpgme_engine_io_event): New prototype.
4878         * keylist.c (finish_key): Call _gpgme_engine_io_event, and move
4879         the real work for the default IO callback routines to ...
4880         (_gpgme_op_keylist_event_cb): ... here.  New function.
4881         * trustlist.c (trustlist_colon_handler): Signal
4882         GPGME_EVENT_NEXT_TRUSTITEM.  Move queue manipulation to ...
4883         (_gpgme_op_trustlist_event_cb): ... here.  New function.
4884         * gpgme.c (_gpgme_op_event_cb): Call _gpgme_op_keylist_event_cb
4885         and _gpgme_op_trustlist_event_cb when appropriate.
4886         * ops.h (_gpgme_op_keylist_event_cb): New prototype.
4887         (_gpgme_op_trustlist_event_cb): Likewise.
4888         * op-support.c (_gpgme_op_reset): Add comment why we don't use the
4889         user provided event handler directly.
4890         * gpgme.h (GpgmeRegisterIOCb): Return GpgmeError value, and TAG in
4891         a pointer argument.
4892         * wait.c (_gpgme_add_io_cb): Likewise.
4893         * wait.h (_gpgme_add_io_cb): Likewise for prototype.
4894         * rungpg.c (_gpgme_gpg_add_io_cb): Call IO_CBS->add with new
4895         argument.  Fix up error handling.
4896         * engine-gpgsm.c (_gpgme_gpgsm_add_io_cb): Call IO_CBS->add with
4897         new argument, fix up error handling.
4898
4899 2002-07-03  Werner Koch  <wk@gnupg.org>
4900
4901         * encrypt.c (status_handler_finish): New.
4902         (_gpgme_encrypt_status_handler): Moved some code out to the new
4903         function and call this function also in case we get into the
4904         status handler with an error which might happen due to a kludge in
4905         engine-gpgsm.c
4906
4907 2002-06-28  Marcus Brinkmann  <marcus@g10code.de>
4908
4909         * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4910         table (eg use synchronous mode).
4911
4912 2002-06-28  Marcus Brinkmann  <marcus@g10code.de>
4913
4914         * ops.h (_gpgme_wait_on_condition): Remove HANG argument from
4915         prototype and change return type to GpgmeError.
4916         (_gpgme_wait_one): New prototype.
4917         * wait.c (gpgme_wait): Replace with the meat from
4918         _gpgme_wait_on_condition here, and remove the support for
4919         conditions.
4920         (_gpgme_wait_on_condition): Remove HANG argument from prototype
4921         and change return type to GpgmeError.  Replace with meat from
4922         _gpgme_wait_one and add support for conditions.
4923         (_gpgme_wait_one): Just call _gpgme_wait_on_condition without
4924         condition.
4925         * keylist.c (gpgme_op_keylist_ext_start): Always use our own FD
4926         table (eg use synchronous mode).
4927         (gpgme_op_keylist_next): Remove HANG argument from
4928         _gpgme_wait_on_condition.  Check its return value.
4929         * trustlist.c (gpgme_op_trustlist_start): Always use our own FD
4930         table (eg use synchronous mode).
4931         (gpgme_op_trustlist_next): Remove HANG argument from
4932         _gpgme_wait_on_condition.  Check its return value.
4933         
4934 2002-06-27  Marcus Brinkmann  <marcus@g10code.de>
4935
4936         * gpgme.h: Fix documentation of key attribute retrieval functions.
4937
4938 2002-06-26  Werner Koch  <wk@gnupg.org>
4939
4940         * engine-gpgsm.c (map_assuan_error): Map No_Data_Available to EOF.
4941
4942         * import.c (append_xml_impinfo): Kludge to print fingerprint
4943         instead of keyid for use with gpgsm.
4944         (import_status_handler): Set a flag to know whether any import
4945         occured.
4946         (gpgme_op_import): Reurn -1 if no certificate ewas imported.
4947
4948 2002-06-25  Werner Koch  <wk@gnupg.org>
4949
4950         * engine-gpgsm.c (_gpgme_gpgsm_set_io_cbs) [ENABLE_GPGSM]: Fixed
4951         function arguments.
4952
4953 2002-06-25  Marcus Brinkmann  <marcus@g10code.de>
4954
4955         * engine-gpgsm.c (_gpgme_gpgsm_op_export): Only export the keys
4956         listed in RECP.
4957         * export.c (gpgme_op_export): If no data was returned, return
4958         GPGME_No_Recipients.
4959
4960 2002-06-25  Marcus Brinkmann  <marcus@g10code.de>
4961
4962         * engine-gpgsm.c (_gpgme_gpgsm_op_export): Implement.
4963
4964 2002-06-21  Marcus Brinkmann  <marcus@g10code.de>
4965
4966         * engine-gpgsm.c (gpgsm_assuan_simple_command): Return ERR.
4967         (parse_status): New function.
4968         (gpgsm_status_handler): Use parse_status.
4969         (gpgsm_assuan_simple_command): Accept new arguments STATUS_FNC and
4970         STATUS_FNC_VALUE and process status messages.
4971         (gpgsm_set_recipients): Pass new arugments to gpgsm_assuan_simple_command.
4972         (gpgsm_set_fd): Likewise.
4973         (_gpgme_gpgsm_op_keylist): Likewise.
4974         (_gpgme_gpgsm_op_keylist_ext): Likewise.
4975         (_gpgme_gpgsm_op_sign): Likewise.
4976
4977 2002-06-21  Marcus Brinkmann  <marcus@g10code.de>
4978
4979         * wait.c (_gpgme_remove_io_cb): Unlock FDT->lock.
4980
4981 2002-06-20  Werner Koch  <wk@gnupg.org>
4982
4983         * rungpg.c (build_argv): Ignore GPG_AGENT_INFO if set but empty.
4984
4985         * verify.c (calc_sig_summary): Set bad policy for wrong key usage.
4986         (skip_token): New.
4987         (_gpgme_verify_status_handler): Watch out for wrong key usage.
4988         (gpgme_get_sig_string_attr): Hack to return info on the key
4989         usage.  Does now make use of the former RESERVED argument which
4990         has been renamed to WHATIDX.
4991         (gpgme_get_sig_ulong_attr): Renamed RESERVED to WHATIDX.
4992
4993 2002-06-14  Marcus Brinkmann  <marcus@g10code.de>
4994
4995         * wait.c (do_select): Return -1 on error, and 0 if nothing to run.
4996         (_gpgme_wait_one): Only set HANG to zero if do_select returned an
4997         error, or there are no more file descriptors to wait on.
4998         (_gpgme_wait_on_condition): Ignore return value from do_select for
4999         now.
5000
5001 2002-06-13  Werner Koch  <wk@gnupg.org>
5002
5003         * verify.c (gpgme_op_verify): Make sure that we never access an
5004         unitialized result structure.
5005
5006 2002-06-12  Werner Koch  <wk@gnupg.org>
5007
5008         * keylist.c (struct keylist_result_s): New.
5009         (_gpgme_release_keylist_result): Release it here 
5010         (keylist_status_handler): Handle truncated.
5011         (append_xml_keylistinfo): New.
5012         * gpgme.c (_gpgme_release_result): and use it here.
5013         * types.h: Declare the new type here.
5014         * context.h (struct gpgme_context_s): Use it here.
5015
5016 2002-06-11  Marcus Brinkmann  <marcus@g10code.de>
5017
5018         * engine-gpgsm.c (_gpgme_gpgsm_release): Close status_cb.fd.
5019         (_gpgme_gpgsm_new): Duplicate status file descriptor, so we can
5020         use our own close notification mechanism without interfering with
5021         assuan.
5022
5023 2002-06-11  Werner Koch  <wk@gnupg.org>
5024
5025         * gpgme.h: Add GPGME_ATTR_SIG_SUMMARY and the GPGME_SIGSUM_
5026         constants.
5027         * verify.c (calc_sig_summary): New.
5028         (gpgme_get_sig_ulong_attr): And use it here.
5029
5030 2002-06-10  Werner Koch  <wk@gnupg.org>
5031
5032         * rungpg.h: Add new status codes TRUNCATED and ERROR.
5033         * verify.c (is_token, copy_token): New.
5034         (_gpgme_verify_status_handler): Use copy_token, handle the new
5035         ERROR status and store the errorcode used withgpgsm and trust
5036         status codes.
5037         * gpgme.h: New attribute ERRTOK.
5038         * key.c (gpgme_key_get_string_attr): Add dummy case for it.
5039         (gpgme_get_sig_string_attr): Use it here to return the last error.
5040
5041 2002-06-10  Marcus Brinkmann  <marcus@g10code.de>
5042
5043         * engine-gpgsm.c (_gpgme_gpgsm_start): Move the code that sets the
5044         close notification for the status fd to ...
5045         (_gpgme_gpgsm_new): ... here.
5046         * wait.h: Include "sema.h".  Remove prototypes of
5047         _gpgme_remove_proc_from_wait_queue and
5048         _gpgme_register_pipe_handler.  Add prototypes of
5049         _gpgme_fd_table_init, _gpgme_fd_table_deinit, _gpgme_fd_table_put,
5050         _gpgme_add_io_cb, _gpgme_remove_io_cb, _gpgme_wait_event_cb and
5051         _gpgme_wait_one..
5052         * wait.c: Remove global variables PROC_QUEUE, PROC_QUEUE_LOCK,
5053         FD_TABLE_SIZE, FD_TABLE, FD_TABLE_LOCK.  New global variables
5054         FDT_GLOBAL, CTX_DONE_LIST, CTX_DONE_LIST_SIZE,
5055         CTX_DONE_LIST_LENGTH and CTX_DONE_LIST_LOCK.  Remove struct
5056         proc_s.  Replace struct wait_item_s.
5057         (_gpgme_fd_table_init): New function.
5058         (_gpgme_fd_table_deinit): Likewise.
5059         (_gpgme_fd_table_put): Likewise.
5060         (set_process_done): Remove function.
5061         (do_select): Take argument FDT.  Use that to decide which fds to
5062         select on.
5063         (_gpgme_remove_proc_from_wait_queue): Remove function.
5064         (_gpgme_wait_event_cb): New function.
5065         (_gpgme_wait_one): Likewise.
5066         (_gpgme_register_pipe_hanldler): Remove function.
5067         (_gpgme_add_io_cb): New function.
5068         (_gpgme_remove_io_cb): Likewise.
5069         (_gpgme_freeze_fd): Remove function.
5070         (_gpgme_thaw_fd): Remove function.
5071         * rungpg.c (struct fd_data_map_s): Add new member TAG.
5072         (struct gpg_object_s): Likewise for STATUS and COLON.  Add member
5073         IDX to CMD.  Add new member IO_CBS.
5074         (close_notify_handler): New variables POSSIBLY_DONE and NOT_DONE.
5075         For each I/O callback, check if it should be unregistered.  If all
5076         callbacks have been unregistered, trigger GPGME_EVENT_DONE.
5077         Remove member RUNNING.
5078         (_gpgme_gpg_new): Initialize new members.
5079         (_gpgme_gpg_release): Check PID not RUNNING.  Don't call
5080         _gpgme_remove_proc_from_wait_queue.  Close GPG->CMD.FD if set.
5081         (build_argv): Store away the index instead the file descriptor for
5082         CMD.
5083         (_gpgme_gpg_add_io_cb): New function.
5084         (_gpgme_gpg_spawn): Use _gpgme_gpg_add_io_cb to register IO
5085         callbacks.
5086         (gpg_status_handler): Change return type to void, remove PID
5087         argument, close filedescriptor if EOF or error occurs.
5088         (read_status): Use _gpgme_gpg_add_io_cb instead _gpgme_thaw_fd.
5089         Use IO_CBS->remove instead _gpgme_freeze_fd.
5090         (gpg_colon_line_handler): Change return type to void, remove PID
5091         argument, close filedescriptor if EOF or error occurs.
5092         (command_cb): Use IO_CBS->remove instead _gpgme_freeze_fd.
5093         (_gpgme_gpg_set_io_cbs): New function.
5094         * rungpg.h (_gpgme_gpg_set_io_cbs): Prototype for
5095         _gpgme_gpg_set_io_cbs.
5096         * gpgme.h (GpgmeIOCb): New type.
5097         (GpgmeRegisterIOCb): Likewise.
5098         (GpgmeRemoveIOCb): Likewise.
5099         (GpgmeEventIO): Likewise.
5100         (GpgmeEventIOCb): Likewise.
5101         (struct GpgmeIOCbs): New structure to hold I/O callbacks.
5102         (gpgme_set_op_io_cbs): New prototype.
5103         (gpgme_get_op_io_cbs): Likewise.
5104         * ops.h: New prototype for _gpgme_op_event_cb.  Remove prototypes
5105         for _gpgme_freeze_fd and _gpgme_thaw_fd.  Remove PID argument from
5106         _gpgme_data_inbound_handler and _gpgme_data_outbound_handler
5107         prototype.  Add prototype for _gpgme_op_reset.
5108         Add synchronous argument to _gpgme_decrypt_start prototype.
5109         * io.h: Beautification.
5110         * gpgme.c: Include "wait.h".
5111         (gpgme_new): Initialize FDT.
5112         (gpgme_set_io_cbs): New function.
5113         (gpgme_get_io_cbs): Likewise.
5114         (_gpgme_op_event_cb): Likewise.
5115         * data.c (_gpgme_data_inbound_handler): Change return type to
5116         void.  Drop PID argument.  Close FD on error and EOF.
5117         (write_mem_data): Don't close FD here ...
5118         (write_cb_data): ... or here ...
5119         (_gpgme_data_outbound_handler): ... but here.  Change return type
5120         to void.  Drop PID argument.
5121         * context.h: Include "wait.h".
5122         (struct gpgme_context_s): New members FDT and IO_CBS.
5123         * op-support.c: New file.
5124         * Makefile.am (libgpgme_la_SOURCES): Add op-support.c.
5125         * ops.h: Add prototype for _gpgme_op_reset().
5126         * decrypt.c (_gpgme_decrypt_start): New argument SYNCHRONOUS.  Use
5127         _gpgme_op_reset.
5128         (gpgme_op_decrypt_start): Add synchronous argument.
5129         (gpgme_op_decrypt): Likewise.  Use _gpgme_wait_one instead
5130         gpgme_wait.
5131         * delete.c (gpgme_op_delete_start): Rename to ...
5132         (_gpgme_op_delete_start): ... this.  New argument SYNCHRONOUS.
5133         Use _gpgme_op_reset.  Make function static.
5134         (gpgme_op_delete_start): Just a wrapper around
5135         _gpgme_op_delete_start now.
5136         (gpgme_op_delete): Add synchronous argument.  Use _gpgme_wait_one
5137         instead gpgme_wait.
5138         * encrypt.c: Include "wait.h".
5139         (ggpgme_op_encrypt_start): Rename to ...
5140         (_gpgme_op_encrypt_start): ... this.  New argument SYNCHRONOUS.
5141         Use _gpgme_op_reset.  Make function static.
5142         (gpgme_op_encrypt_start): Just a wrapper around
5143         _gpgme_op_encrypt_start now.
5144         (gpgme_op_encrypt): Add synchronous argument.  Use _gpgme_wait_one
5145         instead gpgme_wait.
5146         * encrypt_sign.c (gpgme_op_encrypt_sign_start): Rename to ...
5147         (_gpgme_op_encrypt_sign_start): ... this.  New argument
5148         SYNCHRONOUS.  Use _gpgme_op_reset.  Make function static.
5149         (gpgme_op_encrypt_sign_start): Just a wrapper around
5150         _gpgme_op_encrypt_sign_start now.
5151         (gpgme_op_encrypt_sign): Add synchronous argument.  Use
5152         _gpgme_wait_one instead gpgme_wait.
5153         * export.c (gpgme_op_export_start): Rename to ...
5154         (_gpgme_op_export_start): ... this.  New argument SYNCHRONOUS.
5155         Use _gpgme_op_reset.  Make function static.
5156         (gpgme_op_export_start): Just a wrapper around
5157         _gpgme_op_export_start now.
5158         (gpgme_op_export): Add synchronous argument.  Use _gpgme_wait_one
5159         instead gpgme_wait.
5160         * genkey.c (gpgme_op_genkey_start): Rename to ...
5161         (_gpgme_op_genkey_start): ... this.  New argument SYNCHRONOUS.
5162         Use _gpgme_op_reset.  Make function static.
5163         (gpgme_op_genkey_start): Just a wrapper around
5164         _gpgme_op_genkey_start now.
5165         (gpgme_op_genkey): Add synchronous argument.  Use _gpgme_wait_one
5166         instead gpgme_wait.
5167         * import.c (gpgme_op_import_start): Rename to ...
5168         (_gpgme_op_import_start): ... this.  New argument SYNCHRONOUS.
5169         Use _gpgme_op_reset.  Make function static.
5170         (gpgme_op_import_start): Just a wrapper around
5171         _gpgme_op_import_start now.
5172         (gpgme_op_import): Add synchronous argument.  Use _gpgme_wait_one
5173         instead gpgme_wait.
5174         * keylist.c (gpgme_op_keylist_start): Use _gpgme_op_reset.
5175         (gpgme_op_keylist_ext_start): Likewise.
5176         * sign.c (gpgme_op_sign_start): Rename to ...
5177         (_gpgme_op_sign_start): ... this.  New argument SYNCHRONOUS.  Use
5178         _gpgme_op_reset.  Make function static.
5179         (gpgme_op_sign_start): Just a wrapper around _gpgme_op_sign_start
5180         now.
5181         (gpgme_op_sign): Add synchronous argument.  Use _gpgme_wait_one
5182         instead gpgme_wait.
5183         * trustlist.c (gpgme_op_trustlist_start): Use _gpgme_op_reset.
5184         * verify.c (gpgme_op_verify_start): Rename to ...
5185         (_gpgme_op_verify_start): ... this.  New argument SYNCHRONOUS.
5186         Use _gpgme_op_reset.  Make function static.
5187         (gpgme_op_verify_start): Just a wrapper around
5188         _gpgme_op_verify_start now.
5189         (gpgme_op_verify): Add synchronous argument.  Use _gpgme_wait_one
5190         instead gpgme_wait.
5191         * engine-gpgsm.c (iocb_data_t): New type.
5192         (struct gpgsm_object_s): New member status_cb.  Replace input_fd
5193         and input_data with input_cb.  Replace output_fd and output_data
5194         with output_cb.  Replace message_fd and message_data with
5195         message_cb.  New member io_cbs.
5196         (_gpgme_gpgsm_new): Initialize all new members (and drop the old
5197         ones).
5198         (close_notify_handler): New variable POSSIBLY_DONE.  For each I/O
5199         callback, check if it should be unregistered.  If all callbacks
5200         have been unregistered, trigger GPGME_EVENT_DONE.
5201         (_gpgme_gpgsm_release): Remove variable PID.  Use new variable
5202         names to close the file descriptors.
5203         (_gpgme_gpgsm_op_decrypt): Use new variable names,
5204         (_gpgme_gpgsm_op_encrypt): Likewise.
5205         (_gpgme_gpgsm_op_genkey): Likewise.
5206         (_gpgme_gpgsm_op_import): Likewise.
5207         (_gpgme_gpgsm_op_keylist): Likewise.
5208         (_gpgme_gpgsm_op_keylist_ext): Likewise.
5209         (_gpgme_gpgsm_op_sign): Likewise.
5210         (_gpgme_gpgsm_op_verify): Likewise.
5211         (gpgsm_status_handler): Drop argument PID.  Change return type to
5212         void.  Close status pipe before returning because of EOF or error.
5213         (_gpgme_gpgsm_add_io_cb): New function.
5214         (_gpgme_gpgsm_start): Use _gpgme_gpgsm_add_io_cb to register
5215         callback function.
5216         (_gpgme_gpgsm_set_io_cbs): New function.
5217         * engine-gpgsm.h: New prototype for _gpgme_gpgsm_set_io_cbs.
5218         * engine.c (_gpgme_engine_set_io_cbs): New function.
5219         * engine.h: New prototype for _gpgme_engine_set_io_cbs.
5220
5221 2002-06-04  Marcus Brinkmann  <marcus@g10code.de>
5222
5223         * Makefile.am (libgpgme_la_SOURCES): Remove mutex.h.
5224
5225 2002-06-03  Marcus Brinkmann  <marcus@g10code.de>
5226
5227         * key.c: Include <ctype.h>.
5228         (_gpgme_key_append_name): Skip one more char when
5229         processing escaped char.  Submitted by Marc Mutz <mutz@kde.org>.
5230         Handle hexadecimal encodings.  Also reported by Marc.  Thanks!
5231
5232 2002-06-02  Marcus Brinkmann  <marcus@g10code.de>
5233
5234         * ath.h: Enable the _gpgme_ prefix.  Fix all those prefix macros.
5235         * posix-sema.c: Use that prefix here.
5236         * posix-io.c: Include "ath.h".
5237         (_gpgme_io_read): Use _gpgme_ath_read instead read.
5238         (_gpgme_io_write): Use _gpgme_ath_write instead write.
5239         (_gpgme_io_waitpid): Use _gpgme_ath_waitpid instead waitpid.
5240         (_gpgme_io_select): Use _gpgme_ath_select instead select.
5241
5242 2002-06-02  Marcus Brinkmann  <marcus@g10code.de>
5243
5244         * Makefile.am (ath_components): New variable.
5245         (ath_components_pthread): Likewise.
5246         (ath_components_pth): Likewise.
5247         (system_components): Add ath_componentes.
5248
5249         * ath.h: New file.
5250         * ath.c: Likewise.
5251         * ath-pthread.c: Likewise.
5252         * ath-pth.c: Likewise.
5253         * posix-sema.c (_gpgme_sema_cs_enter): Rework to use the ATH
5254         interface.
5255         * mutex.h: Remove file.
5256
5257 2002-05-30  Werner Koch  <wk@gnupg.org>
5258
5259         * key.c (gpgme_key_get_string_attr): Return NULL when asking for
5260         an issuer with IDX > 0.  We don't support altIssuerNames for now.
5261
5262 2002-05-22  Werner Koch  <wk@gnupg.org>
5263
5264         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Aehmm, added
5265         missing variable definition.  Oohh - Marcus was faster.
5266
5267 2002-05-22  Marcus Brinkmann  <marcus@gnu.org>
5268
5269         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): Fix last change.
5270
5271 2002-05-21  Werner Koch  <wk@gnupg.org>
5272
5273         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist)
5274         (_gpgme_gpgsm_op_keylist_ext):  Pass the keylist mode to gpgsm.
5275
5276 2002-05-10  Werner Koch  <wk@gnupg.org>
5277
5278         * key.h (gpgme_key_s): Add OTRUST.
5279         * keylist.c (set_ownertrust): New.
5280         (keylist_colon_handler): Get the ownertrust value
5281         * key.c (gpgme_key_get_string_attr,gpgme_key_get_ulong_attr):
5282         Return that value.
5283
5284 2002-05-08  Marcus Brinkmann  <marcus@g10code.de>
5285
5286         * w32-util.c: New static variable GET_PATH_LOCK.
5287         (_gpgme_get_gpg_path): Remove superfluous NULL initializer.
5288         Take lock while determining path.
5289         (_gpgme_get_gpgsm_path): Likewise.
5290         * version.c (do_subsystem_inits): Set DONE to 1 after
5291         initialization.
5292         (gpgme_get_engine_info): New variable ENGINE_INFO_LOCK.  Take lock
5293         while determining engine info.
5294         * rungpg.c (_gpgme_gpg_get_version): New variable
5295         GPG_VERSION_LOCK.  Take the lock while determining the program
5296         version.
5297         * posix-io.c: Include "sema.h".
5298         (_gpgme_io_spawn): New variable FIXED_SIGNALS_LOCK.  Take the lock
5299         while fixing the signals.
5300         (_gpgme_io_select): Make READFDS and WRITEFDS non-static.
5301         * key.c: Include "sema.h".  New globals KEY_CACHE_LOCK and
5302         KEY_REF_LOCK.
5303         (capabilities_to_string): Make STRINGS very const.
5304         (_gpgme_key_cache_add): Lock the key cache.
5305         (_gpgme_key_cache_get): Likewise.
5306         (gpgme_key_ref, gpgme_key_release): Lock the key_ref_lock.
5307         * import.c (append_xml_impinfo): Make IMPORTED_FIELDS and
5308         IMPORT_RES_FIELDS very const.  Make FIELD and FIELD_NAME a litle
5309         const.
5310         * engine.c (_gpgme_engine_get_info): New variable
5311         ENGINE_INFO_LOCK.  Take lock while determining engine info.
5312         * engine-gpgsm.c: Include "sema.h".
5313         (_gpgme_gpgsm_get_version): New variable GPGSM_VERSION_LOCK.  Take
5314         lock while getting program version.
5315
5316 2002-05-08  Marcus Brinkmann  <marcus@g10code.de>
5317
5318         * debug.h: New file.
5319         * Makefile.am (libgpgme_la_SOURCES): Add debug.h.
5320         * util.h: Removed all prototypes and declarations related to
5321         debugging.  Include "debug.h".
5322
5323         * debug.c (debug_level): Comment variable and remove superfluous
5324         zero initializer.
5325         (errfp): Likewise.
5326         (_gpgme_debug_enabled): Function removed.
5327         (struct debug_control_s): Definition removed.
5328         (_gpgme_debug_level): Function removed.
5329         (_gpgme_debug_begin): Rewritten to use vasprintf.  Accept a
5330         pritnf-style format specification and a variable number of
5331         arguments.
5332         (_gpgme_debug_add): Rewritten using vasprintf.  Expect that format
5333         starts out with "%s" for simplicity.
5334         (_gpgme_debug_end): Rewritten using vasprintf.  Do not accept a
5335         TEXT argument anymore.
5336
5337         * posix-io.c (_gpgme_io_select): Use new level argument for
5338         DEBUG_BEGIN instead explicit if construct.
5339
5340         * debug.c (debug_init): Remove superfluous zero initializer,
5341         remove volatile flag of INITIALIZED.  Do not use the
5342         double-checked locking algorithm, it is fundamentally flawed and
5343         will empty your fridge (on a more serious note, despite the
5344         volatile flag it doesn't give you the guarantee you would expect,
5345         for example on a DEC Alpha or an SMP machine.  The volatile only
5346         serializes accesses to the volatile variable, but not to the other
5347         variables).
5348
5349 2002-05-03  Werner Koch  <wk@gnupg.org>
5350
5351         * engine-gpgsm.c (_gpgme_gpgsm_new): Redirect any gpgsm error
5352         output to /dev/null.
5353
5354         * verify.c (gpgme_get_sig_key): Set the protocol of the listctx.
5355         * gpgme.c (gpgme_get_protocol): New.
5356
5357         * data.c (gpgme_data_write): Changed type of BUFFER to void*.
5358         (gpgme_data_read): Ditto.
5359
5360         * verify.c (_gpgme_verify_status_handler): Handle TRUST_* status
5361         lines so that a claim can be made without looking up the key.
5362         (gpgme_get_sig_string_attr): New. 
5363         (gpgme_get_sig_ulong_attr): New.
5364
5365         * gpgme.h (GpgmeAttr): Added GPGME_ATTR_SIG_STATUS.
5366
5367         * rungpg.h: Add new status codes from gpg 1.0.7 and formatted the
5368         list to align with the status.h file from gnupg.
5369
5370         * gpgme.h (GpgmeSigStat): Add _GOOD_EXP and _GOOD_EXPKEY.
5371         * verify.c (_gpgme_verify_status_handler, finish_sig): Handle
5372         these new status codes.  Store the expiration time 
5373
5374 2002-04-27  Werner Koch  <wk@gnupg.org>
5375
5376         * gpgme.h (GpgmeData_Encoding): New.
5377         * data.c (gpgme_data_get_encoding,gpgme_data_set_encoding): New.
5378         * engine-gpgsm.c (map_input_enc): New. Use it in all local
5379         functions where the INPUT command gets send.
5380
5381 2002-04-27  Marcus Brinkmann  <marcus@g10code.de>
5382
5383         * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Close the output
5384         descriptor only when we don't need it anymore.  Close the message
5385         descriptor if we don't need it.
5386
5387 2002-04-26  Werner Koch  <wk@gnupg.org>
5388
5389         * Makefile.am (libgpgme_la_LIBADD): Use libtool libraries.
5390
5391 2002-04-25  Marcus Brinkmann  <marcus@g10code.de>
5392
5393         * rungpg.c (_gpgme_gpg_release): Call gpgme_data_release on
5394         GPG->cmd.cb_data, not xfree.
5395
5396 2002-04-25  Marcus Brinkmann  <marcus@g10code.de>
5397
5398         * engine-gpgsm.c (_gpgme_gpgsm_new): Set the display, ttyname,
5399         ttytype, lc_ctype and lc_messages options in the server.
5400
5401 2002-04-24  Marcus Brinkmann  <marcus@g10code.de>
5402
5403         * engine-gpgsm.c (map_assuan_error): Add new error codes.
5404
5405 2002-04-23  Werner Koch  <wk@gnupg.org>
5406
5407         * key.c (gpgme_key_get_ulong_attr): Swapped use of can_encrypt and
5408         can_certify to return the requested values.
5409
5410 2002-04-23  Marcus Brinkmann  <marcus@g10code.de>
5411
5412         * gpgme.c (gpgme_get_progress_cb): Allow either return parameter
5413         to be NULL.
5414         (gpgme_get_passphrase_cb): Likewise.
5415
5416 2002-04-22  Marcus Brinkmann  <marcus@g10code.de>
5417
5418         * gpgme.c (gpgme_get_passphrase_cb): New function.
5419         (gpgme_get_progress_cb): New function.
5420         * gpgme.h: Add new prototypes for gpgme_get_passphrase_cb and
5421         gpgme_get_progress_cb.
5422
5423 2002-03-28  Werner Koch  <wk@gnupg.org>
5424
5425         * gpgme.h (GpgmeAttr): Add values for issuer and chaining.
5426         * key.h (gpgme_key_s): Add issuer and chaining elements for X509.
5427         * keylist.c (keylist_colon_handler): Store them.
5428         * key.c (gpgme_key_release): Free them.
5429         (gpgme_key_get_as_xml,gpgme_key_get_string_attr): Print them.
5430
5431 2002-03-26  Werner Koch  <wk@gnupg.org>
5432
5433         * Makefile.am (libgpgme_la_SOURCES): Add mutex.h
5434
5435 2002-03-21  Werner Koch  <wk@gnupg.org>
5436
5437         * util.h [!HAVE_FOPENCOOKIE]: Make sure off_t and ssize_t are
5438         defined.
5439
5440 2002-03-18  Marcus Brinkmann  <marcus@g10code.de>
5441
5442         * Makefile.am (system_components): New variable, set depending on
5443         HAVE_DOSISH_SYSTEM.
5444         (libgpgme_la_SOURCES): Use system_components.  Remove `syshdr.h'.
5445         * syshdr.h: File removed.
5446
5447         * posix-io.c: Remove !HAVE_DOSISH_SYSTEM safeguard.  Clean up source.
5448         * posix-sema.c: Likewise.
5449         * posix-util.c: Likewise.
5450
5451         * w32-io.c: Remove HAVE_DOSISH_SYSTEM safeguard.
5452         * w32-sema.c: Likewise.
5453         * w32-util.c: Likewise.
5454
5455         * posix-io.c: Include `unistd.h', do not include `syshdr.h'.
5456         * posix-sema.c: Likewise.
5457         * w32-io.c: Include `io.h', do not include `syshdr.h'
5458         * w32-sema.c: Likewise.
5459         * w32-util.c: Likewise.
5460         * data.c: Do not include `syshdr.h'.
5461         * wait.c: Likewise.
5462         * wait.h: Code cleanup.
5463
5464         * mutex.h: New file.
5465         * posix-sema.c: Implement.
5466
5467 2002-03-08  Werner Koch  <wk@gnupg.org>
5468
5469         * util.h [!HAVE_FOPENCOOKIE]: Fixed type.  Thanks to Frank Heckenbach.
5470
5471 2002-03-07  Werner Koch  <wk@gnupg.org>
5472
5473         * gpgme.h (gpgme_op_keylist_ext_start): Add prototype.
5474
5475 2002-03-06  Marcus Brinkmann  <marcus@g10code.de>
5476
5477         * encrypt.c (_gpgme_encrypt_sym_status_handler): New function.
5478         (gpgme_op_encrypt_start): New variable SYMMETRIC, set it if RECP
5479         is null, and if it is set, use _gpgme_encrypt_sym_status_handler
5480         as status handler and run _gpgme_passphrase_start.
5481         * rungpg.c (_gpgme_gpg_op_encrypt): If RECP is zero, do symmetric
5482         encryption.
5483         * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): If RECP is zero,
5484         return error value.
5485
5486         * rungpg.c (_gpgme_gpg_op_verify): Add "--" argument.
5487
5488 2002-03-03  Marcus Brinkmann  <marcus@g10code.de>
5489
5490         * passphrase.c (_gpgme_passphrase_status_handler): Also set the
5491         error No_Passphrase if only a bad passphrase was provided.
5492
5493 2002-03-03  Marcus Brinkmann  <marcus@g10code.de>
5494
5495         * rungpg.c (_gpgme_gpg_op_verify): If TEXT is of mode
5496         GPGME_DATA_MODE_IN, construct a command line that stores the
5497         plaintext in TEXT.
5498         * verify.c (gpgme_op_verify_start): Accept TEXT being
5499         uninitialized, and in this case interpret SIG as a normal or
5500         cleartext signature and TEXT as a return data object.
5501         * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Likewise.
5502
5503 2002-03-03  Marcus Brinkmann  <marcus@g10code.de>
5504
5505         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext) [!ENABLE_GPGSM]:
5506         Add stub function.
5507
5508 2002-02-28  Werner Koch  <wk@gnupg.org>
5509
5510         * key.h (subkey_s): New member expires_at.
5511         * keylist.c (keylist_colon_handler): Set it here
5512         * key.c (gpgme_key_get_as_xml,gpgme_key_get_ulong_attr): Return it.
5513
5514 2002-02-27  Marcus Brinkmann  <marcus@g10code.de>
5515
5516         * rungpg.h (_gpgme_gpg_op_keylist_ext): New prototype.
5517         * rungpg.c (_gpgme_gpg_op_keylist_ext): New function.
5518         * engine-gpgsm.h (_gpgme_gpgsm_op_keylist_ext): New prototype.
5519         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist_ext): New function.
5520         * engine.h (_gpgme_engine_op_keylist_ext): New prototype.
5521         * engine.c (_gpgme_engine_op_keylist_ext): New function.
5522         * keylist.c (gpgme_op_keylist_ext_start): New function.
5523
5524 2002-02-27  Marcus Brinkmann  <marcus@g10code.de>
5525
5526         * gpgme.h: Add new error code GPGME_Invalid_Recipient.
5527         * encrypt.c (struct encrypt_result_s): New member invalid_recipients,
5528         rename no_recipients to no_valid_recipients.
5529         (_gpgme_encrypt_status_handler): Include error for invalid
5530         recipients.
5531         * engine-gpgsm.c (gpgsm_set_recipients): Change type of first
5532         argument to GpgsmObject.  Use that to report back the status about
5533         the recipients.
5534
5535 2002-02-26  Marcus Brinkmann  <marcus@g10code.de>
5536
5537         * verify.c (_gpgme_verify_status_handler): Fix the last change.
5538
5539 2002-02-25  Marcus Brinkmann  <marcus@g10code.de>
5540
5541         * engine.c (_gpgme_engine_op_encrypt_sign): New function.
5542         * engine.h (_gpgme_engine_op_encrypt_sign): New prototype.
5543         * rungpg.c (_gpgme_append_gpg_args_from_signers): New function.
5544         (_gpgme_gpg_op_sign): Use that new function.
5545         (_gpgme_gpg_op_encrypt_sign): New function.
5546         * rungpg.h (_gpgme_gpg_op_encrypt_sign): New prototype. 
5547         * gpgme.h (gpgme_op_encrypt_sign_start): New prototype.
5548         (gpgme_op_encrypt_sign): Likewise.
5549         * Makefile.am (libgpgme_la_SOURCES): Add encrypt-sign.c.
5550         * ops.h (_gpgme_encrypt_status_handler): Add prototype.
5551         (_gpgme_sign_status_handler): Add prototype.
5552         * sign.c (sign_status_handler): Rename to ...
5553         (_gpgme_sign_status_handler): ... this and make non-static.
5554         * encrypt.c (encrypt_status_handler): Rename to ...
5555         (_gpgme_encrypt_status_handler): ... this and make non-static.
5556         * encrypt.c (gpgme_op_encrypt_start): Use new status handler name.
5557         * sign.c (gpgme_op_sign_start): Likewise.
5558         
5559 2002-02-25  Marcus Brinkmann  <marcus@g10code.de>
5560
5561         * verify.c (_gpgme_verify_status_handler): Parse the args line to
5562         see if the problem is due to a missing key, and report that back
5563         to the user.
5564
5565 2002-02-25  Marcus Brinkmann  <marcus@g10code.de>
5566
5567         * context.h (struct gpgme_context_s): New member include_certs.
5568         * gpgme.h (gpgme_set_include_certs): Add prototype.
5569         (gpgme_get_include_certs): Likewise.
5570         * gpgme.c (gpgme_set_include_certs): New function.
5571         (gpgme_get_include_certs): Likewise.
5572         (gpgme_new): Set include_certs to 1 (the default).
5573         * engine.c (_gpgme_engine_op_sign): Accept new argument include_certs,
5574         and pass it to _gpgme_gpgsm_op_sign.
5575         * engine.h (_gpgme_engine_op_sign): Likewise for prototype.
5576         * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Accept new argument
5577         include_certs and handle it.
5578         * engine-gpgsm.h (_gpgme_gpgsm_start): Add new argument include_certs.
5579         * sign.c (gpgme_op_sign_start): Add new argument to
5580         _gpgme_engine_op_sign call.
5581
5582 2002-02-14  Werner Koch  <wk@gnupg.org>
5583
5584         * keylist.c (gpgme_op_keylist_start): Do not use a verbose listing.
5585
5586 2002-02-13  Werner Koch  <wk@gnupg.org>
5587
5588         * vasprintf.c, fopencookie.c: Add replacement functions.
5589         * util.h: Add prototypes for them.
5590
5591 2002-02-09  Marcus Brinkmann  <marcus@g10code.de>
5592
5593         * engine-gpgsm.c (gpgsm_assuan_simple_command): Return 0 if we
5594         reach the end of the function.
5595
5596 2002-02-09  Marcus Brinkmann  <marcus@g10code.de>
5597
5598         * genkey.c (gpgme_op_genkey_start): Fix logic in validity check.
5599         (gpgme_op_genkey_start): Skip newlines after opening tag.
5600
5601         * engine-gpgsm.c (_gpgme_gpgsm_start): Remove cruft.
5602
5603 2002-02-08  Marcus Brinkmann  <marcus@g10code.de>
5604
5605         * genkey.c (gpgme_op_genkey_start): Allow PUBKEY and SECKEY to be
5606         set, and pass them down to the crypto engine.
5607         * engine-gpgsm.h (_gpgme_gpgsm_start): New arguments PUBKEY and SECKEY.
5608         * engine.h: Likewise.
5609         * rungpg.h (_gpgme_gpg_spawn): Likewise.
5610         * engine.c (_gpgme_engine_op_genkey): Likewise.  Use those
5611         arguments.
5612         * rungpg.c (_gpgme_gpg_op_genkey): Likewise.  Complain if those
5613         arguments are set.
5614         * engine-gpgsm.c (_gpgme_gpgsm_op_genkey): Likewise.  Implement
5615         function.
5616
5617         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Beautify comment.
5618
5619 2002-02-06  Marcus Brinkmann  <marcus@g10code.de>
5620
5621         * rungpg.c (_gpgme_gpg_op_keylist): Remove handling of keylist
5622         mode (for now).
5623
5624 2002-02-06  Marcus Brinkmann  <marcus@g10code.de>
5625
5626         * wait.c (gpgme_wait): Add new argument STATUS, in which the
5627         status of the returned context is returned.
5628         (_gpgme_wait_on_condition): Rework the function a bit, to make it
5629         aware of cancelled processes, and to allow to use gpgme_wait with
5630         CTX being NULL (as documented in the source).
5631         (struct proc_s): New member REPORTED.
5632         * gpgme.h: Fix prototype.
5633         * verify.c (gpgme_op_verify): Fix use of gpgme_wait.
5634         * sign.c (gpgme_op_sign): Likewise.
5635         * import.c (gpgme_op_import): Likewise.
5636         * genkey.c (gpgme_op_genkey): Likewise.
5637         * export.c (gpgme_op_export): Likewise.
5638         * encrypt.c (gpgme_op_encrypt): Likewise.
5639         * delete.c (gpgme_op_delete): Likewise.
5640         * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5641
5642 2002-02-06  Marcus Brinkmann  <marcus@g10code.de>
5643
5644         * gpgme.c (gpgme_set_keylist_mode): Possibly return an error
5645         value.
5646         (gpgme_get_keylist_mode): New function.
5647         (gpgme_new): Set the default for keylist_mode member of CTX.
5648
5649         * gpgme.h (gpgme_set_keylist_mode): Fix prototype.
5650         (gpgme_get_keylist_mode): New prototype.
5651         (GPGME_KEYLIST_MODE_LOCAL): New macro.
5652         (GPGME_KEYLIST_MODE_EXTERN): Likewise..
5653
5654 2002-02-02  Marcus Brinkmann  <marcus@g10code.de>
5655
5656         This patch has gotten a bit large... mmh.  The main thing that
5657         happens here is that error values are now not determined in the
5658         operation function after gpgme_wait completed, but in the status
5659         handler when EOF is received.  It should always be the case that
5660         either an error is flagged or EOF is received, so that after a
5661         gpgme_wait you should never have the situation that no error is
5662         flagged and EOF is not received.  One problem is that the engine
5663         status handlers don't have access to the context, a horrible
5664         kludge works around this for now.  All errors that happen during a
5665         pending operation should be catched and reported in ctx->error,
5666         including out-of-core and cancellation.  This rounds up neatly a
5667         couple of loose ends, and makes it possible to pass up any errors
5668         in the communication with the backend as well.  As a bonus, there
5669         will be a function to access gpgme->wait, so that the operations
5670         can truly be implemented with their _start function.
5671
5672         * engine-gpgsm.c (gpgsm_status_handler): Horrible kludge to report
5673         error back to the context.
5674         * rungpg.c (gpg_status_handler): Same horrible kludge applied here.
5675
5676         * engine-gpgsm.c (gpgsm_assuan_simple_command): Add error checking.
5677
5678         * wait.c (_gpgme_wait_on_condition): If canceled, set CTX->error
5679         to a value indication that.
5680
5681         * verify.c (add_notation): Set error, not out_of_core.
5682         (finish_sig): Likewise.
5683         (gpgme_op_verify_start): Don't clear out_of_core.
5684         (_gpgme_verify_status_handler): At EOF, clean up the notation data.
5685         (gpgme_op_verify): And don't do it here.
5686
5687         * trustlist.c (trustlist_status_handler): Check error, not out_of_core.
5688         (gpgme_op_trustlist_start): Don't clear out_of_core.
5689         (gpgme_op_trustlist_next): Check error, not out_of_core.
5690         (gpgme_op_trustlist_end): Likewise.
5691
5692         * ops.h (test_and_allocate_result): New macro.
5693         (_gpgme_passphrase_result): Remove prototype.
5694         * delete.c (gpgme_op_delete): Return error from context.
5695         (delete_status_handler): Use macro test_and_allocate_result.
5696         Perform error checking at EOF.
5697         (gpgme_op_delete_start): Release result.
5698         * passphrase.c (_gpgme_passphrase_status_handler): Use macro
5699         test_and_allocate_result, and perform error checking here.
5700         (_gpgme_passphrase_result): Function removed.
5701         * sign.c (gpgme_op_sign_start): Do not set out_of_core to zero.
5702         (gpgme_op_sign): Just return the error value from the context.
5703         (sign_status_handler): Only progress if no error is set yet.  If
5704         we process an EOF, set the resulting error value (if any).
5705         * decrypt.c (_gpgme_decrypt_result): Function removed.
5706         (create_result_struct): Function removed.
5707         (_gpgme_decrypt_status_handler): Use macro test_and_allocate_result,
5708         caclulate error on EOF, do not progress with errors.
5709         (_gpgme_decrypt_start): Do not set out_of_core to zero.
5710         (gpgme_op_decrypt): Just return the error value from the context.
5711         * encrypt.c (encrypt_status_handler): Perform the error checking
5712         here.
5713         (gpgme_op_encrypt_start): Do not clear out_of_core.
5714         * export.c (export_status_handler): Return if error is set in context.
5715         (gpgme_op_export_start): Release result.
5716         (gpgme_op_export): Return error from context.
5717         * decrypt-verify.c (gpgme_op_decrypt_verify): Return the error in
5718         the context.
5719         * genkey.c (genkey_status_handler): Use macro
5720         test_and_allocate_result.  Perform error checking at EOF.
5721         (gpgme_op_genkey): Just return the error from context.
5722         * import.c (gpgme_op_import): Return the error from context.
5723         (import_status_handler): Use macro test_and_allocate_result.
5724         * keylist.c (gpgme_op_keylist_start): Do not clear out_of_core.
5725         (gpgme_op_keylist_next): Return error of context.
5726         (keylist_colon_handler): Set error instead out_of_code.
5727         (finish_key): Likewise.
5728
5729         * context.h: Remove member out_of_core, add member error.
5730         * gpgme.c (_gpgme_release_result): Clear error flag.
5731
5732         * engine.h (_gpgme_engine_get_error): New prototype.
5733         * engine.c (_gpgme_engine_get_error): New function.
5734         * engine-gpgsm.c (_gpgme_gpgsm_get_error): New function.
5735
5736         * engine-gpgsm.c (map_assuan_error): New function.
5737         (gpgsm_assuan_simple_command): Change return type to GpgmeError,
5738         use the new function to map error values.
5739         (gpgsm_set_fd): Change return type tp GpgmeError.
5740         (_gpgme_gpgsm_op_decrypt): Change type of ERR to GpgmeError.
5741         (gpgsm_set_recipients): Likewise.  Change type of return value
5742         equivalently.  Adjust error values.
5743         (_gpgme_gpgsm_op_import): Likewise.
5744         (_gpgme_gpgsm_op_sign): Likewise.
5745         (struct gpgsm_object_s): New member error.
5746         (gpgsm_status_handler): Set error if error occurs.  Determine
5747         error number from ERR line received.  If assuan_read_line fails,
5748         terminate the connection.
5749
5750 2002-02-01  Marcus Brinkmann  <marcus@g10code.de>
5751
5752         * Makefile.am (MOSTLYCLEANFILES): New variable.
5753
5754 2002-02-01  Marcus Brinkmann  <marcus@g10code.de>
5755
5756         * engine-gpgsm.c (gpgsm_status_handler): At error, terminate the
5757         connection to the server.
5758
5759 2002-01-31  Marcus Brinkmann  <marcus@g10code.de>
5760
5761         * rungpg.h: Add STATUS_KEY_CREATED.
5762
5763         * progress.c: New file.
5764         * Makefile.am (libgpgme_la_SOURCES): Add progress.c.
5765
5766         * genkey.c (genkey_status_handler): Use
5767         _gpgme_progress_status_handler.  Add check for status.
5768         (struct genkey_result_s): New structure.
5769         (_gpgme_release_genkey_result): New function.
5770         (gpgme_op_genkey): Check for error.
5771         * gpgme.c (_gpgme_release_result): Call
5772         _gpgme_release_genkey_result.
5773         * ops.h (_gpgme_release_genkey_result): Add prototype.
5774         * types.h (GenKeyResult): New type.
5775         * context.h (gpgme_context_s): Add GenKeyResult to member result.
5776
5777 2002-01-30  Marcus Brinkmann  <marcus@g10code.de>
5778
5779         * gpgme.c (_gpgme_release_result): Call
5780         _gpgme_release_delete_result.
5781         * ops.h (_gpgme_release_delete_result): Add prototype.
5782         * types.h (DeleteResult): New type.
5783         * context.h (gpgme_context_s): Add DeleteResult to member result.
5784
5785         * delete.c (enum delete_problem): New type.
5786         (struct delete_result_s): New structure.
5787         (_gpgme_release_delete_result): New function.
5788         (delete_status_handler): Implement more status codes.
5789         (gpgme_op_delete): Return error on failure.
5790
5791         * import.c (MAX_IMPORTED_FIELDS): Bump up to 14.
5792
5793 2002-01-30  Marcus Brinkmann  <marcus@g10code.de>
5794
5795         * import.c (struct import_result_s): New structure.
5796         (_gpgme_release_import_result): New function.
5797         (append_xml_impinfo): Likewise.
5798         (import_status_handler): Implement.
5799         * gpgme.c (_gpgme_release_result): Add call to
5800         _gpgme_release_import_result.
5801         * ops.h (_gpgme_release_import_result): Add prototype.
5802         * types.h (ImportResult): New type.
5803         * context.h (gpgme_context_s): Add ImportResult to member result.
5804
5805         * encrypt.c (gpgme_op_encrypt): Code clean up.
5806
5807 2002-01-30  Marcus Brinkmann  <marcus@g10code.de>
5808
5809         * gpgme.h: Add lots of comment and fix the formatting.  Add
5810         gpgme_trustlist_end prototype.
5811
5812 2002-01-29  Marcus Brinkmann  <marcus@g10code.de>
5813
5814         * gpgme.h: Add new type GpgmeIdleFunc.  Change type of
5815         gpgme_register_idle to return and accept this type.
5816         * wait.c (gpgme_register_idle): Fix type.
5817         Save and return old value of idle_function.
5818
5819 2002-01-29  Werner Koch  <wk@gnupg.org>
5820
5821         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Implement secret only mode.
5822
5823         * keylist.c (keylist_colon_handler): Add support for the new "crs"
5824         record type.
5825
5826 2002-01-22  Marcus Brinkmann  <marcus@g10code.de>
5827
5828         * engine-gpgsm.c (_gpgme_gpgsm_release): Call assuan_disconnect,
5829         not assuan_pipe_disconnect.
5830
5831         * Makefile.am (libgpgme_la_LIBADD): Change to link assuan and
5832         jnlib (needed by assuan) statically into libgpgme.  Linking a
5833         static library into a shared library this way is not portable.
5834
5835 2002-01-22  Marcus Brinkmann  <marcus@g10code.de>
5836
5837         * gpgme.h (GpgmePassphraseCb): Change type of R_HD from void* to
5838         void**.
5839
5840 2002-01-22  Marcus Brinkmann  <marcus@g10code.de>
5841
5842         * data.c (gpgme_data_new_from_filepart): Change type of LENGTH
5843         from off_t to size_t.
5844         * gpgme.h: Likewise.
5845
5846 2002-01-22  Marcus Brinkmann  <marcus@g10code.de>
5847
5848         * wait.c (_gpgme_wait_on_condition): If the process finished,
5849         reset the pending flag.  Also if the operation was cancelled.
5850
5851         (struct proc_s): Rename READY to DONE.
5852         (wait_item_s): Likewise.
5853         (set_process_ready): Rename to ...
5854         (set_process_done): ... this.
5855         (_gpgme_remove_proc_from_wait_queue): Call set_process_done
5856         instead set_process_ready.
5857         (_gpgme_wait_on_condition): Likewise.
5858         (do_select): Rename READY to DONE.
5859
5860         * verify.c (gpgme_op_verify): Do not set pending to zero here.
5861         * sign.c (gpgme_op_sign): Likewise.
5862         * import.c (gpgme_op_import): Likewise.
5863         * genkey.c (gpgme_op_genkey): Likewise.
5864         * export.c (gpgme_op_export): Likewise.
5865         * encrypt.c (gpgme_op_encrypt): Likewise.
5866         * delete.c (gpgme_op_delete): Likewise.
5867         * decrypt-verify.c (gpgme_op_decrypt_verify): Likewise.
5868         * decrypt.c (gpgme_op_decrypt): Likewise.
5869
5870 2002-01-22  Marcus Brinkmann  <marcus@g10code.de>
5871
5872         * export.c: Cleanup.
5873
5874 2002-01-15  Marcus Brinkmann  <marcus@g10code.de>
5875
5876         * trustlist.c: Various source clean ups.
5877         (my_isdigit): Removed.
5878         (gpgme_op_trustlist_end): New function.
5879
5880 2002-01-13  Marcus Brinkmann  <marcus@g10code.de>
5881
5882         * gpgme.c: Various source clean ups, like renaming C to CTX where
5883         appropriate.
5884         (gpgme_new): Clear R_CTX before starting the work.
5885         (my_isdigit): Removed.
5886         (my_isxdigit): Likewise.
5887
5888         * data.c: Various source clean ups.
5889         (gpgme_data_new_from_mem): Check BUFFER after clearing R_DH.
5890         (gpgme_data_new_with_read_cb): Similar for READ_CB.
5891         (gpgme_data_new_from_file): Loop over fread while EINTR.
5892         (gpgme_data_new_from_filepart): Rediddled a bit.  Allow LENGTH to
5893         be zero.  Loop over fread while EINTR.
5894
5895         (my_isdigit): Removed.
5896         (my_isxdigit): Likewise.
5897
5898 2001-12-21  Marcus Brinkmann  <marcus@g10code.de>
5899
5900         * engine-gpgsm.c (_gpgme_gpgsm_new): Replace General_Error with
5901         Pipe_Error where appropriate.
5902
5903 2001-12-19  Marcus Brinkmann  <marcus@g10code.de>
5904
5905         * engine.c: Include `string.h'.  Reported by Stéphane Corthésy.
5906
5907         * version.c (get_engine_info): Remove prototype.
5908
5909 2001-12-19  Marcus Brinkmann  <marcus@g10code.de>
5910
5911         * engine-gpgsm.c (_gpgme_gpgsm_new): New variable CHILD_FDS.
5912         Fill it with the servers fds, and pass it to assuan_pipe_connect.
5913
5914 2001-12-18  Marcus Brinkmann  <marcus@g10code.de>
5915
5916         * keylist.c (gpgme_op_keylist_end): New function.
5917         * gpgme.h (gpgme_op_keylist_end): New prototype.
5918
5919         * engine.h (gpgme_engine_check_version): Move prototype to ...
5920         * gpgme.h (gpgme_engine_check_version): ... here.
5921
5922         * genkey.c (gpgme_op_genkey_start): Remove unused variable.
5923
5924 2001-12-18  Marcus Brinkmann  <marcus@g10code.de>
5925
5926         * version.c (gpgme_get_engine_info): Reimplemented.
5927         (gpgme_check_engine): Reimplemented.
5928         (_gpgme_compare_versions): Return NULL if MY_VERSION is NULL.
5929
5930         * engine.c: Include `io.h'.
5931         (gpgme_engine_get_info): New function.
5932         * engine.h (gpgme_engine_check_version, _gpgme_engine_get_info):
5933         Add prototype.
5934
5935 2001-12-18  Marcus Brinkmann  <marcus@g10code.de>
5936
5937         * rungpg.c (struct reap_s, reap_list, reap_list_lock): Moved to ...
5938         * engine.c (struct reap_s, reap_list, reap_list_lock): ... here.
5939         Include `time.h', `sys/types.h', `assert.h', and `sema.h'.
5940
5941         * rungpg.c (_gpgme_engine_add_child_to_reap_list): New function.
5942         (do_reaping, _gpgme_gpg_housecleaning): Moved to ...
5943         * engine.c (do_reaping, _gpgme_engine_housecleaning): ... here.
5944         * rungpg.c (_gpgme_gpg_release): Replace code that is now in its
5945         own function by call to _gpgme_engine_add_child_to_reap_list().
5946
5947         * wait.c: Include `engine.h'.
5948         (run_idle): Call _gpgme_engine_housecleaning(), not
5949         _gpgme_gpg_housecleaning().
5950
5951 2001-12-18  Marcus Brinkmann  <marcus@g10code.de>
5952
5953         * key.c (_gpgme_key_append_name): Append, not prepend, the uid.
5954         Initialize the next field of the uid structure.
5955         (gpgme_key_get_as_xml): Do not list last uid first.
5956
5957 2001-12-17  Marcus Brinkmann  <marcus@g10code.de>
5958
5959         * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New
5960         function [!ENABLE_GPGSM].
5961
5962 2001-12-14  Marcus Brinkmann  <marcus@g10code.de>
5963
5964         * engine-gpgsm.c (_gpgme_gpgsm_op_verify): Put TEXT into
5965         message_data, not SIG.
5966         (_gpgme_gpgsm_op_sign): Use `--detached', not `--detach'.
5967
5968         * sign.c (sign_status_handler): Call
5969         _gpgme_passphrase_status_handler early.
5970
5971 2001-12-14  Marcus Brinkmann  <marcus@g10code.de>
5972
5973         * engine-gpgsm.c: Revert last change.
5974
5975 2001-12-14  Marcus Brinkmann  <marcus@g10code.de>
5976
5977         * engine-gpgsm.c (gpgsm_status_handler): Freeze the output file
5978         handler when ending this operation, otherwise the wait function
5979         will sit on it.
5980
5981 2001-12-14  Marcus Brinkmann  <marcus@g10code.de>
5982
5983         * engine-gpgsm.c (struct gpgsm_object_s): New member colon.attic.
5984         (_gpgme_gpgsm_new): Initialize some more members.
5985         (_gpgme_gpgsm_release): Free the colon line handler's attic line.
5986         (gpgsm_status_handler): Rework the inline-data processing.
5987
5988 2001-12-13  Marcus Brinkmann  <marcus@g10code.de>
5989
5990         * rungpg.c (_gpgme_gpg_spawn): Do not add the fds to the child
5991         list that are not dup'ed, for those the close-on-exec flag is set
5992         now.
5993         * version.c (_gpgme_get_program_version): Remove first entry in
5994         CFD, as the close-on-exec flag is now set for this fd.
5995
5996 2001-12-13  Marcus Brinkmann  <marcus@g10code.de>
5997
5998         * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): Do not add `armor'
5999         option to `ENCRYPT'.
6000         * engine-gpgsm.c (gpgsm_set_recipients): Free LINE when returning
6001         successfully.
6002
6003 2001-12-13  Marcus Brinkmann  <marcus@g10code.de>
6004
6005         * engine-gpgsm.c (close_notify_handler): New function.
6006         (_gpgme_gpgsm_new): Manage the file descriptors a
6007         bit differently.  Do not set close-on-exec flags.
6008         (_gpgme_gpgsm_op_decrypt): Do not set message_fd
6009         to -1, this is done by the close handler.
6010         (_gpgme_gpgsm_op_encrypt): Likewise.
6011         (_gpgme_gpgsm_op_import): Likewise (also for output_fd).
6012         (_gpgme_gpgsm_op_keylist): Likewise (also for input_fd and output_fd).
6013         (_gpgme_gpgsm_op_sign): Likewise.
6014         (_gpgme_gpgsm_op_verify): Likewise, but for output_fd.
6015
6016         * posix-io.c (_gpgme_io_pipe): Set the close-on-exec flag for the
6017         non-inherited file descriptor index of the pipe.
6018
6019 2001-12-13  Werner Koch  <wk@gnupg.org>
6020
6021         * engine-gpgsm.c (_gpgme_gpgsm_set_colon_line_handler): New.
6022         (gpgsm_status_handler): Pass datalines to a colon handler
6023         * engine.c (_gpgme_engine_set_colon_line_handler): Set the colon
6024         handler for gpgsm.
6025
6026         * engine-gpgsm.c (_gpgme_gpgsm_op_keylist): Allow NULL for
6027         pattern.
6028         (gpgsm_assuan_simple_command): Removed underscore from
6029         assuan_write_line.
6030         (_gpgme_gpgsm_start): Ditto.
6031         (gpgsm_assuan_simple_command): Replaced interal Assuan read
6032         function by the new assuan_read_line.  Removed the use of the
6033         internal header.
6034         (gpgsm_status_handler): Ditto. Use the new assuan_pending_line.
6035         (_gpgme_gpgsm_start): Use the documented way to get an fd from
6036         assuan.
6037
6038         * keylist.c (keylist_colon_handler): Handle "crt" records
6039         * key.h (gpgme_key_s): Add an x509 flag.
6040         * key.c (parse_x509_user_id): New.
6041         (_gpgme_key_append_name): Handle x.509 names.
6042
6043 2001-12-05  Marcus Brinkmann  <marcus@g10code.de>
6044
6045         * engine-gpgsm.c (gpgsm_status_handler): Make it work with current
6046         version of assuan.
6047
6048 2001-12-05  Marcus Brinkmann  <marcus@g10code.de>
6049
6050         * engine-gpgsm.c (gpgsm_set_fd): Accept one more argument OPT.
6051         (_gpgme_gpgsm_op_encrypt): Pass armor argument to gpgsm_set_fd for
6052         output descriptor.
6053         (_gpgme_gpgsm_op_sign): Likewise.
6054
6055 2001-12-05  Marcus Brinkmann  <marcus@g10code.de>
6056
6057         * keylist.c (gpgme_op_keylist_next): Set pending to 0 if EOF
6058         occurs.
6059
6060 2001-11-26  Marcus Brinkmann  <marcus@g10code.de>
6061
6062         * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Fix stupid typo.
6063
6064 2001-11-24  Marcus Brinkmann  <marcus@g10code.de>
6065
6066         * engine-gpgsm.c (gpgsm_status_handler): Don't break if bsearch fails.
6067         Deal with assuan read line returning more than one line (for now).
6068
6069 2001-11-23  Marcus Brinkmann  <marcus@g10code.de>
6070
6071         * engine-gpgsm.c (_gpgme_gpgsm_op_sign): Implement it according to
6072         the current protocol definition.
6073
6074 2001-11-23  Marcus Brinkmann  <marcus@g10code.de>
6075
6076         * engine-gpgsm.c (_gpgme_gpgsm_new): Set CLOEXEC flag for parent
6077         ends of the pipe.
6078
6079 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6080
6081         * engine-gpgsm.c: Include stdlib.h and string.h.  Also include,
6082         for now, rungpg.h and status-table.h.
6083         (gpgsm_status_handler): Implement more of the status handler.
6084
6085 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6086
6087         * engine.c (_gpgme_engine_op_decrypt): Implement CMS case.
6088         (_gpgme_engine_op_delete): Likewise.
6089         (_gpgme_engine_op_encrypt): Likewise.
6090         (_gpgme_engine_op_export): Likewise.
6091         (_gpgme_engine_op_genkey): Likewise.
6092         (_gpgme_engine_op_keylist): Likewise.
6093         (_gpgme_engine_op_sign): Likewise.
6094         (_gpgme_engine_op_trustlist): Likewise.
6095
6096         * engine-gpgsm.c (_gpgme_gpgsm_op_encrypt): New function.
6097         (gpgsm_assuan_simple_command): Likewise.
6098         (gpgsm_set_recipients): Likewise.
6099         (gpgsm_set_fd): Reimplement using gpgsm_assuan_simple_command.
6100         (_gpgme_gpgsm_op_delete): New function.
6101         (_gpgme_gpgsm_op_export): Likewise.
6102         (_gpgme_gpgsm_op_genkey): Likewise.
6103         (_gpgme_gpgsm_op_sign): Likewise.
6104         (_gpgme_gpgsm_op_keylist): Likewise.
6105         (_gpgme_gpgsm_op_trustlist): Likewise.
6106         (_gpgme_gpgsm_release): Release command.
6107         (_gpgme_gpgsm_op_decrypt): Allocate command.
6108         (_gpgme_gpgsm_op_import): Likewise.
6109         (gpgsm_status_handler): Also treat `ERR' strings as EOF.
6110
6111 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6112
6113         * gpgme.h (gpgme_set_protocol): New prototype.
6114
6115 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6116
6117         * engine-gpgsm.c (_gpgme_gpgsm_op_decrypt): New function.
6118         (_gpgme_gpgsm_op_import): Likewise.
6119
6120 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6121
6122         * engine-gpgsm.c: Shuffle around header inclusion a bit, to still
6123         keep them seperate.
6124         (_gpgme_set_status_handler) [!ENABLE_GPGSM]: New function.
6125
6126 2001-11-22  Werner Koch  <wk@gnupg.org>
6127
6128         * engine-gpgsm.c: Include more headers so that NULL and mk_error
6129         is defined even with an undefined GPGSM_PATH.
6130
6131 2001-11-22  Marcus Brinkmann  <marcus@g10code.de>
6132
6133         * rungpg.c (gpg_inbound_handler, write_mem_data, write_cb_data,
6134         gpg_outbound_handler): Moved to ...
6135         * data.c (_gpgme_data_inbound_handler, write_mem_data,
6136         write_cb_data, _gpgme_data_outbound_handler): ... here.  Make the
6137         _gpgme_* ones non-static.
6138         * data.c: Include io.h.
6139
6140         * ops.h (_gpgme_data_inbound_handler): New prototype.
6141         (_gpgme_data_outbound_handler): Likewise.
6142         (_gpgme_gpg_spawn): Use these new functions.
6143
6144         * engine-gpgsm.h (_gpgme_gpgsm_op_decrypt, _gpgme_gpgsm_op_delete,
6145         _gpgme_gpgsm_op_encrypt, _gpgme_gpgsm_op_export,
6146         _gpgme_gpgsm_op_genkey, _gpgme_gpgsm_op_import,
6147         _gpgme_gpgsm_op_keylist, _gpgme_gpgsm_op_sign,
6148         _gpgme_gpgsm_op_trustlist, _gpgme_gpgsm_op_verify,
6149         _gpgme_gpgsm_start, _gpgme_gpgsm_set_status_handler): New prototype.
6150         Include <rungpg.h> for status handler function.
6151
6152         * engine-gpgsm.c (struct gpgsm_object_s): New members input_fd,
6153         input_data, output_fd, output_data, message_fd, message_data, command
6154         and status.
6155         (_gpgme_gpgsm_new): Open input, output and message pipes before
6156         connecting to the client.  Close server's ends afterwards.
6157         (_gpgme_gpgsm_release): Close open file descriptors.  Remove
6158         server process from wait queue.
6159         (_gpgme_gpgsm_op_verify, _gpgme_gpgsm_start,
6160         _gpgme_gpgsm_set_status_handler, gpgms_status_handler): New function.
6161         
6162         * engine.c (_gpgme_engine_start): Implement for GPGME_PROTOCOL_CMS.
6163         (_gpgme_engine_set_status_handler): Likewise.
6164         (_gpgme_engine_op_verify): Likewise.
6165
6166 2001-11-21  Marcus Brinkmann  <marcus@g10code.de>
6167
6168         * context.h: Do not include rungpg.h, but engine.h.
6169         (struct gpgme_context_s): Replace member gpg with engine.
6170         * gpgme.c (gpgme_release): Release engine, not gpg.
6171
6172         * recipient.c (_gpgme_append_gpg_args_from_recifgpients): Function
6173         moved ...
6174         * rungpg.c (_gpgme_append_gpg_args_from_recipients): ... here.
6175         Make static, change order of arguments, and return an error value.
6176         * ops.h (_gpgme_append_gpg_args_from_recipients): Removed prototype.
6177
6178         * rungpg.h (_gpgme_gpg_op_verify): Add prototype.
6179         (_gpgme_gpg_op_encrypt): Likewise.
6180         (_gpgme_gpg_op_decrypt): Likewise.
6181         (_gpgme_gpg_op_delete): Likewise.
6182         (_gpgme_gpg_op_export): Likewise.
6183         (_gpgme_gpg_op_genkey): Likewise.
6184         (_gpgme_gpg_op_import): Likewise.
6185         (_gpgme_gpg_op_keylist): Likewise.
6186         (_gpgme_gpg_op_sign): Likewise.
6187         (_gpgme_gpg_op_trustlist): Likewise.
6188         * rungpg.c (_gpgme_gpg_op_verify): New function.
6189         (_gpgme_gpg_op_encrypt): Likewise.
6190         (_gpgme_gpg_op_decrypt): Likewise.
6191         (_gpgme_gpg_op_delete): Likewise.
6192         (_gpgme_gpg_op_export): Likewise.
6193         (_gpgme_gpg_op_genkey): Likewise.
6194         (_gpgme_gpg_op_import): Likewise.
6195         (_gpgme_gpg_op_keylist): Likewise.
6196         (_gpgme_gpg_op_sign): Likewise.
6197         (_gpgme_gpg_op_trustlist): Likewise.
6198
6199         * engine.h (_gpgme_engine_set_status_handler): Add prototype.
6200         (_gpgme_engine_set_command_handler): Likewise.
6201         (_gpgme_engine_set_colon_line_handler): Likewise.
6202         (_gpgme_engine_op_decrypt): Likewise.
6203         (_gpgme_engine_op_delete): Likewise.
6204         (_gpgme_engine_op_encrypt): Likewise.
6205         (_gpgme_engine_op_export): Likewise.
6206         (_gpgme_engine_op_genkey): Likewise.
6207         (_gpgme_engine_op_import): Likewise.
6208         (_gpgme_engine_op_keylist): Likewise.
6209         (_gpgme_engine_op_sign): Likewise.
6210         (_gpgme_engine_op_trustlist): Likewise.
6211         (_gpgme_engine_op_verify): Likewise.
6212         (_gpgme_engine_start): Likewise.
6213         * engine.c (_gpgme_engine_set_status_handler): New function.
6214         (_gpgme_engine_set_command_handler): Likewise.
6215         (_gpgme_engine_set_colon_line_handler): Likewise.
6216         (_gpgme_engine_op_decrypt): Likewise.
6217         (_gpgme_engine_op_delete): Likewise.
6218         (_gpgme_engine_op_encrypt): Likewise.
6219         (_gpgme_engine_op_export): Likewise.
6220         (_gpgme_engine_op_genkey): Likewise.
6221         (_gpgme_engine_op_import): Likewise.
6222         (_gpgme_engine_op_keylist): Likewise.
6223         (_gpgme_engine_op_sign): Likewise.
6224         (_gpgme_engine_op_trustlist): Likewise.
6225         (_gpgme_engine_op_verify): Likewise.
6226         (_gpgme_engine_start): Likewise.
6227
6228         * verify.c (gpgme_op_verify_start): Reimplement in terms of above
6229         functions.
6230         * encrypt.c (gpgme_op_encrypt_start): Likewise.
6231         * decrypt.c (_gpgme_decrypt_start): Likewise.
6232         * passphrase.c (_gpgme_passphrase_start): Likewise.
6233         * keylist.c (gpgme_op_keylist_start): Likewise.
6234
6235 2001-11-20  Marcus Brinkmann  <marcus@g10code.de>
6236
6237         * types.h: Add types EngineObject and GpgsmObject.
6238
6239         * Makefile.am (libgpgme_la_SOURCES): Add engine-gpgsm.h,
6240         engine-gpgsm.c, engine.h and engine.c.
6241         * engine.h: New file.
6242         * engine.c: Likewise.
6243         * engine-gpgsm.h: Likewise.
6244         * engine-gpgsm.c: Likewise.
6245         
6246         * rungpg.c (_gpgme_gpg_get_version): New function.
6247         (_gpgme_gpg_check_version): Likewise.
6248         * rungpg.h: Add prototypes for _gpgme_gpg_get_version and
6249         _gpgme_gpg_check_version.
6250
6251         * version.c (compare_versions): Rename to ...
6252         (_gpgme_compare_versions): ... this.  Make non-static.
6253         (gpgme_check_version): Use _gpgme_compare_versions rather than
6254         compare_versions.
6255         (gpgme_check_engine): Likewise.
6256         * ops.h (_gpgme_get_program_version): Add prototype.
6257
6258 2001-11-20  Marcus Brinkmann  <marcus@g10code.de>
6259
6260         * Makefile.am (libgpgme_la_INCLUDES): Remove obsolete directive.
6261         (AM_CPPFLAGS): New directive [BUILD_ASSUAN].
6262         (libgpgme_la_LIBADD): Likewise.
6263
6264 2001-11-20  Marcus Brinkmann  <marcus@g10code.de>
6265
6266         * version.c: Remove global variables lineno and
6267         tmp_engine_version.
6268         (version_handler): Removed.
6269         (_gpgme_get_program_version): New function.
6270         (get_engine_info): Don't use context and version_handler,
6271         but _gpgme_get_program_version.
6272         * ops.h (_gpgme_get_program_version): Add prototype for
6273         _gpgme_get_program_version (we expect to use it elsewhere soon).
6274
6275 2001-11-18  Marcus Brinkmann  <marcus@g10code.de>
6276
6277         * version.c (get_engine_info): If GnuPG is not available, return
6278         an error message.
6279         * posix-util.c (_gpgme_get_gpg_path): Allow GPG_PATH to be
6280         undefined.
6281         (_gpgme_get_gpgsm_path): New function.
6282         * w32-util.c (find_program_in_registry): New static function.
6283         (_gpgme_get_gpg_path): Allow GPG_PATH to be undefined.  Rework
6284         to use find_program_in_registry.
6285         (_gpgme_get_gpgsm_path): New function.
6286         (util.h): Prototype _gpgme_get_gpgsm_path).
6287         * rungpg.c (_gpgme_gpg_spawn): Verify that _gpgme_get_gpg_path()
6288         returns non-null.
6289
6290 2001-11-16  Marcus Brinkmann  <marcus@g10code.de>
6291
6292         * decrypt-verify.c: New file.
6293         * Makefile.am (libgpgme_la_SOURCES): Add decrypt-verify.c.
6294         * types.h: Add decrypt-verify types.
6295         * ops.h: Likewise.
6296         * context.h: Add result type for decrypt-verify.
6297         * gpgme.h: Add decrypt-verify prototypes.
6298
6299         * decrypt.c (decrypt_status_handler): Renamed to ...
6300         (_gpgme_decrypt_status_handler): ... this.  Make non-static.
6301         (_gpgme_decrypt_start): New function, derived from
6302         gpgme_op_decrypt_start.
6303         (gpgme_op_decrypt_start): Reimplement in terms of
6304         _gpgme_decrypt_start.
6305         (_gpgme_decrypt_result): New function to retrieve error value.
6306         (gpgme_op_decrypt): Use _gpgme_decrypt_result.
6307         * ops.h: Add prototypes for new functions.
6308
6309         * verify.c (verify_status_handler): Renamed to ...
6310         (_gpgme_verify_status_handler): ... this.  Make non-static.
6311         (gpgme_op_verify_start): Use new function name.
6312         (intersect_stati): Renamed to ...
6313         (_gpgme_intersect_stati): ... this.  Make non-static.
6314         (gpgme_op_verify): Use new name.
6315         * ops.h: Add prototypes for new functions.
6316
6317 2001-11-16  Marcus Brinkmann  <marcus@g10code.de>
6318
6319         * passphrase.c: New file.
6320         * Makefile.am (libgpgme_la_SOURCES): Add passphrase.c.
6321         * ops.h (_gpgme_passphrase_result): Add prototypes from
6322         passphrase.c.
6323         * types.h: Likewise.
6324         * context.h: Add member passphrase to result.
6325         * gpgme.c (_gpgme_release_result): Release passphrase member.
6326
6327         * decrypt.c: Some formatting and variable name changes (like
6328         CTX instead C).
6329         (struct decrypt_result_s): Remove members now found in
6330         passphrase result.
6331         (_gpgme_release_decrypt_result): Don't release removed members.
6332         (decrypt_status_handler): Call _gpgme_passphrase_status_handler,
6333         and don't handle the cases catched there.
6334         (command_handler): Removed.
6335         (gpgme_op_decrypt_start): Don't set command handler, but invoke
6336         _gpgme_passphrase_start which does it.
6337         (gpgme_op_decrypt): Invoke _gpgme_passphrase_result and drop the
6338         cases covered by it.
6339
6340         * sign.c Some formatting and variable name changes (like
6341         CTX instead C).
6342         (struct sign_result_s): Remove members now found in
6343         passphrase result.
6344         (_gpgme_release_sign_result): Don't release removed members.
6345         (sign_status_handler): Call _gpgme_passphrase_status_handler,
6346         and don't handle the cases catched there.
6347         (command_handler): Removed.
6348         (gpgme_op_sign_start): Don't set command handler, but invoke
6349         _gpgme_passphrase_start which does it.
6350         (gpgme_op_sign): Invoke _gpgme_passphrase_result and drop the
6351         cases covered by it.
6352
6353 2001-11-15  Marcus Brinkmann  <marcus@g10code.de>
6354
6355         * decrypt.c (command_handler): Fix last change.
6356
6357 2001-11-15  Marcus Brinkmann  <marcus@g10code.de>
6358
6359         * verify.c (_gpgme_release_verify_result): Rename RES to RESULT.
6360         Rename R2 to NEXT_RESULT.
6361         (intersect_stati): Rename RES to RESULT.
6362         (gpgme_get_sig_status): Likewise.  Do not check return_type, but
6363         the member verify of result.
6364         (gpgme_get_sig_key): Likewise.
6365
6366         * sign.c (_gpgme_release_sign_result): Rename RES to RESULT.  If
6367         RESULT is zero, return.
6368         (sign_status_handler, command_handler): Do not check return_type,
6369         but the member sign of result.
6370         (gpgme_op_sign): Likewise.  Drop assertion.
6371
6372         * encrypt.c (_gpgme_release_encrypt_result): Rename RES to RESULT.
6373         If RESULT is zero, return.
6374         (encrypt_status_handler): Do not check return_type, but the member
6375         encrypt of result.
6376         (gpgme_op_encrypt): Likewise.  Drop assertion.
6377
6378         * decrypt.c (_gpgme_release_decrypt_result): Rename RES to RESULT.
6379         (create_result_struct): Do not set result_type.
6380         (command_handler, decrypt_status_handler): Do not check
6381         return_type, but the member decrypt of result.
6382         (gpgme_op_decrypt): Likewise.  Drop assertion.
6383
6384         * context.h (enum ResultType): Removed.
6385         (struct gpgme_context_s): Remove member result_type.
6386         (struct result): Replaces union result.
6387         * gpgme.c: Include string.h.
6388         (_gpgme_release_result): Release all members of c->result, which
6389         is now a struct.  Zero out all members of the struct afterwards.
6390
6391 2001-11-11  Marcus Brinkmann  <marcus@g10code.de>
6392
6393         * rungpg.c (_gpgme_gpg_release): Release GPG->cmd.cb_data.
6394         Release all members of the list GPG->arglist.
6395         Reported by Michael Schmidt <mschmidt@cs.uni-sb.de>.
6396
6397 2001-11-02  Marcus Brinkmann  <marcus@g10code.de>
6398
6399         * rungpg.c (pipemode_copy): Change type of NBYTES to size_t.
6400
6401         * key.c: Include string.h.
6402         * data.c: Likewise.
6403         * recipient.c: Likewise.
6404
6405 2001-10-29  Marcus Brinkmann  <marcus@g10code.de>
6406
6407         * context.h: New member signers_len.
6408         * signers.c (gpgme_signers_clear): Require that signers are
6409         non-NULL with assertion.  Use signers_len to determine how much
6410         keys to release.  Add documentation.
6411         (gpgme_signers_add): Use signers_len to determine if the buffer is
6412         large enough.  Use xtryrealloc rather than xtrymalloc and copying.
6413         Add documentation.
6414         (gpgme_signers_enum): Use signers_len to determine if key is
6415         available.  Add documentation.
6416
6417 2001-10-22  Marcus Brinkmann  <marcus@g10code.de>
6418
6419         * data.c (_gpgme_data_append): Check if LENGTH is smaller than
6420         ALLOC_CHUNK, not DH->length.
6421
6422 2001-10-17  Marcus Brinkmann  <marcus@g10code.de>
6423
6424         * gpgme.c (gpgme_set_protocol): Fix last change.
6425
6426 2001-10-15  Werner Koch  <wk@gnupg.org>
6427
6428         * gpgme.h (GpgmeProtocol): New.
6429         * gpgme.c (gpgme_set_protocol): New.
6430
6431 2001-09-26  Werner Koch  <wk@gnupg.org>
6432
6433         * gpgme.c (gpgme_set_passphrase_cb): Ignore a NULL context.
6434         (gpgme_set_progress_cb): Ditto. Suggested by Mark Mutz.
6435
6436 2001-09-17  Werner Koch  <wk@gnupg.org>
6437
6438         * keylist.c (finish_key): Shortcut for no tmp_key.  Changed all
6439         callers to use this function without a check for tmp_key.
6440         
6441         * keylist.c (gpgme_op_keylist_next): Reset the key_cond after
6442         emptying the queue.  Bug reported by Stéphane Corthésy.
6443
6444 2001-09-12  Werner Koch  <wk@gnupg.org>
6445
6446         * data.c (gpgme_data_rewind): Allow rewind for callbacks.
6447
6448 2001-09-07  Werner Koch  <wk@gnupg.org>
6449
6450         * rungpg.h: Add NO_RECP.
6451         * encrypt.c (encrypt_status_handler): Take on No_RECP.
6452         (gpgme_op_encrypt): Better error return.
6453
6454         * verify.c (verify_status_handler): Take on NODATA.
6455
6456 2001-09-03  Werner Koch  <wk@gnupg.org>
6457
6458         * rungpg.h: Added STATUS_INV_RECP.
6459         * gpgme.c (_gpgme_release_result): Add support for new
6460         EncryptResult object.
6461         * encrypt.c (append_xml_encinfo): New.
6462         (encrypt_status_handler): Add some status parsing.
6463         (_gpgme_release_encrypt_result): New.
6464
6465 2001-08-29  Werner Koch  <wk@gnupg.org>
6466
6467         * recipient.c (gpgme_recipients_release): Free the list.  By Timo.
6468
6469         * keylist.c (keylist_colon_handler): Do a finish key if we receive
6470         an EOF here.  This is probably the reason for a lot of bugs
6471         related to keylisting.  It is so obvious.  Kudos to Enno Cramer
6472         for pointing that out. 
6473
6474 2001-08-28  Werner Koch  <wk@gnupg.org>
6475
6476         * gpgme.c, gpgme.h (gpgme_get_op_info): New.
6477         (_gpgme_set_op_info): New. 
6478         (_gpgme_release_result): Reset the op_info here.
6479         * sign.c (append_xml_siginfo): New.
6480         (sign_status_handler): Store the sig create information.
6481
6482 2001-07-31  Werner Koch  <wk@gnupg.org>
6483
6484         * encrypt.c (gpgme_op_encrypt): Hack to detect no valid recipients.
6485
6486 2001-07-30  Werner Koch  <wk@gnupg.org>
6487
6488         * gpgme.c (gpgme_get_armor,gpgme_get_textmode): New.
6489
6490         * rungpg.c (build_argv): Disable armor comments
6491         * w32-io.c (build_commandline): Need to add quotes here
6492
6493 2001-07-24  Werner Koch  <wk@gnupg.org>
6494
6495         * data.c (gpgme_data_read): Add a a way to return the available bytes.
6496
6497 2001-07-23  Werner Koch  <wk@gnupg.org>
6498
6499         * util.c: Removed stpcpy() because we use the version from jnlib.
6500
6501 2001-07-19  Werner Koch  <wk@gnupg.org>
6502
6503         * mkstatus: Define the collating sequence for sort.
6504
6505 2001-06-26  Werner Koch  <wk@gnupg.org>
6506
6507         * rungpg.h: Add STATUS_UNEXPECTED as suggested by Timo.
6508
6509 2001-06-15  Werner Koch  <wk@gnupg.org>
6510
6511         * keylist.c (set_userid_flags): Fixed the assigned values. Kudos
6512         to Timo for pointing this out.
6513
6514 2001-06-01  Werner Koch  <wk@gnupg.org>
6515
6516         * debug.c (_gpgme_debug_begin): Fixed a /tmp race.  Noted by
6517         Johannes Poehlmann.
6518
6519 2001-05-28  Werner Koch  <wk@gnupg.org>
6520
6521         * version.c (gpgme_check_engine): Stop version number parsing at
6522         the opening angle and not the closing one.  By Tommy Reynolds.
6523
6524 2001-05-01  José Carlos García Sogo <jose@jaimedelamo.eu.org>
6525
6526         * encrypt.c (gpgme_op_encrypt_start): Deleted the assert ( !c->gpg )
6527         line, because it gave an error if another operation had been made 
6528         before using the same context.
6529         
6530         * decrypt.c (gpgme_op_decrypt_start): The same as above. Also added 
6531         one line to release the gpg object in the context (if any).
6532         
6533 2001-04-26  Werner Koch  <wk@gnupg.org>
6534
6535         * key.c, key.h (_gpgme_key_cache_init): New.
6536         (_gpgme_key_cache_add): New.
6537         (_gpgme_key_cache_get): New.
6538         * version.c (do_subsystem_inits): Init the cache.
6539         * keylist.c (finish_key): Put key into the cache
6540         * verify.c (gpgme_get_sig_key): First look into the cache.
6541
6542 2001-04-19  Werner Koch  <wk@gnupg.org>
6543
6544         * keylist.c (parse_timestamp): Adjusted for the changed
6545         --fixed-list-mode of gpg 1.0.4h.
6546
6547 2001-04-05  Werner Koch  <wk@gnupg.org>
6548
6549         * verify.c (gpgme_op_verify_start): Enabled pipemode for detached sigs.
6550
6551 2001-04-04  Werner Koch  <wk@gnupg.org>
6552
6553         * w32-io.c (_gpgme_io_select): Don't select on the writer if there
6554         are still bytes pending.  Timo found this not easy to track down
6555         race condition. 
6556
6557 2001-04-02  Werner Koch  <wk@gnupg.org>
6558
6559         * gpgme.h: Add GPGME_ATTR_KEY_{EXPIRED,DISABLED}.
6560         * key.c (gpgme_key_get_ulong_attr): And return those attribs.
6561
6562         * verify.c (gpgme_get_sig_key): Set keyliosting mode depending on 
6563         the mode set in the current context.  Suggested by Timo.
6564
6565         * key.c (gpgme_key_get_ulong_attr): Return can_certify and not
6566         can_encrypt. By Timo.
6567
6568 2001-03-30  Werner Koch  <wk@gnupg.org>
6569
6570         * debug.c (debug_init): Allow to specify a debug file.
6571         (_gpgme_debug_level): New.
6572
6573         * posix-io.c (_gpgme_io_read, _gpgme_io_write): Print output.
6574         (_gpgme_io_select): Debug only with level > 2.
6575
6576 2001-03-15  Werner Koch  <wk@gnupg.org>
6577
6578         * rungpg.c: Included time.h.
6579
6580         * key.h: New keyflags for capabilities.
6581         * keylist.c (set_mainkey_capability, set_subkey_capability): New.
6582         (keylist_colon_handler): Parse them.
6583         * gpgme.h: New attribute values for capabilties.
6584         * key.c (gpgme_key_get_string_attr): Return them.
6585         (capabilities_to_string): New.
6586         (gpgme_key_get_ulong_attr): Return the global caps.
6587
6588 2001-03-14  Werner Koch  <wk@gnupg.org>
6589
6590         * w32-io.c (destroy_reader,destroy_writer): Fixed syntax error. 
6591         Thanks to Jan Oliver Wagner.
6592
6593 2001-03-13  Werner Koch  <wk@gnupg.org>
6594
6595         * context.h: Add invalid and revoke flags to user_id structure.
6596         * keylist.c (gpgme_op_keylist_start): Use --fixed-list-mode.
6597         (keylist_colon_handler): Adjust for that.
6598         (set_userid_flags): New. 
6599         (set_mainkey_trust_info): Handle new key invalid flag
6600         (set_subkey_trust_info): Ditto.
6601         * gpgme.h: Add new attributes for key and user ID flags.
6602         * key.c (_gpgme_key_append_name): Init these flags
6603         (gpgme_key_get_as_xml): Print them.
6604         (one_uid_as_xml): New helper for above.
6605         (gpgme_key_get_string_attr, gpgme_key_get_ulong_attr):
6606         Return the new attributes.  Enhanced, so that subkey information
6607         can be returned now.
6608
6609 2001-02-28  Werner Koch  <wk@gnupg.org>
6610
6611         * w32-io.c (destroy_reader): Set stop_me flag.
6612         (writer,create_writer,destroy_writer,find_writer,kill_writer): New.
6613         (_gpgme_io_write): Use a writer thread to avaoid blocking.
6614         (_gpgme_io_close): Cleanup a writer thread
6615         (_gpgme_io_select): Repalce tthe faked wait on writing by a real
6616         waiting which is now possible due to the use of a writer thread.
6617
6618 2001-02-20  Werner Koch  <wk@gnupg.org>
6619
6620         * w32-io.c (destroy_reader,kill_reader): New. 
6621         (create_reader, reader): Add a new event to stop the thread.
6622         (_gpgme_io_close): Kill the reader thread.
6623
6624         * posix-io.c (_gpgme_io_select): Handle frozen fds here. 
6625         * 32-io.c (_gpgme_io_select): Ditto. Removed a bunch of unused code.
6626
6627         * wait.c: Reworked the whole thing.
6628         * rungpg.c (_gpgme_gpg_new): Init pid to -1.
6629         (_gpgme_gpg_release): Remove the process from the wait queue.
6630
6631 2001-02-19  Werner Koch  <wk@gnupg.org>
6632
6633         * w32-io.c (_gpgme_io_set_close_notify): New.
6634         (_gpgme_io_close): Do the notification.
6635
6636         * posix-io.c (_gpgme_io_select): Use a 1 sec timeout and not 200
6637         microseconds.
6638
6639         * wait.c (remove_process): Don't close the fd here.
6640         (do_select): Set the fd to -1 and remove the is_closed flag everywhere.
6641         (_gpgme_wait_on_condition): Remove the assert on the queue and
6642         break out if we could not find the queue.  The whole thing should
6643         be reworked.
6644
6645         * posix-io.c (_gpgme_io_set_close_notify): New.
6646         (_gpgme_io_close): Do the notification.
6647
6648         * rungpg.c (close_notify_handler): New. 
6649         (_gpgme_gpg_new): Register a callback for the fd.
6650         (_gpgme_gpg_set_colon_line_handler): Ditto.
6651         (build_argv): Ditto
6652
6653 2001-02-13  Werner Koch  <wk@gnupg.org>
6654
6655         * rungpg.c (struct reap_s): Replaced pid_t by int.
6656
6657         * types.h: Add ulong typedef.
6658
6659         * rungpg.c (do_reaping,_gpgme_gpg_housecleaning): New.
6660         (_gpgme_gpg_release): Reap children.
6661         * io.h, posix-io.c (_gpgme_io_kill): New.
6662         * w32-io.c (_gpgme_io_kill): New (dummy).
6663
6664         * keylist.c (gpgme_op_keylist_start): Cancel a pending request.
6665
6666         * posix-io.c (_gpgme_io_read): Add some debug output. 
6667         (_gpgme_io_write): Ditto.
6668         (_gpgme_io_select): Increased the timeout.
6669
6670 2001-02-12  Werner Koch  <wk@gnupg.org>
6671
6672         Enhanced the signature verification, so that it can how handle
6673         more than one signature and is able to return more information on 
6674         the signatures.
6675         * verify.c (gpgme_get_sig_key): New.
6676         (gpgme_get_sig_status): New.
6677
6678         * gpgme.h: Add stdio.h. 
6679         (GpgmeSigStat): New status DIFF.
6680
6681 2001-02-01  Werner Koch  <wk@gnupg.org>
6682
6683         * w32-io.c (set_synchronize): Add EVENT_MODIFY_STATE.  Add Debug
6684         code to all Set/ResetEvent().
6685
6686         * rungpg.c (read_status): Check for end of stream only if we have
6687         an r.  By Timo.
6688
6689 2001-01-31  Werner Koch  <wk@gnupg.org>
6690
6691         * wait.c (_gpgme_wait_on_condition): Removed all exit code processing.
6692         (propagate_term_results,clear_active_fds): Removed.
6693         (count_active_fds): Renamed to .. 
6694         (count_active_and_thawed_fds): .. this and count only thawed fds. 
6695
6696         * rungpg.c (gpg_colon_line_handler): Return colon.eof and not
6697         status.eof ;-)
6698
6699 2001-01-30  Werner Koch  <wk@gnupg.org>
6700
6701         * w32-io.c (_gpgme_io_spawn): Use the supplied path arg.
6702
6703         * version.c (get_engine_info): Return better error information.
6704
6705         * posix-util.c, w32-util.c: New.
6706         (_gpgme_get_gpg_path): New, suggested by Jan-Oliver.
6707         * rungpg.c (_gpgme_gpg_spawn): Use new function to get GPG's path.
6708
6709         * signers.c (gpgme_signers_add): Ooops, one should test code and
6710         not just write it; the newarr was not assigned.  Thanks to José
6711         for pointing this out.  Hmmm, still not tested, why should a coder
6712         test his fix :-)
6713
6714         * w32-io.c: Does now use reader threads, so that we can use
6715         WaitForMultipleObjects. 
6716         * sema.h, posix-sema.c, w32-sema.c: Support for Critcial sections.
6717         Does currently only work for W32.
6718
6719         * debug.c, util.h : New. Changed all fprintfs to use this new
6720         set of debugging functions.
6721
6722 2001-01-23  Werner Koch  <wk@gnupg.org>
6723
6724         * data.c (_gpgme_data_release_and_return_string): Fixed string
6725         termination.
6726
6727 2001-01-22  Werner Koch  <wk@gnupg.org>
6728
6729         * delete.c: New.
6730
6731         * signers.c: New.
6732         * key.c (gpgme_key_ref, gpgme_key_unref): New.
6733         * sign.c (gpgme_op_sign_start): Allow the use of other keys.
6734
6735         * version.c (gpgme_get_engine_info,gpgme_check_engine): New.
6736         * rungpg.c (_gpgme_gpg_set_simple_line_handler): New.
6737
6738 2001-01-05  Werner Koch  <wk@gnupg.org>
6739
6740         * data.c (gpgme_data_rewind): Allow to rewind data_type_none.
6741
6742
6743  Copyright 2001,2002,2003,2004,2005,2006,2007,2008,2009 g10 Code GmbH
6744
6745  This file is free software; as a special exception the author gives
6746  unlimited permission to copy and/or distribute it, with or without
6747  modifications, as long as this notice is preserved.
6748
6749  This file is distributed in the hope that it will be useful, but
6750  WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
6751  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.