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